mickekring / diane Goto Github PK
View Code? Open in Web Editor NEWThis is a basic prototype of the app Diane, which is a voice recorder using Whisper and GPT to process text and sends it to Obsidian
This is a basic prototype of the app Diane, which is a voice recorder using Whisper and GPT to process text and sends it to Obsidian
Hi Micke
I seem not to be able to stop the recording after I started it. These are the steps on the way:
uwestephan@Uwes-MacBook-Air Diane-main2 % python3 main.py
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
_--- --- ---
Recording...
Converting to mp3
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 1948, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/customtkinter/windows/widgets/ctk_button.py", line 553, in _clicked
self._command()
File "/Users/uwestephan/Python/Diane/Diane-main2/main.py", line 253, in
command=lambda: record(self, icon_rec, icon_stop_rec), text="Spela in")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/uwestephan/Python/Diane/Diane-main2/main.py", line 108, in record
convert_to_mp3(filename, mp3_filename)
File "/Users/uwestephan/Python/Diane/Diane-main2/main.py", line 55, in convert_to_mp3
audio.export(output_file, format="mp3")
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pydub/audio_segment.py", line 963, in export
p = subprocess.Popen(conversion_command, stdin=devnull, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1024, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1901, in execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'
Anny ideas what might have happened?
Best regards Uwe
Hi Micke
When I stop the recording in "Diane" the app seems to store an empty audio-file in the audio folder. Whisper can then not transcribe anything an ChatGPT wonders what it should summarize.
I'm a little new to python on the MacOS. Is that anything that you have experienced when coding? Or is it a setting on my side?
Thank you in advance!
Best regards
Uwe
When using OpenAI's GPT-3.5-turbo model, you may encounter an InvalidRequestError due to exceeding the model's maximum context length. The error message will indicate that your input message has resulted in more tokens than the model can handle. The program might need to adress this issue in order to get a proper response.
To resolve this issue, the user or program needs to reduce the number of tokens in a particular input. There may be several ways to do this:
Divide input text into several parts: Trim the text in the messages to create several parts with a reasonable token size.
Limit the input data and stop the recording and create several recordings that propagate reasonable lenghts of transcription.
Token counting utility: Use OpenAI's tiktoken Python library to count tokens in a text string without making an API call. This might manage mana input size.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.