Closed RLinnae closed 1 month ago
š¤
Hey @RLinnae! Great to see you back in our digital neck of the woods. š
Based on the information provided, it seems like there's a misunderstanding about the usage of the InstructorEmbedding
class. The InstructorEmbedding
class does not accept a token
argument during initialization. The parameters it accepts are model_name
, query_instruction
, text_instruction
, embed_batch_size
, cache_folder
, device
, and callback_manager
.
The error message you're seeing is likely due to the fact that you're trying to pass a token
argument to the InstructorEmbedding
class, which it does not recognize.
Here's how you should be initializing the InstructorEmbedding
class:
from llama_index.embeddings.instructor import InstructorEmbedding
embed_model = InstructorEmbedding(model_name="hkunlp/instructor-base")
If you're trying to use a token for some other purpose (like authentication), could you please provide more details about what you're trying to achieve? That way, I can provide more targeted assistance.
For more information about the InstructorEmbedding
class and its usage, you can refer to the source code.
Note: the issue is with sentence transformers package 2.3+ , a quick fix was to use pip install sentence-transformers==2.2.2
Hi, @RLinnae,
I'm helping the LlamaIndex team manage their backlog and am marking this issue as stale. From what I understand, you encountered a TypeError with the InstructorEmbedding
due to an unexpected 'token' argument, but Dosubot provided a detailed response explaining that the InstructorEmbedding
class does not accept a token
argument during initialization and suggested the correct way to initialize the class. You later noted that the issue was with the sentence transformers package 2.3+ and a quick fix was to use pip install sentence-transformers==2.2.2.
Could you please confirm if this issue is still relevant to the latest version of the LlamaIndex repository? If it is, please let the LlamaIndex team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.
Thank you for your understanding and cooperation. If you have any further questions or concerns, feel free to reach out.
Bug Description
I have tried multiple examples including https://docs.llamaindex.ai/en/stable/examples/embeddings/huggingface.html#huggingfaceembedding And https://docs.llamaindex.ai/en/stable/examples/embeddings/custom_embeddings.html
Both result in the error:
Version
10.7
Steps to Reproduce
Relevant Logs/Tracbacks