Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,133 +44,28 @@ def convert_yt_to_wav(url):
|
|
| 44 |
return str(e), None
|
| 45 |
|
| 46 |
with gr.Blocks() as app:
|
| 47 |
-
gr.HTML("<h1> Simple RVC Inference - by Juuxn 💻 </h1>")
|
| 48 |
-
|
| 49 |
-
gr.HTML("<h4> El espacio actual usa solo cpu, así que es solo para inferencia. Se recomienda duplicar el espacio para no tener problemas con las colas de procesamiento. </h4>")
|
| 50 |
-
|
| 51 |
-
gr.Markdown("Simple RVC GPU Inference on colab: [](https://colab.research.google.com/drive/1NKqqTR04HujeBxzwe7jbYEvNi8LbxD_N?usp=sharing)")
|
| 52 |
-
gr.Markdown(
|
| 53 |
-
"[](https://huggingface.co/spaces/juuxn/SimpleRVC?duplicate=true)\n\n"
|
| 54 |
-
)
|
| 55 |
-
|
| 56 |
-
gr.Markdown("Recopilación de modelos que puedes usar: RVC + Kits ai. **[RVC Community Models](https://docs.google.com/spreadsheets/d/1owfUtQuLW9ReiIwg6U9UkkDmPOTkuNHf0OKQtWu1iaI)**")
|
| 57 |
-
|
| 58 |
-
with gr.Tab("Inferencia"):
|
| 59 |
-
model_url = gr.Textbox(placeholder="https://huggingface.co/AIVER-SE/BillieEilish/resolve/main/BillieEilish.zip", label="Url del modelo", show_label=True)
|
| 60 |
-
with gr.Row():
|
| 61 |
-
with gr.Column():
|
| 62 |
-
audio_path = gr.Audio(label="Archivo de audio", show_label=True, type="filepath",)
|
| 63 |
-
index_rate = gr.Slider(minimum=0, maximum=1, label="Search feature ratio:", value=0.75, interactive=True,)
|
| 64 |
-
filter_radius1 = gr.Slider(minimum=0, maximum=7, label="Filtro (reducción de asperezas respiración)", value=3, step=1, interactive=True,)
|
| 65 |
-
with gr.Column():
|
| 66 |
-
f0_method = gr.Dropdown(choices=["harvest", "pm", "crepe", "crepe-tiny", "mangio-crepe", "mangio-crepe-tiny", "rmvpe"],
|
| 67 |
-
value="rmvpe",
|
| 68 |
-
label="Algoritmo", show_label=True)
|
| 69 |
-
vc_transform0 = gr.Slider(minimum=-12, label="Número de semitonos, subir una octava: 12, bajar una octava: -12", value=0, maximum=12, step=1)
|
| 70 |
-
protect0 = gr.Slider(
|
| 71 |
-
minimum=0, maximum=0.5, label="Protejer las consonantes sordas y los sonidos respiratorios. 0.5 para desactivarlo.", value=0.33,
|
| 72 |
-
step=0.01,
|
| 73 |
-
interactive=True,
|
| 74 |
-
)
|
| 75 |
-
resample_sr1 = gr.Slider(
|
| 76 |
-
minimum=0,
|
| 77 |
-
maximum=48000,
|
| 78 |
-
label="Re-muestreo sobre el audio de salida hasta la frecuencia de muestreo final. 0 para no re-muestrear.",
|
| 79 |
-
value=0,
|
| 80 |
-
step=1,
|
| 81 |
-
interactive=True,
|
| 82 |
-
)
|
| 83 |
-
|
| 84 |
-
# Salida
|
| 85 |
-
with gr.Row():
|
| 86 |
-
vc_output1 = gr.Textbox(label="Salida")
|
| 87 |
-
vc_output2 = gr.Audio(label="Audio de salida")
|
| 88 |
-
|
| 89 |
-
btn = gr.Button(value="Convertir")
|
| 90 |
-
btn.click(infer, inputs=[model_url, f0_method, audio_path, index_rate, vc_transform0, protect0, resample_sr1, filter_radius1], outputs=[vc_output1, vc_output2])
|
| 91 |
-
|
| 92 |
-
with gr.TabItem("TTS"):
|
| 93 |
-
with gr.Row():
|
| 94 |
-
tts_text = gr.Textbox(
|
| 95 |
-
label="Texto:",
|
| 96 |
-
placeholder="Texto que deseas convertir a voz...",
|
| 97 |
-
lines=6,
|
| 98 |
-
)
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
with gr.Row():
|
| 105 |
-
tts_method = gr.Dropdown(choices=VOICE_METHODS, value="Edge-tts", label="Método TTS:", visible=True)
|
| 106 |
-
tts_model = gr.Dropdown(choices=EDGE_VOICES, label="Modelo TTS:", visible=True, interactive=True)
|
| 107 |
-
tts_api_key = gr.Textbox(label="ElevenLabs Api key", show_label=True, placeholder="4a4afce72349680c8e8b6fdcfaf2b65a",interactive=True, visible=False)
|
| 108 |
-
|
| 109 |
-
tts_coqui_languages = gr.Radio(
|
| 110 |
-
label="Language",
|
| 111 |
-
choices=COQUI_LANGUAGES,
|
| 112 |
-
value="en",
|
| 113 |
-
visible=False
|
| 114 |
-
)
|
| 115 |
-
|
| 116 |
-
tts_btn = gr.Button(value="Convertir")
|
| 117 |
-
|
| 118 |
-
with gr.Row():
|
| 119 |
-
tts_vc_output1 = gr.Textbox(label="Salida")
|
| 120 |
-
tts_vc_output2 = gr.Audio(label="Audio de salida")
|
| 121 |
-
|
| 122 |
-
tts_btn.click(fn=tts_infer, inputs=[tts_text, tts_model_url, tts_method, tts_model, tts_api_key, tts_coqui_languages], outputs=[tts_vc_output1, tts_vc_output2])
|
| 123 |
-
|
| 124 |
-
tts_msg = gr.Markdown("""**Recomiendo que te crees una cuenta de eleven labs y pongas tu clave de api, es gratis y tienes 10k caracteres de limite al mes.** <br/>
|
| 125 |
-

|
| 126 |
-
""", visible=False)
|
| 127 |
-
|
| 128 |
-
tts_method.change(fn=update_tts_methods_voice, inputs=[tts_method], outputs=[tts_model, tts_msg, tts_api_key, tts_coqui_languages])
|
| 129 |
-
|
| 130 |
-
with gr.TabItem("Youtube"):
|
| 131 |
-
gr.Markdown("## Convertir video de Youtube a audio")
|
| 132 |
-
with gr.Row():
|
| 133 |
-
yt_url = gr.Textbox(
|
| 134 |
-
label="Url del video:",
|
| 135 |
-
placeholder="https://www.youtube.com/watch?v=3vEiqil5d3Q"
|
| 136 |
-
)
|
| 137 |
-
yt_btn = gr.Button(value="Convertir")
|
| 138 |
-
|
| 139 |
-
with gr.Row():
|
| 140 |
-
yt_output1 = gr.Textbox(label="Salida")
|
| 141 |
-
yt_output2 = gr.Audio(label="Audio de salida")
|
| 142 |
-
|
| 143 |
-
yt_btn.click(fn=convert_yt_to_wav, inputs=[yt_url], outputs=[yt_output1, yt_output2])
|
| 144 |
-
|
| 145 |
-
# with gr.TabItem("Mejora de audio"):
|
| 146 |
-
# enhance_input_audio = gr.Audio(label="Audio de entrada")
|
| 147 |
-
# enhance_output_audio = gr.Audio(label="Audio de salida")
|
| 148 |
-
|
| 149 |
-
# btn_enhance_audio = gr.Button()
|
| 150 |
-
# # btn_enhance_audio.click(fn=audio_enhance, inputs=[enhance_input_audio], outputs=[enhance_output_audio])
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
with gr.Tab("Modelos"):
|
| 154 |
-
gr.HTML("<h4>Buscar modelos</h4>")
|
| 155 |
-
search_name = gr.Textbox(placeholder="Billie Eillish (RVC v2 - 100 epoch)", label="Nombre", show_label=True)
|
| 156 |
# Salida
|
| 157 |
with gr.Row():
|
| 158 |
-
sarch_output = gr.Markdown(label="
|
| 159 |
|
| 160 |
-
btn_search_model = gr.Button(value="
|
| 161 |
btn_search_model.click(fn=search_model, inputs=[search_name], outputs=[sarch_output])
|
| 162 |
|
| 163 |
-
gr.HTML("<
|
| 164 |
-
post_name = gr.Textbox(placeholder="
|
| 165 |
-
post_model_url = gr.Textbox(placeholder="https://huggingface.co/
|
| 166 |
-
post_creator = gr.Textbox(placeholder="
|
| 167 |
-
post_version = gr.Dropdown(choices=["RVC v1", "RVC v2"], value="RVC
|
| 168 |
|
| 169 |
# Salida
|
| 170 |
with gr.Row():
|
| 171 |
-
post_output = gr.Markdown(label="
|
| 172 |
|
| 173 |
-
btn_post_model = gr.Button(value="
|
| 174 |
btn_post_model.click(fn=post_model, inputs=[post_name, post_model_url, post_version, post_creator], outputs=[post_output])
|
| 175 |
|
| 176 |
# with gr.Column():
|
|
|
|
| 44 |
return str(e), None
|
| 45 |
|
| 46 |
with gr.Blocks() as app:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
with gr.Tab("模型搜索及上传"):
|
| 49 |
+
gr.HTML("<h3>搜索AI歌手模型</h3>")
|
| 50 |
+
search_name = gr.Textbox(placeholder="孙燕姿", label="请填写模型名称进行搜索", show_label=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
# Salida
|
| 52 |
with gr.Row():
|
| 53 |
+
sarch_output = gr.Markdown(label="搜索结果")
|
| 54 |
|
| 55 |
+
btn_search_model = gr.Button(value="开始搜索吧💖")
|
| 56 |
btn_search_model.click(fn=search_model, inputs=[search_name], outputs=[sarch_output])
|
| 57 |
|
| 58 |
+
gr.HTML("<h3>上传AI歌手模型至社区,上传完成后您立即可以搜索到您上传的模型</h3>")
|
| 59 |
+
post_name = gr.Textbox(placeholder="滔滔歌姬", label="请填写模型名称", show_label=True)
|
| 60 |
+
post_model_url = gr.Textbox(placeholder="https://huggingface.co/kevinwang676/RVC-models/resolve/main/talktalkgirl.zip", label="模型链接", info="1.推荐使用Hugging Face存放模型 2.复制Hugging Face模型链接后,需要将链接中的blob四个字母替换成resolve,使模型可以通过链接直接下载", show_label=True)
|
| 61 |
+
post_creator = gr.Textbox(placeholder="滔滔AI", label="模型贡献者", info="可填写您的昵称或任何有趣的ID", show_label=True)
|
| 62 |
+
post_version = gr.Dropdown(choices=["RVC v1", "RVC v2"], value="RVC v2", label="RVC模型版本", show_label=True)
|
| 63 |
|
| 64 |
# Salida
|
| 65 |
with gr.Row():
|
| 66 |
+
post_output = gr.Markdown(label="模型上传状态")
|
| 67 |
|
| 68 |
+
btn_post_model = gr.Button(value="开始上传吧💕")
|
| 69 |
btn_post_model.click(fn=post_model, inputs=[post_name, post_model_url, post_version, post_creator], outputs=[post_output])
|
| 70 |
|
| 71 |
# with gr.Column():
|