Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -100,6 +100,7 @@ output_label = gr.Textbox(label="Spam Classification")
|
|
100 |
save_button = gr.Button("Save to JSON")
|
101 |
save_output = gr.Textbox(label="Save Status")
|
102 |
|
|
|
103 |
demo = gr.Interface(
|
104 |
fn=generate_ocr,
|
105 |
inputs=[method_input, image_input],
|
@@ -109,7 +110,14 @@ demo = gr.Interface(
|
|
109 |
theme="compact",
|
110 |
)
|
111 |
|
112 |
-
#
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
114 |
|
|
|
115 |
demo.launch()
|
|
|
|
100 |
save_button = gr.Button("Save to JSON")
|
101 |
save_output = gr.Textbox(label="Save Status")
|
102 |
|
103 |
+
# Define the save button within the interface
|
104 |
demo = gr.Interface(
|
105 |
fn=generate_ocr,
|
106 |
inputs=[method_input, image_input],
|
|
|
110 |
theme="compact",
|
111 |
)
|
112 |
|
113 |
+
# Create a separate interface for saving the results
|
114 |
+
save_interface = gr.Interface(
|
115 |
+
fn=save_to_json,
|
116 |
+
inputs=[output_text, output_label],
|
117 |
+
outputs=[save_output],
|
118 |
+
live=False
|
119 |
+
)
|
120 |
|
121 |
+
# Launch both interfaces together
|
122 |
demo.launch()
|
123 |
+
save_interface.launch()
|