Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,15 +10,14 @@ def process_pdf(file):
|
|
10 |
text += page.extract_text()
|
11 |
return text
|
12 |
|
13 |
-
|
14 |
gr.Markdown("### File upload", elem_classes="tab-header")
|
15 |
with gr.Row():
|
16 |
-
|
17 |
file_input = gr.File(label="Wähle eine PDF-Datei aus", type="filepath")
|
18 |
upload_output = gr.Textbox(label="Upload Status")
|
19 |
with gr.Row():
|
20 |
submit_button = gr.Button("upload")
|
21 |
-
submit_button.click(process_pdf, inputs=file_input, outputs=text_output
|
22 |
|
23 |
-
|
24 |
-
|
|
|
10 |
text += page.extract_text()
|
11 |
return text
|
12 |
|
13 |
+
with gr.Blocks() as demo:
|
14 |
gr.Markdown("### File upload", elem_classes="tab-header")
|
15 |
with gr.Row():
|
16 |
+
text_output = gr.Textbox(label="text")
|
17 |
file_input = gr.File(label="Wähle eine PDF-Datei aus", type="filepath")
|
18 |
upload_output = gr.Textbox(label="Upload Status")
|
19 |
with gr.Row():
|
20 |
submit_button = gr.Button("upload")
|
21 |
+
submit_button.click(process_pdf, inputs=file_input, outputs=text_output)
|
22 |
|
23 |
+
demo.launch()
|
|