seawolf2357 commited on
Commit
0350c55
ยท
verified ยท
1 Parent(s): 97ce835

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,6 +5,7 @@ import base64
5
 
6
  # Mathpix์— ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ๋ณด๋‚ด์–ด LaTeX ๋ฌธ์ž์—ด์„ ์ถ”์ถœํ•˜๋Š” ํ•จ์ˆ˜
7
  def get_latex_from_image(image):
 
8
  image_base64 = base64.b64encode(image).decode('utf-8')
9
 
10
  # Mathpix API ์š”์ฒญ ํ—ค๋”
@@ -34,7 +35,7 @@ def get_latex_from_image(image):
34
  def build_gradio_app():
35
  with gr.Blocks() as app:
36
  with gr.Row():
37
- image_input = gr.Image(type="file", label="์ด๋ฏธ์ง€ ์—…๋กœ๋“œ")
38
  submit_button = gr.Button("๋ณ€ํ™˜ํ•˜๊ธฐ")
39
  latex_output = gr.Textbox(label="์ถ”์ถœ๋œ LaTeX")
40
 
 
5
 
6
  # Mathpix์— ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ ๋ณด๋‚ด์–ด LaTeX ๋ฌธ์ž์—ด์„ ์ถ”์ถœํ•˜๋Š” ํ•จ์ˆ˜
7
  def get_latex_from_image(image):
8
+ # ์ด๋ฏธ์ง€ ํŒŒ์ผ์„ base64 ์ธ์ฝ”๋”ฉ
9
  image_base64 = base64.b64encode(image).decode('utf-8')
10
 
11
  # Mathpix API ์š”์ฒญ ํ—ค๋”
 
35
  def build_gradio_app():
36
  with gr.Blocks() as app:
37
  with gr.Row():
38
+ image_input = gr.Image(type="filepath", label="์ด๋ฏธ์ง€ ์—…๋กœ๋“œ")
39
  submit_button = gr.Button("๋ณ€ํ™˜ํ•˜๊ธฐ")
40
  latex_output = gr.Textbox(label="์ถ”์ถœ๋œ LaTeX")
41