pandora-s commited on
Commit
32e43ff
·
verified ·
1 Parent(s): c74a552

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -76,7 +76,7 @@ def perform_ocr_file(file, ocr_method="Mistral OCR"):
76
  combined_markdown, raw_markdown = get_combined_markdown(ocr_response)
77
  return combined_markdown, raw_markdown
78
 
79
- return "## Method not supported.", "Method not supported."
80
 
81
  def perform_ocr_url(url, ocr_method="Mistral OCR"):
82
  if ocr_method == "Mistral OCR":
@@ -101,12 +101,12 @@ def perform_ocr_url(url, ocr_method="Mistral OCR"):
101
  include_image_base64=True
102
  )
103
  else:
104
- return "Unsupported file type. Please provide a URL to a PDF or an image.", ""
105
 
106
  combined_markdown, raw_markdown = get_combined_markdown(ocr_response)
107
  return combined_markdown, raw_markdown
108
 
109
- return "## Method not supported.", "Method not supported."
110
 
111
  with gr.Blocks() as demo:
112
  gr.Markdown("# Mistral OCR")
 
76
  combined_markdown, raw_markdown = get_combined_markdown(ocr_response)
77
  return combined_markdown, raw_markdown
78
 
79
+ return "## Method not supported.", ""
80
 
81
  def perform_ocr_url(url, ocr_method="Mistral OCR"):
82
  if ocr_method == "Mistral OCR":
 
101
  include_image_base64=True
102
  )
103
  else:
104
+ return f"## Unsupported file type. Please provide a URL to a PDF or an image (png, jpeg, jpg).\n\n### You provided:\n{content_type}", ""
105
 
106
  combined_markdown, raw_markdown = get_combined_markdown(ocr_response)
107
  return combined_markdown, raw_markdown
108
 
109
+ return "## Method not supported.", ""
110
 
111
  with gr.Blocks() as demo:
112
  gr.Markdown("# Mistral OCR")