Skip to content

Embeddings --max_length parameter - error message when value is grater then model's max length - #4521

Open
przepeck wants to merge 1 commit into
mainfrom
przepeck/embeddings_max_length_fix
Open

Embeddings --max_length parameter - error message when value is grater then model's max length#4521
przepeck wants to merge 1 commit into
mainfrom
przepeck/embeddings_max_length_fix

Conversation

@przepeck

@przepeck przepeck commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

🛠 Summary

OVMS was silently failing when the --max_length parameter was grater then model's max length. Adding error message and OV_THROW to stop server.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

Copilot AI lite review requested due to automatic review settings September 8, 2026 11:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new failure path should provide a single, fully-informative exception message (including relevant values/context) and should be backed by a regression test for invalid max_length configurations.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR hardens the embeddings servable initialization by validating that a graph-configured max_length does not exceed the model’s detected maximum length (from config.json), preventing previously silent/undefined failures.

Changes:

  • Add a validation check for configuredMaxLength vs. detected maxModelLength.
  • Emit an error and throw to stop initialization when the configuration is invalid.
File summaries
File Description
src/embeddings/embeddings_servable.cpp Adds a guard that rejects max_length values greater than the model’s detected maximum length during preprocessing setup.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/embeddings/embeddings_servable.cpp
Comment thread src/embeddings/embeddings_servable.cpp
@przepeck
przepeck force-pushed the przepeck/embeddings_max_length_fix branch from 8725c3a to 5d677da Compare September 8, 2026 12:47
@przepeck
przepeck requested a review from mzegla September 9, 2026 09:55
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.

3 participants