kevinwang676 commited on
Commit
bc01a52
·
1 Parent(s): c48b863

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -66
app.py CHANGED
@@ -208,79 +208,27 @@ def predict_song_from_yt(
208
 
209
  description = f"""
210
 
211
- ## <center>🏞️ - 滔滔AI,为您提供全场景的AI声音服务(如AI拟声、AI歌手、AI变声等)</center>
212
 
213
- ### <center>🌟 - 滔滔AI合作音乐人:[一清清清](https://space.bilibili.com/22960772?spm_id_from=333.337.0.0);AI歌手,唱我想唱!</center>
214
 
215
- ### <center>🎡 - 更多精彩,尽在[滔滔AI](http://www.talktalkai.com);合作:talktalkai.kevin@gmail.com</center>
216
 
217
- <center>💡 - 如何使用此程序:在页面上方选择“从B站视频上传”模块,填写视频网址和视频起止时间后,点击“submit”按键即可!您还可以点击页面最下方的示例快速预览效果</center>
218
-
219
- <h1 align="center"><a href="http://www.talktalkai.com"><img src="https://y.qq.com/music/photo_new/T001R300x300M0000025Gr0r2OXvrn_2.jpg", alt="talktalkai" border="0" style="margin: 0 auto; height: 200px;" /></a> </h1>
220
-
221
-
222
- """.strip()
223
-
224
- article = """
225
- <p style='text-align: center'> 注意❗:请不要生成会对个人以及组织造成侵害的内容,此程序仅供科研、学习及个人娱乐使用。
226
- </p>
227
- <p style='text-align: center'> 🌊🎶🏞️ - 江水东流急,滔滔无尽声。 明·顾璘
228
- </p>
229
  """.strip()
230
 
231
 
232
- interface_mic = gr.Interface(
233
- predict,
234
- inputs=[
235
- gr.Dropdown(speakers, value=speakers[0], label="🎤AI歌手🎶 - 🌟一清清清🌟"),
236
- gr.Audio(type="filepath", source="microphone", label="请用麦克风上传您想转换的歌曲"),
237
- gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
238
- gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
239
- gr.Slider(0.0, 1.0, value=default_cluster_infer_ratio, step=0.1, label="聚类模型混合比例", info="0-1之间,0即不启用聚类。使用聚类模型能提升音色相似度,但会导致咬字下降 (如果使用,建议0.5左右)"),
240
- gr.Slider(0.0, 1.0, value=0.4, step=0.1, label="noise scale (建议保持不变)", visible=False),
241
- gr.Dropdown(
242
- choices=["crepe", "crepe-tiny", "parselmouth", "dio", "harvest"],
243
- value=default_f0_method,
244
- label="模型推理方法 (crepe推理效果最好)", visible=False
245
- ),
246
- ],
247
- outputs="audio",
248
- title="🌊💕🎶 - 滔滔AI+音乐:可从B站直接上传素材,无需分离背景音",
249
- description=description,
250
- article=article,
251
- )
252
- interface_file = gr.Interface(
253
- predict,
254
- inputs=[
255
- gr.Dropdown(speakers, value=speakers[0], label="🎤AI歌手🎶 - 🌟一清清清🌟"),
256
- gr.Audio(type="filepath", source="upload", label="请上传您想转换的歌曲 (仅人声部分)"),
257
- gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
258
- gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
259
- gr.Slider(0.0, 1.0, value=default_cluster_infer_ratio, step=0.1, label="聚类模型混合比例", info="0-1之间,0即不启用聚类。使用聚类模型能提升音色相似度,但会导致咬字下降 (如果使用,建议0.5左右)"),
260
- gr.Slider(0.0, 1.0, value=0.4, step=0.1, label="noise scale (建议保持不变)", visible=False),
261
- gr.Dropdown(
262
- choices=["crepe", "crepe-tiny", "parselmouth", "dio", "harvest"],
263
- value=default_f0_method,
264
- label="模型推理方法 (crepe推理效果最好)", visible=False
265
- ),
266
- ],
267
- outputs="audio",
268
- title="🌊💕🎶 - 滔滔AI+音乐:可从B站直接上传素材,无需分离背景音",
269
- description=description,
270
- article=article,
271
- )
272
  interface_yt = gr.Interface(
273
  predict_song_from_yt,
274
  inputs=[
275
  gr.Textbox(
276
- label="Bilibili网址", info="请填写含有您喜欢歌曲的Bilibili网址,可直接填写相应的BV号", value="https://www.bilibili.com/video/BV..."
277
  ),
278
- gr.Number(value=0, label="起始时间 ()"),
279
- gr.Number(value=15, label="结束时间 ()"),
280
- gr.Dropdown(speakers, value=speakers[0], label="🎤AI歌手🎶 - 🌟一清清清🌟"),
281
- gr.Slider(-12, 12, value=0, step=1, label="变调 (默认为0;有正负值,+2为升高两个key)"),
282
  gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
283
- gr.Slider(0.0, 1.0, value=default_cluster_infer_ratio, step=0.1, label="聚类模型混合比例", info="0-1之间,0即不启用聚类。使用聚类模型能提升音色相似度,但会导致咬字下降"),
284
  gr.Slider(0.0, 1.0, value=0.4, step=0.1, label="noise scale (建议保持不变)", visible=False),
285
  gr.Dropdown(
286
  choices=["crepe", "crepe-tiny", "parselmouth", "dio", "harvest"],
@@ -288,17 +236,17 @@ interface_yt = gr.Interface(
288
  label="模型推理方法 (crepe推理效果最好)", visible=False
289
  ),
290
  ],
291
- outputs=[gr.Audio(label="AI歌手+伴奏🎵"), gr.Audio(label="AI歌手人声部分🎤")],
292
- title="🌊💕🎶 - 滔滔AI+音乐:可从B站直接上传素材,无需分离背景音",
293
  description=description,
294
  article=article,
295
  examples=[
296
- ["https://www.bilibili.com/video/BV1ip4y1p7Pn", 87, 103, speakers[0], 0, False, default_cluster_infer_ratio, 0.4, default_f0_method],
297
  ],
298
  )
299
  interface = gr.TabbedInterface(
300
- [interface_yt, interface_mic, interface_file],
301
- ["📺 - 从B站视频上传 ⭐推荐⭐", "🎙️ - 从麦克风上传", "🎵 - 从文件上传"],
302
  )
303
 
304
 
 
208
 
209
  description = f"""
210
 
211
+ ## <center>🏞️ - TalkTalkAI - Generative AI Text to Speech & Singing Voice Cloning</center>
212
 
213
+ ### <center>🌟 - The singer who collaborates with TalkTalkAI[一清清清](https://space.bilibili.com/22960772?spm_id_from=333.337.0.0)</center>
214
 
215
+ ### <center>🤗 - Stay tuned. The best is yet to come. Contact us: talktalkai.kevin@gmail.com</center>
216
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  """.strip()
218
 
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  interface_yt = gr.Interface(
221
  predict_song_from_yt,
222
  inputs=[
223
  gr.Textbox(
224
+ label="YouTube URL or ID", info="A YouTube URL (or ID) to a song on YouTube you want to clone from"
225
  ),
226
+ gr.Number(value=0, label="Start Time (seconds)"),
227
+ gr.Number(value=15, label="End Time (seconds)"),
228
+ gr.Dropdown(speakers, value=speakers[0], label="🎤 AI Singer"),
229
+ gr.Slider(-12, 12, value=0, step=1, label="Transpose (Semitones)"),
230
  gr.Checkbox(False, label="是否开启自动f0预测", info="勾选即为开启;配合聚类模型f0预测效果更好,仅限语音转换时使用", visible=False),
231
+ gr.Slider(0.0, 1.0, value=default_cluster_infer_ratio, step=0.1, label="聚类模型混合比例", info="0-1之间,0即不启用聚类。使用聚类模型能提升音色相似度,但会导致咬字下降", visible=False),
232
  gr.Slider(0.0, 1.0, value=0.4, step=0.1, label="noise scale (建议保持不变)", visible=False),
233
  gr.Dropdown(
234
  choices=["crepe", "crepe-tiny", "parselmouth", "dio", "harvest"],
 
236
  label="模型推理方法 (crepe推理效果最好)", visible=False
237
  ),
238
  ],
239
+ outputs=[gr.Audio(label="With BGM🎵"), gr.Audio(label="Without BGM🎤")],
240
+ title="🌊💕🎶 - TalkTalkAI",
241
  description=description,
242
  article=article,
243
  examples=[
244
+ ["https://www.youtube.com/watch?v=cn4M-fH08XY", 0, 11, speakers[0], 0, False, default_cluster_infer_ratio, 0.4, default_f0_method],
245
  ],
246
  )
247
  interface = gr.TabbedInterface(
248
+ [interface_yt],
249
+ ["📺 - Clone Song From YouTube],
250
  )
251
 
252