Closed Hannibal046 closed 3 months ago
I would still use GritLM if you only want representation but pass mode=embedding
similar to here: https://github.com/ContextualAI/gritlm/blob/f0c3820e9dde0ea2beb0c4ede775eeaac3398eda/evaluation/eval_mteb.py#L1143
GritLM (via pip install gritlm
) is just a wrapper around Hugging Face in a single file: https://github.com/ContextualAI/gritlm/blob/main/gritlm/gritlm.py , so you can ofc also just copy the necessary parts from that file but I recommend just using GritLM as it handles many things for you like batching, using multiple GPUs, etc.
Thank you for your prompt response!
I'm grateful for the fully functional GritLM
class that seamlessly manages the entire process. Nonetheless, in my situation, the embedding model is just a component of a more extensive system. Therefore, I'm inclined to utilize a method native to Hugging Face to integrate it. It seems that I'll need to review the gritlm.py file in detail myself.
Once again, thank you for your assistance!
Thank you for your prompt response!
I'm grateful for the fully functional
GritLM
class that seamlessly manages the entire process. Nonetheless, in my situation, the embedding model is just a component of a more extensive system. Therefore, I'm inclined to utilize a method native to Hugging Face to integrate it. It seems that I'll need to review the gritlm.py file in detail myself.Once again, thank you for your assistance!
Sure that makes sense, it should be easy to just pick the parts from gritlm.py that you want! Feel free to share your Hugging Face script if you create one so others could benefit from it, too :)
Hi, thanks so much for the great work!
I am asking if there is a compatible way to directly use HuggingFace AutoModel and AutoTokenzier to get the representation of GritLM?
For example, this is how
SFR-Embedding-Mistral
works with HF:Do we have similar implementation if I only care about the representation ability of GritLM? Thanks!