rag_korean_manufacturing_docs / launch_rag_demo.py
A7m0d's picture
Upload folder using huggingface_hub
7dfe46c verified
import subprocess
import sys
from pathlib import Path
def main():
"""Launch the Streamlit demo application."""
# Get the directory containing this script
script_dir = Path(__file__).parent
demo_path = script_dir / "src" / "rag_demo.py"
if not demo_path.exists():
print(f"Error: Demo file not found at {demo_path}")
sys.exit(1)
# Launch Streamlit
try:
print("🏭 Launching Manufacturing RAG Agent Demo...")
print(f"πŸ“ Demo path: {demo_path}")
print("🌐 The demo will open in your default web browser")
print("πŸ›‘ Press Ctrl+C to stop the demo")
print("-" * 50)
subprocess.run([
sys.executable, "-m", "streamlit", "run", str(demo_path),
"--server.port", "8501",
"--server.address", "localhost",
"--browser.gatherUsageStats", "false"
])
except KeyboardInterrupt:
print("\nπŸ›‘ Demo stopped by user")
except Exception as e:
print(f"❌ Failed to launch demo: {e}")
sys.exit(1)
if __name__ == "__main__":
main()