Skip to content

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Sep 8, 2025

fastdeploy/entrypoints 单测补充
已有 test_generation.py,增加 add test_chat.py
修改 fastdeploy/entrypoints/llm.py,如果消息包含prompt_token_ids字段,不再增加一层列表
输入会被修改,需要使用 copy.copy 复制

Copy link

paddle-bot bot commented Sep 8, 2025

Thanks for your contribution!

@co63oc
Copy link
Contributor Author

co63oc commented Sep 9, 2025

/re-run all-failed

1 similar comment
@co63oc
Copy link
Contributor Author

co63oc commented Sep 10, 2025

/re-run all-failed

"Hello, my name is",
"The capital of China is",
"The future of AI is",
"人工智能是",
Copy link
Collaborator

Choose a reason for hiding this comment

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

建议换个测试样例

Copy link
Contributor Author

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


Copy link
Collaborator

Choose a reason for hiding this comment

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

如果测试内容与generate 完全一致,建议合并不需要再增加chat的单独测试,单测需要体现chat 接口与generate接口的不同

Copy link
Contributor Author

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接口

Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改test_chat单测,chat 和 generation相同参数部分合并测试

@co63oc
Copy link
Contributor Author

co63oc commented Sep 12, 2025

@luotao1 CI已完成

@luotao1 luotao1 merged commit c86b335 into PaddlePaddle:develop Sep 12, 2025
25 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants