modelscope / modelscope/ms-swift
seq-cls微调qwen3模型,multi-label推理出错
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 1.7k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 136
Description
为什么有的输出三个label,有的输出两个label?三个label训练,理应是输出三个label
ChatMessage(role='assistant', content=[0, 1, 35], tool_calls=None, reasoning_content=None)
ChatMessage(role='assistant', content=[0, 1], tool_calls=None, reasoning_content=None)
ChatMessage(role='assistant', content=[0, 1], tool_calls=None, reasoning_content=None)
ChatMessage(role='assistant', content=[0, 1], tool_calls=None, reasoning_content=None)
ChatMessage(role='assistant', content=[0, 1], tool_calls=None, reasoning_content=None)
ChatMessage(role='assistant', content=[0, 1, 2], tool_calls=None, reasoning_content=None)
ChatMessage(role='assistant', content=[0, 1, 2], tool_calls=None, reasoning_content=None)
....
批量推理代码片段:
outputs = engine.infer(
[InferRequest(messages=vd["messages"]) for vd in val_data[i : i + bs]],
req_cfg,
use_tqdm=False,
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported behavior with the shown batch call to engine.infer, using the same InferRequest messages and req_cfg. Compare the varying label lists with the expected multi-label outputs and trace how inference handles the batch. Done means the cause of the inconsistent label counts is identified and the intended three-label behavior is verified or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100