Skip to content

Commit 0dbac44

Browse files
committed
Fix ocrweb api not import module api error
1 parent 5dcecf4 commit 0dbac44

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ocrweb/rapidocr_web/api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ def main():
5555
parser.add_argument('-p', '--port', type=int, default=9003,
5656
help='IP port')
5757
args = parser.parse_args()
58-
uvicorn.run(f"{Path(__file__).stem}:app",
59-
host=args.ip, port=args.port, reload=True)
58+
59+
cur_file_path = Path(__file__).resolve()
60+
app_path = f'{cur_file_path.parent.name}.{cur_file_path.stem}:app'
61+
uvicorn.run(app_path, host=args.ip, port=args.port, reload=True)
6062

6163

6264
if __name__ == '__main__':

0 commit comments

Comments
 (0)