Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,9 @@ def respond(
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
|
|
|
|
|
|
|
|
|
| 18 |
messages = [{"role": "system", "content": system_message}]
|
| 19 |
|
| 20 |
for val in history:
|
|
@@ -50,9 +53,6 @@ body {
|
|
| 50 |
}
|
| 51 |
"""
|
| 52 |
|
| 53 |
-
# Initial chat history with a welcome message
|
| 54 |
-
initial_history = [("Chat with me", "")]
|
| 55 |
-
|
| 56 |
"""
|
| 57 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 58 |
"""
|
|
@@ -71,7 +71,6 @@ demo = gr.ChatInterface(
|
|
| 71 |
),
|
| 72 |
],
|
| 73 |
css=custom_css,
|
| 74 |
-
initial_history=initial_history
|
| 75 |
)
|
| 76 |
|
| 77 |
|
|
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
+
if len(history) == 0:
|
| 19 |
+
history.append(("Chat with me", ""))
|
| 20 |
+
|
| 21 |
messages = [{"role": "system", "content": system_message}]
|
| 22 |
|
| 23 |
for val in history:
|
|
|
|
| 53 |
}
|
| 54 |
"""
|
| 55 |
|
|
|
|
|
|
|
|
|
|
| 56 |
"""
|
| 57 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 58 |
"""
|
|
|
|
| 71 |
),
|
| 72 |
],
|
| 73 |
css=custom_css,
|
|
|
|
| 74 |
)
|
| 75 |
|
| 76 |
|