积极的屁孩
commited on
Commit
·
6ac7b96
1
Parent(s):
5dab72b
add space gpu
Browse files
app.py
CHANGED
@@ -10,6 +10,9 @@ import numpy as np
|
|
10 |
from huggingface_hub import snapshot_download, hf_hub_download
|
11 |
import subprocess
|
12 |
import re
|
|
|
|
|
|
|
13 |
|
14 |
def install_espeak():
|
15 |
"""检测并安装espeak-ng依赖"""
|
@@ -350,6 +353,7 @@ def get_pipeline(pipeline_type):
|
|
350 |
return inference_pipeline
|
351 |
|
352 |
# 实现VEVO功能函数
|
|
|
353 |
def vevo_style(content_wav, style_wav):
|
354 |
temp_content_path = "wav/temp_content.wav"
|
355 |
temp_style_path = "wav/temp_style.wav"
|
@@ -432,6 +436,7 @@ def vevo_style(content_wav, style_wav):
|
|
432 |
traceback.print_exc()
|
433 |
raise e
|
434 |
|
|
|
435 |
def vevo_timbre(content_wav, reference_wav):
|
436 |
temp_content_path = "wav/temp_content.wav"
|
437 |
temp_reference_path = "wav/temp_reference.wav"
|
@@ -525,6 +530,7 @@ def vevo_timbre(content_wav, reference_wav):
|
|
525 |
traceback.print_exc()
|
526 |
raise e
|
527 |
|
|
|
528 |
def vevo_voice(content_wav, style_reference_wav, timbre_reference_wav):
|
529 |
temp_content_path = "wav/temp_content.wav"
|
530 |
temp_style_path = "wav/temp_style.wav"
|
@@ -646,6 +652,7 @@ def vevo_voice(content_wav, style_reference_wav, timbre_reference_wav):
|
|
646 |
traceback.print_exc()
|
647 |
raise e
|
648 |
|
|
|
649 |
def vevo_tts(text, ref_wav, timbre_ref_wav=None, style_ref_text=None, src_language="en", ref_language="en", style_ref_text_language="en"):
|
650 |
temp_ref_path = "wav/temp_ref.wav"
|
651 |
temp_timbre_path = "wav/temp_timbre.wav"
|
|
|
10 |
from huggingface_hub import snapshot_download, hf_hub_download
|
11 |
import subprocess
|
12 |
import re
|
13 |
+
# 添加Huggingface spaces导入
|
14 |
+
from huggingface_hub.spaces import Space
|
15 |
+
import spaces
|
16 |
|
17 |
def install_espeak():
|
18 |
"""检测并安装espeak-ng依赖"""
|
|
|
353 |
return inference_pipeline
|
354 |
|
355 |
# 实现VEVO功能函数
|
356 |
+
@spaces.GPU
|
357 |
def vevo_style(content_wav, style_wav):
|
358 |
temp_content_path = "wav/temp_content.wav"
|
359 |
temp_style_path = "wav/temp_style.wav"
|
|
|
436 |
traceback.print_exc()
|
437 |
raise e
|
438 |
|
439 |
+
@spaces.GPU
|
440 |
def vevo_timbre(content_wav, reference_wav):
|
441 |
temp_content_path = "wav/temp_content.wav"
|
442 |
temp_reference_path = "wav/temp_reference.wav"
|
|
|
530 |
traceback.print_exc()
|
531 |
raise e
|
532 |
|
533 |
+
@spaces.GPU
|
534 |
def vevo_voice(content_wav, style_reference_wav, timbre_reference_wav):
|
535 |
temp_content_path = "wav/temp_content.wav"
|
536 |
temp_style_path = "wav/temp_style.wav"
|
|
|
652 |
traceback.print_exc()
|
653 |
raise e
|
654 |
|
655 |
+
@spaces.GPU
|
656 |
def vevo_tts(text, ref_wav, timbre_ref_wav=None, style_ref_text=None, src_language="en", ref_language="en", style_ref_text_language="en"):
|
657 |
temp_ref_path = "wav/temp_ref.wav"
|
658 |
temp_timbre_path = "wav/temp_timbre.wav"
|