-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with os.environ['FAISS_NO_AVX2'] = '1' #8857
Comments
Answer generated by a 🤖 AnswerHello, Thank you for providing detailed information about the issue you're facing. The error message you're seeing, The vector = np.array(embeddings, dtype=np.float32)
if normalize_L2 and distance_strategy == DistanceStrategy.EUCLIDEAN_DISTANCE:
faiss.normalize_L2(vector)
index.add(vector) In this code, The error message suggests that the One possibility is that the Another possibility is that there's an issue with the FAISS library itself. You mentioned that you're setting the To help troubleshoot this issue, could you please provide more information about the data you're using and the exact steps you're taking to generate the embeddings and create the FAISS index? Specifically, it would be helpful to know:
This additional information will help us better understand the issue and provide a more accurate solution. Best regards, SourcesThis response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
Hi, @aiakubovich! I'm Dosu, and I'm helping the LangChain team manage our backlog. I wanted to let you know that we are marking this issue as stale. Based on my understanding, you are experiencing a bug when trying to create FAISS embeddings in a Docker image. You mentioned that you are getting a Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you! |
I think when turn on the FAISS_NO_AVX2 as "1", and it doesn't be wrapped by handle_Index on |
Hi, @aiakubovich I'm helping the LangChain team manage our backlog and am marking this issue as stale. From what I understand, I am encountering a Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and cooperation. |
System Info
I was trying to create FAISS embeddings that would work on different platforms so I tried to use:
os.environ['FAISS_NO_AVX2'] = '1'
as recommended in https://github.com/langchain-ai/langchain/blob/6cdd4b5edca511b0015f1b39102225fe638d8359/langchain/vectorstores/faiss.py
It works for windows, but I am getting
TypeError: IndexFlatCodes.add() missing 1 required positional argument: 'x'
when I try to create embeddings in Docker imageFull error:
langchain==0.0.226
Who can help?
@hwchase17
Information
Related Components
Reproduction
from langchain.document_loaders.csv_loader import CSVLoader
from langchain.vectorstores import FAISS
from langchain.embeddings.openai import OpenAIEmbeddings
loader = CSVLoader(file_path=tmp_file_path, encoding="utf-8",csv_args={
'delimiter': ',',})
data = loader.load()
embeddings = OpenAIEmbeddings(...)
vectors = FAISS.from_documents(data, embeddings)
Expected behavior
embeddings should generated
The text was updated successfully, but these errors were encountered: