Update app.py
Browse files
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")
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
iface = gr.Interface(
|
|
@@ -40,8 +40,10 @@ if __name__ == "__main__":
|
|
| 40 |
lines=1,
|
| 41 |
),
|
| 42 |
],
|
| 43 |
-
outputs=[
|
| 44 |
-
|
|
|
|
|
|
|
| 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 |
)
|