From 7e25315a4f8e9dc5aa3c8162fa176fb2d2be19cc Mon Sep 17 00:00:00 2001
From: 嘉渊 <wangjiaming.wjm@alibaba-inc.com>
Date: 星期一, 24 四月 2023 11:32:51 +0800
Subject: [PATCH] update
---
funasr/tasks/asr.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/funasr/tasks/asr.py b/funasr/tasks/asr.py
index 13898a6..e151473 100644
--- a/funasr/tasks/asr.py
+++ b/funasr/tasks/asr.py
@@ -125,7 +125,7 @@
bicif_paraformer=BiCifParaformer,
contextual_paraformer=ContextualParaformer,
mfcca=MFCCA,
- timestamp_predictor=TimestampPredictor,
+ timestamp_prediction=TimestampPredictor,
),
type_check=AbsESPnetModel,
default="asr",
@@ -826,7 +826,7 @@
if "model.ckpt-" in model_name or ".bin" in model_name:
model_name_pth = os.path.join(model_dir, model_name.replace('.bin',
'.pb')) if ".bin" in model_name else os.path.join(
- model_dir, "{}.pth".format(model_name))
+ model_dir, "{}.pb".format(model_name))
if os.path.exists(model_name_pth):
logging.info("model_file is load from pth: {}".format(model_name_pth))
model_dict = torch.load(model_name_pth, map_location=device)
@@ -1073,7 +1073,7 @@
if "model.ckpt-" in model_name or ".bin" in model_name:
model_name_pth = os.path.join(model_dir, model_name.replace('.bin',
'.pb')) if ".bin" in model_name else os.path.join(
- model_dir, "{}.pth".format(model_name))
+ model_dir, "{}.pb".format(model_name))
if os.path.exists(model_name_pth):
logging.info("model_file is load from pth: {}".format(model_name_pth))
model_dict = torch.load(model_name_pth, map_location=device)
@@ -1278,8 +1278,6 @@
token_list = list(args.token_list)
else:
raise RuntimeError("token_list must be str or list")
- vocab_size = len(token_list)
- logging.info(f"Vocabulary size: {vocab_size}")
# 1. frontend
if args.input_size is None:
@@ -1316,6 +1314,7 @@
frontend=frontend,
encoder=encoder,
predictor=predictor,
+ token_list=token_list,
**args.model_conf,
)
@@ -1331,4 +1330,4 @@
cls, train: bool = True, inference: bool = False
) -> Tuple[str, ...]:
retval = ("speech", "text")
- return retval
\ No newline at end of file
+ return retval
--
Gitblit v1.9.1