textilindo-ai-assistant / DEPLOYMENT_GUIDE.md
harismlnaslm's picture
Initial commit: Textilindo AI Assistant for HF Spaces
298d6c1

πŸš€ 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

  1. Git installed on your system
  2. Hugging Face account (free)
  3. Python 3.8+ installed
  4. All project files in the current directory

🌐 Step 1: Create Hugging Face Space

  1. Go to Hugging Face Spaces
  2. Click "Create new Space"
  3. Fill in the details:
    • Name: textilindo-ai-assistant
    • SDK: Docker
    • Hardware: GPU Basic (recommended) or CPU Basic
    • Visibility: Public or Private
  4. Click "Create Space"
  5. 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

  1. Go to your Hugging Face Space
  2. Check the "Logs" tab
  3. Wait for the build to complete (5-10 minutes)
  4. The Space will automatically start when ready

🎯 Step 6: Test Your Space

  1. Visit your Space URL: https://huggingface.co/spaces/your-username/textilindo-ai-assistant
  2. Check Health: Visit /health endpoint
  3. Test Interface: Use the web interface to run scripts
  4. 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:

  1. Test the interface with sample data
  2. Train your first model using the web interface
  3. Share your Space with others
  4. Monitor performance and logs

πŸ“ž Support

If you encounter issues:

  1. Check the Space logs
  2. Verify all files are present
  3. Test locally with python test_build.py
  4. Review the troubleshooting section above

πŸ”„ Updates

To update your Space:

  1. Make changes to your local files
  2. Commit and push: git push origin main
  3. The Space will automatically rebuild
  4. Check build logs for any issues