Update README.md
Browse files
README.md
CHANGED
|
@@ -102,7 +102,7 @@ model = SentenceTransformer(
|
|
| 102 |
model_kwargs={
|
| 103 |
"torch_dtype": torch.bfloat16,
|
| 104 |
"attn_implementation": "flash_attention_2",
|
| 105 |
-
"device_map": "
|
| 106 |
}
|
| 107 |
)
|
| 108 |
|
|
@@ -122,8 +122,8 @@ document_embeddings = model.encode(documents, prompt_name="nl2code_document")
|
|
| 122 |
# Compute the (cosine) similarity between the query and document embeddings
|
| 123 |
similarity = model.similarity(query_embeddings, document_embeddings)
|
| 124 |
print(similarity)
|
| 125 |
-
# tensor([[0.
|
| 126 |
-
# [0.
|
| 127 |
```
|
| 128 |
</details>
|
| 129 |
|
|
|
|
| 102 |
model_kwargs={
|
| 103 |
"torch_dtype": torch.bfloat16,
|
| 104 |
"attn_implementation": "flash_attention_2",
|
| 105 |
+
"device_map": "cuda"
|
| 106 |
}
|
| 107 |
)
|
| 108 |
|
|
|
|
| 122 |
# Compute the (cosine) similarity between the query and document embeddings
|
| 123 |
similarity = model.similarity(query_embeddings, document_embeddings)
|
| 124 |
print(similarity)
|
| 125 |
+
# tensor([[0.7650, 0.1131],
|
| 126 |
+
# [0.0938, 0.6607]])
|
| 127 |
```
|
| 128 |
</details>
|
| 129 |
|