Update main.py
Browse files16 unmodified lines1718192021222316 unmodified lines@app.post("/upload/")async def upload_file(file: UploadFile = File(...)):contents = await file.read()result = client.predict(contents, api_name="/predict")return {"sketch_image": result[0]}app.mount("/", StaticFiles(directory="static", html=True), name="static")16 unmodified lines1718192021222316 unmodified lines@app.post("/upload/")async def upload_file(file: UploadFile = File(...)):contents = await file.read()result = client.predict(io.BytesIO(contents), api_name="/predict") # Pass the image data as bytes-like objectreturn {"sketch_image": result[0]}app.mount("/", StaticFiles(directory="static", html=True), name="static")
main.py+1-1