Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -8885,6 +8885,8 @@ embeddings_1 = model.encode_queries(queries)
|
|
8885 |
embeddings_2 = model.encode_corpus(documents)
|
8886 |
similarity = embeddings_1 @ embeddings_2.T
|
8887 |
print(similarity)
|
|
|
|
|
8888 |
```
|
8889 |
|
8890 |
By default, FlagLLMModel will use all available GPUs when encoding. Please set `os.environ["CUDA_VISIBLE_DEVICES"]` to select specific GPUs.
|
@@ -8943,6 +8945,7 @@ with torch.no_grad():
|
|
8943 |
embeddings = F.normalize(embeddings, p=2, dim=1)
|
8944 |
scores = (embeddings[:2] @ embeddings[2:].T) * 100
|
8945 |
print(scores.tolist())
|
|
|
8946 |
```
|
8947 |
|
8948 |
|
|
|
8885 |
embeddings_2 = model.encode_corpus(documents)
|
8886 |
similarity = embeddings_1 @ embeddings_2.T
|
8887 |
print(similarity)
|
8888 |
+
# [[ 0.559 0.01654 ]
|
8889 |
+
# [-0.002575 0.4998 ]]
|
8890 |
```
|
8891 |
|
8892 |
By default, FlagLLMModel will use all available GPUs when encoding. Please set `os.environ["CUDA_VISIBLE_DEVICES"]` to select specific GPUs.
|
|
|
8945 |
embeddings = F.normalize(embeddings, p=2, dim=1)
|
8946 |
scores = (embeddings[:2] @ embeddings[2:].T) * 100
|
8947 |
print(scores.tolist())
|
8948 |
+
# [[55.92064666748047, 1.6549524068832397], [-0.2698777914047241, 49.95653533935547]]
|
8949 |
```
|
8950 |
|
8951 |
|