From b1983832ebea4aa30e28d04ce850aa0cb511f296 Mon Sep 17 00:00:00 2001 From: SWHL Date: Mon, 19 Aug 2024 09:27:13 +0800 Subject: [PATCH] fix(api): Fixed the way of running the app --- api/rapidocr_api/api.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/rapidocr_api/api.py b/api/rapidocr_api/api.py index 9b553a73d..471f3028e 100644 --- a/api/rapidocr_api/api.py +++ b/api/rapidocr_api/api.py @@ -71,10 +71,7 @@ def main(): parser.add_argument("-p", "--port", type=int, default=9003, help="IP port") args = parser.parse_args() - cur_file_path = Path(__file__).resolve() - app_path = f"{cur_file_path.parent.name}.{cur_file_path.stem}:app" - print(app_path) - uvicorn.run(app_path, host=args.ip, port=args.port, reload=True) + uvicorn.run("api:app", host=args.ip, port=args.port, reload=True) if __name__ == "__main__":