Skip to content

Commit eb4d5d0

Browse files
authored
Merge pull request #868 from FunAudioLLM/dev/lyuxiang.lx
move prompt wav to asset
2 parents 06e8661 + d450c32 commit eb4d5d0

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ cosyvoice = CosyVoice2('pretrained_models/CosyVoice2-0.5B', load_jit=False, load
132132

133133
# NOTE if you want to reproduce the results on https://funaudiollm.github.io/cosyvoice2, please add text_frontend=False during inference
134134
# zero_shot usage
135-
prompt_speech_16k = load_wav('zero_shot_prompt.wav', 16000)
135+
prompt_speech_16k = load_wav('./asset/zero_shot_prompt.wav', 16000)
136136
for i, j in enumerate(cosyvoice.inference_zero_shot('收到好友从远方寄来的生日礼物,那份意外的惊喜与深深的祝福让我心中充满了甜蜜的快乐,笑容如花儿般绽放。', '希望你以后能够做的比我还好呦。', prompt_speech_16k, stream=False)):
137137
torchaudio.save('zero_shot_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)
138138

@@ -156,16 +156,16 @@ for i, j in enumerate(cosyvoice.inference_sft('你好,我是通义生成式语
156156

157157
cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M') # or change to pretrained_models/CosyVoice-300M-25Hz for 25Hz inference
158158
# zero_shot usage, <|zh|><|en|><|jp|><|yue|><|ko|> for Chinese/English/Japanese/Cantonese/Korean
159-
prompt_speech_16k = load_wav('zero_shot_prompt.wav', 16000)
159+
prompt_speech_16k = load_wav('./asset/zero_shot_prompt.wav', 16000)
160160
for i, j in enumerate(cosyvoice.inference_zero_shot('收到好友从远方寄来的生日礼物,那份意外的惊喜与深深的祝福让我心中充满了甜蜜的快乐,笑容如花儿般绽放。', '希望你以后能够做的比我还好呦。', prompt_speech_16k, stream=False)):
161161
torchaudio.save('zero_shot_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)
162162
# cross_lingual usage
163-
prompt_speech_16k = load_wav('cross_lingual_prompt.wav', 16000)
163+
prompt_speech_16k = load_wav('./asset/cross_lingual_prompt.wav', 16000)
164164
for i, j in enumerate(cosyvoice.inference_cross_lingual('<|en|>And then later on, fully acquiring that company. So keeping management in line, interest in line with the asset that\'s coming into the family is a reason why sometimes we don\'t buy the whole thing.', prompt_speech_16k, stream=False)):
165165
torchaudio.save('cross_lingual_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)
166166
# vc usage
167-
prompt_speech_16k = load_wav('zero_shot_prompt.wav', 16000)
168-
source_speech_16k = load_wav('cross_lingual_prompt.wav', 16000)
167+
prompt_speech_16k = load_wav('./asset/zero_shot_prompt.wav', 16000)
168+
source_speech_16k = load_wav('./asset/cross_lingual_prompt.wav', 16000)
169169
for i, j in enumerate(cosyvoice.inference_vc(source_speech_16k, prompt_speech_16k, stream=False)):
170170
torchaudio.save('vc_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)
171171

File renamed without changes.
File renamed without changes.

runtime/python/fastapi/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def main():
7979
default='希望你以后能够做的比我还好呦。')
8080
parser.add_argument('--prompt_wav',
8181
type=str,
82-
default='../../../zero_shot_prompt.wav')
82+
default='../../../asset/zero_shot_prompt.wav')
8383
parser.add_argument('--instruct_text',
8484
type=str,
8585
default='Theo \'Crimson\', is a fiery, passionate rebel leader. \

runtime/python/grpc/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def main():
9393
default='希望你以后能够做的比我还好呦。')
9494
parser.add_argument('--prompt_wav',
9595
type=str,
96-
default='../../../zero_shot_prompt.wav')
96+
default='../../../asset/zero_shot_prompt.wav')
9797
parser.add_argument('--instruct_text',
9898
type=str,
9999
default='Theo \'Crimson\', is a fiery, passionate rebel leader. \

0 commit comments

Comments
 (0)