Spaces:
Running
Running
Download tests/test_bug.py from Jaleed02/AI-notes-agent: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/Jaleed02/AI-notes-agent/resolve/main/tests/test_bug.py
- Command line
-
hf download hf://spaces/Jaleed02/AI-notes-agent/tests/test_bug.py
-
curl -L -o test_bug.py https://huggingface.co/spaces/Jaleed02/AI-notes-agent/resolve/main/tests/test_bug.py
469 Bytes
| from io import BytesIO | |
| from pdf_reader import extract_text_from_pdf | |
| # Mock Streamlit UploadedFile behavior | |
| with open("test.pdf", "rb") as f: | |
| mock_uploaded_file = BytesIO(f.read()) | |
| print("First extraction:") | |
| text1 = extract_text_from_pdf(mock_uploaded_file) | |
| print(f"Length of text1: {len(text1)}") | |
| print("\nSecond extraction (simulating Streamlit rerun on button click):") | |
| text2 = extract_text_from_pdf(mock_uploaded_file) | |
| print(f"Length of text2: {len(text2)}") | |