Spaces:
Running
on
Zero
Running
on
Zero
Update webui.py
Browse files
webui.py
CHANGED
@@ -39,7 +39,6 @@ instruct_dict = {'预训练音色': '1. 选择预训练音色\n2. 点击生成
|
|
39 |
stream_mode_list = [('否', False), ('是', True)]
|
40 |
max_val = 0.8
|
41 |
|
42 |
-
@spaces.GPU
|
43 |
def generate_seed():
|
44 |
seed = random.randint(1, 100000000)
|
45 |
return {
|
@@ -47,7 +46,6 @@ def generate_seed():
|
|
47 |
"value": seed
|
48 |
}
|
49 |
|
50 |
-
@spaces.GPU
|
51 |
def postprocess(speech, top_db=60, hop_length=220, win_length=440):
|
52 |
speech, _ = librosa.effects.trim(
|
53 |
speech, top_db=top_db,
|
@@ -59,7 +57,6 @@ def postprocess(speech, top_db=60, hop_length=220, win_length=440):
|
|
59 |
speech = torch.concat([speech, torch.zeros(1, int(target_sr * 0.2))], dim=1)
|
60 |
return speech
|
61 |
|
62 |
-
@spaces.GPU
|
63 |
def change_instruction(mode_checkbox_group):
|
64 |
return instruct_dict[mode_checkbox_group]
|
65 |
|
@@ -177,7 +174,6 @@ def get_cosyvoice():
|
|
177 |
cosyvoice_instance=CosyVoice(model_dir)
|
178 |
return cosyvoice_instance
|
179 |
|
180 |
-
@spaces.GPU
|
181 |
def load_sft_options():
|
182 |
sound_choices=get_cosyvoice().list_avaliable_spks()
|
183 |
sound_choices_tuples = [(choice, choice) for choice in sound_choices]
|
|
|
39 |
stream_mode_list = [('否', False), ('是', True)]
|
40 |
max_val = 0.8
|
41 |
|
|
|
42 |
def generate_seed():
|
43 |
seed = random.randint(1, 100000000)
|
44 |
return {
|
|
|
46 |
"value": seed
|
47 |
}
|
48 |
|
|
|
49 |
def postprocess(speech, top_db=60, hop_length=220, win_length=440):
|
50 |
speech, _ = librosa.effects.trim(
|
51 |
speech, top_db=top_db,
|
|
|
57 |
speech = torch.concat([speech, torch.zeros(1, int(target_sr * 0.2))], dim=1)
|
58 |
return speech
|
59 |
|
|
|
60 |
def change_instruction(mode_checkbox_group):
|
61 |
return instruct_dict[mode_checkbox_group]
|
62 |
|
|
|
174 |
cosyvoice_instance=CosyVoice(model_dir)
|
175 |
return cosyvoice_instance
|
176 |
|
|
|
177 |
def load_sft_options():
|
178 |
sound_choices=get_cosyvoice().list_avaliable_spks()
|
179 |
sound_choices_tuples = [(choice, choice) for choice in sound_choices]
|