tomaarsen HF Staff commited on
Commit
4311ce5
·
verified ·
1 Parent(s): e990968

Remove convert_to_tensor=True in MultiVectorEncoder, this parameter was removed

Browse files

Hello!

This simple PR removes `convert_to_tensor=True` in the MultiVectorEncoder `encode_query`/`encode_document`/`encode` calls, as I removed this parameter and made a Tensor output the default just prior to the release. I didn't realize these snippets still used this parameter, my apologies!

- Tom Aarsen

Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -180,8 +180,8 @@ documents = [
180
  for i in range(1, 5)
181
  ]
182
 
183
- query_embeddings = model.encode_query(queries, convert_to_tensor=True)
184
- document_embeddings = model.encode_document(documents, convert_to_tensor=True)
185
  print(f"Query 0 shape: {tuple(query_embeddings[0].shape)}")
186
  print(f"Document 0 shape: {tuple(document_embeddings[0].shape)}")
187
  # Query 0 shape: (23, 320)
 
180
  for i in range(1, 5)
181
  ]
182
 
183
+ query_embeddings = model.encode_query(queries)
184
+ document_embeddings = model.encode_document(documents)
185
  print(f"Query 0 shape: {tuple(query_embeddings[0].shape)}")
186
  print(f"Document 0 shape: {tuple(document_embeddings[0].shape)}")
187
  # Query 0 shape: (23, 320)