My python version is 3.11.4 and I am using Pycharms and my project is in a venv So, I am trying to use vosk speech recognition offline model and gpt4all falcon model to make a voice assistant in python. The error I am facing is when I import the gpt4all module after importing the vosk Model, it throws this error:
Traceback (most recent call last):
File "C:\Users\Atharv\PycharmProjects\HYLIA_AI\main.py", line 15, in <module>
from gpt4all import GPT4All
File "C:\Users\Atharv\PycharmProjects\HYLIA_AI\venv\Lib\site-packages\gpt4all\__init__.py", line 1, in <module>
from .gpt4all import GPT4All, Embed4All # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharv\PycharmProjects\HYLIA_AI\venv\Lib\site-packages\gpt4all\gpt4all.py", line 13, in <module>
from . import pyllmodel
File "C:\Users\Atharv\PycharmProjects\HYLIA_AI\venv\Lib\site-packages\gpt4all\pyllmodel.py", line 50, in <module>
llmodel = load_llmodel_library()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharv\PycharmProjects\HYLIA_AI\venv\Lib\site-packages\gpt4all\pyllmodel.py", line 45, in load_llmodel_library
llmodel_lib = ctypes.CDLL(llmodel_dir)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharv\AppData\Local\Programs\Python\Python311\Lib\ctypes\__init__.py", line 376, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 127] The specified procedure could not be found
This the code:
from vosk import Model, KaldiRecognizer
from gpt4all import GPT4All
This only occurs when I am importing gpt4all after importing vosk model. If I just import vosk model, it works, or if i just import gpt4all, it works too. I dont know what is the relation between these 2 imports that cant enable them to imported together and work.
Some say its about to dll files. I dont know. I have tried everything and I really came here expecting an answer that can solve my error that persisted for 1 week for now. I request all the python developers out there to pls help me. I am literally stuck at this for a long time now.