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

Whether the simsimd library can be changed to optional configuration #208

Open
oldpiao opened this issue Sep 9, 2024 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@oldpiao
Copy link

oldpiao commented Sep 9, 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 [...]
simsimd cannot be installed properly on some older systems, and simsimd is not a necessary dependency in my opinion.

Describe the solution you'd like
A clear and concise description of what you want to happen.
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.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
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:
    from scipy.spatial import distance as simsimd

Additional context
Add any other context or screenshots about the feature request here.

@oldpiao oldpiao added the enhancement New feature or request label Sep 9, 2024
@hsm207 hsm207 added the good first issue Good for newcomers label Sep 9, 2024
@hsm207
Copy link
Collaborator

hsm207 commented Sep 9, 2024

I like this idea, just also add a logging message to inform user that simsimd lib is not found and will drop to numpy.

leaving this open for community contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants