HoneyTian commited on
Commit
f9690b9
1 Parent(s): 18f3a11
Files changed (2) hide show
  1. main.py +1 -0
  2. toolbox/k2_sherpa/nn_models.py +2 -0
main.py CHANGED
@@ -153,6 +153,7 @@ def process(
153
  local_model_dir = pretrained_model_dir / "huggingface" / md5_encrypt("csukuangfj/sherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12")
154
  punctuation_model = nn_models.load_punctuation_model(
155
  local_model_dir=local_model_dir,
 
156
  nn_model_file="model.onnx",
157
  nn_model_file_sub_folder=".",
158
  )
 
153
  local_model_dir = pretrained_model_dir / "huggingface" / md5_encrypt("csukuangfj/sherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12")
154
  punctuation_model = nn_models.load_punctuation_model(
155
  local_model_dir=local_model_dir,
156
+ repo_id="csukuangfj/sherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12",
157
  nn_model_file="model.onnx",
158
  nn_model_file_sub_folder=".",
159
  )
toolbox/k2_sherpa/nn_models.py CHANGED
@@ -842,12 +842,14 @@ def load_recognizer(local_model_dir: Path,
842
 
843
  @lru_cache(maxsize=15)
844
  def load_punctuation_model(local_model_dir: Path,
 
845
  nn_model_file: str,
846
  nn_model_file_sub_folder: str,
847
  ):
848
  if not local_model_dir.exists():
849
  download_model(
850
  local_model_dir=local_model_dir.as_posix(),
 
851
  nn_model_file=nn_model_file,
852
  nn_model_file_sub_folder=nn_model_file_sub_folder,
853
  )
 
842
 
843
  @lru_cache(maxsize=15)
844
  def load_punctuation_model(local_model_dir: Path,
845
+ repo_id: str,
846
  nn_model_file: str,
847
  nn_model_file_sub_folder: str,
848
  ):
849
  if not local_model_dir.exists():
850
  download_model(
851
  local_model_dir=local_model_dir.as_posix(),
852
+ repo_id=repo_id,
853
  nn_model_file=nn_model_file,
854
  nn_model_file_sub_folder=nn_model_file_sub_folder,
855
  )