Victor Gerardo Rivera commited on
Commit
10a815e
·
1 Parent(s): a63e7fe

Correct base64 handling in extract endpoint

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -33,7 +33,7 @@ async def health():
33
  async def extract(file: UploadFile = File(...)):
34
  try:
35
  contents = await file.read()
36
- b64_content = base64.b64encode(contents)
37
  data = await parser.extract_data(b64_content, file.filename)
38
  return data
39
  except Exception as e:
 
33
  async def extract(file: UploadFile = File(...)):
34
  try:
35
  contents = await file.read()
36
+ b64_content = base64.b64encode(contents).decode("utf-8")
37
  data = await parser.extract_data(b64_content, file.filename)
38
  return data
39
  except Exception as e: