-
Checked other resources
Commit to Help
Example Codefrom langchain_huggingface import HuggingFaceEmbeddings
device = 'cuda'#'cpu'
print(f"Initializing the Embedding Model: {embed_model_path}")
hfem = HuggingFaceEmbeddings(
model_name="./models/sentence-transformers/all-MiniLM-L6-v2",
model_kwargs={'device': device},
encode_kwargs={'device': device, 'batch_size': 32}
) DescriptionI recently updated a bunch pip packages to include langchain v3. After upgrading, I re-ran code (which worked previously) and resulted in an error when initializing a downloaded embedding model (sentence-transformers/all-MiniLM-L6-v2). Now I'm receiving a exception referencing a I suspect there's some compatibility issue with System InfoSystem Information
Package Information
Optional packages not installed
Other Dependencies
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After reviewing the call stack and diving down into the code of This was not a compatibility issue between |
Beta Was this translation helpful? Give feedback.
After reviewing the call stack and diving down into the code of
importlib
, it became apparent there was an issue with obtaining the version installed for PyTorch. Turns out that if you have some lingering dist-info from previous installation oftorch
theimportlib
gets "confused" and returnNone
for the version. That along with noticing that I had torch installed for the user and globally that conflicted with each other. After uninstallingtorch
and then manually doing some clean up on the global site-packages, then re-installingtorch
seemed to fix the issue.This was not a compatibility issue between
langchain-huggingface
andhuggingface-hub