SWivid commited on
Commit
ef091c4
·
1 Parent(s): 2669893

v1.0.4 fix finetune_gradio.py vocab extend with .safetensors ckpt

Browse files
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
 
5
  [project]
6
  name = "f5-tts"
7
- version = "1.0.3"
8
  description = "F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching"
9
  readme = "README.md"
10
  license = {text = "MIT License"}
 
4
 
5
  [project]
6
  name = "f5-tts"
7
+ version = "1.0.4"
8
  description = "F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching"
9
  readme = "README.md"
10
  license = {text = "MIT License"}
src/f5_tts/train/finetune_gradio.py CHANGED
@@ -1013,7 +1013,10 @@ def expand_model_embeddings(ckpt_path, new_ckpt_path, num_new_tokens=42):
1013
 
1014
  ema_sd[embed_key_ema] = expand_embeddings(ema_sd[embed_key_ema])
1015
 
1016
- torch.save(ckpt, new_ckpt_path)
 
 
 
1017
 
1018
  return vocab_new
1019
 
 
1013
 
1014
  ema_sd[embed_key_ema] = expand_embeddings(ema_sd[embed_key_ema])
1015
 
1016
+ if new_ckpt_path.endswith(".safetensors"):
1017
+ save_file(ema_sd, new_ckpt_path)
1018
+ elif new_ckpt_path.endswith(".pt"):
1019
+ torch.save(ckpt, new_ckpt_path)
1020
 
1021
  return vocab_new
1022