File size: 611 Bytes
a33458e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
03016b2
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
"""
Main entry point for Hugging Face Spaces deployment.
This file starts the Streamlit UI when deployed to Hugging Face Spaces.
"""
import subprocess
import os
import sys

# Make sure the app directory is in the path
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

# Create necessary directories
os.makedirs('data/documents', exist_ok=True)
os.makedirs('data/vector_db', exist_ok=True)

# Run the Streamlit app with specific port to match huggingface-space.yml
subprocess.run(["streamlit", "run", "app/ui/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"])