提交 34ace673 编写于 作者: 走神的阿圆's avatar 走神的阿圆

Modify gunicorn bind 120.0.0.1 to 0.0.0.0.

上级 b9cbf49d
...@@ -156,7 +156,7 @@ class ServingCommand(BaseCommand): ...@@ -156,7 +156,7 @@ class ServingCommand(BaseCommand):
print("Port %s is occupied, please change it." % port) print("Port %s is occupied, please change it." % port)
return False return False
workers = configs.get("workers", number_of_workers()) workers = configs.get("workers", number_of_workers())
options = {"bind": "127.0.0.1:%s" % port, "workers": workers} options = {"bind": "0.0.0.0:%s" % port, "workers": workers}
StandaloneApplication( StandaloneApplication(
app.create_app(init_flag=False, configs=configs), options).run() app.create_app(init_flag=False, configs=configs), options).run()
print("PaddleHub-Serving has been stopped.") print("PaddleHub-Serving has been stopped.")
...@@ -196,7 +196,7 @@ class ServingCommand(BaseCommand): ...@@ -196,7 +196,7 @@ class ServingCommand(BaseCommand):
"queue_size": 20 "queue_size": 20
}) for item in module_info }) for item in module_info
] ]
options = {"bind": "127.0.0.1:%s" % port, "workers": workers} options = {"bind": "0.0.0.0:%s" % port, "workers": workers}
configs = {"use_gpu": use_gpu, "modules_info": module_info} configs = {"use_gpu": use_gpu, "modules_info": module_info}
StandaloneApplication( StandaloneApplication(
app.create_app(init_flag=False, configs=configs), app.create_app(init_flag=False, configs=configs),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册