unknown commited on
Commit
2eae16b
·
1 Parent(s): 0de2e53

Do not overwrite the vocab if it already exists !

Browse files
src/f5_tts/train/finetune_gradio.py CHANGED
@@ -564,10 +564,11 @@ def create_metadata(name_project, ch_tokenizer, progress=gr.Progress()):
564
 
565
  new_vocal = ""
566
  if not ch_tokenizer:
567
- file_vocab_finetune = os.path.join(path_data, "Emilia_ZH_EN_pinyin/vocab.txt")
568
- if not os.path.isfile(file_vocab_finetune):
569
- return "Error: Vocabulary file 'Emilia_ZH_EN_pinyin' not found!", ""
570
- shutil.copy2(file_vocab_finetune, file_vocab)
 
571
 
572
  with open(file_vocab, "r", encoding="utf-8-sig") as f:
573
  vocab_char_map = {}
 
564
 
565
  new_vocal = ""
566
  if not ch_tokenizer:
567
+ if not os.path.isfile(file_vocab):
568
+ file_vocab_finetune = os.path.join(path_data, "Emilia_ZH_EN_pinyin/vocab.txt")
569
+ if not os.path.isfile(file_vocab_finetune):
570
+ return "Error: Vocabulary file 'Emilia_ZH_EN_pinyin' not found!", ""
571
+ shutil.copy2(file_vocab_finetune, file_vocab)
572
 
573
  with open(file_vocab, "r", encoding="utf-8-sig") as f:
574
  vocab_char_map = {}