feat: late interaction and MUVERA - #209
Closed
lmmx wants to merge 3 commits into
Closed
Conversation
lmmx
force-pushed
the
late-intxn-muvera-postprocess
branch
5 times, most recently
from
December 27, 2025 21:14
7016220 to
79d439b
Compare
lmmx
force-pushed
the
late-intxn-muvera-postprocess
branch
from
December 27, 2025 21:33
79d439b to
635c01a
Compare
Contributor
Author
|
I have a libonnxruntime.so lying around from ORT_DYLIB_PATH=/home/louis/dev/polars-fastembed/polars-fastembed-cuda/python/polars_fastembed_cuda/libs/libonnxruntime.so cargo run --example beir_scidocs_benchmark --features "hf-hub,muvera,ort-load-dynamic" --releaseBEIR scidocs bench:Batch shape inconsistency error workaround diff --git a/examples/beir_scidocs_benchmark.rs b/examples/beir_scidocs_benchmark.rs
index 9c861c7..15e3024 100644
--- a/examples/beir_scidocs_benchmark.rs
+++ b/examples/beir_scidocs_benchmark.rs
@@ -144,18 +144,25 @@ fn main() -> Result<()> {
// 3. Embed corpus
println!("Embedding corpus...");
- let corpus_embeddings = model.embed(&corpus_texts, Some(batch_size))?;
-
- // Create id -> index mapping
- let corpus_id_to_idx: HashMap<&str, usize> = corpus_ids
- .iter()
- .enumerate()
- .map(|(i, id)| (id.as_str(), i))
- .collect();
+ let mut corpus_embeddings = Vec::with_capacity(corpus_texts.len());
+ for (i, text) in corpus_texts.iter().enumerate() {
+ if i % 1000 == 0 {
+ println!(" Embedded {}/{} documents", i, corpus_texts.len());
+ }
+ let emb = model.embed(&[text], None)?;
+ corpus_embeddings.push(emb.into_iter().next().unwrap());
+ }
// 4. Embed queries
println!("Embedding queries...");
- let query_embeddings = model.query_embed(&query_texts, Some(batch_size))?;
+ let mut query_embeddings = Vec::with_capacity(query_texts.len());
+ for (i, text) in query_texts.iter().enumerate() {
+ if i % 100 == 0 {
+ println!(" Embedded {}/{} queries", i, query_texts.len());
+ }
+ let emb = model.query_embed(&[text], None)?;
+ query_embeddings.push(emb.into_iter().next().unwrap());
+ }
// 5. Evaluate brute-force ColBERT (baseline)
println!("\n--- Evaluating brute-force ColBERT ---");Something's very off Goal is to reproduce: Getting: |
Closed
Contributor
Author
|
Note: it's been a month and I've got other stuff taking priority over this work, apologies that it got held up but for anyone else seeking to take it on, the BEIR benchmark would be the place to seek to check that this is working (if not clear from the discussion above), or feel free to make an entirely fresh attempt. |
Owner
|
Closing since stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following the example of the fastembed Python lib (qdrant/fastembed#542) this PR adds support (via a new
muverafeature) for both late interaction models (ColBERT and AnswerAIColbertSmallV1) and MUVERAWorking standalone demo:
examples/muvera_demo.rs, will be removed when finalisedTODO:
test_muvera_with_colbert_modelOut of scope (?)
status: