myrkur commited on
Commit
2bcf495
·
verified ·
1 Parent(s): 7ee930a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -318,7 +318,7 @@ pip install -U sentence-transformers
318
 
319
  Then you can load this model and run inference.
320
  ```python
321
- from sentence_transformers import SentenceTransformer
322
 
323
  # Download from the 🤗 Hub
324
  model = SentenceTransformer("myrkur/sentence-transformer-parsbert-fa-2.0")
@@ -333,7 +333,7 @@ print(embeddings.shape)
333
  # [3, 768]
334
 
335
  # Get the similarity scores for the embeddings
336
- similarities = model.similarity(embeddings, embeddings)
337
  print(similarities.shape)
338
  # [3, 3]
339
  ```
 
318
 
319
  Then you can load this model and run inference.
320
  ```python
321
+ from sentence_transformers import SentenceTransformer, util
322
 
323
  # Download from the 🤗 Hub
324
  model = SentenceTransformer("myrkur/sentence-transformer-parsbert-fa-2.0")
 
333
  # [3, 768]
334
 
335
  # Get the similarity scores for the embeddings
336
+ similarities = util.cos_sim(embeddings, embeddings)
337
  print(similarities.shape)
338
  # [3, 3]
339
  ```