[Serve] Bugfix serve_id in YAML file can be any value - #1057
Merged
Conversation
tengqm
reviewed
Jan 12, 2026
Comment on lines
15
to
+22
| if not TASK_CONFIG.get("serve"): | ||
| raise ValueError("No 'serve' section found in task config.") | ||
| if not serve_id: | ||
| raise ValueError("No serve_id in YAML config file") | ||
| for item in TASK_CONFIG.serve: | ||
| if item.get("serve_id") == serve_id: | ||
| if "serve_id" in item and item.get("serve_id") is not None: | ||
| return item | ||
| raise ValueError(f"Model config with serve_id={serve_id} not found.") | ||
| raise ValueError("serve_id in YAML config file is null") |
Contributor
There was a problem hiding this comment.
I'd write this:
serve_cfg = TASK_CONFIG.get("serve", {})
serve_id = serve_cfg.get("serve_id", None)
if serve_id is None:
raise ValueError(...)
return serve_id
Contributor
Author
There was a problem hiding this comment.
In this writing style, the value of serve_id cannot be obtained through serve_cfg
Contributor
There was a problem hiding this comment.
Okay, I see. TASK_CONFIG.serve, if exists , should be a list.
for item in TASK_CONFIG.get("serve", []):
serve_id = item.get("serve_id", None)
if serve_id is not None:
return serve_id
raise ValueError("The 'serve' section in the task config has to be configured properly.")
Collaborator
There was a problem hiding this comment.
Good advice. To be applied later.
cyber-pioneer
previously approved these changes
Jan 13, 2026
Collaborator
|
LGTM |
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.
PR Category
Serve
PR Types
Bug Fixes
PR Description
Bugfix serve_id in YAML file can be any value but cannot be empty
Bugfix CI test: tests/scripts/functional_tests/test_task.sh --type serve --task qwen2_5