A newer version of the Gradio SDK is available:
5.29.0
Deploying to Hugging Face Spaces
This guide explains how to deploy the Music Genre Classifier & Lyrics Generator to Hugging Face Spaces.
Prerequisites
- A Hugging Face account
- Access to the Llama 3.1 8B Instruct model (requires acceptance of the model license)
- A Hugging Face API token
Deployment Steps
1. Create a New Space
- Go to the Hugging Face website and log in
- Navigate to "Spaces" in the top navigation
- Click "Create new Space"
- Choose "Gradio" as the SDK
- Give your Space a name and description
- Select "T4 GPU" as the hardware
2. Set up Environment Variables
Set up your Hugging Face access token as an environment variable:
- Go to your profile settings in Hugging Face
- Navigate to "Access Tokens" and create a new token with "write" access
- In your Space settings, under "Repository secrets", add a new secret:
- Name:
HF_TOKEN
- Value: Your Hugging Face access token
- Name:
3. Upload the Files
Upload all the files from this repository to your Space.
4. Wait for Deployment
Hugging Face will automatically build and deploy your Space. This may take a few minutes, especially since it needs to download the models.
5. Access Your Application
Once deployed, you can access your application on your Hugging Face Space URL.