ArsanForEver commited on
Commit
19bedfe
·
verified ·
1 Parent(s): 09a13d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import tensorflow as tf
3
  import numpy as np
4
  from PIL import Image
5
  import io
 
6
 
7
  app = FastAPI()
8
 
@@ -37,3 +38,11 @@ async def predict(file: UploadFile = File(...)):
37
  label = labels[np.argmax(prediction)]
38
 
39
  return {"prediction": label}
 
 
 
 
 
 
 
 
 
3
  import numpy as np
4
  from PIL import Image
5
  import io
6
+ import uvicorn
7
 
8
  app = FastAPI()
9
 
 
38
  label = labels[np.argmax(prediction)]
39
 
40
  return {"prediction": label}
41
+
42
+
43
+ @app.get("/endpoints")
44
+ def get_endpoints():
45
+ return { "routes": [route.path for route in app.routes] }
46
+
47
+ if __name__ == "__main__":
48
+ uvicorn.run(app, host="0.0.0.0", port=7860)