skanderovitch commited on
Commit
4f12c55
·
verified ·
1 Parent(s): 3c26eb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -18,6 +18,10 @@ feature_extraction_pipeline = pipeline(
18
  # Initialize FastAPI
19
  app = FastAPI()
20
 
 
 
 
 
21
  # Endpoint to extract image features
22
  @app.post("/extract-features/")
23
  async def extract_features(file: UploadFile = File(...)):
@@ -39,3 +43,6 @@ async def extract_features(file: UploadFile = File(...)):
39
  except Exception as e:
40
  raise HTTPException(status_code=500, detail=str(e))
41
 
 
 
 
 
18
  # Initialize FastAPI
19
  app = FastAPI()
20
 
21
+ @app.get("/")
22
+ def read_root():
23
+ return {"message": "App is running successfully!"}
24
+
25
  # Endpoint to extract image features
26
  @app.post("/extract-features/")
27
  async def extract_features(file: UploadFile = File(...)):
 
43
  except Exception as e:
44
  raise HTTPException(status_code=500, detail=str(e))
45
 
46
+ if __name__ == "__main__":
47
+ import uvicorn
48
+ uvicorn.run(app, host="0.0.0.0", port=7860)