zylon-ai / private-gpt

Interact with your documents using the power of GPT, 100% privately, no data leaks
https://privategpt.dev
Apache License 2.0
53.87k stars 7.24k forks source link

Error on "PGPT_PROFILES=openai make run" #1093

Closed CloudAlarms closed 11 months ago

CloudAlarms commented 11 months ago

I have installed privateGPT and ran the make run "configured with a mock LLM" and it was successfull and i was able to chat viat the UI. I added settings-openai.yaml and inserted the openai api in between the <> when I run PGPT_PROFILES=openai make run i get the following error.

I should note this is on Ubuntu 22.04 with a small NVIDIA GeForce GTX 1050 Ti GPU

root@privateGPT:/home/privateGPT# PGPT_PROFILES=openai make run
poetry run python -m private_gpt
The currently activated Python version 3.12.0 is not supported by the project (>=3.11,<3.12).
Trying to find and use a compatible version.
Using python3 (3.11.6)
Starting application with profiles: ['default', 'openai']
Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 798, in get
    return self._context[key]
           ~~~~~~~~~~~~~^^^^^
KeyError: <class 'private_gpt.server.ingest.ingest_service.IngestService'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 798, in get
    return self._context[key]
           ~~~~~~~~~~~~~^^^^^
KeyError: <class 'private_gpt.components.embedding.embedding_component.EmbeddingComponent'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/torch/__init__.py", line 174, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/root/.pyenv/versions/3.11.6/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libcufft.so.11: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/privateGPT/private_gpt/__main__.py", line 5, in <module>
    from private_gpt.main import app
  File "/home/privateGPT/private_gpt/main.py", line 123, in <module>
    from private_gpt.ui.ui import mount_in_app
  File "/home/privateGPT/private_gpt/ui/ui.py", line 19, in <module>
    ingest_service = root_injector.get(IngestService)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 91, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 974, in get
    provider_instance = scope_instance.get(interface, binding.provider)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 91, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 800, in get
    instance = self._get_instance(key, provider, self.injector)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 811, in _get_instance
    return provider.get(injector)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 264, in get
    return injector.create_object(self._cls)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 998, in create_object
    self.call_with_injection(init, self_=instance, kwargs=additional_kwargs)
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 1031, in call_with_injection
    dependencies = self.args_to_inject(
                   ^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 91, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 1079, in args_to_inject
    instance: Any = self.get(interface)
                    ^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 91, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 974, in get
    provider_instance = scope_instance.get(interface, binding.provider)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 91, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 800, in get
    instance = self._get_instance(key, provider, self.injector)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 811, in _get_instance
    return provider.get(injector)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 264, in get
    return injector.create_object(self._cls)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 998, in create_object
    self.call_with_injection(init, self_=instance, kwargs=additional_kwargs)
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/injector/__init__.py", line 1040, in call_with_injection
    return callable(*full_args, **dependencies)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/privateGPT/private_gpt/components/embedding/embedding_component.py", line 23, in __init__
    self.embedding_model = HuggingFaceEmbedding(
                           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/llama_index/embeddings/huggingface.py", line 58, in __init__
    import torch
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/torch/__init__.py", line 234, in <module>
    _load_global_deps()
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/torch/__init__.py", line 195, in _load_global_deps
    _preload_cuda_deps(lib_folder, lib_name)
  File "/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages/torch/__init__.py", line 160, in _preload_cuda_deps
    raise ValueError(f"{lib_name} not found in the system path {sys.path}")
ValueError: libcublas.so.*[0-9] not found in the system path ['/home/privateGPT', '/root/.pyenv/versions/3.11.6/lib/python311.zip', '/root/.pyenv/versions/3.11.6/lib/python3.11', '/root/.pyenv/versions/3.11.6/lib/python3.11/lib-dynload', '/root/.cache/pypoetry/virtualenvs/private-gpt-jSGsLBP4-py3.11/lib/python3.11/site-packages', '/home/privateGPT']
make: *** [Makefile:36: run] Error 1
donnadulcinea commented 11 months ago

I still have the same problem. I get the error with a fresh install. I'm aligned with the last commit.

bgmin commented 11 months ago

I'm running into the same issue. Has anybody successfully resolved this?

donnadulcinea commented 11 months ago

I'm running into the same issue. Has anybody successfully resolved this?

Yes this issue has been addressed, you can check this post on StackOverflow, and the following link on Medium: https://stackoverflow.com/questions/77333198/trouble-with-privategpt-when-using-pgpt-profiles-local-make-run-command?noredirect=1#comment136364579_77333198