jonmac303 commited on
Commit ·
d39299f
1
Parent(s): 859b546
Add Chatterbox Turbo HF wrapper
Browse files- .DS_Store +0 -0
- README.md +16 -0
- __init__.py.txt +7 -0
- config.json +4 -0
- pipeline.py.txt +14 -0
- requirements.txt +5 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: text-to-speech
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Chatterbox Turbo (HF Wrapper)
|
| 7 |
+
|
| 8 |
+
This repository wraps ResembleAI Chatterbox Turbo in a
|
| 9 |
+
Transformers-compatible text-to-speech pipeline.
|
| 10 |
+
|
| 11 |
+
## Usage
|
| 12 |
+
|
| 13 |
+
Input: text
|
| 14 |
+
Output: audio waveform
|
| 15 |
+
|
| 16 |
+
Supports zero-shot voice cloning via voice embeddings.
|
__init__.py.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PIPELINE_REGISTRY
|
| 2 |
+
from .pipeline import ChatterboxTurboPipeline
|
| 3 |
+
|
| 4 |
+
PIPELINE_REGISTRY.register_pipeline(
|
| 5 |
+
"text-to-speech",
|
| 6 |
+
pipeline_class=ChatterboxTurboPipeline
|
| 7 |
+
)
|
config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "chatterbox-turbo",
|
| 3 |
+
"architectures": ["ChatterboxTurboPipeline"]
|
| 4 |
+
}
|
pipeline.py.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import Pipeline
|
| 2 |
+
from chatterbox.turbo import synthesize_turbo
|
| 3 |
+
|
| 4 |
+
class ChatterboxTurboPipeline(Pipeline):
|
| 5 |
+
def _sanitize_parameters(self, **kwargs):
|
| 6 |
+
return {}, {}, kwargs
|
| 7 |
+
|
| 8 |
+
def __call__(self, text, voice_embedding=None, **kwargs):
|
| 9 |
+
audio = synthesize_turbo(
|
| 10 |
+
text=text,
|
| 11 |
+
voice_embedding=voice_embedding,
|
| 12 |
+
**kwargs
|
| 13 |
+
)
|
| 14 |
+
return audio
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch
|
| 2 |
+
transformers
|
| 3 |
+
soundfile
|
| 4 |
+
numpy
|
| 5 |
+
git+https://github.com/resemble-ai/chatterbox.git
|