Spaces:
Paused
Paused
Commit
·
d2d4595
1
Parent(s):
13974f1
update
Browse files- app_locally.py +11 -26
app_locally.py
CHANGED
|
@@ -123,16 +123,16 @@ def predict(prompt, style, audio_file_pth, mic_file_path, use_mic, agree):
|
|
| 123 |
None,
|
| 124 |
None,
|
| 125 |
)
|
| 126 |
-
if len(prompt) > 200:
|
| 127 |
-
text_hint += f"[ERROR] Text length limited to 200 characters for this demo, please try shorter text. You can clone our open-source repo and try for your usage \n"
|
| 128 |
-
gr.Warning(
|
| 129 |
-
"Text length limited to 200 characters for this demo, please try shorter text. You can clone our open-source repo for your usage"
|
| 130 |
-
)
|
| 131 |
-
return (
|
| 132 |
-
text_hint,
|
| 133 |
-
None,
|
| 134 |
-
None,
|
| 135 |
-
)
|
| 136 |
|
| 137 |
# note diffusion_conditioning not used on hifigan (default mode), it will be empty but need to pass it to model.inference
|
| 138 |
try:
|
|
@@ -239,21 +239,6 @@ examples = [
|
|
| 239 |
|
| 240 |
with gr.Blocks(analytics_enabled=False) as demo:
|
| 241 |
|
| 242 |
-
with gr.Row():
|
| 243 |
-
with gr.Column():
|
| 244 |
-
with gr.Row():
|
| 245 |
-
gr.Markdown(
|
| 246 |
-
"""
|
| 247 |
-
## <img src="https://huggingface.co/spaces/myshell-ai/OpenVoice/raw/main/logo.jpg" height="40"/>
|
| 248 |
-
"""
|
| 249 |
-
)
|
| 250 |
-
with gr.Row():
|
| 251 |
-
gr.Markdown(markdown_table_v2)
|
| 252 |
-
with gr.Row():
|
| 253 |
-
gr.Markdown(description)
|
| 254 |
-
with gr.Column():
|
| 255 |
-
gr.Video('./open_voice.mp4', autoplay=True)
|
| 256 |
-
|
| 257 |
with gr.Row():
|
| 258 |
gr.HTML(wrapped_markdown_content)
|
| 259 |
|
|
@@ -311,4 +296,4 @@ with gr.Blocks(analytics_enabled=False) as demo:
|
|
| 311 |
tts_button.click(predict, [input_text_gr, style_gr, ref_gr, mic_gr, use_mic_gr, tos_gr], outputs=[out_text_gr, audio_gr, ref_audio_gr])
|
| 312 |
|
| 313 |
demo.queue()
|
| 314 |
-
demo.launch(debug=True, show_api=True, share=args.share)
|
|
|
|
| 123 |
None,
|
| 124 |
None,
|
| 125 |
)
|
| 126 |
+
# if len(prompt) > 200:
|
| 127 |
+
# text_hint += f"[ERROR] Text length limited to 200 characters for this demo, please try shorter text. You can clone our open-source repo and try for your usage \n"
|
| 128 |
+
# gr.Warning(
|
| 129 |
+
# "Text length limited to 200 characters for this demo, please try shorter text. You can clone our open-source repo for your usage"
|
| 130 |
+
# )
|
| 131 |
+
# return (
|
| 132 |
+
# text_hint,
|
| 133 |
+
# None,
|
| 134 |
+
# None,
|
| 135 |
+
# )
|
| 136 |
|
| 137 |
# note diffusion_conditioning not used on hifigan (default mode), it will be empty but need to pass it to model.inference
|
| 138 |
try:
|
|
|
|
| 239 |
|
| 240 |
with gr.Blocks(analytics_enabled=False) as demo:
|
| 241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
with gr.Row():
|
| 243 |
gr.HTML(wrapped_markdown_content)
|
| 244 |
|
|
|
|
| 296 |
tts_button.click(predict, [input_text_gr, style_gr, ref_gr, mic_gr, use_mic_gr, tos_gr], outputs=[out_text_gr, audio_gr, ref_audio_gr])
|
| 297 |
|
| 298 |
demo.queue()
|
| 299 |
+
demo.launch(debug=True, show_api=True, share=args.share)
|