Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,6 +37,8 @@ def respond(
|
|
| 37 |
top_p,
|
| 38 |
):
|
| 39 |
global messages
|
|
|
|
|
|
|
| 40 |
|
| 41 |
generation_kwargs = dict(
|
| 42 |
max_length=max_length,
|
|
@@ -52,6 +54,8 @@ def respond(
|
|
| 52 |
if messages == []:
|
| 53 |
messages = [chatglm_cpp.ChatMessage(role="system", content=system_message)]
|
| 54 |
|
|
|
|
|
|
|
| 55 |
# for val in history:
|
| 56 |
# if val[0]:
|
| 57 |
# messages.append(chatglm_cpp.ChatMessage(role="user", content=val[0]))
|
|
@@ -70,6 +74,8 @@ def respond(
|
|
| 70 |
|
| 71 |
messages.append(chatglm_cpp.ChatMessage(role="assistant", content=response))
|
| 72 |
|
|
|
|
|
|
|
| 73 |
|
| 74 |
"""
|
| 75 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
|
|
|
| 37 |
top_p,
|
| 38 |
):
|
| 39 |
global messages
|
| 40 |
+
|
| 41 |
+
print(messages)
|
| 42 |
|
| 43 |
generation_kwargs = dict(
|
| 44 |
max_length=max_length,
|
|
|
|
| 54 |
if messages == []:
|
| 55 |
messages = [chatglm_cpp.ChatMessage(role="system", content=system_message)]
|
| 56 |
|
| 57 |
+
print(messages)
|
| 58 |
+
|
| 59 |
# for val in history:
|
| 60 |
# if val[0]:
|
| 61 |
# messages.append(chatglm_cpp.ChatMessage(role="user", content=val[0]))
|
|
|
|
| 74 |
|
| 75 |
messages.append(chatglm_cpp.ChatMessage(role="assistant", content=response))
|
| 76 |
|
| 77 |
+
print(messages)
|
| 78 |
+
|
| 79 |
|
| 80 |
"""
|
| 81 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|