Jiangxz01 commited on
Commit
7def66f
·
verified ·
1 Parent(s): 77f51bb

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -13
app.py CHANGED
@@ -75,21 +75,25 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as iface:
75
  gr.Markdown("# 🎙️ Generated Podcast Audio. Deployed by 江信宗")
76
 
77
  input_text = gr.Textbox(label="請輸入您的文字")
78
- Language = gr.Dropdown(choices=["繁體中文", "Auto Detect", "英文"], value="繁體中文", label="語言")
79
 
80
- speaker_choices = [
81
- "Andrew - English (United States)",
82
- "Ava - English (United States)",
83
- "Brian - English (United States)",
84
- "Emma - English (United States)",
85
- "Florian - German (Germany)",
86
- "Seraphina - German (Germany)",
87
- "Remy - French (France)",
88
- "Vivienne - French (France)"
89
- ]
 
 
 
 
 
 
 
90
 
91
- Speaker_1 = gr.Dropdown(choices=speaker_choices, value=speaker_choices[0], label="主持人的語音")
92
- Speaker_2 = gr.Dropdown(choices=speaker_choices, value=speaker_choices[1], label="來賓的語音")
93
  api_key = gr.Textbox(label="API Key", type="password", placeholder="API authentication key for large language models")
94
  output_text = gr.Textbox(label="生成的結果")
95
 
 
75
  gr.Markdown("# 🎙️ Generated Podcast Audio. Deployed by 江信宗")
76
 
77
  input_text = gr.Textbox(label="請輸入您的文字")
 
78
 
79
+ # 使用 Radio 替代 Dropdown
80
+ Language = gr.Radio(choices=["繁體中文", "Auto Detect", "英文"], value="繁體中文", label="語言")
81
+
82
+ speaker_choices = {
83
+ "Andrew - English (United States)": "Andrew - English (United States)",
84
+ "Ava - English (United States)": "Ava - English (United States)",
85
+ "Brian - English (United States)": "Brian - English (United States)",
86
+ "Emma - English (United States)": "Emma - English (United States)",
87
+ "Florian - German (Germany)": "Florian - German (Germany)",
88
+ "Seraphina - German (Germany)": "Seraphina - German (Germany)",
89
+ "Remy - French (France)": "Remy - French (France)",
90
+ "Vivienne - French (France)": "Vivienne - French (France)"
91
+ }
92
+
93
+ # 使用字典初始化 Dropdown
94
+ Speaker_1 = gr.Dropdown(choices=speaker_choices, value="Andrew - English (United States)", label="主持人的語音")
95
+ Speaker_2 = gr.Dropdown(choices=speaker_choices, value="Ava - English (United States)", label="來賓的語音")
96
 
 
 
97
  api_key = gr.Textbox(label="API Key", type="password", placeholder="API authentication key for large language models")
98
  output_text = gr.Textbox(label="生成的結果")
99