VoVanPhuc commited on
Commit
cdcb089
·
verified ·
1 Parent(s): 01a63e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -20,7 +20,7 @@ def call_predict_api(image, private_key=None):
20
  if response.status_code != 200:
21
  raise Exception(f"API Error: {response.text}")
22
  result = response.json()["result"]
23
- return result.replace("\n", "\n\n"), "Success"
24
 
25
  if __name__ == "__main__":
26
  iface = gr.Interface(
@@ -40,8 +40,10 @@ if __name__ == "__main__":
40
  lines=1,
41
  ),
42
  ],
43
- outputs=[gr.Markdown(label="Result"),
44
- gr.Textbox(label="Status", type="text", visible=False)],
 
 
45
  title="BBC-OCR",
46
  description="A simple OCR tool to extract text from images.",
47
  )
 
20
  if response.status_code != 200:
21
  raise Exception(f"API Error: {response.text}")
22
  result = response.json()["result"]
23
+ return "Success", result.replace("\n", "\n\n")
24
 
25
  if __name__ == "__main__":
26
  iface = gr.Interface(
 
40
  lines=1,
41
  ),
42
  ],
43
+ outputs=[
44
+ gr.Textbox(label="Status", type="text", visible=False),
45
+ gr.Markdown(label="Result")
46
+ ],
47
  title="BBC-OCR",
48
  description="A simple OCR tool to extract text from images.",
49
  )