Spaces:
Build error
Build error
Ashish Kumar commited on
Commit ·
f4c79a8
1
Parent(s): fccd4e3
Rebrand: Change to generic TTS model description, remove Kokoro branding
Browse files- DEPLOY_HUGGINGFACE.md +113 -0
- README.md +26 -6
- app.py +4 -4
DEPLOY_HUGGINGFACE.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deploy to Hugging Face Spaces
|
| 2 |
+
|
| 3 |
+
This guide will help you deploy your TTS model to your own Hugging Face Space.
|
| 4 |
+
|
| 5 |
+
## Step 1: Create a New Space on Hugging Face
|
| 6 |
+
|
| 7 |
+
1. Go to https://huggingface.co/spaces
|
| 8 |
+
2. Click **"Create new Space"**
|
| 9 |
+
3. Fill in the details:
|
| 10 |
+
- **Space name**: Choose your name (e.g., `NeuralVoiceTTS`, `MyTTS`)
|
| 11 |
+
- **SDK**: Select **Gradio**
|
| 12 |
+
- **Visibility**: Choose **Public** (or Private if you prefer)
|
| 13 |
+
- **Hardware**: Choose **CPU Basic** (free) or **GPU** (if you have quota)
|
| 14 |
+
4. Click **"Create Space"**
|
| 15 |
+
|
| 16 |
+
## Step 2: Push Code to Your Space
|
| 17 |
+
|
| 18 |
+
### Option A: Using Git (Recommended)
|
| 19 |
+
|
| 20 |
+
1. **Clone your new Space**:
|
| 21 |
+
```bash
|
| 22 |
+
cd /Users/blinkdigital/Documents/Projects-Source-Files/IDE/AI\ Models/TTS/Kokoro/NuralVoiceBeta
|
| 23 |
+
git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
2. **Push to Hugging Face**:
|
| 27 |
+
```bash
|
| 28 |
+
git push hf main
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
Note: You'll need to authenticate with your Hugging Face token. You can get one from: https://huggingface.co/settings/tokens
|
| 32 |
+
|
| 33 |
+
### Option B: Upload Files via Web Interface
|
| 34 |
+
|
| 35 |
+
1. Go to your Space's **Files** tab
|
| 36 |
+
2. Upload all files:
|
| 37 |
+
- `app.py`
|
| 38 |
+
- `requirements.txt`
|
| 39 |
+
- `README.md`
|
| 40 |
+
- `en.txt`
|
| 41 |
+
- `frankenstein5k.md`
|
| 42 |
+
- `gatsby5k.md`
|
| 43 |
+
- `packages.txt`
|
| 44 |
+
|
| 45 |
+
## Step 3: Configure Hardware (Important!)
|
| 46 |
+
|
| 47 |
+
1. Go to your Space **Settings**
|
| 48 |
+
2. Under **Hardware**, select:
|
| 49 |
+
- **CPU Basic** (free, slower)
|
| 50 |
+
- **CPU Upgrade** (paid, faster)
|
| 51 |
+
- **GPU** (if available)
|
| 52 |
+
|
| 53 |
+
## Step 4: Environment Variables (Optional)
|
| 54 |
+
|
| 55 |
+
If you need custom settings, add them in Space **Settings** → **Repository secrets**:
|
| 56 |
+
- Any custom environment variables your app needs
|
| 57 |
+
|
| 58 |
+
## Step 5: Wait for Build
|
| 59 |
+
|
| 60 |
+
- Hugging Face will automatically build your Space
|
| 61 |
+
- First build takes longer (~5-10 minutes) as it downloads models
|
| 62 |
+
- Monitor build logs in the **Logs** tab
|
| 63 |
+
|
| 64 |
+
## Step 6: Access Your Space
|
| 65 |
+
|
| 66 |
+
Once built, your Space will be available at:
|
| 67 |
+
```
|
| 68 |
+
https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Troubleshooting
|
| 72 |
+
|
| 73 |
+
### Build Fails
|
| 74 |
+
- Check the **Logs** tab for errors
|
| 75 |
+
- Verify `requirements.txt` is correct
|
| 76 |
+
- Ensure all file paths are correct
|
| 77 |
+
|
| 78 |
+
### Model Not Loading
|
| 79 |
+
- First run downloads models (~326MB)
|
| 80 |
+
- Check available disk space
|
| 81 |
+
- Ensure `packages.txt` includes `espeak-ng`
|
| 82 |
+
|
| 83 |
+
### Slow Performance
|
| 84 |
+
- Upgrade to GPU hardware (if available)
|
| 85 |
+
- Model loads faster after first use (cached)
|
| 86 |
+
|
| 87 |
+
## Customization
|
| 88 |
+
|
| 89 |
+
### Change Space Title/Description
|
| 90 |
+
Edit `README.md` frontmatter:
|
| 91 |
+
```yaml
|
| 92 |
+
title: Your Custom Title
|
| 93 |
+
short_description: Your description
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
### Change App Theme
|
| 97 |
+
Update in `README.md`:
|
| 98 |
+
```yaml
|
| 99 |
+
colorFrom: blue
|
| 100 |
+
colorTo: purple
|
| 101 |
+
emoji: 🎙️
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
## Continuous Updates
|
| 105 |
+
|
| 106 |
+
To update your Space:
|
| 107 |
+
```bash
|
| 108 |
+
git add .
|
| 109 |
+
git commit -m "Update description"
|
| 110 |
+
git push hf main
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
Your Space will automatically rebuild with the changes.
|
README.md
CHANGED
|
@@ -1,15 +1,35 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.24.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
license: apache-2.0
|
| 11 |
-
short_description:
|
| 12 |
-
disable_embedding:
|
| 13 |
---
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Neural Voice TTS
|
| 3 |
+
emoji: 🎙️
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.24.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
license: apache-2.0
|
| 11 |
+
short_description: TTS model with 82 million parameters
|
| 12 |
+
disable_embedding: false
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# Neural Voice TTS
|
| 16 |
+
|
| 17 |
+
High-quality text-to-speech synthesis model with 82 million parameters.
|
| 18 |
+
|
| 19 |
+
## Features
|
| 20 |
+
|
| 21 |
+
- Multiple voice options (US and UK English accents)
|
| 22 |
+
- Real-time streaming audio generation
|
| 23 |
+
- Customizable pronunciation
|
| 24 |
+
- Adjustable speech speed
|
| 25 |
+
- Generate or stream audio output
|
| 26 |
+
|
| 27 |
+
## Usage
|
| 28 |
+
|
| 29 |
+
Enter your text, select a voice, and generate high-quality speech audio.
|
| 30 |
+
|
| 31 |
+
## License
|
| 32 |
+
|
| 33 |
+
Apache 2.0
|
| 34 |
+
|
| 35 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
|
@@ -143,7 +143,7 @@ for v in CHOICES.values():
|
|
| 143 |
pipelines[v[0]].load_voice(v)
|
| 144 |
|
| 145 |
TOKEN_NOTE = '''
|
| 146 |
-
💡 Customize pronunciation with Markdown link syntax and /slashes/ like `[
|
| 147 |
|
| 148 |
💬 To adjust intonation, try punctuation `;:,.!?—…"()“”` or stress `ˈ` and `ˌ`
|
| 149 |
|
|
@@ -164,7 +164,7 @@ with gr.Blocks() as generate_tab:
|
|
| 164 |
STREAM_NOTE = ['⚠️ There is an unknown Gradio bug that might yield no audio the first time you click `Stream`.']
|
| 165 |
if CHAR_LIMIT is not None:
|
| 166 |
STREAM_NOTE.append(f'✂️ Each stream is capped at {CHAR_LIMIT} characters.')
|
| 167 |
-
STREAM_NOTE.append('🚀
|
| 168 |
STREAM_NOTE = '\n\n'.join(STREAM_NOTE)
|
| 169 |
|
| 170 |
with gr.Blocks() as stream_tab:
|
|
@@ -177,9 +177,9 @@ with gr.Blocks() as stream_tab:
|
|
| 177 |
gr.DuplicateButton()
|
| 178 |
|
| 179 |
BANNER_TEXT = '''
|
| 180 |
-
|
| 181 |
|
| 182 |
-
This demo
|
| 183 |
'''
|
| 184 |
API_OPEN = os.getenv('SPACE_ID') != 'hexgrad/Kokoro-TTS'
|
| 185 |
API_NAME = None if API_OPEN else False
|
|
|
|
| 143 |
pipelines[v[0]].load_voice(v)
|
| 144 |
|
| 145 |
TOKEN_NOTE = '''
|
| 146 |
+
💡 Customize pronunciation with Markdown link syntax and /slashes/ like `[example](/ɪɡˈzæmpəl/)`
|
| 147 |
|
| 148 |
💬 To adjust intonation, try punctuation `;:,.!?—…"()“”` or stress `ˈ` and `ˌ`
|
| 149 |
|
|
|
|
| 164 |
STREAM_NOTE = ['⚠️ There is an unknown Gradio bug that might yield no audio the first time you click `Stream`.']
|
| 165 |
if CHAR_LIMIT is not None:
|
| 166 |
STREAM_NOTE.append(f'✂️ Each stream is capped at {CHAR_LIMIT} characters.')
|
| 167 |
+
STREAM_NOTE.append('🚀 For longer text generation, you can duplicate this space or use the API.')
|
| 168 |
STREAM_NOTE = '\n\n'.join(STREAM_NOTE)
|
| 169 |
|
| 170 |
with gr.Blocks() as stream_tab:
|
|
|
|
| 177 |
gr.DuplicateButton()
|
| 178 |
|
| 179 |
BANNER_TEXT = '''
|
| 180 |
+
**TTS model with 82 million parameters.**
|
| 181 |
|
| 182 |
+
This demo showcases high-quality text-to-speech synthesis in English and other languages.
|
| 183 |
'''
|
| 184 |
API_OPEN = os.getenv('SPACE_ID') != 'hexgrad/Kokoro-TTS'
|
| 185 |
API_NAME = None if API_OPEN else False
|