zhzluke96
commited on
Commit
•
ba0472f
1
Parent(s):
503e823
update
Browse files
modules/utils/hf.py
CHANGED
@@ -10,8 +10,11 @@ except:
|
|
10 |
def __init__(self):
|
11 |
pass
|
12 |
|
13 |
-
def GPU(self,
|
14 |
-
|
|
|
|
|
|
|
15 |
|
16 |
spaces = NoneSpaces()
|
17 |
is_spaces_env = False
|
|
|
10 |
def __init__(self):
|
11 |
pass
|
12 |
|
13 |
+
def GPU(self, *args, **kwargs):
|
14 |
+
def _GPU(func):
|
15 |
+
return func
|
16 |
+
|
17 |
+
return _GPU
|
18 |
|
19 |
spaces = NoneSpaces()
|
20 |
is_spaces_env = False
|
modules/webui/speaker/speaker_creator.py
CHANGED
@@ -54,7 +54,7 @@ names_list = [
|
|
54 |
|
55 |
|
56 |
@torch.inference_mode()
|
57 |
-
@spaces.GPU
|
58 |
def create_spk_from_seed(
|
59 |
seed: int,
|
60 |
name: str,
|
@@ -75,7 +75,7 @@ def create_spk_from_seed(
|
|
75 |
|
76 |
|
77 |
@torch.inference_mode()
|
78 |
-
@spaces.GPU
|
79 |
def test_spk_voice(seed: int, text: str):
|
80 |
return tts_generate(
|
81 |
spk=seed,
|
|
|
54 |
|
55 |
|
56 |
@torch.inference_mode()
|
57 |
+
@spaces.GPU(duration=120)
|
58 |
def create_spk_from_seed(
|
59 |
seed: int,
|
60 |
name: str,
|
|
|
75 |
|
76 |
|
77 |
@torch.inference_mode()
|
78 |
+
@spaces.GPU(duration=120)
|
79 |
def test_spk_voice(seed: int, text: str):
|
80 |
return tts_generate(
|
81 |
spk=seed,
|
modules/webui/speaker/speaker_editor.py
CHANGED
@@ -9,7 +9,7 @@ import tempfile
|
|
9 |
|
10 |
|
11 |
@torch.inference_mode()
|
12 |
-
@spaces.GPU
|
13 |
def test_spk_voice(spk_file, text: str):
|
14 |
if spk_file == "" or spk_file is None:
|
15 |
return None
|
|
|
9 |
|
10 |
|
11 |
@torch.inference_mode()
|
12 |
+
@spaces.GPU(duration=120)
|
13 |
def test_spk_voice(spk_file, text: str):
|
14 |
if spk_file == "" or spk_file is None:
|
15 |
return None
|
modules/webui/speaker/speaker_merger.py
CHANGED
@@ -75,7 +75,7 @@ def merge_spk(
|
|
75 |
|
76 |
|
77 |
@torch.inference_mode()
|
78 |
-
@spaces.GPU
|
79 |
def merge_and_test_spk_voice(
|
80 |
spk_a, spk_a_w, spk_b, spk_b_w, spk_c, spk_c_w, spk_d, spk_d_w, test_text
|
81 |
):
|
@@ -96,7 +96,7 @@ def merge_and_test_spk_voice(
|
|
96 |
|
97 |
|
98 |
@torch.inference_mode()
|
99 |
-
@spaces.GPU
|
100 |
def merge_spk_to_file(
|
101 |
spk_a,
|
102 |
spk_a_w,
|
|
|
75 |
|
76 |
|
77 |
@torch.inference_mode()
|
78 |
+
@spaces.GPU(duration=120)
|
79 |
def merge_and_test_spk_voice(
|
80 |
spk_a, spk_a_w, spk_b, spk_b_w, spk_c, spk_c_w, spk_d, spk_d_w, test_text
|
81 |
):
|
|
|
96 |
|
97 |
|
98 |
@torch.inference_mode()
|
99 |
+
@spaces.GPU(duration=120)
|
100 |
def merge_spk_to_file(
|
101 |
spk_a,
|
102 |
spk_a_w,
|
modules/webui/ssml/podcast_tab.py
CHANGED
@@ -9,7 +9,7 @@ from modules.utils.hf import spaces
|
|
9 |
|
10 |
# NOTE: 因为 text_normalize 需要使用 tokenizer
|
11 |
@torch.inference_mode()
|
12 |
-
@spaces.GPU
|
13 |
def merge_dataframe_to_ssml(msg, spk, style, df: pd.DataFrame):
|
14 |
ssml = ""
|
15 |
indent = " " * 2
|
|
|
9 |
|
10 |
# NOTE: 因为 text_normalize 需要使用 tokenizer
|
11 |
@torch.inference_mode()
|
12 |
+
@spaces.GPU(duration=120)
|
13 |
def merge_dataframe_to_ssml(msg, spk, style, df: pd.DataFrame):
|
14 |
ssml = ""
|
15 |
indent = " " * 2
|
modules/webui/ssml/spliter_tab.py
CHANGED
@@ -12,7 +12,7 @@ from modules.utils.hf import spaces
|
|
12 |
|
13 |
# NOTE: 因为 text_normalize 需要使用 tokenizer
|
14 |
@torch.inference_mode()
|
15 |
-
@spaces.GPU
|
16 |
def merge_dataframe_to_ssml(dataframe, spk, style, seed):
|
17 |
if style == "*auto":
|
18 |
style = None
|
|
|
12 |
|
13 |
# NOTE: 因为 text_normalize 需要使用 tokenizer
|
14 |
@torch.inference_mode()
|
15 |
+
@spaces.GPU(duration=120)
|
16 |
def merge_dataframe_to_ssml(dataframe, spk, style, seed):
|
17 |
if style == "*auto":
|
18 |
style = None
|