Spaces:
Sleeping
Sleeping
| # Deployment script for Hugging Face Spaces | |
| # This script copies all necessary files to your HF Space directory | |
| set -e # Exit on error | |
| echo "π AI Personas β Hugging Face Spaces Deployment" | |
| echo "================================================" | |
| echo "" | |
| # Check if HF Space directory path is provided | |
| if [ -z "$1" ]; then | |
| echo "β Error: Please provide the path to your cloned HF Space directory" | |
| echo "" | |
| echo "Usage: ./deploy_to_hf.sh /path/to/AI_Personas_HF_Space" | |
| echo "" | |
| echo "First, clone your HF Space:" | |
| echo " cd ~" | |
| echo " git clone https://huggingface.co/spaces/MatthewStroud/AI_Personas" | |
| echo " cd AI_Personas" | |
| echo "" | |
| echo "Then run this script:" | |
| echo " cd /home/user/AI_Personas" | |
| echo " ./deploy_to_hf.sh ~/AI_Personas" | |
| exit 1 | |
| fi | |
| HF_DIR="$1" | |
| # Check if directory exists | |
| if [ ! -d "$HF_DIR" ]; then | |
| echo "β Error: Directory $HF_DIR does not exist" | |
| echo "" | |
| echo "Please clone your HF Space first:" | |
| echo " git clone https://huggingface.co/spaces/MatthewStroud/AI_Personas" | |
| exit 1 | |
| fi | |
| # Check if it's a git repository | |
| if [ ! -d "$HF_DIR/.git" ]; then | |
| echo "β Error: $HF_DIR is not a git repository" | |
| echo "Please clone your HF Space using git clone" | |
| exit 1 | |
| fi | |
| echo "π Target directory: $HF_DIR" | |
| echo "" | |
| # Copy directories | |
| echo "π¦ Copying directories..." | |
| cp -r data/ "$HF_DIR/" | |
| echo " β data/" | |
| cp -r pages/ "$HF_DIR/" | |
| echo " β pages/" | |
| cp -r src/ "$HF_DIR/" | |
| echo " β src/" | |
| cp -r .streamlit/ "$HF_DIR/" | |
| echo " β .streamlit/" | |
| # Copy main app file | |
| echo "" | |
| echo "π Copying main files..." | |
| cp web_app.py "$HF_DIR/" | |
| echo " β web_app.py" | |
| # Copy requirements (rename for HF) | |
| cp requirements_hf.txt "$HF_DIR/requirements.txt" | |
| echo " β requirements.txt (from requirements_hf.txt)" | |
| # Copy README (rename for HF) | |
| cp README_HF.md "$HF_DIR/README.md" | |
| echo " β README.md (from README_HF.md)" | |
| # Copy .gitignore | |
| cp .gitignore_hf "$HF_DIR/.gitignore" | |
| echo " β .gitignore" | |
| echo "" | |
| echo "β All files copied successfully!" | |
| echo "" | |
| echo "π Next steps:" | |
| echo " 1. cd $HF_DIR" | |
| echo " 2. git status # Review what will be committed" | |
| echo " 3. git add ." | |
| echo " 4. git commit -m \"Initial deployment of AI Personas with Be.FM\"" | |
| echo " 5. git push" | |
| echo "" | |
| echo "β±οΈ The Space will build in 5-10 minutes after pushing." | |
| echo "π View your Space at: https://huggingface.co/spaces/MatthewStroud/AI_Personas" | |
| echo "" | |
| echo "π‘ Tips:" | |
| echo " - First Be.FM load will take 2-3 minutes (downloading model)" | |
| echo " - T4 GPU costs ~$0.60/hour when Space is running" | |
| echo " - Pause the Space in Settings when not in use to save costs" | |
| echo "" | |