pandora-s commited on
Commit
b12b4c3
·
verified ·
1 Parent(s): e82221d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,7 +43,7 @@ def get_content_type(url):
43
 
44
  def perform_ocr_file(file, ocr_method="Mistral OCR"):
45
  if ocr_method == "Mistral OCR":
46
- if lower(file.name).endswith('.pdf'):
47
  uploaded_pdf = client.files.upload(
48
  file={
49
  "file_name": file.name,
@@ -62,7 +62,7 @@ def perform_ocr_file(file, ocr_method="Mistral OCR"):
62
  )
63
  client.files.delete(file_id=uploaded_pdf.id)
64
 
65
- elif lower(file.name).endswith(('.png', '.jpg', '.jpeg')):
66
  base64_image = encode_image(file.name)
67
  ocr_response = client.ocr.process(
68
  model="mistral-ocr-latest",
 
43
 
44
  def perform_ocr_file(file, ocr_method="Mistral OCR"):
45
  if ocr_method == "Mistral OCR":
46
+ if file.name.lower().endswith('.pdf'):
47
  uploaded_pdf = client.files.upload(
48
  file={
49
  "file_name": file.name,
 
62
  )
63
  client.files.delete(file_id=uploaded_pdf.id)
64
 
65
+ elif file.name.lower().endswith(('.png', '.jpg', '.jpeg')):
66
  base64_image = encode_image(file.name)
67
  ocr_response = client.ocr.process(
68
  model="mistral-ocr-latest",