Update README.md
Browse files
README.md
CHANGED
@@ -33,7 +33,7 @@ input_texts = [
|
|
33 |
tokenizer = AutoTokenizer.from_pretrained('efederici/e5-large-v2-4096')
|
34 |
model = AutoModel.from_pretrained('efederici/e5-large-v2-4096', trust_remote_code=True)
|
35 |
|
36 |
-
batch_dict = tokenizer(input_texts, max_length=
|
37 |
outputs = model(**batch_dict)
|
38 |
embeddings = average_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
|
39 |
|
|
|
33 |
tokenizer = AutoTokenizer.from_pretrained('efederici/e5-large-v2-4096')
|
34 |
model = AutoModel.from_pretrained('efederici/e5-large-v2-4096', trust_remote_code=True)
|
35 |
|
36 |
+
batch_dict = tokenizer(input_texts, max_length=4096, padding=True, truncation=True, return_tensors='pt')
|
37 |
outputs = model(**batch_dict)
|
38 |
embeddings = average_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
|
39 |
|