Spaces:
Runtime error
Runtime error
Download report_parser.py from knvishwanath/PV-Defects-Cleaning: direct link, hf CLI and curl.
- Browser
- Download file 190 Bytes
-
https://huggingface.co/spaces/knvishwanath/PV-Defects-Cleaning/resolve/main/report_parser.py
- Command line
-
hf download hf://spaces/knvishwanath/PV-Defects-Cleaning/report_parser.py
-
curl -L -o report_parser.py https://huggingface.co/spaces/knvishwanath/PV-Defects-Cleaning/resolve/main/report_parser.py
190 Bytes
| from PyPDF2 import PdfReader | |
| def extract_text_from_pdf(fileobj): | |
| reader = PdfReader(fileobj) | |
| return "\n".join([page.extract_text() for page in reader.pages if page.extract_text()]) | |