SigmaTriple / DEPLOY.md
feras-vbrl's picture
Upload 7 files
d876e1d verified
|
raw
history blame
3.59 kB

Deploying SigmaTriple to Hugging Face Spaces

This guide will help you deploy the SigmaTriple application to Hugging Face Spaces.

Prerequisites

  1. A Hugging Face account (sign up at huggingface.co)
  2. Git installed on your local machine
  3. Hugging Face CLI (optional, for command line deployment)

Deployment Steps

Option 1: Using the Hugging Face Web Interface

  1. Create a New Space:

    • Go to huggingface.co/spaces
    • Click on "Create new Space"
    • Enter a name for your Space (e.g., "SigmaTriple")
    • Select "Streamlit" as the SDK
    • Choose "Public" or "Private" visibility
    • Select "T4" as the Hardware (GPU is recommended for this application)
    • Click "Create Space"
  2. Upload Files:

    • You can either upload the files directly through the web interface
    • Or clone the Space repository and push the files using Git (recommended)
  3. Git Deployment:

    # Clone your new Space repository
    git clone https://huggingface.co/spaces/YOUR_USERNAME/SigmaTriple
    
    # Copy all files from this project to the cloned repository
    cp -r * /path/to/cloned/repo/
    cp -r .streamlit /path/to/cloned/repo/
    cp .gitignore /path/to/cloned/repo/
    
    # Navigate to the cloned repository
    cd /path/to/cloned/repo
    
    # Add all files
    git add .
    
    # Commit the changes
    git commit -m "Initial commit of SigmaTriple application"
    
    # Push to Hugging Face Spaces
    git push
    
  4. Wait for Deployment:

    • Hugging Face will automatically build and deploy your Space
    • This may take a few minutes, especially for the first deployment
    • You can monitor the build process in the "Settings" tab of your Space

Option 2: Using Hugging Face CLI

  1. Install the Hugging Face CLI:

    pip install huggingface_hub
    
  2. Login to Hugging Face:

    huggingface-cli login
    
  3. Create a New Space:

    huggingface-cli repo create SigmaTriple --type space --sdk streamlit
    
  4. Clone and Push:

    git clone https://huggingface.co/spaces/YOUR_USERNAME/SigmaTriple
    cp -r * /path/to/cloned/repo/
    cp -r .streamlit /path/to/cloned/repo/
    cp .gitignore /path/to/cloned/repo/
    cd /path/to/cloned/repo
    git add .
    git commit -m "Initial commit of SigmaTriple application"
    git push
    

Configuration Options

You can customize your Space by modifying the following files:

  • .streamlit/config.toml: Streamlit configuration
  • README.md: Documentation and Space description
  • requirements.txt: Python dependencies
  • packages.txt: System dependencies

Troubleshooting

If you encounter any issues during deployment:

  1. Check the Build Logs:

    • Go to the "Settings" tab of your Space
    • Look for any error messages in the build logs
  2. Common Issues:

    • Memory Errors: The model requires significant memory. Make sure you're using a GPU instance.
    • Dependency Issues: Check that all required packages are listed in requirements.txt and packages.txt.
    • Timeout Errors: The initial model loading might take time. Hugging Face Spaces has a build timeout of 10 minutes.
  3. Reduce Model Size:

    • If you're experiencing memory issues, you can modify app.py to use a smaller model or implement model loading optimizations.

Accessing Your Space

Once deployed, your Space will be available at: https://huggingface.co/spaces/YOUR_USERNAME/SigmaTriple

You can share this URL with others to let them use your application.