From 1b0b40d347ce1ed40d8343357249a312f5f6b759 Mon Sep 17 00:00:00 2001 From: Satyam Yadav <114805086+Coding-Professional@users.noreply.github.com> Date: Sat, 3 Oct 2026 01:11:02 +0530 Subject: [PATCH 1/2] feat(sparse): allow MiniCOIL sequence length limit --- README.md | 9 +++ fastembed/sparse/minicoil.py | 28 +++++++ tests/test_minicoil_sequence_length.py | 104 +++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 tests/test_minicoil_sequence_length.py diff --git a/README.md b/README.md index 206915a0..dd4eaeeb 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,15 @@ embeddings = list(model.embed(documents)) # ] ``` +For MiniCOIL, use `max_sequence_length` to cap the tokens sent to the model when +embedding long texts. The limit includes special tokens and must leave room for at least one +text token. Values above the model's own tokenizer limit are capped at that limit. + +```python +model = SparseTextEmbedding(model_name="Qdrant/minicoil-v1", max_sequence_length=512) +embeddings = list(model.embed(documents)) +``` +