Ashrafb commited on
Commit
e120bd1
·
verified ·
1 Parent(s): f3e6112

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -1
main.py CHANGED
@@ -18,7 +18,8 @@ import base64
18
 
19
  @app.post("/upload/")
20
  async def upload_file(file: UploadFile = File(...)):
21
- contents = await file.read()
 
22
  result = client.predict(contents, api_name="/predict")
23
  return {"sketch_image": result[0]}
24
 
 
18
 
19
  @app.post("/upload/")
20
  async def upload_file(file: UploadFile = File(...)):
21
+ with file.file as f:
22
+ contents = f.read()
23
  result = client.predict(contents, api_name="/predict")
24
  return {"sketch_image": result[0]}
25