ONNX Model Zoo

anzorq/kbd-vits-tts-male

By anzorq · ↓ 3 · ♥ 0 · Updated 2024-06-09

What's in this repo

This page lists the files in anzorq/kbd-vits-tts-male, including kbd_vits_male.onnx.

  • 1 ONNX models (.onnx files)
  • 13 files, including 5 .pth, 4 .json, 1 .md, 1 .0, 1 .onnx
  • Last updated 2024-06-09

ONNX files

File Size Download
onnx/kbd_vits_male.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

KBD TTS Male Model

Install dependencies

pip install git+https://github.com/coqui-ai/TTS@dev#egg=TTS`
pip install gradio`

Usage

import os
from TTS.utils.download import download_url
from TTS.utils.synthesizer import Synthesizer
import tempfile

def download_model_and_config():
    dir_path = "kbd-vits-tts"
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
    model_url = "https://huggingface.co/anzorq/kbd-vits-tts-male/resolve/main/checkpoint_56000.pth"
    config_url = "https://huggingface.co/anzorq/kbd-vits-tts-male/resolve/main/config_35000.json"
    download_url(model_url, dir_path, "model.pth")
    download_url(config_url, dir_path, "config.json")
    return dir_path

model_dir = download_model_and_config()

def tts_male(text: str):
    synthesizer = Synthesizer(f"{model_dir}/model.pth", f"{model_dir}/config.json")
    text = text.replace("I", "ӏ") #replace capital 'i's with lowercase "Palochka" symbol
    wavs = synthesizer.tts(text)
    
    with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
        synthesizer.save_wav(wavs, fp)
        return fp.name

text = "Гупсыси псалъэ, зыплъыхьи тIыс"
output_path = tts_male(text)
print(f"Generated audio saved at: {output_path}")

This will generate an audio file using the male model and save it to a temporary file. The path to the generated audio file will be printed.

Note

The model was trained on text with the lowercase palochka symbol.

Make sure to replace "I"s and similar symbols with "ӏ" (lowercase palochka symbol) in the input text, as shown in the provided code.

Model info

text-to-speech transformers
transformers tensorboard onnx audio text-to-speech kbd dataset:anzorq/kbd_speech license:mit endpoints_compatible region:us
↓ 3 ♥ 0

Created: 2023-08-23

Updated: 2024-06-09

View on Hugging Face

Files (13)

.gitattributes
README.md
best_model_2550.pth
best_model_2550_1.pth
checkpoint_3000.pth
checkpoint_35000.pth
checkpoint_56000.pth
config.json
config_1.json
config_3.json
config_35000.json
events.out.tfevents.1692867492.7f5a199528f5.974.0
onnx/kbd_vits_male.onnx ONNX

Related models