Skip to content

Conversation

@AuferGachet
Copy link
Contributor

@AuferGachet AuferGachet commented Aug 6, 2025

本次支持了completion 接口的单/多prompt的echo回显:

  • 非流式上逻辑上支持,但最新版本报错,已修复。
  • 流式上最新版本不支持, 已做相应的支持。
    具体而言,针对于v1/completion接口
  1. 非流式
    请求:
    curl -X POST http://127.0.0.1:8566/v1/completions \ -H "Content-Type: application/json" \ -d '{ "prompt": "以下是你的自我介绍:", "echo": true }'
    结果:(能够做到prompt拼接在回复文本之前)
    ..."text":"以下是你的自我介绍:\n这是我的第一篇博客,欢迎大家来阅读。\n我是来自2018级计算机科学与技术专业的刘文博。"...
  2. 流式
    实现相同功能,能够做到prompt拼接在第一包返回的文本之前。

@paddle-bot
Copy link

paddle-bot bot commented Aug 6, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Aug 6, 2025
@CLAassistant
Copy link

CLAassistant commented Aug 6, 2025

CLA assistant check
All committers have signed the CLA.

@AuferGachet AuferGachet closed this Aug 7, 2025
@AuferGachet AuferGachet reopened this Aug 7, 2025
@AuferGachet AuferGachet reopened this Aug 12, 2025
@AuferGachet AuferGachet reopened this Aug 13, 2025
@LiqinruiG LiqinruiG changed the title Wenxin tools 551-completion接口echo回显支持 【BugFix】completion接口echo回显支持 Aug 19, 2025
@LiqinruiG LiqinruiG merged commit c95b339 into PaddlePaddle:develop Aug 19, 2025
13 of 15 checks passed
AuferGachet added a commit to AuferGachet/FastDeploy that referenced this pull request Aug 19, 2025
【BugFix】completion接口echo回显支持 (PaddlePaddle#3245)

* wenxin-tools-511,修复v1/completion无法回显的问题。

* 支持多prompt的回显

* 支持多prompt情况下的流式回显

* 补充了 completion 接口支持 echo 的单元测试

* pre-commit

* 移除了多余的test文件

* 修复了completion接口echo支持的单测方法

* 补充了单元测试文件

* 补充单测

* unittest

* 补充单测

* 修复单测

* 删除不必要的assert.

* 重新提交

* 更新测试方法

* ut

* 验证是否是正确思路单测

* 验证是否是正确思路单测

* 验证是否是正确思路单测3

* 优化单测代码,有针对性地缩小单测范围。

* 优化单测代码2,有针对性地缩小单测范围。

* 优化单测代码3,有针对性地缩小单测范围。

* support 'echo' in chat/completion.

* update

* update

* update

* update

* update

* update

* 补充了关于tokenid的单元测试

* update

* 修正index错误

* 修正index错误
Jiang-Jia-Jun added a commit that referenced this pull request Aug 23, 2025
* update
【BugFix】completion接口echo回显支持 (#3245)

* wenxin-tools-511,修复v1/completion无法回显的问题。

* 支持多prompt的回显

* 支持多prompt情况下的流式回显

* 补充了 completion 接口支持 echo 的单元测试

* pre-commit

* 移除了多余的test文件

* 修复了completion接口echo支持的单测方法

* 补充了单元测试文件

* 补充单测

* unittest

* 补充单测

* 修复单测

* 删除不必要的assert.

* 重新提交

* 更新测试方法

* ut

* 验证是否是正确思路单测

* 验证是否是正确思路单测

* 验证是否是正确思路单测3

* 优化单测代码,有针对性地缩小单测范围。

* 优化单测代码2,有针对性地缩小单测范围。

* 优化单测代码3,有针对性地缩小单测范围。

* support 'echo' in chat/completion.

* update

* update

* update

* update

* update

* update

* 补充了关于tokenid的单元测试

* update

* 修正index错误

* 修正index错误

* 解决冲突

* 解决冲突

* 解决冲突

---------

Co-authored-by: YuBaoku <[email protected]>
Co-authored-by: Jiang-Jia-Jun <[email protected]>
AuferGachet added a commit to AuferGachet/FastDeploy that referenced this pull request Aug 26, 2025
【BugFix】completion接口echo回显支持 (PaddlePaddle#3245)

* wenxin-tools-511,修复v1/completion无法回显的问题。

* 支持多prompt的回显

* 支持多prompt情况下的流式回显

* 补充了 completion 接口支持 echo 的单元测试

* pre-commit

* 移除了多余的test文件

* 修复了completion接口echo支持的单测方法

* 补充了单元测试文件

* 补充单测

* unittest

* 补充单测

* 修复单测

* 删除不必要的assert.

* 重新提交

* 更新测试方法

* ut

* 验证是否是正确思路单测

* 验证是否是正确思路单测

* 验证是否是正确思路单测3

* 优化单测代码,有针对性地缩小单测范围。

* 优化单测代码2,有针对性地缩小单测范围。

* 优化单测代码3,有针对性地缩小单测范围。

* support 'echo' in chat/completion.

* update

* update

* update

* update

* update

* update

* 补充了关于tokenid的单元测试

* update

* 修正index错误

* 修正index错误
Jiang-Jia-Jun pushed a commit that referenced this pull request Aug 27, 2025
* 恢复异步方法。
【BugFix】completion接口echo回显支持 (#3245)

* wenxin-tools-511,修复v1/completion无法回显的问题。

* 支持多prompt的回显

* 支持多prompt情况下的流式回显

* 补充了 completion 接口支持 echo 的单元测试

* pre-commit

* 移除了多余的test文件

* 修复了completion接口echo支持的单测方法

* 补充了单元测试文件

* 补充单测

* unittest

* 补充单测

* 修复单测

* 删除不必要的assert.

* 重新提交

* 更新测试方法

* ut

* 验证是否是正确思路单测

* 验证是否是正确思路单测

* 验证是否是正确思路单测3

* 优化单测代码,有针对性地缩小单测范围。

* 优化单测代码2,有针对性地缩小单测范围。

* 优化单测代码3,有针对性地缩小单测范围。

* support 'echo' in chat/completion.

* update

* update

* update

* update

* update

* update

* 补充了关于tokenid的单元测试

* update

* 修正index错误

* 修正index错误

* [Bugfix] Significant performance degradation of 0.3B model on branch 2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants