unfinity commited on
Commit
883b8b9
·
1 Parent(s): 0eeb953
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. api.py +3 -3
  3. test.py +7 -0
Dockerfile CHANGED
@@ -22,4 +22,4 @@ COPY . /app
22
 
23
  USER root
24
  EXPOSE 7860
25
- CMD uvicorn api:app --port 7860 --host 0.0.0.0
 
22
 
23
  USER root
24
  EXPOSE 7860
25
+ CMD uvicorn test:app --port 7860 --host 0.0.0.0
api.py CHANGED
@@ -58,6 +58,6 @@ async def predict_image(file: UploadFile = File(...)):
58
  return JSONResponse(content=json_data)
59
 
60
 
61
- if __name__ == "__main__":
62
- import uvicorn
63
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
58
  return JSONResponse(content=json_data)
59
 
60
 
61
+ # if __name__ == "__main__":
62
+ # import uvicorn
63
+ # uvicorn.run(app, host="0.0.0.0", port=7860)
test.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+
3
+ app = FastAPI()
4
+
5
+ @app.get("/")
6
+ def read_root():
7
+ return {"Hello": "World!"}