Dan Vancea commited on
Commit
fc1cec8
·
1 Parent(s): e812ba5

Fixed typo

Browse files
Files changed (1) hide show
  1. api.py +4 -4
api.py CHANGED
@@ -15,10 +15,10 @@ logging.basicConfig(level=logging.INFO)
15
  logger = logging.getLogger("API")
16
 
17
  # FastAPI application entry point
18
- app = FastAPI(title="Enhance AI")
19
 
20
  # CORS configuration to allow frontend communication
21
- app.add_middleware(
22
  CORSMiddleware,
23
  allow_origins=["*"],
24
  allow_credentials=True,
@@ -139,7 +139,7 @@ def predict(
139
  return prediction, runtime
140
 
141
  # Image upscaling endpoint
142
- @app.post("/upscale")
143
  async def upscale(
144
  file: UploadFile = File(...),
145
  model_name: str = Form(...),
@@ -215,4 +215,4 @@ async def upscale(
215
 
216
  # Development entry point
217
  if __name__ == "__main__":
218
- uvicorn.run(app, host="0.0.0.0", port=8000)
 
15
  logger = logging.getLogger("API")
16
 
17
  # FastAPI application entry point
18
+ api = FastAPI(title="EnhanceAI")
19
 
20
  # CORS configuration to allow frontend communication
21
+ api.add_middleware(
22
  CORSMiddleware,
23
  allow_origins=["*"],
24
  allow_credentials=True,
 
139
  return prediction, runtime
140
 
141
  # Image upscaling endpoint
142
+ @api.post("/upscale")
143
  async def upscale(
144
  file: UploadFile = File(...),
145
  model_name: str = Form(...),
 
215
 
216
  # Development entry point
217
  if __name__ == "__main__":
218
+ uvicorn.run(api, host="0.0.0.0", port=8000)