Skip to content
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

The similarity results obtained from the index.faiss file are significantly different from those obtained from previous versions #3412

Closed
Amala-R opened this issue May 3, 2024 · 1 comment

Comments

@Amala-R
Copy link

Amala-R commented May 3, 2024

Summary

When using the Java implementation of FAISS and extracting the classes.faiss file, the similarity results obtained are significantly different from previous versions.

Platform

OS: Windows 11

Faiss version: faiss-cpu~=1.7.4

Installed from: pip install faiss-cpu~=1.7.4

Interface:

  • Python

Reproduction instructions

  • Extracted and created new db
  • Saved to local workspace
    db = FAISS.from_documents(docs, get_embeddings())
    db.save_local("./db/", "classes")
  • This new created classes.faiss works differently from the previous version. Always returns the same similarity result for all queries. DB data is correctly extracted. If I use old classes.faiss file with the new extracted DB, it works perfectly.

General steps:
Load the Java implementation of FAISS.
Extract the classes.faiss file using the provided tools or methods.
Perform similarity search using the extracted index file.
Compare the similarity results with those obtained from previous versions.

@mlomeli1
Copy link
Contributor

mlomeli1 commented May 3, 2024

The langchain library advises to install faiss via pip install, however, the faiss library (us) do not support installs via pip (even when it is possible). In order to see whether this problem comes from the core faiss library, I would recommend first to create a clean conda environment and install faiss via conda as per the INSTALL.md therein. Otherwise, please post your issue in the langchain git repo : https://github.com/langchain-ai/langchain

@mlomeli1 mlomeli1 closed this as completed May 3, 2024
@mlomeli1 mlomeli1 reopened this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants