zpn commited on
Commit
1066b65
·
verified ·
1 Parent(s): e89d1c9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -0
README.md CHANGED
@@ -204,6 +204,12 @@ print(similarity)
204
  # tensor(0.9118)
205
  ```
206
 
 
 
 
 
 
 
207
  ### SentenceTransformers
208
 
209
  With SentenceTransformers, you can specify the `prompt_name` as either `"query"` or `"passage"`, and the task instruction will be included automatically.
 
204
  # tensor(0.9118)
205
  ```
206
 
207
+ For truncation, you can trucate before applying normalization
208
+ ```diff
209
+ + embeddings = embeddings[:, :matryoshka_dim]
210
+ embeddings = F.normalize(embeddings, p=2, dim=1)
211
+ ```
212
+
213
  ### SentenceTransformers
214
 
215
  With SentenceTransformers, you can specify the `prompt_name` as either `"query"` or `"passage"`, and the task instruction will be included automatically.