Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ from PyPDF2 import PdfReader
|
|
3 |
import os
|
4 |
from docx import Document as DocxDocument
|
5 |
from gradio_client import Client
|
|
|
|
|
6 |
|
7 |
def routing(message):
|
8 |
client = Client("mgokg/SemanticRouting")
|
@@ -35,7 +37,7 @@ def process_file(file):
|
|
35 |
if file_extension == 'pdf':
|
36 |
ocr_text = process_pdf(file)
|
37 |
result = mitteilung(ocr_text)
|
38 |
-
|
39 |
return result
|
40 |
return ocr_text
|
41 |
|
@@ -46,7 +48,7 @@ def process_file(file):
|
|
46 |
text += paragraph.text + "\n"
|
47 |
|
48 |
result = mitteilung(text)
|
49 |
-
|
50 |
return result
|
51 |
return text
|
52 |
#return [Document(text=text)]
|
@@ -54,7 +56,7 @@ def process_file(file):
|
|
54 |
with gr.Blocks() as demo:
|
55 |
gr.Markdown("### File upload", elem_classes="tab-header")
|
56 |
with gr.Row():
|
57 |
-
text_output = gr.
|
58 |
with gr.Row():
|
59 |
file_input = gr.File(label="Wähle eine PDF-Datei aus", type="filepath")
|
60 |
with gr.Row():
|
|
|
3 |
import os
|
4 |
from docx import Document as DocxDocument
|
5 |
from gradio_client import Client
|
6 |
+
from IPython.display import display
|
7 |
+
from IPython.display import Markdown
|
8 |
|
9 |
def routing(message):
|
10 |
client = Client("mgokg/SemanticRouting")
|
|
|
37 |
if file_extension == 'pdf':
|
38 |
ocr_text = process_pdf(file)
|
39 |
result = mitteilung(ocr_text)
|
40 |
+
display(Markdown(result))
|
41 |
return result
|
42 |
return ocr_text
|
43 |
|
|
|
48 |
text += paragraph.text + "\n"
|
49 |
|
50 |
result = mitteilung(text)
|
51 |
+
display(Markdown(result))
|
52 |
return result
|
53 |
return text
|
54 |
#return [Document(text=text)]
|
|
|
56 |
with gr.Blocks() as demo:
|
57 |
gr.Markdown("### File upload", elem_classes="tab-header")
|
58 |
with gr.Row():
|
59 |
+
text_output = gr.Markdown(label="output")
|
60 |
with gr.Row():
|
61 |
file_input = gr.File(label="Wähle eine PDF-Datei aus", type="filepath")
|
62 |
with gr.Row():
|