KarthiEz commited on
Commit
d2146b6
·
verified ·
1 Parent(s): 542e67d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -37
app.py CHANGED
@@ -215,45 +215,21 @@ def main():
215
  # UI: ChatInterface + image
216
  # -------------------------
217
  with gr.Blocks() as demo:
218
- gr.Markdown(
219
- "# HunyuanOCR\n"
220
- "Upload an image (invoice, document, receipt, notice, etc.) and ask OCR questions."
221
- )
222
-
223
- with gr.Row():
224
- with gr.Column(scale=2):
225
- chat = gr.ChatInterface(
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
- gr.Markdown(
247
- "Tips:\n"
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.queue().launch(
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__":