Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -259,19 +259,24 @@ iface = gr.Blocks(css="""
|
|
| 259 |
with iface:
|
| 260 |
gr.Markdown(f"# {title}")
|
| 261 |
gr.Markdown(description)
|
|
|
|
|
|
|
| 262 |
text_input = gr.Textbox(label="", placeholder="Type or paste your content here...", elem_id="text_input_box", lines=5)
|
|
|
|
|
|
|
|
|
|
| 263 |
|
| 264 |
-
gr.
|
|
|
|
|
|
|
|
|
|
| 265 |
file_input = gr.File(label="Upload PDF or Text Files", file_types=[".pdf", ".txt", ".py", ".ipynb"], file_count="multiple")
|
| 266 |
result_table = gr.Dataframe(headers=["File Name", "Classification Result"], wrap=True)
|
| 267 |
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
result_output = gr.Markdown("", elem_id="result_output_box")
|
| 273 |
-
text_input.change(classify_text, inputs=text_input, outputs=result_output)
|
| 274 |
-
|
| 275 |
|
| 276 |
gr.Markdown(bottom_text, elem_id="bottom_text")
|
| 277 |
|
|
|
|
| 259 |
with iface:
|
| 260 |
gr.Markdown(f"# {title}")
|
| 261 |
gr.Markdown(description)
|
| 262 |
+
|
| 263 |
+
gr.Markdown("## Option 1: Past your text here")
|
| 264 |
text_input = gr.Textbox(label="", placeholder="Type or paste your content here...", elem_id="text_input_box", lines=5)
|
| 265 |
+
result_output = gr.Markdown("", elem_id="result_output_box")
|
| 266 |
+
|
| 267 |
+
# text_input.change(classify_text, inputs=text_input, outputs=result_output)
|
| 268 |
|
| 269 |
+
starttextprocessing_button = gr.Button("Start text processing")
|
| 270 |
+
starttextprocessing_button_button.click(fn=batch_classify, inputs=file_input, outputs=result_table)
|
| 271 |
+
|
| 272 |
+
gr.Markdown("## Option 2: Upload multiple files for batch classification")
|
| 273 |
file_input = gr.File(label="Upload PDF or Text Files", file_types=[".pdf", ".txt", ".py", ".ipynb"], file_count="multiple")
|
| 274 |
result_table = gr.Dataframe(headers=["File Name", "Classification Result"], wrap=True)
|
| 275 |
|
| 276 |
+
# file_input.change(fn=batch_classify, inputs=file_input, outputs=result_table)
|
| 277 |
+
|
| 278 |
+
startbatchprocessing_button = gr.Button("Start batch processing")
|
| 279 |
+
startbatchprocessing_button_button.click(fn=batch_classify, inputs=file_input, outputs=result_table)
|
|
|
|
|
|
|
|
|
|
| 280 |
|
| 281 |
gr.Markdown(bottom_text, elem_id="bottom_text")
|
| 282 |
|