Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -90,8 +90,11 @@ def process_json_and_generate_audio(prompt_audio_role0_file, prompt_text_role0,
|
|
90 |
title_en = "# MoonCast PODCAST generator (supports English and Chinese)"
|
91 |
title_zh = "# MoonCast 播客生成 (支持英文和中文)"
|
92 |
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
95 |
|
96 |
output_label_en = "Generated Audio Output (streaming)"
|
97 |
output_label_zh = "生成的音频输出(流式)"
|
@@ -155,6 +158,7 @@ examples = [
|
|
155 |
def update_ui_language(language):
|
156 |
if language == "English":
|
157 |
return gr.update(value=title_en), \
|
|
|
158 |
gr.update(label="UI Language"), \
|
159 |
gr.update(label=input_labels_en[0]), \
|
160 |
gr.update(label=input_labels_en[1]), \
|
@@ -167,6 +171,7 @@ def update_ui_language(language):
|
|
167 |
|
168 |
elif language == "中文":
|
169 |
return gr.update(value=title_zh), \
|
|
|
170 |
gr.update(label="UI 语言"), \
|
171 |
gr.update(label=input_labels_zh[0]), \
|
172 |
gr.update(label=input_labels_zh[1]), \
|
@@ -191,6 +196,7 @@ css = """
|
|
191 |
with gr.Blocks(css=css) as iface:
|
192 |
|
193 |
title_output = gr.Markdown(value=title_zh, elem_classes="centered-title")
|
|
|
194 |
language_choice = gr.Radio(["中文", "English"], value="中文", label="UI语言")
|
195 |
|
196 |
with gr.Row(): # Main row to create two columns
|
@@ -224,7 +230,7 @@ with gr.Blocks(css=css) as iface:
|
|
224 |
language_choice.change(
|
225 |
fn=update_ui_language,
|
226 |
inputs=language_choice,
|
227 |
-
outputs=[title_output, language_choice, audio_input_role0, text_input_role0, audio_input_role1, text_input_role1, json_input, audio_output, submit_button, examples_component.dataset]
|
228 |
)
|
229 |
|
230 |
|
|
|
90 |
title_en = "# MoonCast PODCAST generator (supports English and Chinese)"
|
91 |
title_zh = "# MoonCast 播客生成 (支持英文和中文)"
|
92 |
|
93 |
+
instruct_en = "## See [Github](https://github.com/jzq2000/MoonCast) for podcast script generation."
|
94 |
+
instruct_zh = "## 播客剧本生成请参考 [Github](https://github.com/jzq2000/MoonCast)。"
|
95 |
+
|
96 |
+
input_labels_en = ["Prompt Audio for Role 0", "Prompt Text for Role 0", "Prompt Audio for Role 1", "Prompt Text for Role 1", "Script JSON Input"]
|
97 |
+
input_labels_zh = ["角色 0 的 Prompt 音频", "角色 0 的 Prompt 文本", "角色 1 的 Prompt 音频", "角色 1 的 Prompt 文本", "剧本 JSON 输入"]
|
98 |
|
99 |
output_label_en = "Generated Audio Output (streaming)"
|
100 |
output_label_zh = "生成的音频输出(流式)"
|
|
|
158 |
def update_ui_language(language):
|
159 |
if language == "English":
|
160 |
return gr.update(value=title_en), \
|
161 |
+
gr.update(value=instruct_en), \
|
162 |
gr.update(label="UI Language"), \
|
163 |
gr.update(label=input_labels_en[0]), \
|
164 |
gr.update(label=input_labels_en[1]), \
|
|
|
171 |
|
172 |
elif language == "中文":
|
173 |
return gr.update(value=title_zh), \
|
174 |
+
gr.update(value=instruct_zh), \
|
175 |
gr.update(label="UI 语言"), \
|
176 |
gr.update(label=input_labels_zh[0]), \
|
177 |
gr.update(label=input_labels_zh[1]), \
|
|
|
196 |
with gr.Blocks(css=css) as iface:
|
197 |
|
198 |
title_output = gr.Markdown(value=title_zh, elem_classes="centered-title")
|
199 |
+
instruct_output = gr.Markdown(value=instruct_zh)
|
200 |
language_choice = gr.Radio(["中文", "English"], value="中文", label="UI语言")
|
201 |
|
202 |
with gr.Row(): # Main row to create two columns
|
|
|
230 |
language_choice.change(
|
231 |
fn=update_ui_language,
|
232 |
inputs=language_choice,
|
233 |
+
outputs=[title_output, instruct_output, language_choice, audio_input_role0, text_input_role0, audio_input_role1, text_input_role1, json_input, audio_output, submit_button, examples_component.dataset]
|
234 |
)
|
235 |
|
236 |
|