From 2f7f7623e4f8e7fdca5c129f3288e49de6f0f506 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Fri, 25 Sep 2026 02:53:30 +0700 Subject: [PATCH] fix: load bm25 offline by listing only files present in its hf repo --- fastembed/sparse/bm25.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fastembed/sparse/bm25.py b/fastembed/sparse/bm25.py index c31acd12c..59087bda8 100644 --- a/fastembed/sparse/bm25.py +++ b/fastembed/sparse/bm25.py @@ -51,9 +51,13 @@ license="apache-2.0", size_in_GB=0.01, sources=ModelSource(hf="Qdrant/bm25"), - additional_files=[f"{lang}.txt" for lang in supported_languages], + # The repo has no tamil.txt, and Tamil works without stopwords. Listing a missing file + # would make download_model reject every cached snapshot. + additional_files=[f"{lang}.txt" for lang in supported_languages if lang != "tamil"], requires_idf=True, - model_file="mock.file", + # BM25 has no weights, but download_model requires model_file in a cached snapshot, so + # point it at the repo's (empty) config.json. + model_file="config.json", ), ]