Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,18 +35,15 @@ with gr.Blocks() as interface:
|
|
| 35 |
output_area = gr.Markdown()
|
| 36 |
|
| 37 |
# Loading spinner (show loading during API call)
|
| 38 |
-
loading_spinner = gr.HTML("<p style='color: #
|
| 39 |
-
|
| 40 |
-
|
| 41 |
# Define button click interaction
|
| 42 |
def on_submit(prompt):
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
loading_spinner.visible = False
|
| 46 |
-
return result, loading_spinner
|
| 47 |
|
| 48 |
# Link the button with the function
|
| 49 |
-
submit_button.click(on_submit, inputs=prompt_input, outputs=[
|
| 50 |
|
| 51 |
# Launch Gradio interface
|
| 52 |
-
interface.launch()
|
|
|
|
| 35 |
output_area = gr.Markdown()
|
| 36 |
|
| 37 |
# Loading spinner (show loading during API call)
|
| 38 |
+
loading_spinner = gr.HTML("<p style='color: #4CAF50;'>Loading... Please wait...</p>")
|
| 39 |
+
|
|
|
|
| 40 |
# Define button click interaction
|
| 41 |
def on_submit(prompt):
|
| 42 |
+
# Show the spinner when the button is clicked
|
| 43 |
+
return gr.update(visible=True), generate_content(prompt)
|
|
|
|
|
|
|
| 44 |
|
| 45 |
# Link the button with the function
|
| 46 |
+
submit_button.click(on_submit, inputs=prompt_input, outputs=[loading_spinner, output_area])
|
| 47 |
|
| 48 |
# Launch Gradio interface
|
| 49 |
+
interface.launch()
|