aws-samples / amazon-bedrock-aistylist-lab

MIT No Attribution
84 stars 48 forks source link

langchain version compatible #4

Open qingyuan18 opened 5 months ago

qingyuan18 commented 5 months ago

when running the aistyle.ipynb, the langchain import throws execption :


ImportError Traceback (most recent call last) Cell In[12], line 4 2 from langchain.embeddings import BedrockEmbeddings 3 from langchain.vectorstores import FAISS ----> 4 from langchain.indexes.vectorstore import VectorStoreIndexWrapper ---> 21 from sqlalchemy import ( 22 URL, ....etc 41 from sqlalchemy.ext.declarative import declarative_base

ImportError: cannot import name 'URL' from 'sqlalchemy' (/home/ec2-user/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/sqlalchemy/init.py)

it seems like the langchain version is incompatible with my own env

do we have a requirements.txt for the dependence lib with versions for this lab?

thanks

qingyuan18 commented 5 months ago

problem solved by upgrade the sqlalchemy lib, but another incompatible issue throws out: TypeError Traceback (most recent call last) Cell In[9], line 37 31 vectorstore_faiss = FAISS.from_documents( 32 documents, 33 bedrock_embeddings, 34 ) 36 wrapper_store_faiss = VectorStoreIndexWrapper(vectorstore=vectorstore_faiss) ---> 37 query_embedding = vectorstore_faiss.embedding_function(customer_input) 38 np.array(query_embedding)

TypeError: 'BedrockEmbeddings' object is not callable

really needs requirements.txt for specific dependence lib versions ...

thanks again