Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -149,6 +149,7 @@ def predict(
|
|
149 |
chunk_seconds: float = 0.5,
|
150 |
absolute_thresh: bool = False,
|
151 |
):
|
|
|
152 |
audio, _ = librosa.load(audio, sr=model.target_sample, duration=duration_limit)
|
153 |
audio = model.infer_silence(
|
154 |
audio.astype(np.float32),
|
@@ -165,6 +166,7 @@ def predict(
|
|
165 |
)
|
166 |
return model.target_sample, audio
|
167 |
|
|
|
168 |
def predict_song_from_yt(
|
169 |
ytid_or_url,
|
170 |
start,
|
@@ -180,6 +182,7 @@ def predict_song_from_yt(
|
|
180 |
chunk_seconds: float = 0.5,
|
181 |
absolute_thresh: bool = False,
|
182 |
):
|
|
|
183 |
end = min(start + duration_limit, end)
|
184 |
original_track_filepath = download_youtube_clip(
|
185 |
ytid_or_url,
|
@@ -208,6 +211,8 @@ def predict_song_from_yt(
|
|
208 |
full_song = inst_wav + np.expand_dims(cloned_vox, 1)
|
209 |
return (model.target_sample, full_song), (model.target_sample, cloned_vox)
|
210 |
|
|
|
|
|
211 |
description = f"""
|
212 |
<center>💡 - 如何使用此程序:在页面上方选择“从B站视频上传”模块,填写视频网址和视频起止时间后,点击“submit”按键即可!您还可以点击页面最下方的示例快速预览效果</center>
|
213 |
""".strip()
|
|
|
149 |
chunk_seconds: float = 0.5,
|
150 |
absolute_thresh: bool = False,
|
151 |
):
|
152 |
+
model = models[speaker]
|
153 |
audio, _ = librosa.load(audio, sr=model.target_sample, duration=duration_limit)
|
154 |
audio = model.infer_silence(
|
155 |
audio.astype(np.float32),
|
|
|
166 |
)
|
167 |
return model.target_sample, audio
|
168 |
|
169 |
+
|
170 |
def predict_song_from_yt(
|
171 |
ytid_or_url,
|
172 |
start,
|
|
|
182 |
chunk_seconds: float = 0.5,
|
183 |
absolute_thresh: bool = False,
|
184 |
):
|
185 |
+
model = models[speaker]
|
186 |
end = min(start + duration_limit, end)
|
187 |
original_track_filepath = download_youtube_clip(
|
188 |
ytid_or_url,
|
|
|
211 |
full_song = inst_wav + np.expand_dims(cloned_vox, 1)
|
212 |
return (model.target_sample, full_song), (model.target_sample, cloned_vox)
|
213 |
|
214 |
+
|
215 |
+
|
216 |
description = f"""
|
217 |
<center>💡 - 如何使用此程序:在页面上方选择“从B站视频上传”模块,填写视频网址和视频起止时间后,点击“submit”按键即可!您还可以点击页面最下方的示例快速预览效果</center>
|
218 |
""".strip()
|