tomaarsen HF Staff commited on
Commit
49d7a03
·
verified ·
1 Parent(s): 8131032

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
@@ -68,8 +68,8 @@ images = [
68
  "https://huggingface.co/datasets/sentence-transformers/example-documents/resolve/main/doc4.jpg",
69
  ]
70
 
71
- query_embeddings = model.encode_query(queries, convert_to_tensor=True)
72
- document_embeddings = model.encode_document(images, convert_to_tensor=True)
73
  print(f"Query 0 shape: {tuple(query_embeddings[0].shape)}")
74
  print(f"Document 0 shape: {tuple(document_embeddings[0].shape)}")
75
  # Query 0 shape: (26, 128)
 
68
  "https://huggingface.co/datasets/sentence-transformers/example-documents/resolve/main/doc4.jpg",
69
  ]
70
 
71
+ query_embeddings = model.encode_query(queries)
72
+ document_embeddings = model.encode_document(images)
73
  print(f"Query 0 shape: {tuple(query_embeddings[0].shape)}")
74
  print(f"Document 0 shape: {tuple(document_embeddings[0].shape)}")
75
  # Query 0 shape: (26, 128)