fix cv3 train

This commit is contained in:
lyuxiang.lx
2025-12-26 10:16:58 +00:00
parent a14e063ead
commit 8524c81acd
2 changed files with 6 additions and 8 deletions

View File

@@ -40,11 +40,10 @@ def main():
with open('{}/spk2utt'.format(args.des_dir), 'w') as f:
for k, v in spk2utt.items():
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:
for k, v in utt2text.items():
# NOTE in CosyVoice3, we add instruct in sequence
f.write('{} You are a helpful assistant.<|endofprompt|>\n'.format(k, v))
f.write('{} {}\n'.format(k, args.instruct))
return
@@ -55,8 +54,6 @@ if __name__ == "__main__":
parser.add_argument('--des_dir',
type=str)
parser.add_argument('--instruct',
action='store_true',
default=False,
help='create instruct file or not')
type=str)
args = parser.parse_args()
main()