-
Notifications
You must be signed in to change notification settings - Fork 693
[Feature] support reward api #4518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] support reward api #4518
Conversation
|
Thanks for your contribution! |
3ba1e1d to
7d98bf0
Compare
7d98bf0 to
305b16c
Compare
| @staticmethod | ||
| def from_base(pooling_output: PoolingOutput): | ||
| pooled_data = pooling_output.data | ||
| # if pooled_data.ndim != 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
| GENERATION_TASKS = get_args(GenerationTask) | ||
|
|
||
| PoolingTask = Literal["encode", "embed"] | ||
| PoolingTask = Literal["encode", "embed", "reward"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里reward哪里用到了吗?
|
|
||
|
|
||
| class ChatRewardRequest(BaseModel): | ||
| model: Optional[str] = None # 指定模型,例如 "default" 或支持 embedding 的 chat 模型 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成英文注释
|
|
||
|
|
||
| class ChatRewardData(BaseModel): | ||
| index: Optional[int] = None # 数据索引(可选) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
Motivation
支持reward接口,给指定的内容打分
Modifications
Usage or Command
本 PR 增加了一个多模态
chat/reward接口请求示例。示例请求如下:
Accuracy Tests
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.