Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,7 +122,15 @@ Uploaded file content will provide context for the conversation.
|
|
| 122 |
history[-1] = (user_message, assistant_response)
|
| 123 |
return "", history
|
| 124 |
|
| 125 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
user_input.submit(
|
| 127 |
fn=chat_function,
|
| 128 |
inputs=[user_input, chat_history_state, file_content_state, system_prompt, max_tokens, temperature, top_p],
|
|
|
|
| 122 |
history[-1] = (user_message, assistant_response)
|
| 123 |
return "", history
|
| 124 |
|
| 125 |
+
# Add a Send Button for manual submission
|
| 126 |
+
send_button = gr.Button("Send")
|
| 127 |
+
send_button.click(
|
| 128 |
+
fn=chat_function,
|
| 129 |
+
inputs=[user_input, chat_history_state, file_content_state, system_prompt, max_tokens, temperature, top_p],
|
| 130 |
+
outputs=[user_input, chatbot]
|
| 131 |
+
)
|
| 132 |
+
|
| 133 |
+
# Submit Chat Input with Enter Key as well
|
| 134 |
user_input.submit(
|
| 135 |
fn=chat_function,
|
| 136 |
inputs=[user_input, chat_history_state, file_content_state, system_prompt, max_tokens, temperature, top_p],
|