Skip to content

Commit

Permalink
except
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio committed Oct 9, 2024
1 parent 9d2edc8 commit 1cc6c24
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ def predict(input_file: Path, output_file: Path):

try:
input_file.unlink()
finally:
# Save the OCR results to a new PDF file
doc.save(output_file, garbage=4, deflate=True)
doc.close()
print(f"Processed {relative_path}")
except:
pass

# Save the OCR results to a new PDF file
doc.save(output_file, garbage=4, deflate=True)
doc.close()
print(f"Processed {relative_path}")

Parallel(n_jobs=-1)(
delayed(predict)(Path(root) / file, Path(root.replace("todo", "done")) / file)
Expand Down

0 comments on commit 1cc6c24

Please sign in to comment.