SWivid commited on
Commit
041c339
·
1 Parent(s): 0022231

fix vocab path for pip pkg infer

Browse files
Files changed (1) hide show
  1. src/f5_tts/infer/utils_infer.py +3 -4
src/f5_tts/infer/utils_infer.py CHANGED
@@ -4,6 +4,7 @@
4
  import hashlib
5
  import re
6
  import tempfile
 
7
 
8
  import matplotlib
9
 
@@ -147,10 +148,8 @@ def load_checkpoint(model, ckpt_path, device, use_ema=True):
147
 
148
  def load_model(model_cls, model_cfg, ckpt_path, vocab_file="", ode_method=ode_method, use_ema=True, device=device):
149
  if vocab_file == "":
150
- vocab_file = "Emilia_ZH_EN"
151
- tokenizer = "pinyin"
152
- else:
153
- tokenizer = "custom"
154
 
155
  print("\nvocab : ", vocab_file)
156
  print("tokenizer : ", tokenizer)
 
4
  import hashlib
5
  import re
6
  import tempfile
7
+ from importlib.resources import files
8
 
9
  import matplotlib
10
 
 
148
 
149
  def load_model(model_cls, model_cfg, ckpt_path, vocab_file="", ode_method=ode_method, use_ema=True, device=device):
150
  if vocab_file == "":
151
+ vocab_file = str(files("f5_tts").joinpath("infer/examples/vocab.txt"))
152
+ tokenizer = "custom"
 
 
153
 
154
  print("\nvocab : ", vocab_file)
155
  print("tokenizer : ", tokenizer)