Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -150,12 +150,16 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
150 |
state = gr.State([])
|
151 |
|
152 |
# Add a file upload component for Python files
|
153 |
-
file_upload = gr.File(label="Upload Python File", type=
|
|
|
154 |
# Example modification for the input submission handler
|
155 |
-
inputs.submit(handle_file, [file_upload, openai_gpt4_key, system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code])
|
|
|
|
|
156 |
# If you have a button for submission, modify its click handler similarly
|
157 |
-
b1.click(handle_file, [file_upload, openai_gpt4_key, system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code])
|
158 |
-
|
|
|
159 |
with gr.Row():
|
160 |
with gr.Column(scale=7):
|
161 |
b1 = gr.Button().style(full_width=True)
|
|
|
150 |
state = gr.State([])
|
151 |
|
152 |
# Add a file upload component for Python files
|
153 |
+
file_upload = gr.File(label="Upload Python File", type="file", placeholder="Upload a Python file to start the conversation with its content")
|
154 |
+
|
155 |
# Example modification for the input submission handler
|
156 |
+
inputs.submit(handle_file, inputs=[file_upload, openai_gpt4_key, system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], outputs=[chatbot, state, chat_counter, server_status_code])
|
157 |
+
|
158 |
+
# inputs.submit(handle_file, [file_upload, openai_gpt4_key, system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code])
|
159 |
# If you have a button for submission, modify its click handler similarly
|
160 |
+
# b1.click(handle_file, [file_upload, openai_gpt4_key, system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code])
|
161 |
+
b1.click(handle_file, inputs=[file_upload, openai_gpt4_key, system_msg, inputs, top_p, temperature, chat_counter, chatbot, state], outputs=[chatbot, state, chat_counter, server_status_code])
|
162 |
+
|
163 |
with gr.Row():
|
164 |
with gr.Column(scale=7):
|
165 |
b1 = gr.Button().style(full_width=True)
|