ILikeAI / AlwaysReddy

AlwaysReddy is a LLM voice assistant that is always just a hotkey away.
MIT License
639 stars 66 forks source link

Could not locate cudnn_ops_infer64_8.dll #85

Closed ctxadm closed 1 week ago

ctxadm commented 1 week ago

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!

ctxadm commented 1 week ago

Could the following help?

https://github.com/vladmandic/automatic/issues/1756

Jobus0 commented 1 week ago

If you want to use GPU acceleration, follow the steps inside the folded section GPU Setup Instructions at the top of #Setup.

ctxadm commented 1 week ago

thanks in advice, missed the following part:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

ctxadm commented 1 week ago

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...

ctxadm commented 1 week ago

my head is smoking ...

ctxadm commented 1 week ago

misstake by myself, have cuda runtime 12.1 not 12.4

will change that ...

ctxadm commented 1 week ago

same error -_-

Jobus0 commented 1 week ago

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?

ctxadm commented 1 week ago

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?

ctxadm commented 1 week ago

"Is some other program taking exclusive access over your audio device?"

nope

Jobus0 commented 1 week ago

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).

ctxadm commented 1 week ago

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'}}

ctxadm commented 1 week ago

My AlwaysReddy runs on Python 3.10.11 and Cuda 12.4 (torch 2.4.1+cu124).

THANKS !!!

ctxadm commented 1 week ago

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

ctxadm commented 1 week ago

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

Jobus0 commented 1 week ago

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.

ctxadm commented 1 week ago

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

ctxadm commented 1 week ago

OLLAMA COMPLETIONS API EXAMPLE

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

Jobus0 commented 1 week ago

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.

ctxadm commented 1 week ago

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

ctxadm commented 1 week ago

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

ctxadm commented 1 week ago

ok now is running on CPU, and it runs with less latency, maybe depends on my Epyc 7502 ...

but this issue is still there ...

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)

Jobus0 commented 1 week ago

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?

ctxadm commented 1 week ago

Is any audio played when the AI responds?

Have you double-checked that audio works otherwise, like on YouTube?

Jobus0 commented 1 week ago

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?

ctxadm commented 1 week ago

-> 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

ctxadm commented 1 week ago

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.

ctxadm commented 1 week ago

can we get in touch via email, maybe have some paid topics for you

Jobus0 commented 1 week ago

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.

ctxadm commented 1 week ago

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"

ILikeAI commented 1 week ago

@Jobus0 You're a legend!

ctxadm commented 1 week ago

fixed, case can be closed