Skip to content
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

[Question]: pp-uie推理返回格式 #10245

Open
whwususu opened this issue Mar 21, 2025 · 7 comments
Open

[Question]: pp-uie推理返回格式 #10245

whwususu opened this issue Mar 21, 2025 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@whwususu
Copy link

请提出你的问题

ppuie有提示词,这个提示词如何改,推导的结果格式才能够像uie那样,能够显示出抽取实体在段落中的开始位置和结束位置:
预期:

Image

实际值:

Image

@whwususu whwususu added the question Further information is requested label Mar 21, 2025
@DrownFish19
Copy link
Collaborator

应该无法直接返回位置信息。
因为uie输出的概率值,然后根据概率值判断实体位置,所以可以输出开始和结束的位置。但是PPUIE是生成模型,输出内容为模型直接生成内容,与输入文字具体内容不直接相关。

@whwususu
Copy link
Author

whwususu commented Mar 21, 2025

应该无法直接返回位置信息。 因为uie输出的概率值,然后根据概率值判断实体位置,所以可以输出开始和结束的位置。但是PPUIE是生成模型,输出内容为模型直接生成内容,与输入文字具体内容不直接相关。

我执行这段代码去了20分钟,虽然结果出来了,这在生产中如何使用?有不有好的办法可以优化?谢谢!

@DrownFish19
Copy link
Collaborator

当前使用较慢,是否已经正确使用NPU算力,还是在CPU上进行推理?可以观察NPU负载。

优化方式:可以使用高性能推理来进行优化,在星河平台使用v100 32G版本推理5条数据时间约为700ms,如果是在生产环境,还可以推理部署实现动态插入功能,加速总吞吐。

@whwususu
Copy link
Author

whwususu commented Mar 22, 2025

当前使用较慢,是否已经正确使用NPU算力,还是在CPU上进行推理?可以观察NPU负载。

优化方式:可以使用高性能推理来进行优化,在星河平台使用v100 32G版本推理5条数据时间约为700ms,如果是在生产环境,还可以推理部署实现动态插入功能,加速总吞吐。

“高性能推理”和“推理部署实现动态插入功能”是否有详细的文档介绍?谢谢!

Image
这个是抽取实体提示词,那么抽取关系的提示词呢,是否有文档!

@whwususu whwususu reopened this Mar 22, 2025
@DrownFish19
Copy link
Collaborator

DrownFish19 commented Mar 23, 2025

  1. “高性能推理”相关文档:https://github.com/PaddlePaddle/PaddleNLP/tree/develop/llm/docs/predict
  2. “推理部署实现动态插入功能”需要部署才支持,相关文档:https://github.com/PaddlePaddle/PaddleNLP/tree/develop/llm/server
  3. 抽取关系的提示词我们是使用“的”来进行拼接的,例如歌曲名称通过实体抽取为“青花瓷”,关系抽取的prompt是“青花瓷的歌手”。

@whwususu
Copy link
Author

  1. “高性能推理”相关文档:https://github.com/PaddlePaddle/PaddleNLP/tree/develop/llm/docs/predict
  2. “推理部署实现动态插入功能”需要部署才支持,相关文档:https://github.com/PaddlePaddle/PaddleNLP/tree/develop/llm/server
  3. 抽取关系的提示词我们是使用“的”来进行拼接的,例如歌曲名称通过实体抽取为“青花瓷”,关系抽取的prompt是“青花瓷的歌手”。
    高性能推理,好像没有昇腾版本,如果自己构建,需要哪些组件

@DrownFish19
Copy link
Collaborator

当前算子支持文档在 https://github.com/PaddlePaddle/PaddleNLP/tree/develop/csrc/npu ,算子在PaddleCustomDevice中实现。如果昇腾版本没有支持,无法使用高性能推理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants