AIAnytime / Llama2-Medical-Chatbot

This is a medical bot built using Llama2 and Sentence Transformers. The bot is powered by Langchain and Chainlit. The bot runs on a decent CPU machine with a minimum of 16GB of RAM.
MIT License
311 stars 233 forks source link

Could not import ctransformers package. #8

Open owencraston opened 1 year ago

owencraston commented 1 year ago

I am trying to run this project on a Macbook pro m1 and am getting the following stacktrace.

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/chainlit/utils.py", line 36, in wrapper
    return await user_function(**params_values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/owencraston/src/personal/ai/demo/model.py", line 79, in start
    chain = qa_bot()
            ^^^^^^^^
  File "/Users/owencraston/src/personal/ai/demo/model.py", line 62, in qa_bot
    llm = load_llm()
          ^^^^^^^^^^
  File "/Users/owencraston/src/personal/ai/demo/model.py", line 46, in load_llm
    llm = CTransformers(
          ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/langchain/load/serializable.py", line 74, in __init__
    super().__init__(**kwargs)
  File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic/main.py", line 1102, in pydantic.main.validate_model
  File "/usr/local/lib/python3.11/site-packages/langchain/llms/ctransformers.py", line 67, in validate_environment
    raise ImportError(
ImportError: Could not import `ctransformers` package. Please install it with `pip install ctransformers`

I have of course ran pip install ctransformers

I am also using python 3.11. Does anyone know what the issue could be?

oqp commented 1 year ago

Did you solve this? I have the same error but I'm using conda not pip

ashusnapx commented 1 year ago

rather than conda make a environment using python, in vs code or your IDE, and then run pip install ctransformers. Thanks and close this issue.

oqp commented 1 year ago

Thanks, but I'm using GPU and with pip is not possible to use Cuda.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Ashutosh Kumar @.> Sent: Tuesday, September 12, 2023 2:34:20 PM To: AIAnytime/Llama2-Medical-Chatbot @.> Cc: oqp @.>; Comment @.> Subject: Re: [AIAnytime/Llama2-Medical-Chatbot] Could not import ctransformers package. (Issue #8)

rather than conda make a environment using python, in vs code or your IDE, and then run pip install ctransformers. Thanks and close this issue.

— Reply to this email directly, view it on GitHubhttps://github.com/AIAnytime/Llama2-Medical-Chatbot/issues/8#issuecomment-1716304822, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADITZKZEIXCJIXLL75RPRCTX2C2LZANCNFSM6AAAAAA4D2JWVY. You are receiving this because you commented.Message ID: @.***>

Ezyweb-uk commented 1 year ago

I had the same error. I think I had installed 'transformers' as listed in the requirements. Once I had installed 'ctransformers' the error disappeared.

tahairshad commented 10 months ago

pip install langchain_community