Spaces:
Build error
Build error
π Hugging Face Spaces Deployment Guide
Quick Start
Option 1: Automated Setup (Recommended)
# 1. Setup the repository
python setup_hf_space.py
# 2. Push to Hugging Face Spaces
python push_to_hf_space.py
Option 2: Manual Setup
Follow the steps below for manual deployment.
π Prerequisites
- Git installed on your system
- Hugging Face account (free)
- Python 3.8+ installed
- All project files in the current directory
π Step 1: Create Hugging Face Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Fill in the details:
- Name:
textilindo-ai-assistant - SDK: Docker
- Hardware: GPU Basic (recommended) or CPU Basic
- Visibility: Public or Private
- Name:
- Click "Create Space"
- Copy the repository URL (e.g.,
https://huggingface.co/spaces/your-username/textilindo-ai-assistant)
π§ Step 2: Setup Git Repository
# Initialize git repository (if not already done)
git init
# Add your Hugging Face Space as remote
git remote add origin https://huggingface.co/spaces/your-username/textilindo-ai-assistant
# Verify remote
git remote -v
π Step 3: Prepare Files
The following files are already prepared for you:
- β
README.md- Space configuration - β
Dockerfile- Optimized for HF Spaces - β
requirements.txt- Fixed dependencies - β
app.py- Main entry point - β
app_hf_spaces.py- Web interface - β
health_check.py- Health monitoring - β
All scripts in
scripts/directory
π Step 4: Deploy to Hugging Face Spaces
# Add all files to git
git add .
# Commit changes
git commit -m "Initial commit: Textilindo AI Assistant"
# Push to Hugging Face Spaces
git push origin main
β³ Step 5: Monitor Build
- Go to your Hugging Face Space
- Check the "Logs" tab
- Wait for the build to complete (5-10 minutes)
- The Space will automatically start when ready
π― Step 6: Test Your Space
- Visit your Space URL:
https://huggingface.co/spaces/your-username/textilindo-ai-assistant - Check Health: Visit
/healthendpoint - Test Interface: Use the web interface to run scripts
- Monitor Logs: Check for any errors
βοΈ Step 7: Configure Environment Variables (Optional)
In your Space settings, add:
HUGGINGFACE_TOKEN: Your Hugging Face token (for model downloads)NOVITA_API_KEY: Your Novita AI API key (for external training)
π Troubleshooting
Build Failures
- Check the build logs in your Space
- Verify all files are present
- Ensure Dockerfile is in the root directory
Runtime Errors
- Check the Space logs
- Verify environment variables
- Test individual scripts
Memory Issues
- Use GPU Basic or higher hardware
- Consider using smaller models
- Check resource usage in logs
π Expected Results
After successful deployment:
β
Space builds without errors
β
Web interface accessible
β
Health endpoint returns healthy status
β
All scripts executable via interface
β
Training process can be initiated
π Success!
Your Textilindo AI Assistant is now deployed on Hugging Face Spaces!
Features Available:
- π€ AI Model Training with LoRA
- π Dataset Creation and management
- π§ͺ Model Testing and inference
- π External Service integration
- π± Web Interface for all operations
Next Steps:
- Test the interface with sample data
- Train your first model using the web interface
- Share your Space with others
- Monitor performance and logs
π Support
If you encounter issues:
- Check the Space logs
- Verify all files are present
- Test locally with
python test_build.py - Review the troubleshooting section above
π Updates
To update your Space:
- Make changes to your local files
- Commit and push:
git push origin main - The Space will automatically rebuild
- Check build logs for any issues