mirror of
https://github.com/FunAudioLLM/CosyVoice.git
synced 2026-02-05 18:09:24 +08:00
fix cv3 train
This commit is contained in:
@@ -40,11 +40,10 @@ def main():
|
|||||||
with open('{}/spk2utt'.format(args.des_dir), 'w') as f:
|
with open('{}/spk2utt'.format(args.des_dir), 'w') as f:
|
||||||
for k, v in spk2utt.items():
|
for k, v in spk2utt.items():
|
||||||
f.write('{} {}\n'.format(k, ' '.join(v)))
|
f.write('{} {}\n'.format(k, ' '.join(v)))
|
||||||
if args.instruct is True:
|
if args.instruct != '':
|
||||||
with open('{}/instruct'.format(args.des_dir), 'w') as f:
|
with open('{}/instruct'.format(args.des_dir), 'w') as f:
|
||||||
for k, v in utt2text.items():
|
for k, v in utt2text.items():
|
||||||
# NOTE in CosyVoice3, we add instruct in sequence
|
f.write('{} {}\n'.format(k, args.instruct))
|
||||||
f.write('{} You are a helpful assistant.<|endofprompt|>\n'.format(k, v))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -55,8 +54,6 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument('--des_dir',
|
parser.add_argument('--des_dir',
|
||||||
type=str)
|
type=str)
|
||||||
parser.add_argument('--instruct',
|
parser.add_argument('--instruct',
|
||||||
action='store_true',
|
type=str)
|
||||||
default=False,
|
|
||||||
help='create instruct file or not')
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ stop_stage=3
|
|||||||
|
|
||||||
data_url=www.openslr.org/resources/60
|
data_url=www.openslr.org/resources/60
|
||||||
data_dir=/mnt/lyuxiang.lx/data/tts/openslr/libritts
|
data_dir=/mnt/lyuxiang.lx/data/tts/openslr/libritts
|
||||||
pretrained_model_dir=../../../pretrained_models/CosyVoice3-0.5B
|
pretrained_model_dir=../../../pretrained_models/Fun-CosyVoice3-0.5B
|
||||||
|
|
||||||
if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then
|
if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then
|
||||||
echo "Data Download"
|
echo "Data Download"
|
||||||
@@ -20,7 +20,8 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
|
|||||||
echo "Data preparation, prepare wav.scp/text/utt2spk/spk2utt"
|
echo "Data preparation, prepare wav.scp/text/utt2spk/spk2utt"
|
||||||
for x in train-clean-100 train-clean-360 train-other-500 dev-clean dev-other test-clean test-other; do
|
for x in train-clean-100 train-clean-360 train-other-500 dev-clean dev-other test-clean test-other; do
|
||||||
mkdir -p data/$x
|
mkdir -p data/$x
|
||||||
python local/prepare_data.py --src_dir $data_dir/LibriTTS/$x --des_dir data/$x --instruct
|
# NOTE in CosyVoice3, we add instruct in sequence
|
||||||
|
python local/prepare_data.py --src_dir $data_dir/LibriTTS/$x --des_dir data/$x --instruct "You are a helpful assistant.<|endofprompt|>"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user