yeliu918 commited on
Commit
a08241f
1 Parent(s): 3bb1de1

update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -1
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, return_attention_mask=False, padding=False, truncation=True)
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