TDN-M commited on
Commit
47229c4
·
verified ·
1 Parent(s): 6fde35e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -13
app.py CHANGED
@@ -46,19 +46,23 @@ def interface():
46
  gr.Markdown("# Ứng dụng Tạo Nội dung và Video")
47
 
48
  with gr.Tab("Tạo Nội dung"):
49
- prompt = gr.Textbox(label="Nhập yêu cầu nội dung")
50
- file_upload = gr.File(label="Tải lên file kèm theo", type="filepath")
51
-
52
- # Sử dụng gr.Radio thay gr.CheckboxGroup
53
- content_type = gr.Radio(label="Chọn loại nội dung",
54
- choices=CONTENT_TYPES,
55
- value=None) # Giá trị mặc định là không có gì được chọn
56
-
57
- content_button = gr.Button("Tạo Nội dung")
58
- content_output = gr.Textbox(label="Nội dung tạo ra", interactive=True)
59
- confirm_button = gr.Button("Xác nhận nội dung")
60
- download_docx = gr.File(label="Tải xuống file DOCX", interactive=False)
61
- status_message = gr.Label(label="Trạng thái")
 
 
 
 
62
 
63
  def generate_content(prompt, file, content_type):
64
  try:
@@ -99,6 +103,7 @@ def interface():
99
 
100
  return app
101
 
 
102
  # Khởi chạy ứng dụng
103
  if __name__ == "__main__":
104
  app = interface()
 
46
  gr.Markdown("# Ứng dụng Tạo Nội dung và Video")
47
 
48
  with gr.Tab("Tạo Nội dung"):
49
+ with gr.Row():
50
+ with gr.Column():
51
+ prompt = gr.Textbox(label="Nhập yêu cầu nội dung")
52
+ file_upload = gr.File(label="Tải lên file kèm theo", type="filepath")
53
+
54
+ # Sử dụng gr.Radio thay vì gr.CheckboxGroup
55
+ content_type = gr.Radio(label="Chọn loại nội dung",
56
+ choices=CONTENT_TYPES,
57
+ value=None) # Giá trị mặc định là không có gì được chọn
58
+
59
+ content_button = gr.Button("Tạo Nội dung")
60
+
61
+ with gr.Column():
62
+ content_output = gr.Textbox(label="Nội dung tạo ra", interactive=True)
63
+ confirm_button = gr.Button("Xác nhận nội dung")
64
+ download_docx = gr.File(label="Tải xuống file DOCX", interactive=False)
65
+ status_message = gr.Label(label="Trạng thái")
66
 
67
  def generate_content(prompt, file, content_type):
68
  try:
 
103
 
104
  return app
105
 
106
+
107
  # Khởi chạy ứng dụng
108
  if __name__ == "__main__":
109
  app = interface()