mirror of
https://www.modelscope.cn/iic/speech_sambert-hifigan_tts_zh-cn_16k.git
synced 2026-04-03 02:42:54 +08:00
fix sample code bugs
This commit is contained in:
@ -98,16 +98,13 @@ from modelscope.pipelines import pipeline
|
|||||||
from modelscope.pipelines.outputs import OutputKeys
|
from modelscope.pipelines.outputs import OutputKeys
|
||||||
from modelscope.utils.constant import Tasks, Fields
|
from modelscope.utils.constant import Tasks, Fields
|
||||||
|
|
||||||
single_test_case_label = 'test_case_label_0'
|
|
||||||
text = '待合成文本'
|
text = '待合成文本'
|
||||||
voice = 'zhitian_emo'
|
voice = 'zhitian_emo'
|
||||||
model_id = 'damo\speech_sambert-hifigan_tts_zhcn_16k'
|
model_id = 'damo\speech_sambert-hifigan_tts_zh-cn_16k'
|
||||||
sambert_hifigan_tts = pipeline(task=Tasks.text_to_speech, model=model_id)
|
sambert_hifigan_tts = pipeline(task=Tasks.text_to_speech, model=model_id)
|
||||||
test_cases = {single_test_case_label: text}
|
output = sambert_hifigan_tts(text, voice)
|
||||||
test_cases['voice'] = voice
|
|
||||||
output = sambert_tts(test_cases)
|
|
||||||
# save to file output.wav
|
# save to file output.wav
|
||||||
write('output.wav', 16000, output[OutputKeys.OUTPUT_WAV][single_test_case_label])
|
write('output.wav', 16000, output[OutputKeys.OUTPUT_WAV])
|
||||||
```
|
```
|
||||||
|
|
||||||
### 模型局限性以及可能的偏差
|
### 模型局限性以及可能的偏差
|
||||||
|
|||||||
Reference in New Issue
Block a user