提交 434708cf 编写于 作者: L lym0302

set device cpu, test=doc

上级 920b2c80
...@@ -5,4 +5,4 @@ cfg_path: # [optional] ...@@ -5,4 +5,4 @@ cfg_path: # [optional]
ckpt_path: # [optional] ckpt_path: # [optional]
decode_method: 'attention_rescoring' decode_method: 'attention_rescoring'
force_yes: True force_yes: True
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
...@@ -15,7 +15,7 @@ decode_method: ...@@ -15,7 +15,7 @@ decode_method:
force_yes: True force_yes: True
am_predictor_conf: am_predictor_conf:
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
enable_mkldnn: True enable_mkldnn: True
switch_ir_optim: True switch_ir_optim: True
......
...@@ -29,4 +29,4 @@ voc_stat: ...@@ -29,4 +29,4 @@ voc_stat:
# OTHERS # # OTHERS #
################################################################## ##################################################################
lang: 'zh' lang: 'zh'
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
...@@ -15,7 +15,7 @@ speaker_dict: ...@@ -15,7 +15,7 @@ speaker_dict:
spk_id: 0 spk_id: 0
am_predictor_conf: am_predictor_conf:
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
enable_mkldnn: False enable_mkldnn: False
switch_ir_optim: False switch_ir_optim: False
...@@ -30,7 +30,7 @@ voc_params: # the pdiparams file of your vocoder static model (XX.pdipparams) ...@@ -30,7 +30,7 @@ voc_params: # the pdiparams file of your vocoder static model (XX.pdipparams)
voc_sample_rate: 24000 voc_sample_rate: 24000
voc_predictor_conf: voc_predictor_conf:
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
enable_mkldnn: False enable_mkldnn: False
switch_ir_optim: False switch_ir_optim: False
......
...@@ -5,4 +5,4 @@ cfg_path: # [optional] ...@@ -5,4 +5,4 @@ cfg_path: # [optional]
ckpt_path: # [optional] ckpt_path: # [optional]
decode_method: 'attention_rescoring' decode_method: 'attention_rescoring'
force_yes: True force_yes: True
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
...@@ -15,7 +15,7 @@ decode_method: ...@@ -15,7 +15,7 @@ decode_method:
force_yes: True force_yes: True
am_predictor_conf: am_predictor_conf:
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
enable_mkldnn: True enable_mkldnn: True
switch_ir_optim: True switch_ir_optim: True
......
...@@ -29,4 +29,4 @@ voc_stat: ...@@ -29,4 +29,4 @@ voc_stat:
# OTHERS # # OTHERS #
################################################################## ##################################################################
lang: 'zh' lang: 'zh'
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
...@@ -15,7 +15,7 @@ speaker_dict: ...@@ -15,7 +15,7 @@ speaker_dict:
spk_id: 0 spk_id: 0
am_predictor_conf: am_predictor_conf:
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
enable_mkldnn: False enable_mkldnn: False
switch_ir_optim: False switch_ir_optim: False
...@@ -30,7 +30,7 @@ voc_params: # the pdiparams file of your vocoder static model (XX.pdipparams) ...@@ -30,7 +30,7 @@ voc_params: # the pdiparams file of your vocoder static model (XX.pdipparams)
voc_sample_rate: 24000 #must match the model voc_sample_rate: 24000 #must match the model
voc_predictor_conf: voc_predictor_conf:
device: 'gpu:3' # set 'gpu:id' or 'cpu' device: 'cpu' # set 'gpu:id' or 'cpu'
enable_mkldnn: False enable_mkldnn: False
switch_ir_optim: False switch_ir_optim: False
......
...@@ -53,6 +53,9 @@ class ASREngine(BaseEngine): ...@@ -53,6 +53,9 @@ class ASREngine(BaseEngine):
self.executor = ASRServerExecutor() self.executor = ASRServerExecutor()
self.config = get_config(config_file) self.config = get_config(config_file)
if self.config.device is None:
paddle.set_device(paddle.get_device())
else:
paddle.set_device(self.config.device) paddle.set_device(self.config.device)
self.executor._init_from_path( self.executor._init_from_path(
self.config.model, self.config.lang, self.config.sample_rate, self.config.model, self.config.lang, self.config.sample_rate,
......
...@@ -54,6 +54,9 @@ class TTSEngine(BaseEngine): ...@@ -54,6 +54,9 @@ class TTSEngine(BaseEngine):
try: try:
self.config = get_config(config_file) self.config = get_config(config_file)
if self.config.device is None:
paddle.set_device(paddle.get_device())
else:
paddle.set_device(self.config.device) paddle.set_device(self.config.device)
self.executor._init_from_path( self.executor._init_from_path(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册