Update README.md
Browse files
README.md
CHANGED
@@ -25,7 +25,7 @@ def load_finetuned_model():
|
|
25 |
return tokenizer, query_encoder, sentence_encoder
|
26 |
|
27 |
|
28 |
-
def
|
29 |
input_ids = tokenizer(sentences, padding=True, max_length=128, truncation=True, return_tensors="pt",
|
30 |
add_special_tokens=True).to(device)
|
31 |
features = model(**input_ids)[0]
|
|
|
25 |
return tokenizer, query_encoder, sentence_encoder
|
26 |
|
27 |
|
28 |
+
def encode_batch(model, tokenizer, sentences, device):
|
29 |
input_ids = tokenizer(sentences, padding=True, max_length=128, truncation=True, return_tensors="pt",
|
30 |
add_special_tokens=True).to(device)
|
31 |
features = model(**input_ids)[0]
|