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

Unexpected Deletion : sentence-transformers (remove api key from advanced and update HuggingFace components ( #3397)) #3595

Closed
Arron-Clague opened this issue Aug 28, 2024 · 6 comments · Fixed by #3758
Assignees
Labels
bug Something isn't working

Comments

@Arron-Clague
Copy link

Bug Description

The old Hugging Space Component in v15 allows us to use Sentence-Transformers model locally : this seems to have been removed in v1.16/v1.17 ? Was this a mistake while executing #3397 ?

Reproduction

Component (Hugging Space Embeddings) removed : remaining component (HuggingFace Embbeddings) (which I think was called (HuggingSpaceEnbeddings API) does not allow local embedding through sentence transformers.

Expected behavior

Both local embeddings and API embeddings should be available.

Who can help?

@ogabrielluiz

Operating System

Ubuntu Linux 22.04

Langflow Version

1.01.16 , 1.0.17

Python Version

3.10

Screenshot

No response

Flow File

No response

@Arron-Clague Arron-Clague added the bug Something isn't working label Aug 28, 2024
@Arron-Clague Arron-Clague changed the title Unexpected Deletion : (remove api key from advanced and update HuggingFace components ( #3397)) Unexpected Deletion : sentence-transformers (remove api key from advanced and update HuggingFace components ( #3397)) Aug 28, 2024
Copy link

dosubot bot commented Aug 28, 2024

The HuggingFace Embeddings component does support the use of local Sentence-Transformers models. You can configure it by setting the Model Name parameter to the name or path of your local HuggingFace model. Additionally, you can customize other parameters such as Cache Folder, Encode Kwargs, Model Kwargs, and Multi Process to tailor the embedding process to your needs [1][2].

If the HuggingFace Embeddings component is not functioning as expected for local embeddings, it might be worth checking the configuration settings or reviewing any recent changes in the repository that could have affected this functionality.

To continue talking to Dosu, mention @dosu.

@edwinjosechittilappilly
Copy link
Collaborator

Hi @Arron-Clague Thanks for the feedback.
We no longer support local embeddings through Huggingface, due to some technical dependencies.
Meanwhile, if you like to try local embeddings please try Ollama Embeddings, which does provide most of the local embeddings model in huggingface.

I hope this helps. I would be closing this issue currently. Feel free to reachout if you face any other issues.

Screenshot 2024-09-10 at 1 25 11 PM

@Arron-Clague
Copy link
Author

Arron-Clague commented Sep 11, 2024

HI there : thanks so much for taking the time to reply so this is going be a real production problem for our langflow deployments : I will certainly look an the Olama options, but initially it looks like we would have to run a whole model structure on the langflow server just to do some embeddings ? Is this really a un-reversable decision ? Is it possible to have some more detail on the technical dependancies issues : in the short term, I can obviously make my own component to wrap the functionality for the hugging space code, and load sentence-transforms manually : but I don't understand the change and why it is removed ?

@edwinjosechittilappilly
Copy link
Collaborator

Thank you for your message. We were indeed facing some issues with the PyTorch dependencies for HuggingFace local embeddings. To address this, we have provided support using Hugging Face’s text embeddings inference. This method can be easily integrated into production environments. For a more efficient approach, please refer to this guide on running HuggingFace Embeddings locally with CPU.

The change is primarily due to an improvement in how we interact with HuggingFace embeddings. This new method offers a more effective and streamlined approach compared to previous implementations.

If you have further questions about the technical dependencies or need more details, please let us know. In the short term, creating a custom component to wrap the Hugging Face functionality and manually loading sentence-transformers is a viable solution. But I would highly suggest you to try the huggingFace Embeddings Inference component also.

@edwinjosechittilappilly
Copy link
Collaborator

Hi @Arron-Clague ,

In addition to the Hugging Face support I mentioned earlier, I would also recommend exploring the AstraVectorize component, which supports NVIDIA embeddings as well as several other providers. You can find more details here:

The AstraVectorize component provides a flexible and scalable solution for embedding generation, leveraging the power of NVIDIA embeddings and other integrations. This can be a great alternative for your Langflow deployments, especially if you are looking for enhanced performance and support for various embedding providers.

Feel free to explore these resources and see if they fit your needs. If you have any more questions or need further assistance, just let me know!

@Arron-Clague
Copy link
Author

Hi Edwin : thanks so much for the detailed update : I think I understand where you are going with this : I will definitely check out the AstraDB and HF TEI interfaces. We can definitely close this Issue thread off, and thanks so much for your brilliant answers ! - Tx Arron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants