csukuangfj commited on
Commit
0ea07f8
1 Parent(s): 0d21a7d

small fixes

Browse files
Files changed (1) hide show
  1. model.py +5 -1
model.py CHANGED
@@ -115,12 +115,16 @@ def _get_vits_ljs(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
115
 
116
  @lru_cache(maxsize=10)
117
  def _get_vits_piper(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
 
118
  if "coqui" in repo_id:
119
  name = "model"
120
  else:
121
  n = len("vits-piper-")
122
  name = repo_id.split("/")[1][n:]
123
 
 
 
 
124
  model = get_file(
125
  repo_id=repo_id,
126
  filename=f"{name}.onnx",
@@ -138,7 +142,7 @@ def _get_vits_piper(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
138
  vits=sherpa_onnx.OfflineTtsVitsModelConfig(
139
  model=model,
140
  lexicon="",
141
- data_dir="/tmp/espeak-ng-data",
142
  tokens=tokens,
143
  length_scale=1.0 / speed,
144
  ),
 
115
 
116
  @lru_cache(maxsize=10)
117
  def _get_vits_piper(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
118
+ data_dir = "/tmp/espeak-ng-data"
119
  if "coqui" in repo_id:
120
  name = "model"
121
  else:
122
  n = len("vits-piper-")
123
  name = repo_id.split("/")[1][n:]
124
 
125
+ if "vits-coqui-uk-mai" in repo_id:
126
+ data_dir = ""
127
+
128
  model = get_file(
129
  repo_id=repo_id,
130
  filename=f"{name}.onnx",
 
142
  vits=sherpa_onnx.OfflineTtsVitsModelConfig(
143
  model=model,
144
  lexicon="",
145
+ data_dir=data_dir,
146
  tokens=tokens,
147
  length_scale=1.0 / speed,
148
  ),