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

How to change output behaivor? #86

Open
sherry0429 opened this issue Apr 8, 2023 · 2 comments
Open

How to change output behaivor? #86

sherry0429 opened this issue Apr 8, 2023 · 2 comments

Comments

@sherry0429
Copy link

Great work!

I want to make a api server of these, any way to change output behaivor from output char one by one to output all char when generate done? thanks.

@mirrorange
Copy link

你可以考虑使用 RWKV 的 pip 包。
You can consider using the rwkv pip package.

pip install rwkv

from rwkv.model import RWKV
from rwkv.utils import PIPELINE
model = RWKV("path_to_your_model", "cuda fp16i8")
pipeline = PIPELINE(model, "20B_tokenizer.json")
output = pipeline.generate("your_text")

@gg22mm
Copy link

gg22mm commented May 17, 2023

能不能变成多轮的接口如:
图片

类似于这样可以吗?

多轮对话:

请求:
curl -X POST "http://10.10.10.123:8000" -H 'Content-Type: application/json' -d '{"prompt": "一加一等于几?", "history": []}'

返回:
{"response":"一加一当然是等于二,这是最基础的数学计算问题。","history":[["一加一等于几?","一加一当然是等于二,这是最基础的数学计算问题。"]],"status":200,"time":"2023-04-17 13:30:20"}

多轮请求:
curl -X POST "http://10.10.10.123:8000" -H 'Content-Type: application/json' -d '{"prompt": "不是等于8吗", "history": [["一加一等于几?","一加一当然是等于二,这是最基础的数学计算问题。"]]}'

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

3 participants