Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -213,13 +213,15 @@ with gr.Blocks(css=css) as demo:
|
|
| 213 |
yield render_message(loading_message), loading_message, ""
|
| 214 |
|
| 215 |
assistant_reply = ""
|
|
|
|
| 216 |
for partial_reply in respond(message, api_key, max_tokens, top_p, temperature):
|
| 217 |
partial_history = history + [(message, partial_reply, "You", "P-ALPLE", sessions[api_key]["avatar"], ASSISTANT_PIC_PATH)]
|
| 218 |
yield render_message(partial_history), partial_history, ""
|
| 219 |
|
| 220 |
-
history, assistant_reply = partial_history, partial_reply
|
| 221 |
yield render_message(history), history, ""
|
| 222 |
-
|
|
|
|
| 223 |
def regenerate_response(history, last_message, max_tokens, top_p, temperature):
|
| 224 |
return "", []
|
| 225 |
|
|
|
|
| 213 |
yield render_message(loading_message), loading_message, ""
|
| 214 |
|
| 215 |
assistant_reply = ""
|
| 216 |
+
partial_history = history
|
| 217 |
for partial_reply in respond(message, api_key, max_tokens, top_p, temperature):
|
| 218 |
partial_history = history + [(message, partial_reply, "You", "P-ALPLE", sessions[api_key]["avatar"], ASSISTANT_PIC_PATH)]
|
| 219 |
yield render_message(partial_history), partial_history, ""
|
| 220 |
|
| 221 |
+
history, assistant_reply = partial_history, partial_reply if 'partial_reply' in locals() else ("", "")
|
| 222 |
yield render_message(history), history, ""
|
| 223 |
+
|
| 224 |
+
|
| 225 |
def regenerate_response(history, last_message, max_tokens, top_p, temperature):
|
| 226 |
return "", []
|
| 227 |
|