File size: 537 Bytes
2e43fd1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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")
)
@app.function(image=image)
@modal.web_server(port=7860, startup_timeout=120)
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
)
|