Commit 8196f3c7 authored by zhougaofeng's avatar zhougaofeng
Browse files

Update pdf_server.py

parent fe5d6a3e
...@@ -65,8 +65,10 @@ def ocr_pdf_serve(args: str): ...@@ -65,8 +65,10 @@ def ocr_pdf_serve(args: str):
os.environ["CUDA_VISIBLE_DEVICES"] = args.dcu_id os.environ["CUDA_VISIBLE_DEVICES"] = args.dcu_id
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read(args.config_path) config.read(args.config_path)
host = config.get('server', 'pdf_host') # host = config.get('server', 'pdf_host')
port = int(config.get('server', 'pdf_port')) # port = int(config.get('server', 'pdf_port'))
pdf_server = config.get('server', 'pdf_server').split('://')[1]
host, port = pdf_server.split(':')[0], int(pdf_server.split(':')[1])
global config_path global config_path
config_path = args.config_path config_path = args.config_path
uvicorn.run(app, host=host, port=port) uvicorn.run(app, host=host, port=port)
......
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