Instruct Embedding error

#10
by ASH3002 - opened

This is my code
model = INSTRUCTOR('hkunlp/instructor-large', device='cpu')
sentence = "3D ActionSLAM: wearable person tracking in multi-floor environments"
instruction = "Represent the Query Retrieval"
embeddings = model.encode([[instruction, sentence]])
print(embeddings)

The error i get:

TypeError Traceback (most recent call last)
Cell In[38], line 4
1 from InstructorEmbedding import INSTRUCTOR
3 # Custom initialization to avoid passing unsupported arguments
----> 4 model = INSTRUCTOR('hkunlp/instructor-large', device='cpu')
5 sentence = "3D ActionSLAM: wearable person tracking in multi-floor environments"
6 instruction = "Represent the Query Retrieval"

File ~\AppData\Roaming\Python\Python311\site-packages\sentence_transformers\SentenceTransformer.py:287, in SentenceTransformer.init(self, model_name_or_path, modules, device, prompts, default_prompt_name, similarity_fn_name, cache_folder, trust_remote_code, revision, local_files_only, token, use_auth_token, truncate_dim, model_kwargs, tokenizer_kwargs, config_kwargs, model_card_data)
278 model_name_or_path = MODEL_HUB_ORGANIZATION + "/" + model_name_or_path
280 if is_sentence_transformer_model(
281 model_name_or_path,
282 token,
(...)
285 local_files_only=local_files_only,
286 ):
--> 287 modules = self._load_sbert_model(
288 model_name_or_path,
289 token=token,
290 cache_folder=cache_folder,
291 revision=revision,
292 trust_remote_code=trust_remote_code,
293 local_files_only=local_files_only,
294 model_kwargs=model_kwargs,
295 tokenizer_kwargs=tokenizer_kwargs,
296 config_kwargs=config_kwargs,
297 )
298 else:
299 modules = self._load_auto_model(
300 model_name_or_path,
301 token=token,
(...)
308 config_kwargs=config_kwargs,
309 )

TypeError: INSTRUCTOR._load_sbert_model() got an unexpected keyword argument 'token'

Sign up or log in to comment