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

用预加载模型,生成文本的时间比较长,有什么优化之道呢? #15

Open
liruixue opened this issue Sep 15, 2021 · 1 comment

Comments

@liruixue
Copy link

用当前项目提供的预加载模型,使用的是CPU机器,生成文本的时间比较长:
比如请求参数:title=晚霞 max_len=100,生成文本用了20s+
这个时间感觉太长,大伙用模型跑起来后,生成时间大概多长,是否有什么优化之道呢?

@syspider
Copy link

生成的时候可以使用past_key_values机制加速。博主生成的时候每一次输入都是整个序列,改进后能快不少

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

No branches or pull requests

2 participants