huggingface version

This commit is contained in:
Your Name
2023-04-03 01:09:24 +08:00
parent fff7b8ef91
commit 8140519c82
15 changed files with 242 additions and 85 deletions
+3 -3
View File
@@ -90,12 +90,12 @@ async def run(context, max_token=512):
def predict_tgui(inputs, top_p, temperature, chatbot=[], history=[], system_prompt='', stream = True, additional_fn=None):
def predict_tgui(inputs, top_p, api_key, temperature, chatbot=[], history=[], system_prompt='', stream = True, additional_fn=None):
"""
发送至chatGPT,流式获取输出。
用于基础的对话功能。
inputs 是本次问询的输入
top_p, temperature是chatGPT的内部调优参数
top_p, api_key, temperature是chatGPT的内部调优参数
history 是之前的对话列表(注意无论是inputs还是history,内容太长了都会触发token数量溢出的错误)
chatbot 为WebUI中显示的对话列表,修改它,然后yeild出去,可以直接修改对话界面内容
additional_fn代表点击的哪个按钮,按钮见functional.py
@@ -144,7 +144,7 @@ def predict_tgui(inputs, top_p, temperature, chatbot=[], history=[], system_prom
def predict_tgui_no_ui(inputs, top_p, temperature, history=[], sys_prompt=""):
def predict_tgui_no_ui(inputs, top_p, api_key, temperature, history=[], sys_prompt=""):
raw_input = "What I would like to say is the following: " + inputs
prompt = inputs
tgui_say = ""