Karol Idaszak commited on
Commit
dc4ca5f
1 Parent(s): 4ecae1b

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -144,10 +144,10 @@ def interference(example, page_number=0):
144
  return image, table
145
  except IndexError as e:
146
  # Return a custom HTML-styled error message if an IndexError occurs
147
- return f"<div style='color: grey; font-weight: bold;'>Error: in the current version of the model, the maximum number of words per page is 512.</div>"
148
  except Exception as e:
149
  # Handle other exceptions
150
- return f"<div style='color: grey; font-weight: bold;'>An error occurred: {str(e)}</div>"
151
 
152
 
153
  import gradio as gr
 
144
  return image, table
145
  except IndexError as e:
146
  # Return a custom HTML-styled error message if an IndexError occurs
147
+ gr.Error("Error: in the current version of the model, the maximum number of words per page is 512.")
148
  except Exception as e:
149
  # Handle other exceptions
150
+ gr.Error(f"An error occurred: {e}")
151
 
152
 
153
  import gradio as gr