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

set device cpu, test=doc

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