seawolf2357 commited on
Commit
4069bf3
ยท
verified ยท
1 Parent(s): 9229c9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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() # API ํ†ต์‹ ์„ ํ…Œ์ŠคํŠธํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
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()