Ashrafb commited on
Commit
3ea497c
1 Parent(s): 6ebd507

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -17,7 +17,7 @@ client = Client("https://ashrafb-image-to-sketch.hf.space/", hf_token=hf_token)
17
  @app.post("/upload/")
18
  async def upload_file(file: UploadFile = File(...)):
19
  contents = await file.read()
20
- result = client.predict(io.BytesIO(contents), api_name="/predict") # Pass the image data as bytes-like object
21
  return {"sketch_image": result[0]}
22
 
23
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
 
17
  @app.post("/upload/")
18
  async def upload_file(file: UploadFile = File(...)):
19
  contents = await file.read()
20
+ result = client.predict(contents, api_name="/predict")
21
  return {"sketch_image": result[0]}
22
 
23
  app.mount("/", StaticFiles(directory="static", html=True), name="static")