Open BryanMurkyChan opened 11 months ago
描述:我希望能在web_demo中添加systemprompt,让模型拥有内置的角色设定,类似chatgpt的customize
我在cli_demo.py中能顺利添加systemprompt,在第45行处修改成query = systemprompt+input("\n用户:")即可 但是我在web_demo.py中不知道怎么添加,我尝试过 (1)在72行修改为chatbot.append((systemprompt + parse_text(input), "")) (2)98行user_input = systemprompt+gr.Textbox(show_label=False, placeholder="Input...", lines=10).style(container=False) 第一种方法没有效果,第二种方法报错了 报错为 File "web_demo.py", line 97, in user_input = systemprompt+gr.Textbox(show_label=False, placeholder="Input...", lines=10).style( TypeError: can only concatenate str (not "Textbox") to str 有没有大神指点一下该怎么修改呢?
No response
- OS:Ubuntu 20.04 - Python:3.8 - Transformers:4.26.1 - PyTorch:1.12 - CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :True
m
Is there an existing issue for this?
Current Behavior
描述:我希望能在web_demo中添加systemprompt,让模型拥有内置的角色设定,类似chatgpt的customize
我在cli_demo.py中能顺利添加systemprompt,在第45行处修改成query = systemprompt+input("\n用户:")即可 但是我在web_demo.py中不知道怎么添加,我尝试过 (1)在72行修改为chatbot.append((systemprompt + parse_text(input), "")) (2)98行user_input = systemprompt+gr.Textbox(show_label=False, placeholder="Input...", lines=10).style(container=False) 第一种方法没有效果,第二种方法报错了 报错为 File "web_demo.py", line 97, in
user_input = systemprompt+gr.Textbox(show_label=False, placeholder="Input...", lines=10).style(
TypeError: can only concatenate str (not "Textbox") to str
有没有大神指点一下该怎么修改呢?
Expected Behavior
No response
Steps To Reproduce
我在cli_demo.py中能顺利添加systemprompt,在第45行处修改成query = systemprompt+input("\n用户:")即可 但是我在web_demo.py中不知道怎么添加,我尝试过 (1)在72行修改为chatbot.append((systemprompt + parse_text(input), "")) (2)98行user_input = systemprompt+gr.Textbox(show_label=False, placeholder="Input...", lines=10).style(container=False) 第一种方法没有效果,第二种方法报错了 报错为 File "web_demo.py", line 97, in
user_input = systemprompt+gr.Textbox(show_label=False, placeholder="Input...", lines=10).style(
TypeError: can only concatenate str (not "Textbox") to str
有没有大神指点一下该怎么修改呢?
Environment
Anything else?
No response