Hello, I am getting an error while running an app in the cloud but works locally. I suspect the underlying issue is coming from mismatch in how streamlit handles saved files. So I want to see the variables that get passed to my functions however I tried adding print statements, logs to see what is being passed once I deploy to steamlit but neither of these showed in the console. Does anyone know how to do this?
Thank you
Repo:
Error message post deployment:
[05:32:28] 🐍 Python dependencies were installed from /mount/src/untitledassitanttool/requirements.txt using pip.
Check if streamlit is installed
Streamlit is already installed
[05:32:30] 📦 Processed dependencies!
WARNING ⚠️ user config directory '/home/appuser/.config/lancedb' is not writeable, defaulting to '/tmp' or CWD.Alternatively you can define a LANCEDB_CONFIG_DIR environment variable for this path.
[2024-03-05T05:33:34Z WARN lance::dataset] No existing dataset at /mount/src/untitledassitanttool/src/InformationProcessor/../STM\company_data_08ef266c-4e0c-4595-9201-8cb3ee59685e/pdf_extracted_content.lance, it will be created
2024-03-05 05:33:34.718 Uncaught app exception
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
exec(code, module.__dict__)
File "/mount/src/untitledassitanttool/main.py", line 4, in <module>
app.main()
File "/mount/src/untitledassitanttool/src/ui/streamlit_app.py", line 124, in main
response = generate_llm_response(prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mount/src/untitledassitanttool/src/ui/streamlit_app.py", line 96, in generate_llm_response
ingestor.file_broker() # Process files only once
^^^^^^^^^^^^^^^^^^^^^^
File "/mount/src/untitledassitanttool/src/InformationProcessor/ingestors.py", line 62, in file_broker
self.ingest_pdf(file, open_ai=self.ai_credentials)
File "/mount/src/untitledassitanttool/src/InformationProcessor/ingestors.py", line 111, in ingest_pdf
processed_pdf, size = call_pdf_preprocess(payload, open_ai)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mount/src/untitledassitanttool/src/InformationProcessor/preprocessor.py", line 156, in call_pdf_preprocess
extracted_text, page_count = pdf_processor.parse_pdf()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mount/src/untitledassitanttool/src/InformationProcessor/preprocessor.py", line 87, in parse_pdf
for page_text, images, _ in results:
^^^^^^^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable NoneType object