1 validation error for HuggingFaceHub
Getting error when trying to load the model. I want to perform sentence similarity. I am running it using Langchain-HuggingFaceHub on google colab, but it is giving me error as below:
"""
ValidationError: 1 validation error for HuggingFaceHub
root
Got invalid task sentence-similarity, currently only dict_keys(['translation', 'summarization', 'conversational', 'text-generation', 'text2text-generation']) are supported (type=value_error)
"""
For reference here is the code.
from langchain.llms import HuggingFaceHub
import os
os.environ['HUGGINGFACEHUB_API_TOKEN'] = ' '
model= HuggingFaceHub(repo_id="sentence-transformers/all-MiniLM-L6-v2",model_kwargs={"temperature": 0.5, "max_length": 64,"max_new_tokens":512})
Please help..!!!
Thanks in Advance
Hello!
This model is not an LLM, but an embedding model instead. You should use HuggingFaceEmbeddings
instead.
- Tom Aarsen
Thank You.
Is there any model which can be used for multilingual Sentence similarity ?
https://huggingface.co/intfloat/multilingual-e5-large-instruct or https://huggingface.co/intfloat/multilingual-e5-large are commonly used, although it's a bit bigger.
These also work:
Thank you soo much.