Spaces:
Sleeping
Sleeping
fix 3
Browse files
app.py
CHANGED
@@ -86,21 +86,13 @@ def predict(files):
|
|
86 |
return class_name, report[0] if report else "No report generated."
|
87 |
|
88 |
# Gradio Blocks (100% reliable approach)
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
upload_button.upload(store_files, upload_button, files_state)
|
99 |
-
|
100 |
-
generate_btn = gr.Button("Generate Report")
|
101 |
-
class_output = gr.Textbox(label="Predicted Class")
|
102 |
-
report_output = gr.Textbox(label="Generated Report")
|
103 |
-
|
104 |
-
generate_btn.click(predict, files_state, [class_output, report_output])
|
105 |
|
106 |
demo.launch()
|
|
|
86 |
return class_name, report[0] if report else "No report generated."
|
87 |
|
88 |
# Gradio Blocks (100% reliable approach)
|
89 |
+
# Replace your Blocks interface with this simpler Interface approach
|
90 |
+
demo = gr.Interface(
|
91 |
+
fn=predict,
|
92 |
+
inputs=gr.File(file_count="multiple", file_types=[".dcm", ".jpg", ".jpeg", ".png"]),
|
93 |
+
outputs=[gr.Textbox(label="Predicted Class"), gr.Textbox(label="Generated Report")],
|
94 |
+
title="🩺 Phronesis Medical Report Generator",
|
95 |
+
description="Upload CT scan images to generate a medical report"
|
96 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
demo.launch()
|