Dequn commited on
Commit
8727e62
1 Parent(s): 09f600f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
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=[".py"], placeholder="Upload a Python file to start the conversation with its content")
 
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)