update README.md
Browse files
README.md
CHANGED
@@ -3326,7 +3326,7 @@ tokenizer.add_eos_token = True
|
|
3326 |
# get the embeddings
|
3327 |
max_length = 4096
|
3328 |
input_texts = queries + passages
|
3329 |
-
batch_dict = tokenizer(input_texts, max_length=max_length - 1,
|
3330 |
outputs = model(**batch_dict)
|
3331 |
embeddings = last_token_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
|
3332 |
|
|
|
3326 |
# get the embeddings
|
3327 |
max_length = 4096
|
3328 |
input_texts = queries + passages
|
3329 |
+
batch_dict = tokenizer(input_texts, max_length=max_length - 1, padding=True, truncation=True, return_tensors="pt")
|
3330 |
outputs = model(**batch_dict)
|
3331 |
embeddings = last_token_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
|
3332 |
|