Embrw commited on
Commit
ad85af5
·
verified ·
1 Parent(s): 5d122ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -65,17 +65,21 @@ def process_image(image, user_request):
65
 
66
  return response
67
 
 
 
 
 
 
68
  iface = gr.Interface(
69
  fn=process_image,
70
  inputs=[
71
  gr.Image(type="pil"),
72
- gr.Textbox(lines=2, placeholder="Nhập yêu cầu của bạn, ví dụ: 'Nhận dạng chữ viết tay và trả về dạng văn bản.'"),
73
  ],
74
  outputs="text",
75
- title="Vietnamese Handwriting OCR",
76
- description="Tải ảnh lên và nhập yêu cầu của bạn để trích xuất thông tin từ ảnh.",
77
- theme="dark" # Chuyển sang giao diện tối
78
  )
79
 
 
80
  if __name__ == "__main__":
81
  iface.launch()
 
65
 
66
  return response
67
 
68
+ def center_title(title, width=50):
69
+ return title.center(width)
70
+
71
+ title = center_title("Vietnamese Hand Writing OCR", 80)
72
+
73
  iface = gr.Interface(
74
  fn=process_image,
75
  inputs=[
76
  gr.Image(type="pil"),
77
+ gr.Textbox(lines=2, placeholder="Nhập yêu cầu của bạn, ví dụ: 'Nhận dạng chữ viết tay và trả về dạng văn bản'"),
78
  ],
79
  outputs="text",
80
+ title=title # Gán tiêu đề đã căn giữa
 
 
81
  )
82
 
83
+
84
  if __name__ == "__main__":
85
  iface.launch()