firqaaa commited on
Commit
5e0a102
1 Parent(s): e5d664e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -176,9 +176,10 @@ if uploaded_files:
176
  # Table Extraction
177
  # L = []
178
  output_list = []
179
- st.write(pdf.name)
180
- st.write(type(pdf.name))
181
- elements = partition_pdf(filename=pdf.name, strategy=strategy, infer_table_structure=True, model_name=model_name)
 
182
  with NamedTemporaryFile(dir=".", suffix=".json") as f:
183
  elements_to_json(elements, filename=f"{f.name.split('/')[-1]}")
184
  json_file_path = os.path.abspath(f.name) # Get the absolute file path
 
176
  # Table Extraction
177
  # L = []
178
  output_list = []
179
+ try:
180
+ elements = partition_pdf(filename=pdf.name, strategy=strategy, infer_table_structure=True, model_name=model_name)
181
+ except:
182
+ elements = partition_pdf(filename=pdf.name, strategy=strategy, infer_table_structure=True)
183
  with NamedTemporaryFile(dir=".", suffix=".json") as f:
184
  elements_to_json(elements, filename=f"{f.name.split('/')[-1]}")
185
  json_file_path = os.path.abspath(f.name) # Get the absolute file path