TypeError: INSTRUCTOR._load_sbert_model() got an unexpected keyword argument 'token' when using hkunlp/instructor-xl

#35
by sethanimesh - opened

I’m encountering an error when trying to load the hkunlp/instructor-xl model using the INSTRUCTOR class from the InstructorEmbedding package. Here’s a minimal reproducible example:

from InstructorEmbedding import INSTRUCTOR
model = INSTRUCTOR('hkunlp/instructor-large')
sentence = "3D ActionSLAM: wearable person tracking in multi-floor environments"
instruction = "Represent the Science title:"
embeddings = model.encode([[instruction,sentence]])
print(embeddings)

Traceback (most recent call last):
File "/Users/animesh/Desktop/temp/temp.py", line 2, in
model = INSTRUCTOR('hkunlp/instructor-xl')
File "/Users/animesh/Desktop/temp/my_env/lib/python3.13/site-packages/sentence_transformers/SentenceTransformer.py", line 308, in init
modules, self.module_kwargs = self._load_sbert_model(
~~~~~~~~~~~~~~~~~~~~~~^
model_name_or_path,
^^^^^^^^^^^^^^^^^^^
...<7 lines>...
config_kwargs=config_kwargs,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
TypeError: INSTRUCTOR._load_sbert_model() got an unexpected keyword argument 'token'

why is this issue coming up? Can someone please help

Same issue.

This comment has been hidden

Run pip install sentence-transformers==2.2.2 worked for me.

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment