Spaces:
Runtime error
Runtime error
Hugging Face Spaces Deployment Guide
This guide explains how to deploy the MCO Protocol hackathon submission to Hugging Face Spaces using Docker.
Prerequisites
- A Hugging Face account
- Modal API credentials
- Basic familiarity with Git and Docker
Deployment Steps
1. Create a New Space
- Go to Hugging Face and sign in
- Click on your profile picture and select "New Space"
- Choose a name for your Space
- Select "Docker" as the Space SDK
- Choose "Public" or "Private" visibility as needed
- Click "Create Space"
2. Configure Secrets
Add your Modal API credentials as secrets:
- Go to the Space settings
- Click on the "Variables and Secrets" tab
- Add the following secrets:
MODAL_TOKEN_ID
: Your Modal token IDMODAL_TOKEN_SECRET
: Your Modal token secret
3. Upload Files
You can upload the files using Git:
# Clone the Space repository
git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
# Copy all files to the repository
cp -r /path/to/mco-hackathon-final/* /path/to/cloned/repo/
# Commit and push
cd /path/to/cloned/repo
git add .
git commit -m "Initial commit"
git push
4. Verify Deployment
- Wait for the build to complete (this may take a few minutes)
- Visit your Space URL to see the deployed application
- Test the functionality to ensure everything works as expected
Docker Configuration
The included Dockerfile
sets up the environment with:
- Python 3.9
- Node.js 16.x
- All required Python dependencies
- MCO Protocol npm package
- Proper port exposure for Gradio
Troubleshooting
If you encounter issues with the deployment:
- Check the build logs in the Space for any errors
- Verify that all secrets are correctly set
- Ensure the Docker build completes successfully
- Check that the app starts correctly after deployment