Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ def report_feedback():
|
|
| 59 |
print("No prediction available to report.") # Debugging line
|
| 60 |
return "No prediction available to report."
|
| 61 |
|
| 62 |
-
# Define the Gradio
|
| 63 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
| 64 |
|
| 65 |
gr.Markdown("### Classify image of art as real or AI generated")
|
|
@@ -71,9 +71,9 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
| 71 |
prediction_output = gr.Textbox(label="Prediction", interactive=False)
|
| 72 |
confidence_output = gr.Textbox(label="Confidence", interactive=False)
|
| 73 |
|
| 74 |
-
# Create a row for
|
| 75 |
with gr.Row():
|
| 76 |
-
feedback_output = gr.Textbox(label="Feedback Status", interactive=False, scale=0,min_width=730)
|
| 77 |
|
| 78 |
# Buttons
|
| 79 |
with gr.Row():
|
|
@@ -81,12 +81,12 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
| 81 |
feedback_btn = gr.Button("The model was wrong", variant="secondary", elem_id="feedback_btn")
|
| 82 |
|
| 83 |
gr.Markdown("<br>") # Adding space below buttons
|
| 84 |
-
clear_btn = gr.Button("Clear", elem_id="clear_btn")
|
| 85 |
|
| 86 |
submit_btn.click(predict, inputs=image_input, outputs=[prediction_output, confidence_output])
|
| 87 |
feedback_btn.click(report_feedback, outputs=feedback_output)
|
| 88 |
|
| 89 |
-
# Clear button
|
| 90 |
def clear_all():
|
| 91 |
return None, "", "", "" # Clear all outputs
|
| 92 |
|
|
|
|
| 59 |
print("No prediction available to report.") # Debugging line
|
| 60 |
return "No prediction available to report."
|
| 61 |
|
| 62 |
+
# Define the Gradio blocks
|
| 63 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
| 64 |
|
| 65 |
gr.Markdown("### Classify image of art as real or AI generated")
|
|
|
|
| 71 |
prediction_output = gr.Textbox(label="Prediction", interactive=False)
|
| 72 |
confidence_output = gr.Textbox(label="Confidence", interactive=False)
|
| 73 |
|
| 74 |
+
# Create a row for feedback_output
|
| 75 |
with gr.Row():
|
| 76 |
+
feedback_output = gr.Textbox(label="Feedback Status", interactive=False, scale=0,min_width=730)
|
| 77 |
|
| 78 |
# Buttons
|
| 79 |
with gr.Row():
|
|
|
|
| 81 |
feedback_btn = gr.Button("The model was wrong", variant="secondary", elem_id="feedback_btn")
|
| 82 |
|
| 83 |
gr.Markdown("<br>") # Adding space below buttons
|
| 84 |
+
clear_btn = gr.Button("Clear", elem_id="clear_btn")
|
| 85 |
|
| 86 |
submit_btn.click(predict, inputs=image_input, outputs=[prediction_output, confidence_output])
|
| 87 |
feedback_btn.click(report_feedback, outputs=feedback_output)
|
| 88 |
|
| 89 |
+
# Clear button
|
| 90 |
def clear_all():
|
| 91 |
return None, "", "", "" # Clear all outputs
|
| 92 |
|