Leon-Sander / Local-Multimodal-AI-Chat

GNU General Public License v3.0
136 stars 83 forks source link

Unexpected token when uploading files #15

Closed JTMarsh556 closed 7 months ago

JTMarsh556 commented 7 months ago

I get this error when I try to upload files. Any idea how to fix it? Thanks

File "C:\Projects\AIChat\chat_venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "C:\Projects\AIChat\app.py", line 149, in main() File "C:\Projects\AIChat\app.py", line 91, in main add_documents_to_db(uploaded_pdf) File "C:\Projects\AIChat\pdf_handler.py", line 31, in add_documents_to_db vector_db = load_vectordb(create_embeddings()) ^^^^^^^^^^^^^^^^^^^ File "C:\Projects\AIChat\llm_chains.py", line 25, in create_embeddings return HuggingFaceInstructEmbeddings(model_name=embeddings_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Projects\AIChat\chat_venv\Lib\site-packages\langchain_community\embeddings\huggingface.py", line 153, in init self.client = INSTRUCTOR( ^^^^^^^^^^^ File "C:\Projects\AIChat\chat_venv\Lib\site-packages\sentence_transformers\SentenceTransformer.py", line 190, in init modules = self._load_sbert_model( ^^^^^^^^^^^^^^^^^^^^^^^ TypeError: INSTRUCTOR._load_sbert_model() got an unexpected keyword argument 'token'

Leon-Sander commented 7 months ago

try this: pip uninstall sentence-transformers pip install sentence-transformers==2.2.2

Leon-Sander commented 7 months ago

Also mentioned in #8

JTMarsh556 commented 7 months ago

interesting. I had done that already but apparently somewhere along the way I must have changed it. Either way that fixed it for me. Thank you

Leon-Sander commented 7 months ago

Yes I was also a little confused since you commented in #8 that you did it. Maybe it got changed as sub dependency of another pip install.