Nebolisa Kosiso commited on
Commit ·
6cffb78
1
Parent(s): 935e894
adjust API support configuration
Browse files- config.json +0 -16
- custom_pipeline.py +0 -25
- model_index.json +0 -11
- preprocessor_config.json +0 -6
config.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_name_or_path": "kosinebolisa/igbo-tts-model",
|
| 3 |
-
"model_type": "orpheus_tts",
|
| 4 |
-
"architecture": "FastLanguageModel+SNAC",
|
| 5 |
-
"vocoder": "snac",
|
| 6 |
-
"sample_rate": 24000,
|
| 7 |
-
"max_text_length": 500,
|
| 8 |
-
"tokenizer_settings": {
|
| 9 |
-
"start_of_text": 128000,
|
| 10 |
-
"end_of_text": 128009,
|
| 11 |
-
"speech_tokens": {
|
| 12 |
-
"start": 128257,
|
| 13 |
-
"end": 128258
|
| 14 |
-
}
|
| 15 |
-
}
|
| 16 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
custom_pipeline.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
from transformers import Pipeline
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
class IgboTTSPipeline(Pipeline):
|
| 5 |
-
def __init__(self, *args, **kwargs):
|
| 6 |
-
super().__init__(*args, **kwargs)
|
| 7 |
-
|
| 8 |
-
def _sanitize_parameters(self, **kwargs):
|
| 9 |
-
return {}, {}, {}
|
| 10 |
-
|
| 11 |
-
def preprocess(self, text):
|
| 12 |
-
return {"inputs": text}
|
| 13 |
-
|
| 14 |
-
def _forward(self, model_inputs):
|
| 15 |
-
# Your existing generate_audio() logic here
|
| 16 |
-
input_ids = self.tokenizer(model_inputs["inputs"]).input_ids
|
| 17 |
-
with torch.no_grad():
|
| 18 |
-
outputs = self.model.generate(input_ids)
|
| 19 |
-
|
| 20 |
-
# Convert to audio using your SNAC vocoder
|
| 21 |
-
audio = self.snac_vocoder.decode(outputs)
|
| 22 |
-
return {"audio": audio}
|
| 23 |
-
|
| 24 |
-
def postprocess(self, model_outputs):
|
| 25 |
-
return model_outputs["audio"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model_index.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"pipeline_tag": "text-to-speech",
|
| 3 |
-
"supported_tasks": ["text-to-speech"],
|
| 4 |
-
"custom_pipelines": {
|
| 5 |
-
"igbo-tts": {
|
| 6 |
-
"impl": "custom_pipeline.IgboTTSPipeline",
|
| 7 |
-
"tf": "",
|
| 8 |
-
"pt": "custom_pipeline.IgboTTSPipeline"
|
| 9 |
-
}
|
| 10 |
-
}
|
| 11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
preprocessor_config.json
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"lowercase": false,
|
| 3 |
-
"normalize_numbers": true,
|
| 4 |
-
"remove_punctuation": false,
|
| 5 |
-
"language": "ig"
|
| 6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|