cyberandy commited on
Commit
c568d97
·
verified ·
1 Parent(s): 5d44f1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -163,12 +163,16 @@ with gr.Blocks(css=css) as demo:
163
  value="Short Formal 📝",
164
  elem_classes="gr-box"
165
  )
 
166
  custom_instruction = gr.Textbox(
167
  label="Custom Instruction (Only for 'Other')", visible=False, elem_classes="gr-box"
168
  )
169
  submit_btn = gr.Button(value="Submit", elem_classes="gr-box")
 
170
  with gr.Column():
171
  output_text = gr.Markdown(label="Output Text", show_copy_button=True, elem_classes="output-text")
 
 
172
 
173
  # Toggle visibility of custom instruction based on selected type
174
  def toggle_custom_instruction(type_selection):
@@ -218,12 +222,9 @@ with gr.Blocks(css=css) as demo:
218
  submit_btn.click(
219
  handle_submit,
220
  inputs=[input_img, description_type, custom_instruction],
221
- outputs=[output_text, redirect_message, submit_btn, gr.Markdown(visible=True, label="Test Counter")],
222
  )
223
 
224
- # Launch Gradio app
225
- demo.queue(api_open=False)
226
- demo.launch(debug=True)
227
 
228
  # Launch Gradio app
229
  demo.queue(api_open=False)
 
163
  value="Short Formal 📝",
164
  elem_classes="gr-box"
165
  )
166
+
167
  custom_instruction = gr.Textbox(
168
  label="Custom Instruction (Only for 'Other')", visible=False, elem_classes="gr-box"
169
  )
170
  submit_btn = gr.Button(value="Submit", elem_classes="gr-box")
171
+
172
  with gr.Column():
173
  output_text = gr.Markdown(label="Output Text", show_copy_button=True, elem_classes="output-text")
174
+ redirect_message = gr.Markdown(visible=False, elem_classes="redirect-message")
175
+ test_counter_display = gr.Markdown(visible=True, label="Test Counter")
176
 
177
  # Toggle visibility of custom instruction based on selected type
178
  def toggle_custom_instruction(type_selection):
 
222
  submit_btn.click(
223
  handle_submit,
224
  inputs=[input_img, description_type, custom_instruction],
225
+ outputs=[output_text, redirect_message, submit_btn, test_counter_display],
226
  )
227
 
 
 
 
228
 
229
  # Launch Gradio app
230
  demo.queue(api_open=False)