Spaces:
Running
Running
bravedims
commited on
Commit
ยท
3b23239
1
Parent(s):
bd1f2b1
Add deployment guide and PowerShell script
Browse files- DEPLOYMENT_GUIDE.md +121 -0
- deploy.ps1 +35 -0
DEPLOYMENT_GUIDE.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
๏ปฟ# ๐ Manual Deployment Guide for Hugging Face Spaces
|
| 2 |
+
|
| 3 |
+
Your OmniAvatar project has been prepared for deployment to Hugging Face Spaces. Since we encountered some authentication issues, here's how to complete the deployment manually:
|
| 4 |
+
|
| 5 |
+
## ๐ Prerequisites
|
| 6 |
+
|
| 7 |
+
1. **Hugging Face Account**: Make sure you have an account at https://huggingface.co/
|
| 8 |
+
2. **Access Token**: Generate a write access token from https://huggingface.co/settings/tokens
|
| 9 |
+
3. **Git**: Ensure Git is installed on your system
|
| 10 |
+
|
| 11 |
+
## ๐ Authentication Setup
|
| 12 |
+
|
| 13 |
+
### Option 1: Using Hugging Face CLI (Recommended)
|
| 14 |
+
```bash
|
| 15 |
+
# Install the Hugging Face CLI
|
| 16 |
+
pip install -U "huggingface_hub[cli]"
|
| 17 |
+
|
| 18 |
+
# Login with your token
|
| 19 |
+
huggingface-cli login
|
| 20 |
+
|
| 21 |
+
# When prompted, enter your access token from https://huggingface.co/settings/tokens
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
### Option 2: Using Git Credentials
|
| 25 |
+
```bash
|
| 26 |
+
# Configure git to use your HF token as password
|
| 27 |
+
git remote set-url origin https://bravedims:YOUR_HF_TOKEN@huggingface.co/spaces/bravedims/AI_Avatar_Chat.git
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
## ๐ค Deploy to Hugging Face
|
| 31 |
+
|
| 32 |
+
Once authenticated, push your changes:
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
# Navigate to the deployment directory
|
| 36 |
+
cd path/to/HF_Deploy/AI_Avatar_Chat
|
| 37 |
+
|
| 38 |
+
# Push to deploy
|
| 39 |
+
git push origin main
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## ๐ Files Prepared for Deployment
|
| 43 |
+
|
| 44 |
+
Your space now includes:
|
| 45 |
+
|
| 46 |
+
- โ
**app.py** - Main application with FastAPI + Gradio interface
|
| 47 |
+
- โ
**requirements.txt** - Optimized dependencies for HF Spaces
|
| 48 |
+
- โ
**Dockerfile** - HF Spaces compatible Docker configuration
|
| 49 |
+
- โ
**README.md** - Comprehensive space documentation
|
| 50 |
+
- โ
**configs/** - Model configuration files
|
| 51 |
+
- โ
**scripts/** - Inference scripts
|
| 52 |
+
- โ
**examples/** - Sample inputs
|
| 53 |
+
- โ
**elevenlabs_integration.py** - TTS integration
|
| 54 |
+
|
| 55 |
+
## ๐ง Space Configuration
|
| 56 |
+
|
| 57 |
+
The space is configured with:
|
| 58 |
+
|
| 59 |
+
- **SDK**: Docker
|
| 60 |
+
- **Hardware**: T4-medium (GPU enabled)
|
| 61 |
+
- **Port**: 7860 (required by HF Spaces)
|
| 62 |
+
- **User**: Non-root user as required by HF
|
| 63 |
+
- **Base Image**: PyTorch with CUDA support
|
| 64 |
+
|
| 65 |
+
## ๐ฏ Key Features Deployed
|
| 66 |
+
|
| 67 |
+
1. **๐ญ Avatar Generation**: Text-to-avatar with lip-sync
|
| 68 |
+
2. **๐ฃ๏ธ ElevenLabs TTS**: High-quality text-to-speech
|
| 69 |
+
3. **๐ต Audio URL Support**: Direct audio file inputs
|
| 70 |
+
4. **๐ผ๏ธ Image References**: Guide avatar appearance
|
| 71 |
+
5. **โก GPU Acceleration**: Optimized for HF hardware
|
| 72 |
+
|
| 73 |
+
## ๐ ๏ธ Environment Variables
|
| 74 |
+
|
| 75 |
+
To enable ElevenLabs TTS functionality:
|
| 76 |
+
|
| 77 |
+
1. Go to your Space settings on HF
|
| 78 |
+
2. Add a secret named `ELEVENLABS_API_KEY`
|
| 79 |
+
3. Set the value to your ElevenLabs API key
|
| 80 |
+
|
| 81 |
+
## ๐ฎ Testing Your Deployment
|
| 82 |
+
|
| 83 |
+
After deployment:
|
| 84 |
+
|
| 85 |
+
1. Wait for the space to build (may take 10-15 minutes)
|
| 86 |
+
2. Access your space at: https://huggingface.co/spaces/bravedims/AI_Avatar_Chat
|
| 87 |
+
3. Test the Gradio interface with sample prompts
|
| 88 |
+
4. Verify API endpoints work: `/health`, `/generate`
|
| 89 |
+
|
| 90 |
+
## ๐ Monitoring
|
| 91 |
+
|
| 92 |
+
- Check build logs in the HF Space interface
|
| 93 |
+
- Monitor resource usage and performance
|
| 94 |
+
- Review user feedback and iterate
|
| 95 |
+
|
| 96 |
+
## ๐ Updating Your Space
|
| 97 |
+
|
| 98 |
+
To make changes:
|
| 99 |
+
|
| 100 |
+
1. Modify files in your local HF_Deploy/AI_Avatar_Chat directory
|
| 101 |
+
2. Commit changes: `git add . && git commit -m "Update message"`
|
| 102 |
+
3. Push: `git push origin main`
|
| 103 |
+
4. HF will automatically rebuild and redeploy
|
| 104 |
+
|
| 105 |
+
## ๐ Troubleshooting
|
| 106 |
+
|
| 107 |
+
- **Build fails**: Check Dockerfile and requirements.txt
|
| 108 |
+
- **Model not found**: Ensure download_models.sh runs correctly
|
| 109 |
+
- **Memory issues**: Consider upgrading to larger hardware
|
| 110 |
+
- **Port conflicts**: Space must use port 7860
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## ๐ฏ Next Steps
|
| 115 |
+
|
| 116 |
+
1. Complete authentication setup above
|
| 117 |
+
2. Push to deploy: `git push origin main`
|
| 118 |
+
3. Configure ElevenLabs API key as secret
|
| 119 |
+
4. Test and iterate on your deployed space!
|
| 120 |
+
|
| 121 |
+
Your OmniAvatar-14B space is ready for deployment! ๐
|
deploy.ps1
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
๏ปฟ# PowerShell deployment script for Windows
|
| 2 |
+
# Run this script after setting up your HF token
|
| 3 |
+
|
| 4 |
+
param(
|
| 5 |
+
[Parameter(Mandatory=$true)]
|
| 6 |
+
[string]$HF_TOKEN
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
Write-Host "๐ Deploying OmniAvatar to Hugging Face Spaces..." -ForegroundColor Green
|
| 10 |
+
|
| 11 |
+
# Set git remote with token authentication
|
| 12 |
+
$gitPath = "C:\Program Files\Git\bin\git.exe"
|
| 13 |
+
|
| 14 |
+
try {
|
| 15 |
+
Write-Host "๐ก Configuring authentication..." -ForegroundColor Yellow
|
| 16 |
+
& $gitPath remote set-url origin "https://bravedims:$HF_TOKEN@huggingface.co/spaces/bravedims/AI_Avatar_Chat.git"
|
| 17 |
+
|
| 18 |
+
Write-Host "๐ค Pushing to Hugging Face..." -ForegroundColor Yellow
|
| 19 |
+
& $gitPath push origin main
|
| 20 |
+
|
| 21 |
+
if ($LASTEXITCODE -eq 0) {
|
| 22 |
+
Write-Host "โ
Deployment successful!" -ForegroundColor Green
|
| 23 |
+
Write-Host "๐ Your space will be available at: https://huggingface.co/spaces/bravedims/AI_Avatar_Chat" -ForegroundColor Cyan
|
| 24 |
+
Write-Host "โฑ๏ธ Build time: ~10-15 minutes" -ForegroundColor Yellow
|
| 25 |
+
Write-Host ""
|
| 26 |
+
Write-Host "๐ Don't forget to add your ElevenLabs API key as a secret in the space settings!" -ForegroundColor Magenta
|
| 27 |
+
} else {
|
| 28 |
+
Write-Host "โ Deployment failed. Check the error messages above." -ForegroundColor Red
|
| 29 |
+
exit 1
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
catch {
|
| 33 |
+
Write-Host "โ Error during deployment: $($_.Exception.Message)" -ForegroundColor Red
|
| 34 |
+
exit 1
|
| 35 |
+
}
|