Spaces:
Build error
Build error
File size: 681 Bytes
2c329fa 0a7114a 2c329fa |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
if __name__ == "__main__": # noqa: INP001
import argparse
import uvicorn
from src.app import create_app
parser = argparse.ArgumentParser()
parser.add_argument("--host", type=str, default="0.0.0.0") # nosec
parser.add_argument("--port", type=int, default=7860)
parser.add_argument("--log", type=str, default="info")
parser.add_argument("--reload", action="store_true", help="Reload flag")
args = parser.parse_args()
config = uvicorn.Config(
app=create_app(),
host=args.host,
port=args.port,
log_level=args.log,
reload=args.reload,
)
server = uvicorn.Server(config=config)
server.run()
|