Skip to content

Adding missing head. prefix in the weight name in ModernBertClassificationHead #591

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

Merged
merged 5 commits into from
Apr 18, 2025

Conversation

kozistr
Copy link
Contributor

@kozistr kozistr commented Apr 18, 2025

What does this PR do?

Adding the missing head. prefix in the key name of the weight in the ModernBertClassificationhead. and adding the test case.

text-embeddings-router --model-id ../gte-reranker-modernbert-base/ --pooling cls --port 8080 --dtype float32 --auto-truncate
2025-04-18T06:51:43.264617Z  INFO text_embeddings_router: router/src/main.rs:185: Args { model_id: "../gte-********-**********-*ase/", revision: None, tokenization_workers: None, dtype: Some(Float32), pooling: Some(Cls), max_concurrent_requests: 512, max_batch_tokens: 16384, max_batch_requests: None, max_client_batch_size: 32, auto_truncate: true, default_prompt_name: None, default_prompt: None, hf_api_token: None, hf_token: None, hostname: "0.0.0.0", port: 8080, uds_path: "/tmp/text-embeddings-inference-server", huggingface_hub_cache: None, payload_limit: 2000000, api_key: None, json_output: false, disable_spans: false, otlp_endpoint: None, otlp_service_name: "text-embeddings-inference.server", cors_allow_origin: None }
2025-04-18T06:51:43.264729Z  WARN text_embeddings_router: router/src/lib.rs:372: `--pooling` arg is set but model is a classifier. Ignoring `--pooling` arg.
2025-04-18T06:51:43.338940Z  WARN text_embeddings_router: router/src/lib.rs:188: Could not find a Sentence Transformers config
2025-04-18T06:51:43.338978Z  INFO text_embeddings_router: router/src/lib.rs:192: Maximum number of tokens per request: 8192
2025-04-18T06:51:43.339103Z  INFO text_embeddings_core::tokenization: core/src/tokenization.rs:38: Starting 8 tokenization workers
2025-04-18T06:51:43.400860Z  INFO text_embeddings_router: router/src/lib.rs:234: Starting model backend
2025-04-18T06:51:43.401443Z  INFO text_embeddings_backend_candle: backends/candle/src/lib.rs:281: Starting ModernBert model on Cpu
2025-04-18T06:51:43.629142Z  WARN text_embeddings_router: router/src/lib.rs:262: Backend does not support a batch size > 4
2025-04-18T06:51:43.629167Z  WARN text_embeddings_router: router/src/lib.rs:263: forcing `max_batch_requests=4`
2025-04-18T06:51:43.630357Z  INFO text_embeddings_router::http::server: router/src/http/server.rs:1795: Starting HTTP server: 0.0.0.0:8080
2025-04-18T06:51:43.630387Z  INFO text_embeddings_router::http::server: router/src/http/server.rs:1796: Ready

Fixes #590

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@Narsil @alvarobartt @michaelfeil

Narsil
Narsil previously approved these changes Apr 18, 2025
Copy link
Collaborator

@Narsil Narsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@Narsil Narsil merged commit 27c118a into huggingface:main Apr 18, 2025
@kozistr kozistr deleted the feature/support-modernbert-reranker branch April 18, 2025 09:32
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.

ModernBert Reranker not supported.
2 participants