Update app.py
Browse files
app.py
CHANGED
|
@@ -215,45 +215,21 @@ def main():
|
|
| 215 |
# UI: ChatInterface + image
|
| 216 |
# -------------------------
|
| 217 |
with gr.Blocks() as demo:
|
| 218 |
-
gr.Markdown(
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
fn=ocr_chat,
|
| 227 |
-
chatbot=gr.Chatbot(
|
| 228 |
-
label="HunyuanOCR Chat",
|
| 229 |
-
height=600,
|
| 230 |
-
),
|
| 231 |
-
textbox=gr.Textbox(
|
| 232 |
-
label="Your question",
|
| 233 |
-
placeholder="Example: Detect and recognize all text in this image.",
|
| 234 |
-
lines=2,
|
| 235 |
-
),
|
| 236 |
-
additional_inputs=[
|
| 237 |
-
gr.Image(
|
| 238 |
-
label="Upload image",
|
| 239 |
-
type="filepath",
|
| 240 |
-
)
|
| 241 |
-
],
|
| 242 |
-
title=None,
|
| 243 |
-
description=None,
|
| 244 |
)
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
"
|
| 248 |
-
"- Use clear, high-resolution scans.\n"
|
| 249 |
-
"- Supported: JPG, PNG.\n"
|
| 250 |
-
"- You can reuse the same image for multiple questions."
|
| 251 |
)
|
| 252 |
-
|
| 253 |
-
demo.
|
| 254 |
-
share=args.share,
|
| 255 |
-
inbrowser=args.inbrowser,
|
| 256 |
-
)
|
| 257 |
|
| 258 |
|
| 259 |
if __name__ == "__main__":
|
|
|
|
| 215 |
# UI: ChatInterface + image
|
| 216 |
# -------------------------
|
| 217 |
with gr.Blocks() as demo:
|
| 218 |
+
gr.Markdown("# HunyuanOCR\nUpload an image and ask OCR questions.")
|
| 219 |
+
|
| 220 |
+
chat = gr.ChatInterface(
|
| 221 |
+
fn=ocr_chat,
|
| 222 |
+
additional_inputs=[
|
| 223 |
+
gr.Image(
|
| 224 |
+
label="Upload Image",
|
| 225 |
+
type="filepath"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
)
|
| 227 |
+
],
|
| 228 |
+
title="Hunyuan OCR",
|
| 229 |
+
description="Ask questions about the uploaded document",
|
|
|
|
|
|
|
|
|
|
| 230 |
)
|
| 231 |
+
|
| 232 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
| 233 |
|
| 234 |
|
| 235 |
if __name__ == "__main__":
|