Skip to content

Commit

Permalink
improve error
Browse files Browse the repository at this point in the history
  • Loading branch information
fpgmaas committed Jul 5, 2024
1 parent c88dd4e commit a93071b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sentence_transformers/SentenceTransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,9 @@ def encode(
elif not output_value:
all_embeddings.extend(self._process_all_outputs(out_features))
else:
raise ValueError(f"Got unexpected value for 'output_value' : {output_value}")
raise ValueError(
f"Got unexpected value for 'output_value' : {output_value}. Valid values are 'token_embeddings', 'sentence_embedding' or None."
)

all_embeddings = [all_embeddings[idx] for idx in np.argsort(length_sorted_idx)]

Expand Down

0 comments on commit a93071b

Please sign in to comment.