Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
def nougat_ocr(file_name):
|
6 |
print('******* inside nougat_ocr *******')
|
@@ -34,7 +41,7 @@ def predict(pdf_file):
|
|
34 |
return content
|
35 |
|
36 |
|
37 |
-
with gr.Blocks() as demo:
|
38 |
gr.HTML("<h1><center>Nougat: Neural Optical Understanding for Academic Documents<center><h1>")
|
39 |
gr.HTML("<h3><center>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><center></h3>")
|
40 |
|
@@ -44,7 +51,7 @@ with gr.Blocks() as demo:
|
|
44 |
pdf_link = gr.Textbox(placeholder='Enter an arxiv link here', label='Provide a link', scale=1)
|
45 |
|
46 |
btn = gr.Button()
|
47 |
-
parsed_output = gr.Markdown()
|
48 |
|
49 |
btn.click(predict, pdf_file, parsed_output )
|
50 |
|
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
|
4 |
+
css = """
|
5 |
+
.mkd {
|
6 |
+
height: 500px;
|
7 |
+
overflow: auto;
|
8 |
+
border: 1px solid #ccc;
|
9 |
+
}
|
10 |
+
"""
|
11 |
|
12 |
def nougat_ocr(file_name):
|
13 |
print('******* inside nougat_ocr *******')
|
|
|
41 |
return content
|
42 |
|
43 |
|
44 |
+
with gr.Blocks(css=css) as demo:
|
45 |
gr.HTML("<h1><center>Nougat: Neural Optical Understanding for Academic Documents<center><h1>")
|
46 |
gr.HTML("<h3><center>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><center></h3>")
|
47 |
|
|
|
51 |
pdf_link = gr.Textbox(placeholder='Enter an arxiv link here', label='Provide a link', scale=1)
|
52 |
|
53 |
btn = gr.Button()
|
54 |
+
parsed_output = gr.Markdown(elem_id='mkd')
|
55 |
|
56 |
btn.click(predict, pdf_file, parsed_output )
|
57 |
|