Skip to content

[Serve] Bugfix serve_id in YAML file can be any value - #1057

Merged
aoyulong merged 3 commits into
flagos-ai:mainfrom
luoyc123:bugfix_serve_id_config
Jan 13, 2026
Merged

[Serve] Bugfix serve_id in YAML file can be any value#1057
aoyulong merged 3 commits into
flagos-ai:mainfrom
luoyc123:bugfix_serve_id_config

Conversation

@luoyc123

@luoyc123 luoyc123 commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

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

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")

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.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In this writing style, the value of serve_id cannot be obtained through serve_cfg

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.

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.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good advice. To be applied later.

cyber-pioneer
cyber-pioneer previously approved these changes Jan 13, 2026
@cyber-pioneer

Copy link
Copy Markdown
Collaborator

LGTM

Comment thread flagscale/serve/run_fs_serve_vllm.py Outdated
@aoyulong
aoyulong merged commit 4d1059a into flagos-ai:main Jan 13, 2026
11 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.

4 participants