Getting an error while embedding

#1
by SwatiM - opened

Hi Community,
I am getting the error message while embedding. Also I m using sentence transformer version sentence_transformers-2.6.1
Error:
Pooling.init() got an unexpected keyword argument 'pooling_mode_weightedmean_tokens'

Hello!

The pooling_mode_weightedmean_tokensargument has existed since sentence transformers v2.3.0. What I suspect happened here is that you're running your Python code with a different Python virtual environment than the one in which you've installed Sentence Transformers v2.6.1. So, I think you actually have sentence transformers installed twice, e.g. once 2.6.1 and once some version below 2.3.0 (e.g. 2.2.2). You can perhaps double-check by running:

from sentence_transformers import SentenceTransformer, __version__

print("Sentence Transformers version:", __version__)
model = SentenceTransformer("tomaarsen/st-v3-test-mpnet-base-allnli-stsb")
  • Tom Aarsen

Sign up or log in to comment