Spaces:
Running
Running
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -50,11 +50,12 @@ def build_gradio_app(css=css):
|
|
50 |
# ๋จ์ผ ์ถ๋ ฅ์ ์ํด outputs ๋ถ๋ถ์ ๋จ์ํ
|
51 |
outputs = gr.Textbox(label="๊ฒฐ๊ณผ")
|
52 |
latex_iframe = gr.HTML(value='<iframe src="https://www.mathjax.org/#demo" style="width: 100%; height: 700px; border: 2px solid #007bff; border-radius: 8px;"></iframe>', elem_id="latex_iframe")
|
53 |
-
|
54 |
|
|
|
|
|
|
|
55 |
def process_and_output(image):
|
56 |
latex_result = get_latex_from_image_all_formats(image)
|
57 |
-
# text ๊ฒฐ๊ณผ๋ฅผ ์ง์ ๋ฐํ
|
58 |
text_result = latex_result.get("text", "No result")
|
59 |
return text_result
|
60 |
|
@@ -64,5 +65,4 @@ def build_gradio_app(css=css):
|
|
64 |
|
65 |
if __name__ == "__main__":
|
66 |
app = build_gradio_app()
|
67 |
-
app.launch()
|
68 |
-
|
|
|
50 |
# ๋จ์ผ ์ถ๋ ฅ์ ์ํด outputs ๋ถ๋ถ์ ๋จ์ํ
|
51 |
outputs = gr.Textbox(label="๊ฒฐ๊ณผ")
|
52 |
latex_iframe = gr.HTML(value='<iframe src="https://www.mathjax.org/#demo" style="width: 100%; height: 700px; border: 2px solid #007bff; border-radius: 8px;"></iframe>', elem_id="latex_iframe")
|
|
|
53 |
|
54 |
+
# ์์ ์ด๋ฏธ์ง๋ฅผ ์
๋ ฅ์ผ๋ก ํ๋ Examples ์ปดํฌ๋ํธ ์ถ๊ฐ
|
55 |
+
examples = gr.Examples(examples=[["ko.png"], ["en.png"]], inputs=image_input, fn=process_and_output, outputs=outputs)
|
56 |
+
|
57 |
def process_and_output(image):
|
58 |
latex_result = get_latex_from_image_all_formats(image)
|
|
|
59 |
text_result = latex_result.get("text", "No result")
|
60 |
return text_result
|
61 |
|
|
|
65 |
|
66 |
if __name__ == "__main__":
|
67 |
app = build_gradio_app()
|
68 |
+
app.launch()
|
|