efederici commited on
Commit
d92c7d6
1 Parent(s): 84eccd5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -0
README.md CHANGED
@@ -104,6 +104,20 @@ language:
104
 
105
  Below is an example to encode queries and passages from the MS-MARCO passage ranking dataset.
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  ```python
108
  import torch.nn.functional as F
109
  from torch import Tensor
 
104
 
105
  Below is an example to encode queries and passages from the MS-MARCO passage ranking dataset.
106
 
107
+ ```python
108
+ from sentence_transformers import SentenceTransformer
109
+ model = SentenceTransformer('efederici/multilingual-e5-small-4096', {"trust_remote_code": True})
110
+ input_texts = [
111
+ 'query: how much protein should a female eat',
112
+ 'query: summit define',
113
+ "passage: As a general guideline, the CDC's average requirement of protein for women ages 19 to 70 is 46 grams per day. But, as you can see from this chart, you'll need to increase that if you're expecting or training for a marathon. Check out the chart below to see how much protein you should be eating each day.",
114
+ "passage: Definition of summit for English Language Learners. : 1 the highest point of a mountain : the top of a mountain. : 2 the highest level. : 3 a meeting or series of meetings between the leaders of two or more governments."
115
+ ]
116
+ embeddings = model.encode(input_texts, normalize_embeddings=True)
117
+ ```
118
+
119
+ or...
120
+
121
  ```python
122
  import torch.nn.functional as F
123
  from torch import Tensor