| # Deploying to Hugging Face Spaces |
|
|
| This guide explains how to deploy the Music Genre Classifier & Lyrics Generator to Hugging Face Spaces. |
|
|
| ## Prerequisites |
|
|
| 1. A Hugging Face account |
| 2. Access to the Llama 3.1 8B Instruct model (requires acceptance of the model license) |
| 3. A Hugging Face API token |
|
|
| ## Deployment Steps |
|
|
| ### 1. Create a New Space |
|
|
| 1. Go to the Hugging Face website and log in |
| 2. Navigate to "Spaces" in the top navigation |
| 3. Click "Create new Space" |
| 4. Choose "Gradio" as the SDK |
| 5. Give your Space a name and description |
| 6. Select "T4 GPU" as the hardware |
|
|
| ### 2. Set up Environment Variables |
|
|
| Set up your Hugging Face access token as an environment variable: |
|
|
| 1. Go to your profile settings in Hugging Face |
| 2. Navigate to "Access Tokens" and create a new token with "write" access |
| 3. In your Space settings, under "Repository secrets", add a new secret: |
| - Name: `HF_TOKEN` |
| - Value: Your Hugging Face access token |
|
|
| ### 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. |