Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -42,6 +42,10 @@ mock_image = Image.new("RGB", (448, 448), (255, 255, 255))
|
|
42 |
ds = []
|
43 |
images = []
|
44 |
|
|
|
|
|
|
|
|
|
45 |
@app.post("/index")
|
46 |
def index(files: List[UploadFile] = File(...)):
|
47 |
global ds, images
|
@@ -84,10 +88,5 @@ def search(query: str, k: int):
|
|
84 |
|
85 |
return {"results": results}
|
86 |
|
87 |
-
# Rediriger la racine vers /docs
|
88 |
-
@app.get("/")
|
89 |
-
def read_root():
|
90 |
-
return RedirectResponse(url="/docs")
|
91 |
-
|
92 |
if __name__ == "__main__":
|
93 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
42 |
ds = []
|
43 |
images = []
|
44 |
|
45 |
+
@app.get("/")
|
46 |
+
def read_root():
|
47 |
+
return RedirectResponse(url="/docs")
|
48 |
+
|
49 |
@app.post("/index")
|
50 |
def index(files: List[UploadFile] = File(...)):
|
51 |
global ds, images
|
|
|
88 |
|
89 |
return {"results": results}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
91 |
if __name__ == "__main__":
|
92 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|