| import modal | |
| app = modal.App("chatpdf-app") | |
| image = ( | |
| modal.Image.debian_slim() | |
| .pip_install_from_requirements("requirements.txt") | |
| .with_file("/root/app/streamlit_app.py", local_path="streamlit_app.py") | |
| ) | |
| def launch(): | |
| import subprocess | |
| import sys | |
| subprocess.run( | |
| ["streamlit", "run", "/root/app/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"], | |
| stdout=sys.stdout, | |
| stderr=sys.stderr | |
| ) | |