Commit 7a846eee authored by zhougaofeng's avatar zhougaofeng
Browse files

Update ocr_server.py

parent f34540d6
......@@ -57,7 +57,7 @@ def _load_model_processor(args):
else:
if args.dcu_id is not None:
device_map = {'': f'cuda:{args.dcu_id}'}
os.environ['CUDA_VISIBLE_DEVICES'] = args.dcu_id
print('使用DCU推理:', f'cuda:{args.dcu_id}')
else:
device_map = 'auto'
......@@ -261,6 +261,7 @@ if __name__ == "__main__":
args = _get_args()
config = configparser.ConfigParser()
config.read(args.config_path)
os.environ['CUDA_VISIBLE_DEVICES'] = args.dcu_id
# host = config.get('server', 'ocr_host')
host, port = config.get('server', 'ocr_server').split('://')[1].split(':')[0], int(
config.get('server', 'ocr_server').split('://')[1].split(':')[1])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment