File size: 743 Bytes
8d9d2ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
PsycheOS — HuggingFace Space Entrypoint
This file is the root app.py for HF Spaces deployment.
"""

import subprocess
import sys
import os

# Install dependencies if needed
def install_deps():
    deps = [
        "streamlit",
        "langgraph",
        "langchain",
        "faiss-cpu",
        "sentence-transformers",
        "numpy",
        "matplotlib",
    ]
    for dep in deps:
        try:
            __import__(dep.replace("-", "_").split(">=")[0])
        except ImportError:
            subprocess.check_call([sys.executable, "-m", "pip", "install", dep, "-q"])

install_deps()

# Launch streamlit
if __name__ == "__main__":
    os.system("streamlit run app/streamlit_app.py --server.port 7860 --server.address 0.0.0.0")