-
Notifications
You must be signed in to change notification settings - Fork 634
【Hackathon 9th No.78】add test_chat.py #3958
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
Conversation
Thanks for your contribution! |
/re-run all-failed |
1 similar comment
/re-run all-failed |
tests/entrypoints/test_chat.py
Outdated
"Hello, my name is", | ||
"The capital of China is", | ||
"The future of AI is", | ||
"人工智能是", |
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.
建议换个测试样例
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.
已修改
outputs = self.llm.chat(messages=prompts, sampling_params=None) | ||
self.assertEqual(len(self.PROMPTS), len(outputs)) | ||
|
||
|
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.
如果测试内容与generate 完全一致,建议合并不需要再增加chat的单独测试,单测需要体现chat 接口与generate接口的不同
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.
chat 和 generate参数一样,实现不一样,generate是使用的prompt参数调用_add_request接口,chat是使用的messages封装后调用_add_request接口
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.
chat 是一个对话的形式,generate 是续写,所以希望你进行测试数据的替换。
chat 与 generate 底层实现确实不同,但是在你的单测中并没有体现,如果需要端到端测试,generation 可以 chat 合并,使用同一个llm
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.
已修改test_chat单测,chat 和 generation相同参数部分合并测试
@luotao1 CI已完成 |
fastdeploy/entrypoints 单测补充
已有 test_generation.py,增加 add test_chat.py
修改 fastdeploy/entrypoints/llm.py,如果消息包含prompt_token_ids字段,不再增加一层列表
输入会被修改,需要使用 copy.copy 复制