File size: 853 Bytes
6880cd9
 
be5f84f
6880cd9
 
 
 
 
 
be5f84f
 
 
6880cd9
be5f84f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6880cd9
be5f84f
6880cd9
 
 
be5f84f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""
Minimal launcher for the Streamlit book summarizer.
"""

import subprocess
import sys


def main():
    print("Starting Streamlit app...")
    print("If dependencies are missing, install with: pip install -r requirements.txt\n")
    try:
        subprocess.run(
            [
                sys.executable,
                "-m",
                "streamlit",
                "run",
                "app.py",
                "--server.port",
                "8501",
                "--server.address",
                "0.0.0.0",
            ],
            check=True,
        )
    except subprocess.CalledProcessError as exc:
        print(f"Streamlit exited with an error: {exc}")
        sys.exit(exc.returncode)
    except KeyboardInterrupt:
        print("\nStopping Streamlit...")


if __name__ == "__main__":
    main()