atlantis240805 commited on
Commit
6eeb4db
·
verified ·
1 Parent(s): a60ccfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -55,8 +55,8 @@ def translate_pdf(pdf_file, provider, custom_api_key):
55
  except subprocess.CalledProcessError as e:
56
  return None, f"❌ Có lỗi xảy ra trong quá trình dịch:\n{e.stderr}"
57
 
58
- # Thiết kế giao diện chính
59
- with gr.Blocks(title="PDF Translator by ThienPhuc", theme=gr.themes.Soft()) as app:
60
 
61
  # 1. Giao diện nhập mã (Hiển thị đầu tiên)
62
  with gr.Group(visible=True) as login_screen:
@@ -103,4 +103,5 @@ with gr.Blocks(title="PDF Translator by ThienPhuc", theme=gr.themes.Soft()) as a
103
  outputs=[login_screen, main_screen, error_msg]
104
  )
105
 
106
- app.launch()
 
 
55
  except subprocess.CalledProcessError as e:
56
  return None, f"❌ Có lỗi xảy ra trong quá trình dịch:\n{e.stderr}"
57
 
58
+ # Thiết kế giao diện chính (Đã xóa tham số theme ở đây để sửa lỗi Gradio 6.0+)
59
+ with gr.Blocks(title="PDF Translator by ThienPhuc") as app:
60
 
61
  # 1. Giao diện nhập mã (Hiển thị đầu tiên)
62
  with gr.Group(visible=True) as login_screen:
 
103
  outputs=[login_screen, main_screen, error_msg]
104
  )
105
 
106
+ # Chuyển tham số theme xuống hàm launch
107
+ app.launch(theme=gr.themes.Soft())