UKPLab / sentence-transformers

Multilingual Sentence & Image Embeddings with BERT
https://www.SBERT.net
Apache License 2.0
14.33k stars 2.39k forks source link

Error in semantic search #588

Open Mahmedturk opened 3 years ago

Mahmedturk commented 3 years ago

Hi, When i run semantic search example i get the below error.

File ".../sentence_transformers/models/Transformer.py", line 79, in get_sentence_features return self.tokenizer.prepare_for_model(tokens, max_length=pad_seq_length, padding='max_length', return_tensors='pt', truncation=True, prepend_batch_axis=True) TypeError: prepare_for_model() got an unexpected keyword argument 'padding'

is there a way to fix this?

nreimers commented 3 years ago

Which version of transformers do you use? Try to update to the latest version.

bgootiiz-debug commented 3 years ago

Faced the exact the same error, any tips or advice would be great

bgootiiz-debug commented 3 years ago

I am cloned the 3.5 version from the the GitHub. What is the latest version?

bgootiiz-debug commented 3 years ago

I reinstalled transformer and reloaded my Jupiter notebook error is no longer shows up.

eva806 commented 3 years ago

Any solution for this issue?