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

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -2
main.py CHANGED
@@ -19,8 +19,7 @@ import base64
19
  @app.post("/upload/")
20
  async def upload_file(file: UploadFile = File(...)):
21
  contents = await file.read()
22
- base64_contents = base64.b64encode(contents).decode('utf-8') # Convert bytes to base64-encoded string
23
- result = client.predict(base64_contents, api_name="/predict")
24
  return {"sketch_image": result[0]}
25
 
26
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
 
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
 
25
  app.mount("/", StaticFiles(directory="static", html=True), name="static")