mirror of
https://www.modelscope.cn/iic/speech_sambert-hifigan_tts_zh-cn_16k.git
synced 2026-04-02 18:32:53 +08:00
fix sample code
This commit is contained in:
15
README.md
15
README.md
@ -92,19 +92,16 @@ widgets:
|
|||||||
```Python
|
```Python
|
||||||
from scipy.io.wavfile import write
|
from scipy.io.wavfile import write
|
||||||
|
|
||||||
from modelscope.metainfo import Pipelines
|
from modelscope.outputs import OutputKeys
|
||||||
from modelscope.models import Model
|
|
||||||
from modelscope.pipelines import pipeline
|
from modelscope.pipelines import pipeline
|
||||||
from modelscope.pipelines.outputs import OutputKeys
|
from modelscope.utils.constant import Tasks
|
||||||
from modelscope.utils.constant import Tasks, Fields
|
|
||||||
|
|
||||||
text = '待合成文本'
|
text = '待合成文本'
|
||||||
voice = 'zhitian_emo'
|
model_id = 'damo/speech_sambert-hifigan_tts_zh-cn_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)
|
||||||
output = sambert_hifigan_tts(text, voice)
|
output = sambert_hifigan_tts(input=text)
|
||||||
# save to file output.wav
|
pcm = output[OutputKeys.OUTPUT_PCM]
|
||||||
write('output.wav', 16000, output[OutputKeys.OUTPUT_WAV])
|
write('output.wav', 16000, pcm)
|
||||||
```
|
```
|
||||||
|
|
||||||
### 模型局限性以及可能的偏差
|
### 模型局限性以及可能的偏差
|
||||||
|
|||||||
Reference in New Issue
Block a user