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

[Question]: WARNING - No sentence-transformers model found with name "local_storage_for_embedding_model". Creating a new one with mean pooling. #17325

Closed
1 task done
gdialektakis1 opened this issue Dec 19, 2024 · 3 comments
Labels
question Further information is requested

Comments

@gdialektakis1
Copy link

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

Hi all, I am trying to load a hugging face embedding model from local storage using the wrapper HuggingFaceEmbedding from here : https://docs.llamaindex.ai/en/stable/examples/embeddings/huggingface/. However, no matter what I have tried I can't make it load the model properly from local storage as I get the following warning:

WARNING - No sentence-transformers model found with name local_storage_for_embedding_model. Creating a new one with mean pooling.

The code I use is:

embed_model_local_path = Path("local_storage_for_embedding_model")

Settings.embed_model = HuggingFaceEmbedding(
                model_name=str(embed_model_local_path),  # Pass the temp directory path
                local_files_only=True
            )

and I try to load BAAI/bge-small-en-v1.5 (I have download all the necessary files from hugging-face to my local system in a folder with name "local_storage_for_embedding_model" in the root directory of my repository)

Can anyone please help? Thanks in advance.

@gdialektakis1 gdialektakis1 added the question Further information is requested label Dec 19, 2024
Copy link

dosubot bot commented Dec 19, 2024

Hey there, @gdialektakis1! I'm here to help you with any bugs, questions, or contributions you'd like to make. Let's tackle this together!

The warning you're encountering suggests that the HuggingFaceEmbedding wrapper is not finding the necessary files in your local storage directory. To resolve this, ensure that your local directory, local_storage_for_embedding_model, contains all the required files for the Hugging Face model. Typically, these files include:

  1. config.json
  2. pytorch_model.bin or tf_model.h5 (depending on whether you're using PyTorch or TensorFlow)
  3. tokenizer.json or vocab.txt (for the tokenizer)
  4. special_tokens_map.json (if applicable)
  5. tokenizer_config.json (if applicable)

Additionally, make sure that the directory path is correct and accessible by your script. You can also verify that the directory has the necessary read permissions.

If the issue persists, you might want to check if the model files are compatible with the sentence-transformers library, as the warning indicates that it is attempting to create a new model with mean pooling, which suggests it might not recognize the model format.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@gdialektakis1
Copy link
Author

I have done all the above, still facing the same issue

@gdialektakis1
Copy link
Author

@

@gdialektakis1 gdialektakis1 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant