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

Is there a way to use langchain-weaviate without simsimd package? #187

Closed
taeil00 opened this issue May 22, 2024 · 4 comments
Closed

Is there a way to use langchain-weaviate without simsimd package? #187

taeil00 opened this issue May 22, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@taeil00
Copy link

taeil00 commented May 22, 2024

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

-> My server cannot install simsimd through pypi.org as --index-url
This is an error message:
Could not find a version that satisfies the requirement simsimd<5.0.0,>=3.6.1 (from langchain-weaviate) (from versions: 1.1.2, 1.2.0, 1.3.0, 1.4.0)
ERROR: No matching distribution found for simsimd<5.0.0,>=3.6.1.

Describe the solution you'd like
A clear and concise description of what you want to happen.

-> I saw the sentence like "Fastest SIMD-Accelerated Vector Similarity Functions for x86 and Arm" in https://pypi.org/project/simsimd/.
I think my server isn't x86 or Arm.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
-> Is there a way to use langchain-weaviate without simsimd package?

@taeil00 taeil00 added the enhancement New feature or request label May 22, 2024
@hsm207
Copy link
Collaborator

hsm207 commented May 22, 2024

No, simsimd is there for performance reason.

Could you find out what is your server's architecture is and make a request at the simsimd project to ask for that architecture to be supported?

In the meantime, we could consider making this dependency optional and in the code, drop to a numpy implementation when the lib is not installed.

@oldpiao
Copy link

oldpiao commented Sep 8, 2024

I had the same problem. I'm centos7.8

@oldpiao
Copy link

oldpiao commented Sep 9, 2024

After testing, I found that simsimd requires libc version 2.28+, and the centos version I use is only 2.17, and upgrading libc is too risky.
After looking at the langchain-weaviate code, I see that the vector computation is only accelerated in _math.py, which appears on line 29.
Z = 1 - np.array(simsimd.cdist(X, Y, metric="cosine"))

In fact, this can be changed to an optional configuration, rather than a necessary configuration, so that the package is not available because simsimd is not installed.
For example:

try:
    import simsimd  # type: ignore
except ImportError:
    import numpy as simsimd

@hsm207
Copy link
Collaborator

hsm207 commented Sep 9, 2024

@oldpiao thanks for looking into this and identifying the dependencies.

I'm going to close this in favour of #208

@hsm207 hsm207 closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants