VidSimplify / start.sh
Adityahulk
fixing it for huggingface
0ed929a
#!/bin/bash
# ============================================================================
# Vidsimplify Startup Script for Hugging Face Spaces
# ============================================================================
#
# This script starts only the Streamlit app in DIRECT_MODE.
# In DIRECT_MODE, the app executes video generation directly without
# needing a separate API server, which is ideal for Hugging Face Spaces.
#
# For local development with the API server, set DIRECT_MODE=false
# and run: python api_server.py & streamlit run streamlit_app.py
# ============================================================================
# Ensure DIRECT_MODE is enabled for Hugging Face
export DIRECT_MODE=true
# Ensure all required directories exist
mkdir -p media/voiceover/elevenlabs
mkdir -p media/voiceover/gtts
mkdir -p media/voiceover/edge_tts
mkdir -p media/videos
# Start Streamlit with Hugging Face-compatible settings
# - Port 7860 is required by Hugging Face Spaces
# - CORS and file upload settings for proper functionality
echo "🎬 Starting Vidsimplify in Direct Mode..."
echo " Port: 7860"
echo " Mode: Direct (no API server needed)"
echo ""
streamlit run streamlit_app.py \
--server.port 7860 \
--server.address 0.0.0.0 \
--server.enableCORS true \
--server.enableXsrfProtection false \
--server.maxUploadSize 50 \
--server.fileWatcherType none \
--browser.gatherUsageStats false