set device cpu, test=doc

pull/1482/head
lym0302 3 years ago
parent 920b2c808c
commit 434708cff4

@ -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:
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:
# 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:
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)
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]
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:
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:
# 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:
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)
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):
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):
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(

Loading…
Cancel
Save