Skip to content

fix: use the canonical Hugging Face source for BGE-small - #707

Merged
joein merged 2 commits into
qdrant:mainfrom
rastagan-git:fix/bge-small-canonical-hf-source
Sep 9, 2026
Merged

fix: use the canonical Hugging Face source for BGE-small#707
joein merged 2 commits into
qdrant:mainfrom
rastagan-git:fix/bge-small-canonical-hf-source

Conversation

@rastagan-git

Copy link
Copy Markdown
Contributor

Related to #706.

Use Qdrant/bge-small-en-v1.5-onnx-Q as the Hugging Face source for the existing BAAI/bge-small-en-v1.5 model. The public model name, model file, dimensions, and inference settings are unchanged.

On September 8, I checked the initial HEAD responses for config.json:

  • The currently registered lowercase source returns a 307 to the canonical repository path, without an X-Repo-Commit header.
  • The canonical source returns a 307 to the Hub's resolve-cache endpoint, with X-Repo-Commit present.

This removes the extra case-normalizing redirect described in #706. It does not eliminate all redirects or change Hugging Face Hub's redirect handling. I did not reproduce the reporter's specific macOS/proxy/huggingface-hub 1.29.0 environment.

The regression test checks the source exposed by TextEmbedding.list_supported_models() and fails before the registry change. It is offline and does not download model weights.

Validation on Windows / Python 3.14.4, with huggingface-hub 1.30.0 and ONNX Runtime 1.29.0:

  • python -m pytest tests/test_common.py -q: 4 passed.
  • Ruff 0.3.4 lint and format checks on both changed files: passed.
  • git diff --check: passed.
  • A separate smoke test downloaded the model into a fresh cache and produced a finite 384-dimensional embedding. A subsequent local_files_only=True / HF_HUB_OFFLINE=1 run succeeded from that cache.
  • The full model test suite and the reporter's proxy setup were not tested.

Compatibility note: the Hugging Face repository ID is part of the cache directory name. Existing caches populated using the lowercase ID may need a one-time download into the canonical namespace; offline-only deployments should prepare that cache before upgrading. This patch does not migrate or delete old caches.

PR #593 addresses the analogous source correction for BGE-base, not BGE-small; this patch intentionally leaves that entry untouched.

Prepared with AI assistance; the checks and smoke tests above were executed locally. This is a model-source metadata fix, not a model or embedding-quality change.

All Submissions

  • Followed the contributing guidelines.
  • Checked open and closed PRs for the same change at preparation time.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 6bdcaea4-7b54-47ef-b927-58b36302260e

📥 Commits

Reviewing files that changed from the base of the PR and between d5f552b and 26e46ac.

📒 Files selected for processing (2)
  • fastembed/text/onnx_embedding.py
  • tests/test_common.py

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The BGE-small English model now references Qdrant/bge-small-en-v1.5-onnx-Q as its Hugging Face source. A test verifies that TextEmbedding.list_supported_models() returns this canonical repository identifier.

Priority: ⬇️ Low — Defer this narrow BGE-small source correction because it preserves the existing model behavior and only addresses a canonical Hugging Face repository identifier.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to cfa3d

BGE-small now uses the canonical Hugging Face repository name, avoiding the redirect while preserving model settings and output dimensions. The updated source is covered by a regression test and targeted runtime validation, with no current merge-blocking risk identified.

Suggested reviewers: joein

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: using the canonical Hugging Face source for the BGE-small model.
Description check ✅ Passed The description accurately explains the source correction, regression test, validation results, cache compatibility impact, and scope of the change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@joein
joein self-requested a review September 9, 2026 10:15
@joein

joein commented Sep 9, 2026

Copy link
Copy Markdown
Member

Thank you!

@joein
joein merged commit 0dab99c into qdrant:main Sep 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants