Update app.py
Browse files
app.py
CHANGED
|
@@ -25,14 +25,16 @@ def predict(pdf_file):
|
|
| 25 |
nougat_ocr(pdf_file.name)
|
| 26 |
|
| 27 |
# Open the multimarkdown (.mmd) file for reading
|
| 28 |
-
with open(f'/
|
| 29 |
content = file.read()
|
| 30 |
|
| 31 |
return content
|
| 32 |
|
| 33 |
|
| 34 |
with gr.Blocks() as demo:
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
with gr.Row():
|
| 37 |
pdf_file = gr.File(label='Upload a PDF', scale=1)
|
| 38 |
mkd = gr.Markdown('<h2><center><i>OR</i></center></h2>',scale=1)
|
|
|
|
| 25 |
nougat_ocr(pdf_file.name)
|
| 26 |
|
| 27 |
# Open the multimarkdown (.mmd) file for reading
|
| 28 |
+
with open(f'/output/{pdf_name}.mmd', 'r') as file:
|
| 29 |
content = file.read()
|
| 30 |
|
| 31 |
return content
|
| 32 |
|
| 33 |
|
| 34 |
with gr.Blocks() as demo:
|
| 35 |
+
gr.HTML("<h1>Nougat: Neural Optical Understanding for Academic Documents<h1>")
|
| 36 |
+
gr.HTML("<h3>Lukas Blecher et al. <a href='https://arxiv.org/pdf/2308.13418.pdf' target='_blank'>Paper</a>, <a href='https://facebookresearch.github.io/nougat/'>Project</a></h3>")
|
| 37 |
+
|
| 38 |
with gr.Row():
|
| 39 |
pdf_file = gr.File(label='Upload a PDF', scale=1)
|
| 40 |
mkd = gr.Markdown('<h2><center><i>OR</i></center></h2>',scale=1)
|