default task detection based on model config#4317
Draft
dtrawins wants to merge 11 commits into
Draft
Conversation
dtrawins
commented
Jun 23, 2026
| // Check if task-specific parameters are provided or if graph.pbtxt is missing | ||
| bool hasUnmatchedOptions = ::ovms::hasTaskSpecificParameters(result->unmatched()); | ||
| bool graphExists = ::ovms::graphPbtxtExists(*modelPath); | ||
|
|
| const std::optional<std::string> modelPath = result->count("model_path") ? std::make_optional(result->operator[]("model_path").as<std::string>()) : std::nullopt; | ||
| const std::optional<std::string> sourceModel = result->count("source_model") ? std::make_optional(result->operator[]("source_model").as<std::string>()) : std::nullopt; | ||
| const std::optional<std::string> modelRepositoryPath = result->count("model_repository_path") ? std::make_optional(result->operator[]("model_repository_path").as<std::string>()) : std::nullopt; | ||
|
|
| bool graphExists = ::ovms::graphPbtxtExists(*modelPath); | ||
| shouldInferTask = hasUnmatchedOptions || !graphExists; | ||
| } | ||
|
|
dkalinowski
reviewed
Jun 24, 2026
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "architectures": ["XLMRobertaForSequenceClassification"], | |||
Collaborator
There was a problem hiding this comment.
I see its possible to have more than 1 architecture (its a list). How would OVMS behave? Can you add test for that behavior?
dkalinowski
reviewed
Jun 24, 2026
| @@ -0,0 +1,5 @@ | |||
| { | |||
| "architectures": ["UNet2DConditionModel"], | |||
Collaborator
There was a problem hiding this comment.
Please add these files to data field in unit test build target. If you dont do that, the unit tests will not re-run once this file change.
Example: https://github.com/openvinotoolkit/model_server/blob/main/src/BUILD#L2337-L2364
dkalinowski
reviewed
Jun 24, 2026
| const std::string modelPath = resolveTestModelPath("llama"); | ||
| const std::filesystem::path configJson = std::filesystem::path(modelPath) / "config.json"; | ||
| if (!std::filesystem::exists(configJson)) { | ||
| GTEST_SKIP() << "Test prerequisite missing: " << configJson.string(); |
Collaborator
There was a problem hiding this comment.
Why skipping? Shouldnt it error?
dkalinowski
reviewed
Jun 24, 2026
| cc_binary( | ||
| name = "num_streams_repro", | ||
| srcs = [ | ||
| "num_streams_repro.cpp", |
dkalinowski
reviewed
Jun 24, 2026
| {"XLMRobertaModel", "embeddings"}, | ||
| }; | ||
|
|
||
| std::string getEnvOrDefault(const char* envName, const std::string& defaultValue = "") { |
Collaborator
There was a problem hiding this comment.
these functions should be static
dkalinowski
reviewed
Jun 24, 2026
| } | ||
| } | ||
| if (!resolvedTask.has_value()) { | ||
| throw std::logic_error("config.json architectures do not map to a supported default task"); |
Collaborator
There was a problem hiding this comment.
please add test for that
dkalinowski
reviewed
Jun 24, 2026
|
|
||
| result = std::make_unique<cxxopts::ParseResult>(options->parse(argc, argv)); | ||
|
|
||
| const bool isConfigManagementFlow = |
Collaborator
There was a problem hiding this comment.
could be a CLIParser method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary
JIRA/Issue if applicable.
Describe the changes.
🧪 Checklist
``