Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
title: FroxAI Flex-Audio
|
| 3 |
emoji: π¦
|
| 4 |
colorFrom: purple
|
|
@@ -7,24 +8,42 @@ sdk: gradio
|
|
| 7 |
sdk_version: 5.9.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
| 10 |
license: other
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
-
- `config.json`, `vocab.json` β base model files required to reload (unchanged by fine-tuning)
|
| 21 |
-
- `voice_refs/` β reference voice clips for cloning
|
| 22 |
-
- `app.py` β Gradio demo (this Space)
|
| 23 |
-
- `src/inference.py` β reusable inference code
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
```
|
| 28 |
.
|
| 29 |
βββ app.py
|
| 30 |
βββ config.json
|
|
@@ -37,30 +56,34 @@ Fine-tuned [XTTS-v2](https://huggingface.co/coqui/XTTS-v2) text-to-speech model
|
|
| 37 |
βββ slt.wav
|
| 38 |
βββ bdl.wav
|
| 39 |
βββ ...
|
| 40 |
-
```
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
```python
|
| 45 |
from src.inference import generate
|
| 46 |
|
| 47 |
path = generate(
|
| 48 |
text="Hello, this is Flex-Audio speaking.",
|
| 49 |
language="en",
|
| 50 |
-
voice="slt", #
|
| 51 |
)
|
| 52 |
-
```
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
-
```python
|
| 57 |
from TTS.tts.configs.xtts_config import XttsConfig
|
| 58 |
from TTS.tts.models.xtts import Xtts
|
| 59 |
|
| 60 |
config = XttsConfig()
|
| 61 |
config.load_json("config.json")
|
|
|
|
| 62 |
model = Xtts.init_from_config(config)
|
| 63 |
-
model.load_checkpoint(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
model.cuda()
|
| 65 |
|
| 66 |
outputs = model.synthesize(
|
|
@@ -69,12 +92,28 @@ outputs = model.synthesize(
|
|
| 69 |
speaker_wav="voice_refs/slt.wav",
|
| 70 |
language="en",
|
| 71 |
)
|
| 72 |
-
```
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
|
| 77 |
|
| 78 |
-
|
| 79 |
|
| 80 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
|
| 3 |
title: FroxAI Flex-Audio
|
| 4 |
emoji: π¦
|
| 5 |
colorFrom: purple
|
|
|
|
| 8 |
sdk_version: 5.9.1
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
+
pipeline_tag: text-to-speech
|
| 12 |
license: other
|
| 13 |
+
license_name: proprietary
|
| 14 |
+
|
| 15 |
+
π¦ FroxAI β Flex-Audio
|
| 16 |
+
|
| 17 |
+
Fine-tuned "XTTS-v2" (https://huggingface.co/coqui/XTTS-v2) text-to-speech model with real voice cloning, built by FroxAI.
|
| 18 |
+
|
| 19 |
+
ποΈ Demo
|
| 20 |
+
|
| 21 |
+
The repository includes a Gradio application in "app.py" with:
|
| 22 |
|
| 23 |
+
- Text input
|
| 24 |
+
- Language selection
|
| 25 |
+
- Voice selection
|
| 26 |
+
- Generated WAV output
|
| 27 |
+
- Clickable demo examples
|
| 28 |
|
| 29 |
+
Run the demo
|
| 30 |
|
| 31 |
+
python app.py
|
| 32 |
|
| 33 |
+
Β«Hugging Face: A model repository does not automatically execute "app.py" on its main page. The interactive model-page widget is available only when the model/task is supported by an Inference Provider. For this custom Gradio interface, deploy "app.py" as a Hugging Face Space to let visitors test it directly in a browser.Β»
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
What's included
|
| 36 |
+
|
| 37 |
+
- "model.pth" β fine-tuned model weights
|
| 38 |
+
- "config.json" β base XTTS-v2 configuration required to reload the model
|
| 39 |
+
- "vocab.json" β base model vocabulary required to reload the model
|
| 40 |
+
- "voice_refs/" β reference voice clips for voice cloning
|
| 41 |
+
- "app.py" β Gradio demo application
|
| 42 |
+
- "src/inference.py" β reusable inference code
|
| 43 |
+
- "requirements.txt" β Python dependencies
|
| 44 |
+
|
| 45 |
+
π Repository structure
|
| 46 |
|
|
|
|
| 47 |
.
|
| 48 |
βββ app.py
|
| 49 |
βββ config.json
|
|
|
|
| 56 |
βββ slt.wav
|
| 57 |
βββ bdl.wav
|
| 58 |
βββ ...
|
|
|
|
| 59 |
|
| 60 |
+
π Usage outside this Space
|
| 61 |
+
|
| 62 |
+
The reusable inference interface can be used directly from Python:
|
| 63 |
|
|
|
|
| 64 |
from src.inference import generate
|
| 65 |
|
| 66 |
path = generate(
|
| 67 |
text="Hello, this is Flex-Audio speaking.",
|
| 68 |
language="en",
|
| 69 |
+
voice="slt", # filename without .wav from voice_refs/
|
| 70 |
)
|
|
|
|
| 71 |
|
| 72 |
+
Load the model directly
|
| 73 |
|
|
|
|
| 74 |
from TTS.tts.configs.xtts_config import XttsConfig
|
| 75 |
from TTS.tts.models.xtts import Xtts
|
| 76 |
|
| 77 |
config = XttsConfig()
|
| 78 |
config.load_json("config.json")
|
| 79 |
+
|
| 80 |
model = Xtts.init_from_config(config)
|
| 81 |
+
model.load_checkpoint(
|
| 82 |
+
config,
|
| 83 |
+
checkpoint_dir=".",
|
| 84 |
+
eval=True,
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
model.cuda()
|
| 88 |
|
| 89 |
outputs = model.synthesize(
|
|
|
|
| 92 |
speaker_wav="voice_refs/slt.wav",
|
| 93 |
language="en",
|
| 94 |
)
|
|
|
|
| 95 |
|
| 96 |
+
π Languages
|
| 97 |
+
|
| 98 |
+
Flex-Audio supports 17 languages with real voice cloning, inherited from XTTS-v2:
|
| 99 |
+
|
| 100 |
+
en, es, fr, de, it, pt, pl, tr, ru, nl, cs,
|
| 101 |
+
ar, zh-cn, ja, hu, ko, hi
|
| 102 |
+
|
| 103 |
+
π€ Voices
|
| 104 |
+
|
| 105 |
+
The "voice_refs/" directory contains the reference voice clips available for cloning.
|
| 106 |
+
|
| 107 |
+
To use a voice, provide its filename without the ".wav" extension:
|
| 108 |
+
|
| 109 |
+
voice="slt"
|
| 110 |
+
|
| 111 |
+
For the complete list of available voices, see the files inside "voice_refs/".
|
| 112 |
+
|
| 113 |
+
π License
|
| 114 |
|
| 115 |
+
Proprietary / All Rights Reserved.
|
| 116 |
|
| 117 |
+
No permission is granted to use, copy, modify, distribute, sublicense, sell, or deploy the model or its files except as expressly permitted by the copyright holder.
|
| 118 |
|
| 119 |
+
The model also inherits the applicable terms of its base model. Check the "XTTS-v2 license" (https://huggingface.co/coqui/XTTS-v2) before using or redistributing this model.
|