Spaces:
Running
Running
Create deploy_spaces.sh
Browse files- deploy_spaces.sh +93 -0
deploy_spaces.sh
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
echo "🚀 DEPLOYING SAEM'S TUNES AI TO HUGGING FACE SPACES"
|
| 3 |
+
|
| 4 |
+
# Configuration
|
| 5 |
+
SPACE_NAME="saemstunes/saems-tunes-ai-pro"
|
| 6 |
+
MODEL_REPO="Thetima4/Phi-3.5-mini-instruct-Q4_K_M-GGUF"
|
| 7 |
+
MODEL_FILE="Phi-3.5-mini-instruct-q4_k_m.gguf"
|
| 8 |
+
|
| 9 |
+
# Create necessary directories
|
| 10 |
+
mkdir -p models
|
| 11 |
+
mkdir -p logs
|
| 12 |
+
mkdir -p config
|
| 13 |
+
|
| 14 |
+
# Download the pre-quantized model
|
| 15 |
+
echo "📥 DOWNLOADING PRE-QUANTIZED MODEL"
|
| 16 |
+
wget -O models/phi3.5-mini.Q4_K_M.gguf \
|
| 17 |
+
"https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_FILE}"
|
| 18 |
+
|
| 19 |
+
# Create configuration files
|
| 20 |
+
cat > config/spaces_config.json << EOF
|
| 21 |
+
{
|
| 22 |
+
"space_name": "saems-tunes-ai-pro",
|
| 23 |
+
"model_used": "Phi-3.5-mini-instruct-Q4_K_M",
|
| 24 |
+
"deployment_date": "$(date -I)",
|
| 25 |
+
"features": [
|
| 26 |
+
"multi-model-support",
|
| 27 |
+
"performance-monitoring",
|
| 28 |
+
"supabase-integration",
|
| 29 |
+
"advanced-prompting",
|
| 30 |
+
"real-time-chat"
|
| 31 |
+
]
|
| 32 |
+
}
|
| 33 |
+
EOF
|
| 34 |
+
|
| 35 |
+
# Create README for the space
|
| 36 |
+
cat > README.md << 'EOF'
|
| 37 |
+
# 🎵 Saem's Tunes AI Assistant Pro
|
| 38 |
+
|
| 39 |
+
Advanced AI-powered assistant for Saem's Tunes music platform, built with Microsoft Phi-3.5-mini-instruct.
|
| 40 |
+
|
| 41 |
+
## Features
|
| 42 |
+
|
| 43 |
+
- **Multiple Quantization Support**: Q4_K_M, Q5_K_M, Q8_0 models
|
| 44 |
+
- **Real-time Performance Monitoring**: Track response times and system metrics
|
| 45 |
+
- **Supabase Integration**: Live music platform context
|
| 46 |
+
- **Advanced Prompt Engineering**: Context-aware responses
|
| 47 |
+
- **Production Ready**: Error handling, logging, monitoring
|
| 48 |
+
|
| 49 |
+
## Model Information
|
| 50 |
+
|
| 51 |
+
- **Base Model**: microsoft/Phi-3.5-mini-instruct
|
| 52 |
+
- **Quantization**: Q4_K_M (Optimal balance of quality/speed)
|
| 53 |
+
- **Context Window**: 4K tokens
|
| 54 |
+
- **Specialization**: Music platform assistance
|
| 55 |
+
|
| 56 |
+
## Usage
|
| 57 |
+
|
| 58 |
+
Ask about:
|
| 59 |
+
- Platform features and capabilities
|
| 60 |
+
- Artist and song information
|
| 61 |
+
- Technical support
|
| 62 |
+
- Premium features
|
| 63 |
+
- Music discovery
|
| 64 |
+
|
| 65 |
+
## Technical Details
|
| 66 |
+
|
| 67 |
+
- Built with Gradio for web interface
|
| 68 |
+
- llama.cpp for efficient inference
|
| 69 |
+
- Comprehensive monitoring and logging
|
| 70 |
+
- Designed for Hugging Face Spaces deployment
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
*Powered by Microsoft Phi-3.5-mini-instruct | Built for [Saem's Tunes](https://www.saemstunes.com)*
|
| 74 |
+
EOF
|
| 75 |
+
|
| 76 |
+
echo "✅ HUGGING FACE SPACES DEPLOYMENT CONFIGURED"
|
| 77 |
+
echo "📁 Files prepared:"
|
| 78 |
+
echo " - app.py (Main application)"
|
| 79 |
+
echo " - requirements.txt (Dependencies)"
|
| 80 |
+
echo " - models/ (Quantized model files)"
|
| 81 |
+
echo " - README.md (Documentation)"
|
| 82 |
+
echo " - config/spaces_config.json (Configuration)"
|
| 83 |
+
|
| 84 |
+
# Instructions for manual deployment
|
| 85 |
+
echo ""
|
| 86 |
+
echo "📋 DEPLOYMENT INSTRUCTIONS:"
|
| 87 |
+
echo "1. Go to https://huggingface.co/spaces"
|
| 88 |
+
echo "2. Create new Space with SDK: Gradio"
|
| 89 |
+
echo "3. Upload all files from this directory"
|
| 90 |
+
echo "4. Set environment variables:"
|
| 91 |
+
echo " - SUPABASE_URL=your_supabase_url"
|
| 92 |
+
echo " - SUPABASE_ANON_KEY=your_anon_key"
|
| 93 |
+
echo "5. Deploy and test!"
|