Browse Source

fastapi服务启动限制ip从127.0.0.1改为0.0.0.0,这样docker映射端口才可以使用

zhoupc 1 year ago
parent
commit
7a2014bee3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      runtime/python/fastapi/server.py

+ 1 - 1
runtime/python/fastapi/server.py

@@ -80,4 +80,4 @@ if __name__ == '__main__':
                         help='local path or modelscope repo id')
     args = parser.parse_args()
     cosyvoice = CosyVoice(args.model_dir)
-    uvicorn.run(app, host="127.0.0.1", port=args.port)
+    uvicorn.run(app, host="0.0.0.0", port=args.port)