Closed ctxadm closed 1 week ago
Could the following help?
If you want to use GPU acceleration, follow the steps inside the folded section GPU Setup Instructions at the top of #Setup.
thanks in advice, missed the following part:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
got this version installed:
(venv) D:\AlwaysReddy>nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Tue_Feb_27_16:28:36_Pacific_Standard_Time_2024 Cuda compilation tools, release 12.4, V12.4.99 Build cuda_12.4.r12.4/compiler.33961263_0
after installing of:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
ill got this ...
AlwaysReddy is reddy. Use any of the hotkeys above to get started. Running handle_default_assistant_response... Starting recording... Action: handle_default_assistant_response Traceback (most recent call last): File "D:\AlwaysReddy\soundfx.py", line 19, in play_sound_file stream = p.open(format=p.get_format_from_width(audio_file.getsampwidth()), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio__init.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio\init.py", line 441, in init__ self._stream = pa.open(**arguments) ^^^^^^^^^^^^^^^^^^^^ OSError: [Errno -9998] Invalid number of channels Exception in thread Thread-11 (play_sound_file): Traceback (most recent call last): File "D:\AlwaysReddy\soundfx.py", line 19, in play_sound_file stream = p.open(format=p.get_format_from_width(audio_file.getsampwidth()), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio\init.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio\init.py", line 441, in init__ self._stream = pa.open(**arguments) ^^^^^^^^^^^^^^^^^^^^ OSError: [Errno -9998] Invalid number of channels
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\Program Files\Python311\Lib\threading.py", line 1045, in _bootstrap_inner self.run() File "C:\Program Files\Python311\Lib\threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "D:\AlwaysReddy\soundfx.py", line 59, in __play_sound_file raise Exception(f"An error occurred while playing the sound file: {e}") from e Exception: An error occurred while playing the sound file: [Errno -9998] Invalid number of channels Recording started...
my head is smoking ...
misstake by myself, have cuda runtime 12.1 not 12.4
will change that ...
same error -_-
Exception: An error occurred while playing the sound file: [Errno -9998] Invalid number of channels
This doesn't sound like an issue with CUDA, but rather something stopping the program from accessing your audio device. Is some other program taking exclusive access over your audio device? Did you accidentally unplug your headset/speakers? Tried restarting your computer?
I think it is rather due to various old Cuda installations as well as python installations, caused by the installation of other A.I. tools ...but of course I am not sure
tried 3 times reinstallation from AlwaysReddy, also restarting the computer
maybe i will use a fresh installation of windows with one installed python version as well as one installed cuda version ...
could you reqommend a python and cuda version?
"Is some other program taking exclusive access over your audio device?"
nope
could you reqommend a python and cuda version?
My AlwaysReddy runs on Python 3.10.11 and Cuda 12.4 (torch 2.4.1+cu124).
when i use USE_GPU = False and start the app ill got
Transcript: You You There's test test tool Traceback (most recent call last): File "D:\AlwaysReddy\llm_apis\openai_client.py", line 24, in stream_completion stream = self.client.chat.completions.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_utils_utils.py", line 274, in wrapper return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai\resources\chat\completions.py", line 742, in create return self._post( ^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_base_client.py", line 1277, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_base_client.py", line 954, in request return self._request( ^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_base_client.py", line 1058, in _request raise self._make_status_error_from_response(err.response) from None openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-.... You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} Traceback (most recent call last): File "D:\AlwaysReddy\llm_apis\openai_client.py", line 24, in stream_completion stream = self.client.chat.completions.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_utils_utils.py", line 274, in wrapper return func(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai\resources\chat\completions.py", line 742, in create return self._post( ^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_base_client.py", line 1277, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_base_client.py", line 954, in request return self._request( ^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\openai_base_client.py", line 1058, in _request raise self._make_status_error_from_response(err.response) from None openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-.... You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\AlwaysReddy\actions\always_reddy_voice_assistant\main.py", line 62, in handle_default_assistant_response response = self.AR.completion_client.process_text_stream(stream, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\completion_manager.py", line 166, in process_text_stream for chunk in text_stream: File "D:\AlwaysReddy\llm_apis\openai_client.py", line 41, in stream_completion raise RuntimeError(f"An error occurred streaming completion from OpenAI: {e}") RuntimeError: An error occurred streaming completion from OpenAI: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-.... You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
My AlwaysReddy runs on Python 3.10.11 and Cuda 12.4 (torch 2.4.1+cu124).
THANKS !!!
check this out
Transcript: test test ice store Traceback (most recent call last): File "D:\AlwaysReddy\llm_apis\openai_client.py", line 24, in stream_completion stream = self.client.chat.completions.create(
looks like my headset (micro) have maybe a hardware problem, ...wtf
Transcript: Hello, it's me, and I will help you. Traceback (most recent call last): File "D:\AlwaysReddy\llm_apis\openai_client.py", line 24, in stream_completion stream = self.client.chat.completions.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LOL
RuntimeError: An error occurred streaming completion from OpenAI: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-.... You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
You've switched from using Ollama to using OpenAI's online API. If that's what you want, then you need to put your OpenAI API key in the .env file.
RuntimeError: An error occurred streaming completion from OpenAI: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-.... You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
You've switched switched from using Ollama to using OpenAI's online API. If that's what you want, then you need to put your OpenAI API key in the .env file.
-> iam running local LLM with ollama
COMPLETIONS_API = "ollama" COMPLETION_MODEL = "instructlab/granite-7b-lab" OLLAMA_API_BASE_URL = "http://localhost:11434" #This should be the defualt OLLAMA_KEEP_ALIVE = "30m" # The duration that models stay loaded in memory examples: "20m", "24h". Set to "-1s" to keep models loaded indefinitely
That's strange because the big error above clearly shows that it is trying to connect to OpenAI. Make sure that it is config.py you edited and not config_default.py.
check ...after restarting AlwaysReddy ...
Transcript: Hello, my name is... Playing audio: Greetings! Playing audio: I'm an AI assistant designed to help you with various tasks and answer your questions. Playing audio: How can I assist you today?
Response: Greetings! I'm an AI assistant designed to help you with various tasks and answer your questions. How can I assist you today? Running handle_default_assistant_response... Starting recording... Action: handle_default_assistant_response Traceback (most recent call last): File "D:\AlwaysReddy\soundfx.py", line 19, in play_sound_file stream = p.open(format=p.get_format_from_width(audio_file.getsampwidth()), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio__init.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio\init.py", line 441, in init__ self._stream = pa.open(**arguments) ^^^^^^^^^^^^^^^^^^^^ OSError: [Errno -9998] Invalid number of channels Exception in thread Thread-24 (play_sound_file): Traceback (most recent call last): File "D:\AlwaysReddy\soundfx.py", line 19, in play_sound_file stream = p.open(format=p.get_format_from_width(audio_file.getsampwidth()), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio\init.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio\init.py", line 441, in init__ self._stream = pa.open(**arguments) ^^^^^^^^^^^^^^^^^^^^ OSError: [Errno -9998] Invalid number of channels
That's strange because the big error above clearly shows that it is trying to connect to OpenAI. Make sure that it is config.py you edited and not config_default.py.
believe you, but double checked the config file like i posted
OSError: [Errno -9998] Invalid number of channels Exception in thread Thread-44 (play_sound_file): Traceback (most recent call last): File "D:\AlwaysReddy\soundfx.py", line 19, in play_sound_file stream = p.open(format=p.get_format_from_width(audio_file.getsampwidth()), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio__init.py", line 639, in open stream = PyAudio.Stream(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AlwaysReddy\venv\Lib\site-packages\pyaudio\init.py", line 441, in init__ self._stream = pa.open(**arguments)
Okay, so it's back the the audio device issue. Is any audio played when the AI responds? Have you double-checked that audio works otherwise, like on YouTube?
Is any audio played when the AI responds?
Have you double-checked that audio works otherwise, like on YouTube?
This is odd. Is your audio output device set to mono?
Try this: Open soundfx.py and edit line 20 channels=audio_file.getnchannels(),
to channels=1,
.
Does that get rid of the error?
-> you asking the right questions!! thumbs up <-
This is odd. Is your audio output device set to mono?
"Try this: Open soundfx.py and edit line 20 channels=audio_file.getnchannels(), to channels=1,."
will test that
oh maaaaaan you did it:
Setting up AlwaysReddy...
Initializing action: AlwaysReddyVoiceAssistant 'alt+ctrl+r': Start/stop talking to voice assistant (press to toggle on and off, or hold and release) Hold down 'alt+ctrl' and double tap 'r' to send clipboard content to AlwaysReddy 'alt+ctrl+w': New chat for voice assistant
Initializing action: ReadClipboard 'ctrl+alt+c': To read the text in your clipboard aloud
Initializing action: TranscribeAndPaste 'ctrl+alt+t': Transcribe to clipboard (press to toggle on and off, or hold and release)
System actions: 'alt+ctrl+e': Cancel currently running action, recording, TTS, or other
AlwaysReddy is reddy. Use any of the hotkeys above to get started. Running handle_default_assistant_response... Starting recording... Action: handle_default_assistant_response Recording started... Running handle_default_assistant_response... Stopping recording... Recording saved to audio_files\temp_recording.wav Transcribing audio file: audio_files\temp_recording.wav Detected language: en with probability 1.00
Transcript: Hello, nice to meet you. Playing audio: Greetings! Playing audio: It's great to be here and ready to assist you.
can we get in touch via email, maybe have some paid topics for you
Great to hear it works. Good to know the program is incompatible with mono output; will have to fix that.
My e-mail is visible on my profile page, below the username. Feel free to contact me.
thanks for your great and fast support, will contact you soon via email. pls check spam if you dont get an email from "kontakt@xxxx.xx"
@Jobus0 You're a legend!
fixed, case can be closed
AlwaysReddy is reddy. Use any of the hotkeys above to get started. Running handle_default_assistant_response... Starting recording... Action: handle_default_assistant_response Recording started... Running handle_default_assistant_response... Stopping recording... Recording saved to audio_files\temp_recording.wav Transcribing audio file: audio_files\temp_recording.wav Could not locate cudnn_ops_infer64_8.dll. Please make sure it is in your library path!