Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

answerdotai/answerai-colbert-small-v1 support added #330

Merged
merged 13 commits into from
Aug 23, 2024
12 changes: 11 additions & 1 deletion fastembed/late_interaction/colbert.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@
"hf": "colbert-ir/colbertv2.0",
},
"model_file": "model.onnx",
}
},
{
"model": "answerdotai/answerai-colbert-small-v1",
"dim": 96,
"description": "Text embeddings, Unimodal (text), Multilingual (~100 languages), 512 input tokens truncation, 2024 year",
"size_in_GB": 0.13,
"sources": {
"hf": "answerdotai/answerai-colbert-small-v1",
},
"model_file": "vespa_colbert.onnx",
},
]


Expand Down
49 changes: 47 additions & 2 deletions tests/test_late_interaction_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
[0.0846, 0.0122, 0.0032, -0.0109, -0.1041],
[0.0477, 0.1078, -0.0314, 0.016, 0.0156],
]
)
),
"answerdotai/answerai-colbert-small-v1": np.array(
[
[-0.07281, 0.04632, -0.04711, 0.00762, -0.07374],
[-0.04464, 0.04426, -0.074, 0.01801, -0.05233],
[0.09936, -0.05123, -0.04925, -0.05276, -0.08944],
[0.01644, 0.0203, -0.03789, 0.03165, -0.06501],
[-0.07281, 0.04633, -0.04711, 0.00762, -0.07374],
]
),
}

CANONICAL_QUERY_VALUES = {
Expand Down Expand Up @@ -53,7 +62,43 @@
[0.1022, 0.0228, -0.0174, -0.0102, -0.065],
[0.1043, 0.0231, -0.0144, -0.0246, -0.067],
]
)
),
"answerdotai/answerai-colbert-small-v1": np.array(
[
[-0.07284, 0.04657, -0.04746, 0.00786, -0.07342],
[-0.0473, 0.04615, -0.07551, 0.01591, -0.0517],
[0.09658, -0.0506, -0.04593, -0.05225, -0.09086],
[0.01815, 0.0165, -0.03366, 0.03214, -0.07019],
[-0.07284, 0.04657, -0.04746, 0.00787, -0.07342],
[-0.07748, 0.04493, -0.055, 0.00481, -0.0486],
[-0.0803, 0.04229, -0.0589, 0.00379, -0.04506],
[-0.08477, 0.03724, -0.06162, 0.00578, -0.04554],
[-0.08392, 0.03805, -0.06202, 0.00899, -0.0409],
[-0.07945, 0.04163, -0.06151, 0.00569, -0.04432],
[-0.08469, 0.03985, -0.05765, 0.00485, -0.04485],
[-0.08306, 0.04111, -0.05774, 0.00583, -0.04325],
[-0.08244, 0.04597, -0.05842, 0.00433, -0.04025],
[-0.08385, 0.04745, -0.05845, 0.00469, -0.04002],
[-0.08402, 0.05014, -0.05941, 0.00692, -0.03452],
[-0.08303, 0.05693, -0.05701, 0.00504, -0.03565],
[-0.08216, 0.05516, -0.05687, 0.0057, -0.03748],
[-0.08051, 0.05751, -0.05647, 0.00283, -0.03645],
[-0.08172, 0.05608, -0.06064, 0.00252, -0.03533],
[-0.08073, 0.06144, -0.06373, 0.00935, -0.03154],
[-0.06651, 0.06697, -0.06769, 0.01717, -0.03369],
[-0.06526, 0.06931, -0.06935, 0.0139, -0.03702],
[-0.05435, 0.05829, -0.06593, 0.01708, -0.04559],
[-0.03648, 0.05234, -0.06759, 0.02057, -0.05053],
[-0.03461, 0.05032, -0.06747, 0.02216, -0.05209],
[-0.03444, 0.04835, -0.06812, 0.02296, -0.05276],
[-0.03292, 0.04853, -0.06811, 0.02348, -0.05303],
[-0.03349, 0.04783, -0.06846, 0.02393, -0.05334],
[-0.03485, 0.04677, -0.06826, 0.02362, -0.05326],
[-0.03408, 0.04744, -0.06931, 0.02302, -0.05288],
[-0.03444, 0.04838, -0.06945, 0.02133, -0.05277],
[-0.03473, 0.04792, -0.07033, 0.02196, -0.05314],
]
),
}

docs = ["Hello World"]
Expand Down
Loading