Spaces:
Paused
Paused
Upload app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ https://blog.csdn.net/xmh_free/article/details/127210992
|
|
| 16 |
|
| 17 |
async def get_model_reply(prompt,style,cookies,context=[]):
|
| 18 |
# combines the new question with a previous context
|
|
|
|
| 19 |
context += [prompt]
|
| 20 |
cookies = json.loads(cookies)
|
| 21 |
# given the most recent context (4096 characters)
|
|
@@ -51,9 +52,9 @@ with gr.Blocks() as dialog_app:
|
|
| 51 |
style = gr.Dropdown(label="回答倾向模式选择", choices=["creative", "balanced", "precise"], multiselect=False,
|
| 52 |
value="precise", type="value")
|
| 53 |
|
| 54 |
-
inputs.submit(get_model_reply, [inputs, style, cookies,
|
| 55 |
send = gr.Button("发送请求.....")
|
| 56 |
-
send.click(get_model_reply, [inputs, style, cookies,
|
| 57 |
|
| 58 |
# launches the app in a new local port
|
| 59 |
dialog_app.launch(show_error=True)
|
|
|
|
| 16 |
|
| 17 |
async def get_model_reply(prompt,style,cookies,context=[]):
|
| 18 |
# combines the new question with a previous context
|
| 19 |
+
|
| 20 |
context += [prompt]
|
| 21 |
cookies = json.loads(cookies)
|
| 22 |
# given the most recent context (4096 characters)
|
|
|
|
| 52 |
style = gr.Dropdown(label="回答倾向模式选择", choices=["creative", "balanced", "precise"], multiselect=False,
|
| 53 |
value="precise", type="value")
|
| 54 |
|
| 55 |
+
inputs.submit(get_model_reply, [inputs, style, cookies, ], [chatbot, state])
|
| 56 |
send = gr.Button("发送请求.....")
|
| 57 |
+
send.click(get_model_reply, [inputs, style, cookies, ], [chatbot, state],api_name="xiaolvgpt")
|
| 58 |
|
| 59 |
# launches the app in a new local port
|
| 60 |
dialog_app.launch(show_error=True)
|