langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
92.17k stars 14.7k forks source link

AttributeError: module 'numpy.linalg._umath_linalg' has no attribute '_ilp64' #19734

Closed KaifAhmad1 closed 2 weeks ago

KaifAhmad1 commented 5 months ago

Checked other resources

Example Code

from langchain.embeddings import HuggingFaceEmbeddings

model_name = "sentence-transformers/all-mpnet-base-v2"
model_kwargs = {"device": "cuda"}
embeddings = HuggingFaceEmbeddings(
    model_name=model_name, model_kwargs=model_kwargs
)

Error Message and Stack Trace (if applicable)

No response

Description

--------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-33-394138456f96>](https://localhost:8080/#) in <cell line: 5>()
      3 model_name = "sentence-transformers/all-mpnet-base-v2"
      4 model_kwargs = {"device": "cuda"}
----> 5 embeddings = HuggingFaceEmbeddings(
      6     model_name=model_name, model_kwargs=model_kwargs
      7 )

14 frames
[/usr/local/lib/python3.10/dist-packages/numpy/testing/_private/utils.py](https://localhost:8080/#) in <module>
     55 IS_PYSTON = hasattr(sys, "pyston_version_info")
     56 HAS_REFCOUNT = getattr(sys, 'getrefcount', None) is not None and not IS_PYSTON
---> 57 HAS_LAPACK64 = numpy.linalg._umath_linalg._ilp64
     58 
     59 _OLD_PROMOTION = lambda: np._get_promotion_state() == 'legacy'

AttributeError: module 'numpy.linalg._umath_linalg' has no attribute '_ilp64'

System Info

Windows 11 x64 langchain == 0.1.13 pip == 24.0 python == 3.10.10 sentence-transformers == 2.6.1

falmanna commented 3 months ago

any workaround?