Improve model metadata
#2
by
tomaarsen
HF staff
- opened
- README.md +125 -124
- config.json +2 -2
- configuration_nvembed.py +0 -2
README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
---
|
2 |
tags:
|
3 |
- mteb
|
|
|
4 |
- sentence-transformers
|
5 |
model-index:
|
6 |
- name: NV-Embed-v2
|
@@ -90,17 +91,17 @@ model-index:
|
|
90 |
- type: map_at_5
|
91 |
value: 61.027
|
92 |
- type: mrr_at_1
|
93 |
-
value: 0
|
94 |
- type: mrr_at_10
|
95 |
-
value: 0
|
96 |
- type: mrr_at_100
|
97 |
-
value: 0
|
98 |
- type: mrr_at_1000
|
99 |
-
value: 0
|
100 |
- type: mrr_at_3
|
101 |
-
value: 0
|
102 |
- type: mrr_at_5
|
103 |
-
value: 0
|
104 |
- type: ndcg_at_1
|
105 |
value: 46.515
|
106 |
- type: ndcg_at_10
|
@@ -278,17 +279,17 @@ model-index:
|
|
278 |
- type: map_at_5
|
279 |
value: 42.317083333333336
|
280 |
- type: mrr_at_1
|
281 |
-
value: 0
|
282 |
- type: mrr_at_10
|
283 |
-
value: 0
|
284 |
- type: mrr_at_100
|
285 |
-
value: 0
|
286 |
- type: mrr_at_1000
|
287 |
-
value: 0
|
288 |
- type: mrr_at_3
|
289 |
-
value: 0
|
290 |
- type: mrr_at_5
|
291 |
-
value: 0
|
292 |
- type: ndcg_at_1
|
293 |
value: 38.30616666666667
|
294 |
- type: ndcg_at_10
|
@@ -349,17 +350,17 @@ model-index:
|
|
349 |
- type: map_at_5
|
350 |
value: 31.955
|
351 |
- type: mrr_at_1
|
352 |
-
value: 0
|
353 |
- type: mrr_at_10
|
354 |
-
value: 0
|
355 |
- type: mrr_at_100
|
356 |
-
value: 0
|
357 |
- type: mrr_at_1000
|
358 |
-
value: 0
|
359 |
- type: mrr_at_3
|
360 |
-
value: 0
|
361 |
- type: mrr_at_5
|
362 |
-
value: 0
|
363 |
- type: ndcg_at_1
|
364 |
value: 44.104
|
365 |
- type: ndcg_at_10
|
@@ -420,19 +421,19 @@ model-index:
|
|
420 |
- type: map_at_5
|
421 |
value: 21.062
|
422 |
- type: mrr_at_1
|
423 |
-
value: 0
|
424 |
- type: mrr_at_10
|
425 |
-
value: 0
|
426 |
- type: mrr_at_100
|
427 |
-
value: 0
|
428 |
- type: mrr_at_1000
|
429 |
-
value: 0
|
430 |
- type: mrr_at_3
|
431 |
-
value: 0
|
432 |
- type: mrr_at_5
|
433 |
-
value: 0
|
434 |
- type: ndcg_at_1
|
435 |
-
value: 66
|
436 |
- type: ndcg_at_10
|
437 |
value: 53.496
|
438 |
- type: ndcg_at_100
|
@@ -452,7 +453,7 @@ model-index:
|
|
452 |
- type: precision_at_1000
|
453 |
value: 2.5940000000000003
|
454 |
- type: precision_at_3
|
455 |
-
value: 61
|
456 |
- type: precision_at_5
|
457 |
value: 54.65
|
458 |
- type: recall_at_1
|
@@ -510,17 +511,17 @@ model-index:
|
|
510 |
- type: map_at_5
|
511 |
value: 91.262
|
512 |
- type: mrr_at_1
|
513 |
-
value: 0
|
514 |
- type: mrr_at_10
|
515 |
-
value: 0
|
516 |
- type: mrr_at_100
|
517 |
-
value: 0
|
518 |
- type: mrr_at_1000
|
519 |
-
value: 0
|
520 |
- type: mrr_at_3
|
521 |
-
value: 0
|
522 |
- type: mrr_at_5
|
523 |
-
value: 0
|
524 |
- type: ndcg_at_1
|
525 |
value: 91.20899999999999
|
526 |
- type: ndcg_at_10
|
@@ -581,17 +582,17 @@ model-index:
|
|
581 |
- type: map_at_5
|
582 |
value: 55.054
|
583 |
- type: mrr_at_1
|
584 |
-
value: 0
|
585 |
- type: mrr_at_10
|
586 |
-
value: 0
|
587 |
- type: mrr_at_100
|
588 |
-
value: 0
|
589 |
- type: mrr_at_1000
|
590 |
-
value: 0
|
591 |
- type: mrr_at_3
|
592 |
-
value: 0
|
593 |
- type: mrr_at_5
|
594 |
-
value: 0
|
595 |
- type: ndcg_at_1
|
596 |
value: 64.815
|
597 |
- type: ndcg_at_10
|
@@ -652,17 +653,17 @@ model-index:
|
|
652 |
- type: map_at_5
|
653 |
value: 78.935
|
654 |
- type: mrr_at_1
|
655 |
-
value: 0
|
656 |
- type: mrr_at_10
|
657 |
-
value: 0
|
658 |
- type: mrr_at_100
|
659 |
-
value: 0
|
660 |
- type: mrr_at_1000
|
661 |
-
value: 0
|
662 |
- type: mrr_at_3
|
663 |
-
value: 0
|
664 |
- type: mrr_at_5
|
665 |
-
value: 0
|
666 |
- type: ndcg_at_1
|
667 |
value: 89.305
|
668 |
- type: ndcg_at_10
|
@@ -734,65 +735,65 @@ model-index:
|
|
734 |
type: mteb/msmarco
|
735 |
metrics:
|
736 |
- type: map_at_1
|
737 |
-
value: 0
|
738 |
- type: map_at_10
|
739 |
value: 38.342
|
740 |
- type: map_at_100
|
741 |
-
value: 0
|
742 |
- type: map_at_1000
|
743 |
-
value: 0
|
744 |
- type: map_at_3
|
745 |
-
value: 0
|
746 |
- type: map_at_5
|
747 |
-
value: 0
|
748 |
- type: mrr_at_1
|
749 |
-
value: 0
|
750 |
- type: mrr_at_10
|
751 |
-
value: 0
|
752 |
- type: mrr_at_100
|
753 |
-
value: 0
|
754 |
- type: mrr_at_1000
|
755 |
-
value: 0
|
756 |
- type: mrr_at_3
|
757 |
-
value: 0
|
758 |
- type: mrr_at_5
|
759 |
-
value: 0
|
760 |
- type: ndcg_at_1
|
761 |
-
value: 0
|
762 |
- type: ndcg_at_10
|
763 |
value: 45.629999999999995
|
764 |
- type: ndcg_at_100
|
765 |
-
value: 0
|
766 |
- type: ndcg_at_1000
|
767 |
-
value: 0
|
768 |
- type: ndcg_at_3
|
769 |
-
value: 0
|
770 |
- type: ndcg_at_5
|
771 |
-
value: 0
|
772 |
- type: precision_at_1
|
773 |
-
value: 0
|
774 |
- type: precision_at_10
|
775 |
value: 7.119000000000001
|
776 |
- type: precision_at_100
|
777 |
-
value: 0
|
778 |
- type: precision_at_1000
|
779 |
-
value: 0
|
780 |
- type: precision_at_3
|
781 |
-
value: 0
|
782 |
- type: precision_at_5
|
783 |
-
value: 0
|
784 |
- type: recall_at_1
|
785 |
-
value: 0
|
786 |
- type: recall_at_10
|
787 |
value: 67.972
|
788 |
- type: recall_at_100
|
789 |
-
value: 0
|
790 |
- type: recall_at_1000
|
791 |
-
value: 0
|
792 |
- type: recall_at_3
|
793 |
-
value: 0
|
794 |
- type: recall_at_5
|
795 |
-
value: 0
|
796 |
- type: main_score
|
797 |
value: 45.629999999999995
|
798 |
task:
|
@@ -938,17 +939,17 @@ model-index:
|
|
938 |
- type: map_at_5
|
939 |
value: 15.171000000000001
|
940 |
- type: mrr_at_1
|
941 |
-
value: 0
|
942 |
- type: mrr_at_10
|
943 |
-
value: 0
|
944 |
- type: mrr_at_100
|
945 |
-
value: 0
|
946 |
- type: mrr_at_1000
|
947 |
-
value: 0
|
948 |
- type: mrr_at_3
|
949 |
-
value: 0
|
950 |
- type: mrr_at_5
|
951 |
-
value: 0
|
952 |
- type: ndcg_at_1
|
953 |
value: 55.728
|
954 |
- type: ndcg_at_10
|
@@ -1009,17 +1010,17 @@ model-index:
|
|
1009 |
- type: map_at_5
|
1010 |
value: 65.364
|
1011 |
- type: mrr_at_1
|
1012 |
-
value: 0
|
1013 |
- type: mrr_at_10
|
1014 |
-
value: 0
|
1015 |
- type: mrr_at_100
|
1016 |
-
value: 0
|
1017 |
- type: mrr_at_1000
|
1018 |
-
value: 0
|
1019 |
- type: mrr_at_3
|
1020 |
-
value: 0
|
1021 |
- type: mrr_at_5
|
1022 |
-
value: 0
|
1023 |
- type: ndcg_at_1
|
1024 |
value: 55.417
|
1025 |
- type: ndcg_at_10
|
@@ -1080,17 +1081,17 @@ model-index:
|
|
1080 |
- type: map_at_5
|
1081 |
value: 84.396
|
1082 |
- type: mrr_at_1
|
1083 |
-
value: 0
|
1084 |
- type: mrr_at_10
|
1085 |
-
value: 0
|
1086 |
- type: mrr_at_100
|
1087 |
-
value: 0
|
1088 |
- type: mrr_at_1000
|
1089 |
-
value: 0
|
1090 |
- type: mrr_at_3
|
1091 |
-
value: 0
|
1092 |
- type: mrr_at_5
|
1093 |
-
value: 0
|
1094 |
- type: ndcg_at_1
|
1095 |
value: 82.12
|
1096 |
- type: ndcg_at_10
|
@@ -1181,17 +1182,17 @@ model-index:
|
|
1181 |
- type: map_at_5
|
1182 |
value: 11.158
|
1183 |
- type: mrr_at_1
|
1184 |
-
value: 0
|
1185 |
- type: mrr_at_10
|
1186 |
-
value: 0
|
1187 |
- type: mrr_at_100
|
1188 |
-
value: 0
|
1189 |
- type: mrr_at_1000
|
1190 |
-
value: 0
|
1191 |
- type: mrr_at_3
|
1192 |
-
value: 0
|
1193 |
- type: mrr_at_5
|
1194 |
-
value: 0
|
1195 |
- type: ndcg_at_1
|
1196 |
value: 26.3
|
1197 |
- type: ndcg_at_10
|
@@ -1474,19 +1475,19 @@ model-index:
|
|
1474 |
- type: map_at_5
|
1475 |
value: 74.74
|
1476 |
- type: mrr_at_1
|
1477 |
-
value: 0
|
1478 |
- type: mrr_at_10
|
1479 |
-
value: 0
|
1480 |
- type: mrr_at_100
|
1481 |
-
value: 0
|
1482 |
- type: mrr_at_1000
|
1483 |
-
value: 0
|
1484 |
- type: mrr_at_3
|
1485 |
-
value: 0
|
1486 |
- type: mrr_at_5
|
1487 |
-
value: 0
|
1488 |
- type: ndcg_at_1
|
1489 |
-
value: 66
|
1490 |
- type: ndcg_at_10
|
1491 |
value: 80.12700000000001
|
1492 |
- type: ndcg_at_100
|
@@ -1498,7 +1499,7 @@ model-index:
|
|
1498 |
- type: ndcg_at_5
|
1499 |
value: 78.827
|
1500 |
- type: precision_at_1
|
1501 |
-
value: 66
|
1502 |
- type: precision_at_10
|
1503 |
value: 10.567
|
1504 |
- type: precision_at_100
|
@@ -1516,7 +1517,7 @@ model-index:
|
|
1516 |
- type: recall_at_100
|
1517 |
value: 98.667
|
1518 |
- type: recall_at_1000
|
1519 |
-
value: 100
|
1520 |
- type: recall_at_3
|
1521 |
value: 83.322
|
1522 |
- type: recall_at_5
|
@@ -1680,19 +1681,19 @@ model-index:
|
|
1680 |
- type: map_at_5
|
1681 |
value: 1.185
|
1682 |
- type: mrr_at_1
|
1683 |
-
value: 0
|
1684 |
- type: mrr_at_10
|
1685 |
-
value: 0
|
1686 |
- type: mrr_at_100
|
1687 |
-
value: 0
|
1688 |
- type: mrr_at_1000
|
1689 |
-
value: 0
|
1690 |
- type: mrr_at_3
|
1691 |
-
value: 0
|
1692 |
- type: mrr_at_5
|
1693 |
-
value: 0
|
1694 |
- type: ndcg_at_1
|
1695 |
-
value: 91
|
1696 |
- type: ndcg_at_10
|
1697 |
value: 88.442
|
1698 |
- type: ndcg_at_100
|
@@ -1704,7 +1705,7 @@ model-index:
|
|
1704 |
- type: ndcg_at_5
|
1705 |
value: 89.562
|
1706 |
- type: precision_at_1
|
1707 |
-
value: 92
|
1708 |
- type: precision_at_10
|
1709 |
value: 92.60000000000001
|
1710 |
- type: precision_at_100
|
@@ -1712,7 +1713,7 @@ model-index:
|
|
1712 |
- type: precision_at_1000
|
1713 |
value: 28.222
|
1714 |
- type: precision_at_3
|
1715 |
-
value: 94
|
1716 |
- type: precision_at_5
|
1717 |
value: 93.60000000000001
|
1718 |
- type: recall_at_1
|
@@ -1751,17 +1752,17 @@ model-index:
|
|
1751 |
- type: map_at_5
|
1752 |
value: 9.49
|
1753 |
- type: mrr_at_1
|
1754 |
-
value: 0
|
1755 |
- type: mrr_at_10
|
1756 |
-
value: 0
|
1757 |
- type: mrr_at_100
|
1758 |
-
value: 0
|
1759 |
- type: mrr_at_1000
|
1760 |
-
value: 0
|
1761 |
- type: mrr_at_3
|
1762 |
-
value: 0
|
1763 |
- type: mrr_at_5
|
1764 |
-
value: 0
|
1765 |
- type: ndcg_at_1
|
1766 |
value: 47.959
|
1767 |
- type: ndcg_at_10
|
@@ -2004,7 +2005,7 @@ model-index:
|
|
2004 |
language:
|
2005 |
- en
|
2006 |
license: cc-by-nc-4.0
|
2007 |
-
|
2008 |
---
|
2009 |
## Introduction
|
2010 |
We present NV-Embed-v2, a generalist embedding model that ranks No. 1 on the Massive Text Embedding Benchmark ([MTEB benchmark](https://huggingface.co/spaces/mteb/leaderboard))(as of Aug 30, 2024) with a score of 72.31 across 56 text embedding tasks. It also holds the No. 1 in the retrieval sub-category (a score of 62.65 across 15 tasks) in the leaderboard, which is essential to the development of RAG technology.
|
@@ -2049,7 +2050,7 @@ passages = [
|
|
2049 |
model = AutoModel.from_pretrained('nvidia/NV-Embed-v2', trust_remote_code=True)
|
2050 |
|
2051 |
# get the embeddings
|
2052 |
-
max_length =
|
2053 |
query_embeddings = model.encode(queries, instruction=query_prefix, max_length=max_length)
|
2054 |
passage_embeddings = model.encode(passages, instruction=passage_prefix, max_length=max_length)
|
2055 |
|
@@ -2064,7 +2065,7 @@ passage_embeddings = F.normalize(passage_embeddings, p=2, dim=1)
|
|
2064 |
|
2065 |
scores = (query_embeddings @ passage_embeddings.T) * 100
|
2066 |
print(scores.tolist())
|
2067 |
-
# [[87.
|
2068 |
```
|
2069 |
|
2070 |
|
@@ -2091,7 +2092,7 @@ passages = [
|
|
2091 |
|
2092 |
# load model with tokenizer
|
2093 |
model = SentenceTransformer('nvidia/NV-Embed-v2', trust_remote_code=True)
|
2094 |
-
model.max_seq_length =
|
2095 |
model.tokenizer.padding_side="right"
|
2096 |
|
2097 |
def add_eos(input_examples):
|
@@ -2114,7 +2115,7 @@ For commercial purpose, we recommend you to use the models of [NeMo Retriever Mi
|
|
2114 |
|
2115 |
|
2116 |
## Correspondence to
|
2117 |
-
Chankyu Lee ([email protected]),
|
2118 |
|
2119 |
|
2120 |
## Citation
|
@@ -2185,4 +2186,4 @@ cd sentence-transformers
|
|
2185 |
git checkout v2.7-release
|
2186 |
# Modify L353 in SentenceTransformer.py to **'extra_features["prompt_length"] = tokenized_prompt["input_ids"].shape[-1]'**.
|
2187 |
pip install -e .
|
2188 |
-
```
|
|
|
1 |
---
|
2 |
tags:
|
3 |
- mteb
|
4 |
+
- transformers
|
5 |
- sentence-transformers
|
6 |
model-index:
|
7 |
- name: NV-Embed-v2
|
|
|
91 |
- type: map_at_5
|
92 |
value: 61.027
|
93 |
- type: mrr_at_1
|
94 |
+
value: 0
|
95 |
- type: mrr_at_10
|
96 |
+
value: 0
|
97 |
- type: mrr_at_100
|
98 |
+
value: 0
|
99 |
- type: mrr_at_1000
|
100 |
+
value: 0
|
101 |
- type: mrr_at_3
|
102 |
+
value: 0
|
103 |
- type: mrr_at_5
|
104 |
+
value: 0
|
105 |
- type: ndcg_at_1
|
106 |
value: 46.515
|
107 |
- type: ndcg_at_10
|
|
|
279 |
- type: map_at_5
|
280 |
value: 42.317083333333336
|
281 |
- type: mrr_at_1
|
282 |
+
value: 0
|
283 |
- type: mrr_at_10
|
284 |
+
value: 0
|
285 |
- type: mrr_at_100
|
286 |
+
value: 0
|
287 |
- type: mrr_at_1000
|
288 |
+
value: 0
|
289 |
- type: mrr_at_3
|
290 |
+
value: 0
|
291 |
- type: mrr_at_5
|
292 |
+
value: 0
|
293 |
- type: ndcg_at_1
|
294 |
value: 38.30616666666667
|
295 |
- type: ndcg_at_10
|
|
|
350 |
- type: map_at_5
|
351 |
value: 31.955
|
352 |
- type: mrr_at_1
|
353 |
+
value: 0
|
354 |
- type: mrr_at_10
|
355 |
+
value: 0
|
356 |
- type: mrr_at_100
|
357 |
+
value: 0
|
358 |
- type: mrr_at_1000
|
359 |
+
value: 0
|
360 |
- type: mrr_at_3
|
361 |
+
value: 0
|
362 |
- type: mrr_at_5
|
363 |
+
value: 0
|
364 |
- type: ndcg_at_1
|
365 |
value: 44.104
|
366 |
- type: ndcg_at_10
|
|
|
421 |
- type: map_at_5
|
422 |
value: 21.062
|
423 |
- type: mrr_at_1
|
424 |
+
value: 0
|
425 |
- type: mrr_at_10
|
426 |
+
value: 0
|
427 |
- type: mrr_at_100
|
428 |
+
value: 0
|
429 |
- type: mrr_at_1000
|
430 |
+
value: 0
|
431 |
- type: mrr_at_3
|
432 |
+
value: 0
|
433 |
- type: mrr_at_5
|
434 |
+
value: 0
|
435 |
- type: ndcg_at_1
|
436 |
+
value: 66
|
437 |
- type: ndcg_at_10
|
438 |
value: 53.496
|
439 |
- type: ndcg_at_100
|
|
|
453 |
- type: precision_at_1000
|
454 |
value: 2.5940000000000003
|
455 |
- type: precision_at_3
|
456 |
+
value: 61
|
457 |
- type: precision_at_5
|
458 |
value: 54.65
|
459 |
- type: recall_at_1
|
|
|
511 |
- type: map_at_5
|
512 |
value: 91.262
|
513 |
- type: mrr_at_1
|
514 |
+
value: 0
|
515 |
- type: mrr_at_10
|
516 |
+
value: 0
|
517 |
- type: mrr_at_100
|
518 |
+
value: 0
|
519 |
- type: mrr_at_1000
|
520 |
+
value: 0
|
521 |
- type: mrr_at_3
|
522 |
+
value: 0
|
523 |
- type: mrr_at_5
|
524 |
+
value: 0
|
525 |
- type: ndcg_at_1
|
526 |
value: 91.20899999999999
|
527 |
- type: ndcg_at_10
|
|
|
582 |
- type: map_at_5
|
583 |
value: 55.054
|
584 |
- type: mrr_at_1
|
585 |
+
value: 0
|
586 |
- type: mrr_at_10
|
587 |
+
value: 0
|
588 |
- type: mrr_at_100
|
589 |
+
value: 0
|
590 |
- type: mrr_at_1000
|
591 |
+
value: 0
|
592 |
- type: mrr_at_3
|
593 |
+
value: 0
|
594 |
- type: mrr_at_5
|
595 |
+
value: 0
|
596 |
- type: ndcg_at_1
|
597 |
value: 64.815
|
598 |
- type: ndcg_at_10
|
|
|
653 |
- type: map_at_5
|
654 |
value: 78.935
|
655 |
- type: mrr_at_1
|
656 |
+
value: 0
|
657 |
- type: mrr_at_10
|
658 |
+
value: 0
|
659 |
- type: mrr_at_100
|
660 |
+
value: 0
|
661 |
- type: mrr_at_1000
|
662 |
+
value: 0
|
663 |
- type: mrr_at_3
|
664 |
+
value: 0
|
665 |
- type: mrr_at_5
|
666 |
+
value: 0
|
667 |
- type: ndcg_at_1
|
668 |
value: 89.305
|
669 |
- type: ndcg_at_10
|
|
|
735 |
type: mteb/msmarco
|
736 |
metrics:
|
737 |
- type: map_at_1
|
738 |
+
value: 0
|
739 |
- type: map_at_10
|
740 |
value: 38.342
|
741 |
- type: map_at_100
|
742 |
+
value: 0
|
743 |
- type: map_at_1000
|
744 |
+
value: 0
|
745 |
- type: map_at_3
|
746 |
+
value: 0
|
747 |
- type: map_at_5
|
748 |
+
value: 0
|
749 |
- type: mrr_at_1
|
750 |
+
value: 0
|
751 |
- type: mrr_at_10
|
752 |
+
value: 0
|
753 |
- type: mrr_at_100
|
754 |
+
value: 0
|
755 |
- type: mrr_at_1000
|
756 |
+
value: 0
|
757 |
- type: mrr_at_3
|
758 |
+
value: 0
|
759 |
- type: mrr_at_5
|
760 |
+
value: 0
|
761 |
- type: ndcg_at_1
|
762 |
+
value: 0
|
763 |
- type: ndcg_at_10
|
764 |
value: 45.629999999999995
|
765 |
- type: ndcg_at_100
|
766 |
+
value: 0
|
767 |
- type: ndcg_at_1000
|
768 |
+
value: 0
|
769 |
- type: ndcg_at_3
|
770 |
+
value: 0
|
771 |
- type: ndcg_at_5
|
772 |
+
value: 0
|
773 |
- type: precision_at_1
|
774 |
+
value: 0
|
775 |
- type: precision_at_10
|
776 |
value: 7.119000000000001
|
777 |
- type: precision_at_100
|
778 |
+
value: 0
|
779 |
- type: precision_at_1000
|
780 |
+
value: 0
|
781 |
- type: precision_at_3
|
782 |
+
value: 0
|
783 |
- type: precision_at_5
|
784 |
+
value: 0
|
785 |
- type: recall_at_1
|
786 |
+
value: 0
|
787 |
- type: recall_at_10
|
788 |
value: 67.972
|
789 |
- type: recall_at_100
|
790 |
+
value: 0
|
791 |
- type: recall_at_1000
|
792 |
+
value: 0
|
793 |
- type: recall_at_3
|
794 |
+
value: 0
|
795 |
- type: recall_at_5
|
796 |
+
value: 0
|
797 |
- type: main_score
|
798 |
value: 45.629999999999995
|
799 |
task:
|
|
|
939 |
- type: map_at_5
|
940 |
value: 15.171000000000001
|
941 |
- type: mrr_at_1
|
942 |
+
value: 0
|
943 |
- type: mrr_at_10
|
944 |
+
value: 0
|
945 |
- type: mrr_at_100
|
946 |
+
value: 0
|
947 |
- type: mrr_at_1000
|
948 |
+
value: 0
|
949 |
- type: mrr_at_3
|
950 |
+
value: 0
|
951 |
- type: mrr_at_5
|
952 |
+
value: 0
|
953 |
- type: ndcg_at_1
|
954 |
value: 55.728
|
955 |
- type: ndcg_at_10
|
|
|
1010 |
- type: map_at_5
|
1011 |
value: 65.364
|
1012 |
- type: mrr_at_1
|
1013 |
+
value: 0
|
1014 |
- type: mrr_at_10
|
1015 |
+
value: 0
|
1016 |
- type: mrr_at_100
|
1017 |
+
value: 0
|
1018 |
- type: mrr_at_1000
|
1019 |
+
value: 0
|
1020 |
- type: mrr_at_3
|
1021 |
+
value: 0
|
1022 |
- type: mrr_at_5
|
1023 |
+
value: 0
|
1024 |
- type: ndcg_at_1
|
1025 |
value: 55.417
|
1026 |
- type: ndcg_at_10
|
|
|
1081 |
- type: map_at_5
|
1082 |
value: 84.396
|
1083 |
- type: mrr_at_1
|
1084 |
+
value: 0
|
1085 |
- type: mrr_at_10
|
1086 |
+
value: 0
|
1087 |
- type: mrr_at_100
|
1088 |
+
value: 0
|
1089 |
- type: mrr_at_1000
|
1090 |
+
value: 0
|
1091 |
- type: mrr_at_3
|
1092 |
+
value: 0
|
1093 |
- type: mrr_at_5
|
1094 |
+
value: 0
|
1095 |
- type: ndcg_at_1
|
1096 |
value: 82.12
|
1097 |
- type: ndcg_at_10
|
|
|
1182 |
- type: map_at_5
|
1183 |
value: 11.158
|
1184 |
- type: mrr_at_1
|
1185 |
+
value: 0
|
1186 |
- type: mrr_at_10
|
1187 |
+
value: 0
|
1188 |
- type: mrr_at_100
|
1189 |
+
value: 0
|
1190 |
- type: mrr_at_1000
|
1191 |
+
value: 0
|
1192 |
- type: mrr_at_3
|
1193 |
+
value: 0
|
1194 |
- type: mrr_at_5
|
1195 |
+
value: 0
|
1196 |
- type: ndcg_at_1
|
1197 |
value: 26.3
|
1198 |
- type: ndcg_at_10
|
|
|
1475 |
- type: map_at_5
|
1476 |
value: 74.74
|
1477 |
- type: mrr_at_1
|
1478 |
+
value: 0
|
1479 |
- type: mrr_at_10
|
1480 |
+
value: 0
|
1481 |
- type: mrr_at_100
|
1482 |
+
value: 0
|
1483 |
- type: mrr_at_1000
|
1484 |
+
value: 0
|
1485 |
- type: mrr_at_3
|
1486 |
+
value: 0
|
1487 |
- type: mrr_at_5
|
1488 |
+
value: 0
|
1489 |
- type: ndcg_at_1
|
1490 |
+
value: 66
|
1491 |
- type: ndcg_at_10
|
1492 |
value: 80.12700000000001
|
1493 |
- type: ndcg_at_100
|
|
|
1499 |
- type: ndcg_at_5
|
1500 |
value: 78.827
|
1501 |
- type: precision_at_1
|
1502 |
+
value: 66
|
1503 |
- type: precision_at_10
|
1504 |
value: 10.567
|
1505 |
- type: precision_at_100
|
|
|
1517 |
- type: recall_at_100
|
1518 |
value: 98.667
|
1519 |
- type: recall_at_1000
|
1520 |
+
value: 100
|
1521 |
- type: recall_at_3
|
1522 |
value: 83.322
|
1523 |
- type: recall_at_5
|
|
|
1681 |
- type: map_at_5
|
1682 |
value: 1.185
|
1683 |
- type: mrr_at_1
|
1684 |
+
value: 0
|
1685 |
- type: mrr_at_10
|
1686 |
+
value: 0
|
1687 |
- type: mrr_at_100
|
1688 |
+
value: 0
|
1689 |
- type: mrr_at_1000
|
1690 |
+
value: 0
|
1691 |
- type: mrr_at_3
|
1692 |
+
value: 0
|
1693 |
- type: mrr_at_5
|
1694 |
+
value: 0
|
1695 |
- type: ndcg_at_1
|
1696 |
+
value: 91
|
1697 |
- type: ndcg_at_10
|
1698 |
value: 88.442
|
1699 |
- type: ndcg_at_100
|
|
|
1705 |
- type: ndcg_at_5
|
1706 |
value: 89.562
|
1707 |
- type: precision_at_1
|
1708 |
+
value: 92
|
1709 |
- type: precision_at_10
|
1710 |
value: 92.60000000000001
|
1711 |
- type: precision_at_100
|
|
|
1713 |
- type: precision_at_1000
|
1714 |
value: 28.222
|
1715 |
- type: precision_at_3
|
1716 |
+
value: 94
|
1717 |
- type: precision_at_5
|
1718 |
value: 93.60000000000001
|
1719 |
- type: recall_at_1
|
|
|
1752 |
- type: map_at_5
|
1753 |
value: 9.49
|
1754 |
- type: mrr_at_1
|
1755 |
+
value: 0
|
1756 |
- type: mrr_at_10
|
1757 |
+
value: 0
|
1758 |
- type: mrr_at_100
|
1759 |
+
value: 0
|
1760 |
- type: mrr_at_1000
|
1761 |
+
value: 0
|
1762 |
- type: mrr_at_3
|
1763 |
+
value: 0
|
1764 |
- type: mrr_at_5
|
1765 |
+
value: 0
|
1766 |
- type: ndcg_at_1
|
1767 |
value: 47.959
|
1768 |
- type: ndcg_at_10
|
|
|
2005 |
language:
|
2006 |
- en
|
2007 |
license: cc-by-nc-4.0
|
2008 |
+
base_model: mistralai/Mistral-7B-v0.1
|
2009 |
---
|
2010 |
## Introduction
|
2011 |
We present NV-Embed-v2, a generalist embedding model that ranks No. 1 on the Massive Text Embedding Benchmark ([MTEB benchmark](https://huggingface.co/spaces/mteb/leaderboard))(as of Aug 30, 2024) with a score of 72.31 across 56 text embedding tasks. It also holds the No. 1 in the retrieval sub-category (a score of 62.65 across 15 tasks) in the leaderboard, which is essential to the development of RAG technology.
|
|
|
2050 |
model = AutoModel.from_pretrained('nvidia/NV-Embed-v2', trust_remote_code=True)
|
2051 |
|
2052 |
# get the embeddings
|
2053 |
+
max_length = 4096
|
2054 |
query_embeddings = model.encode(queries, instruction=query_prefix, max_length=max_length)
|
2055 |
passage_embeddings = model.encode(passages, instruction=passage_prefix, max_length=max_length)
|
2056 |
|
|
|
2065 |
|
2066 |
scores = (query_embeddings @ passage_embeddings.T) * 100
|
2067 |
print(scores.tolist())
|
2068 |
+
# [[87.42692565917969, 0.462837278842926], [0.9652643203735352, 86.0372314453125]]
|
2069 |
```
|
2070 |
|
2071 |
|
|
|
2092 |
|
2093 |
# load model with tokenizer
|
2094 |
model = SentenceTransformer('nvidia/NV-Embed-v2', trust_remote_code=True)
|
2095 |
+
model.max_seq_length = 4096
|
2096 |
model.tokenizer.padding_side="right"
|
2097 |
|
2098 |
def add_eos(input_examples):
|
|
|
2115 |
|
2116 |
|
2117 |
## Correspondence to
|
2118 |
+
Chankyu Lee ([email protected]), Wei Ping ([email protected])
|
2119 |
|
2120 |
|
2121 |
## Citation
|
|
|
2186 |
git checkout v2.7-release
|
2187 |
# Modify L353 in SentenceTransformer.py to **'extra_features["prompt_length"] = tokenized_prompt["input_ids"].shape[-1]'**.
|
2188 |
pip install -e .
|
2189 |
+
```
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "nvidia/NV-Embed-
|
3 |
"add_eos": true,
|
4 |
"add_pad_token": true,
|
5 |
"architectures": [
|
@@ -18,7 +18,7 @@
|
|
18 |
"model_type": "nvembed",
|
19 |
"padding_side": "right",
|
20 |
"text_config": {
|
21 |
-
"_name_or_path": "nvidia/NV-Embed-
|
22 |
"add_cross_attention": false,
|
23 |
"architectures": [
|
24 |
"MistralModel"
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "nvidia/NV-Embed-v1",
|
3 |
"add_eos": true,
|
4 |
"add_pad_token": true,
|
5 |
"architectures": [
|
|
|
18 |
"model_type": "nvembed",
|
19 |
"padding_side": "right",
|
20 |
"text_config": {
|
21 |
+
"_name_or_path": "nvidia/NV-Embed-v1",
|
22 |
"add_cross_attention": false,
|
23 |
"architectures": [
|
24 |
"MistralModel"
|
configuration_nvembed.py
CHANGED
@@ -76,8 +76,6 @@ class LatentAttentionConfig(PretrainedConfig):
|
|
76 |
self.latent_dim = latent_dim
|
77 |
self.cross_dim_head = cross_dim_head
|
78 |
|
79 |
-
super().__init__(**kwargs)
|
80 |
-
|
81 |
|
82 |
class BidirectionalMistralConfig(MistralConfig):
|
83 |
model_type = BIDIR_MISTRAL_TYPE
|
|
|
76 |
self.latent_dim = latent_dim
|
77 |
self.cross_dim_head = cross_dim_head
|
78 |
|
|
|
|
|
79 |
|
80 |
class BidirectionalMistralConfig(MistralConfig):
|
81 |
model_type = BIDIR_MISTRAL_TYPE
|