diff --git a/demos/streaming_asr_server/conf/ws_ds2_application.yaml b/demos/streaming_asr_server/conf/ws_ds2_application.yaml index f67d3157..a4e6e9a1 100644 --- a/demos/streaming_asr_server/conf/ws_ds2_application.yaml +++ b/demos/streaming_asr_server/conf/ws_ds2_application.yaml @@ -22,8 +22,8 @@ engine_list: ['asr_online-inference'] ################### speech task: asr; engine_type: online-inference ####################### asr_online-inference: model_type: 'deepspeech2online_aishell' - am_model: # the pdmodel file of am static model [optional] - am_params: # the pdiparams file of am static model [optional] + am_model: # the pdmodel file of am static model [optional] + am_params: # the pdiparams file of am static model [optional] lang: 'zh' sample_rate: 16000 cfg_path: @@ -54,7 +54,7 @@ asr_online-inference: ################### speech task: asr; engine_type: online-onnx ####################### asr_online-onnx: model_type: 'deepspeech2online_aishell' - am_model: # the pdmodel file of am static model [optional] + am_model: # the pdmodel file of onnx am static model [optional] am_params: # the pdiparams file of am static model [optional] lang: 'zh' sample_rate: 16000 diff --git a/paddlespeech/resource/resource.py b/paddlespeech/resource/resource.py index 2e637f0f..15112ba7 100644 --- a/paddlespeech/resource/resource.py +++ b/paddlespeech/resource/resource.py @@ -168,7 +168,6 @@ class CommonTaskResource: exec('from .pretrained_models import {}'.format(import_models)) models = OrderedDict(locals()[import_models]) except Exception as e: - print(e) models = OrderedDict({}) # no models. finally: return models diff --git a/paddlespeech/server/conf/ws_ds2_application.yaml b/paddlespeech/server/conf/ws_ds2_application.yaml index f0a98e72..430e6fd1 100644 --- a/paddlespeech/server/conf/ws_ds2_application.yaml +++ b/paddlespeech/server/conf/ws_ds2_application.yaml @@ -11,7 +11,7 @@ port: 8090 # protocol = ['websocket'] (only one can be selected). # websocket only support online engine type. protocol: 'websocket' -engine_list: ['asr_online-onnx'] +engine_list: ['asr_online-inference'] ################################################################################# @@ -22,8 +22,8 @@ engine_list: ['asr_online-onnx'] ################### speech task: asr; engine_type: online-inference ####################### asr_online-inference: model_type: 'deepspeech2online_aishell' - am_model: # the pdmodel file of am static model [optional] - am_params: # the pdiparams file of am static model [optional] + am_model: # the pdmodel file of am static model [optional] + am_params: # the pdiparams file of am static model [optional] lang: 'zh' sample_rate: 16000 cfg_path: @@ -54,7 +54,7 @@ asr_online-inference: ################### speech task: asr; engine_type: online-onnx ####################### asr_online-onnx: model_type: 'deepspeech2online_aishell' - am_model: # the pdmodel file of am static model [optional] + am_model: # the pdmodel file of onnx am static model [optional] am_params: # the pdiparams file of am static model [optional] lang: 'zh' sample_rate: 16000 @@ -81,4 +81,4 @@ asr_online-onnx: window_n: 7 # frame shift_n: 4 # frame window_ms: 20 # ms - shift_ms: 10 # ms + shift_ms: 10 # ms \ No newline at end of file diff --git a/paddlespeech/server/engine/asr/online/onnx/asr_engine.py b/paddlespeech/server/engine/asr/online/onnx/asr_engine.py index 97addc7a..aab29f78 100644 --- a/paddlespeech/server/engine/asr/online/onnx/asr_engine.py +++ b/paddlespeech/server/engine/asr/online/onnx/asr_engine.py @@ -331,6 +331,13 @@ class PaddleASRConnectionHanddler: else: return '' + def get_word_time_stamp(self): + return [] + + @paddle.no_grad() + def rescoring(self): + ... + class ASRServerExecutor(ASRExecutor): def __init__(self): @@ -409,17 +416,18 @@ class ASRServerExecutor(ASRExecutor): os.path.dirname(os.path.abspath(self.cfg_path))) self.am_model = os.path.join(self.res_path, self.task_resource.res_dict[ - 'model']) if am_model is None else os.path.abspath(am_model) - self.am_params = os.path.join( - self.res_path, self.task_resource.res_dict[ - 'params']) if am_params is None else os.path.abspath(am_params) + 'onnx_model']) if am_model is None else os.path.abspath(am_model) + + # self.am_params = os.path.join( + # self.res_path, self.task_resource.res_dict[ + # 'params']) if am_params is None else os.path.abspath(am_params) logger.info("Load the pretrained model:") logger.info(f" tag = {tag}") logger.info(f" res_path: {self.res_path}") logger.info(f" cfg path: {self.cfg_path}") logger.info(f" am_model path: {self.am_model}") - logger.info(f" am_params path: {self.am_params}") + # logger.info(f" am_params path: {self.am_params}") #Init body. self.config = CfgNode(new_allowed=True) diff --git a/paddlespeech/server/engine/asr/online/paddleinference/asr_engine.py b/paddlespeech/server/engine/asr/online/paddleinference/asr_engine.py index fb24cab9..b3b31a5a 100644 --- a/paddlespeech/server/engine/asr/online/paddleinference/asr_engine.py +++ b/paddlespeech/server/engine/asr/online/paddleinference/asr_engine.py @@ -345,6 +345,12 @@ class PaddleASRConnectionHanddler: else: return '' + def get_word_time_stamp(self): + return [] + + @paddle.no_grad() + def rescoring(self): + ... class ASRServerExecutor(ASRExecutor): def __init__(self):