Update README.md - Fix Wrong CODE

#31
by kyujinpy - opened
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -5432,7 +5432,7 @@ embeddings = average_pool(outputs.last_hidden_state, batch_dict['attention_mask'
5432
 
5433
  # normalize embeddings
5434
  embeddings = F.normalize(embeddings, p=2, dim=1)
5435
- scores = (embeddings[:2] @ embeddings[2:].T) * 100
5436
  print(scores.tolist())
5437
  # => [[91.92852783203125, 67.580322265625], [70.3814468383789, 92.1330795288086]]
5438
  ```
@@ -5461,7 +5461,7 @@ input_texts = queries + documents
5461
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
5462
 
5463
  embeddings = model.encode(input_texts, convert_to_tensor=True, normalize_embeddings=True)
5464
- scores = (embeddings[:2] @ embeddings[2:].T) * 100
5465
  print(scores.tolist())
5466
  # [[91.92853546142578, 67.5802993774414], [70.38143157958984, 92.13307189941406]]
5467
  ```
 
5432
 
5433
  # normalize embeddings
5434
  embeddings = F.normalize(embeddings, p=2, dim=1)
5435
+ scores = (embeddings[:2] @ embeddings[:2].T) * 100
5436
  print(scores.tolist())
5437
  # => [[91.92852783203125, 67.580322265625], [70.3814468383789, 92.1330795288086]]
5438
  ```
 
5461
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
5462
 
5463
  embeddings = model.encode(input_texts, convert_to_tensor=True, normalize_embeddings=True)
5464
+ scores = (embeddings[:2] @ embeddings[:2].T) * 100
5465
  print(scores.tolist())
5466
  # [[91.92853546142578, 67.5802993774414], [70.38143157958984, 92.13307189941406]]
5467
  ```