How to Use HuggingFace free Embedding models
Hi, I’m new at the platform, and trying to build a RAG app with my word doc as knowledge base and llama as LLM model.In order to embed text, I’m struggling with a free model implementation, such as HuggingFaceEmbeddings, but most documentation I have access to is a little bit confusing regard importation and newest version.Some sources:from langchain_huggingface import HuggingFaceEmbeddingsAnother ones:from langchain.embeddings import HuggingFaceEmbeddingsAre there a “source of truth” material in which I can check in order to finish my project?Thank you!
2024-10-01T20:41:17Z
Apparently it is both libraries by a third party and maybe both are real.I am not familiar with Embedding or LangChain, so we will wait for someone more knowledgeable to come by.I found a couple of official HF introductory articles.huggingface.coAdvanced RAG on Hugging Face documentation using LangChain - Hugging Face...We’re on a journey to advance and democratize artificial intelligence through open source and open science.huggingface.coGetting Started With EmbeddingsWe’re on a journey to advance and democratize artificial intelligence through open source and open science.
2024-10-02T02:56:43Z
Personally, I’ve felt that LangChain has pretty fast-paced updates, some of which change the internal structure of the library itself (for example, where the classes are located). Typically, they will indicate that a particular class is deprecated, and suggest alternatives on their official API documentation.image1421×387 35 KBHuggingFaceEmbeddings documentationI would say it depends on which version of LangChain you use; depending on your version, it may be the case that both work, or only one of the two works. I would recommend updating the library and sticking to the newest implementations, unless you run into bugs.
2024-10-07T09:41:43Z
Personally I recommend Chroma db for RAG apps as it handles conversion of any BERT encoder models to embedding models through mean pooling the embedding layer.  Plus it has support for many 3rd parties including SentenceTransformers and Huggingface Transformers. It also supports conditional (By metadata) retrieval.