/ Модель

Характеристики

Лицензия
MIT
Архитектура
speecht5 · dense
Базовая модель
speecht5_tts
Опубликована
9 янв 2025

speecht5_tts-wolof

Синтез речиТекст → аудио3 профессии

Дообученная SpeechT5 для преобразования текста на волоф в речь.

2 984скачиваний за 30 дней1лайквеса обновлены11 янв 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Синтез речи» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели сгенерируют результат по каждой задаче. Опубликованный тест появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель bilalfaye/speecht5_tts-wolof разработана Билалом Файе и дообучена на основе microsoft/speecht5_tts для синтеза речи на языке волоф. Она использует архитектуру SpeechT5 и специальный токенизатор, а конфигурация адаптирована к его словарю. Модель принимает текст на волоф и генерирует речь; её можно встроить в голосовые интерфейсы и помощники для носителей языка.

Модель предназначена прежде всего для волоф. Качество синтеза может меняться в зависимости от сложности текста и обучающих данных; на других языках и с незнакомыми словами или символами она может работать хуже. Репозиторий распространяется по лицензии MIT.

Сценарии применения

  • озвучивание текста на волоф
  • синтез речи для голосовых интерфейсов на волоф
  • голосовые ответы виртуального помощника на волоф

Ограничения

Модель настроена на волоф и может хуже работать с другими языками, акцентами, сложными текстами и словами или символами вне словаря токенизатора.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

speecht5_tts-wolof

This model is a fine-tuned version of SpeechT5 for Text-to-Speech (TTS) on a Wolof dataset. It uses a custom tokenizer designed for Wolof and adjusts the baseline model's configuration to account for the new vocabulary introduced by the custom tokenizer. This version of SpeechT5 provides speech synthesis capabilities specifically tuned for the Wolof language.

Model description

This model is based on the SpeechT5 architecture, which integrates both speech recognition and synthesis into a unified framework. It is fine-tuned for Text-to-Speech (TTS) using a custom-trained tokenizer and an adapted configuration that accounts for the unique vocabulary of the Wolof language. The fine-tuning process was carried out using a dataset containing text in Wolof to help the model synthesize speech that captures the nuances of the language.


Installation Instructions for Users

To install the necessary dependencies, run the following command:

!pip install transformers datasets

Model Loading and Speech Generation Code

import torch
from transformers import SpeechT5ForTextToSpeech, SpeechT5Processor
from transformers import SpeechT5HifiGan

def load_speech_model(checkpoint="bilalfaye/speecht5_tts-wolof", vocoder_checkpoint="microsoft/speecht5_hifigan"):
    """
    Load the SpeechT5 model, processor, and vocoder for text-to-speech.
    
    Args:
        checkpoint (str): The model checkpoint for SpeechT5 TTS.
        vocoder_checkpoint (str): The checkpoint for the HiFi-GAN vocoder.
    
    Returns:
        processor: The processor for the model.
        model: The loaded SpeechT5 model.
        vocoder: The loaded HiFi-GAN vocoder.
        device: The device (CPU or GPU) the model is loaded on.
    """
    # Check for GPU availability and set device accordingly
    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    
    # Load the SpeechT5 processor and model
    processor = SpeechT5Processor.from_pretrained(checkpoint)
    model = SpeechT5ForTextToSpeech.from_pretrained(checkpoint).to(device)  # Move model to the correct device

    # Load the HiFi-GAN vocoder
    vocoder = SpeechT5HifiGan.from_pretrained(vocoder_checkpoint).to(device)  # Move vocoder to the correct device

    return processor, model, vocoder, device

# Example usage
processor, model, vocoder, device = load_speech_model()

# Verify the device being used
print(f"Model and vocoder loaded on device: {device}")

from datasets import load_dataset
# Load speaker embeddings (this dataset contains speaker-specific embeddings)
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
speaker_embedding = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)

import torch
from transformers import SpeechT5ForTextToSpeech, SpeechT5Processor, SpeechT5HifiGan
from IPython.display import Audio, display

def generate_speech_from_text(text, 
                              speaker_embedding=speaker_embedding,
                              processor=processor,
                              model=model,
                              vocoder=vocoder):            
    """
    Generates speech from a given text using SpeechT5 and HiFi-GAN vocoder.

    Args:
        text (str): The input text to be converted to speech.
        checkpoint (str): The model checkpoint for SpeechT5 TTS.
        vocoder_checkpoint (str): The checkpoint for the HiFi-GAN vocoder.
        speaker_embedding (torch.Tensor): The speaker embedding tensor.
        processor (SpeechT5Processor): The processor for the model.
        model (SpeechT5ForTextToSpeech): The loaded SpeechT5 model.
        vocoder (SpeechT5HifiGan): The loaded HiFi-GAN vocoder.

    Returns:
        None
    """
    # Parameters for text-to-speech generation
    max_text_positions = model.config.max_text_positions  # Token limit
    max_length = model.config.max_length * 1.2  # Slightly extended max_length
    min_length = max_length // 3  # Adjust based on max_length
    num_beams = 7  # Use beam search for better quality
    temperature = 0.6  # Reduce temperature for stability

    # Tokenize the input text and move input tensor to the correct device
    inputs = processor(text=text, return_tensors="pt", padding=True, truncation=True, max_length=max_text_positions)
    inputs = {key: value.to(model.device) for key, value in inputs.items()}  # Move inputs to device

    # Generate speech
    speech = model.generate(
        inputs["input_ids"],
        speaker_embeddings=speaker_embedding.to(model.device),  # Ensure speaker_embedding is also on the correct device
        vocoder=vocoder,
        max_length=int(max_length),
        min_length=int(min_length),
        num_beams=num_beams,
        temperature=temperature,
        no_repeat_ngram_size=3,
        repetition_penalty=1.5,
        eos_token_id=None,
        use_cache=True
    )

    # Detach the speech from the computation graph and move it to CPU
    speech = speech.detach().cpu().numpy()

    # Play the generated speech using IPython Audio
    display(Audio(speech, rate=16000))


# Example usage
text = "ñu ne ñoom ñooy nattukaay satélite yi"
generate_speech_from_text(text)

Intended uses & limitations

Intended uses:

  • Text-to-Speech Generation: This model can be used to convert Wolof text into natural-sounding speech. It can be integrated into applications that require voice interfaces, virtual assistants, or voice synthesis for Wolof-speaking communities.

Limitations:

  • Limited Scope: The model has been specifically fine-tuned for Wolof and may not perform well with other languages or accents.
  • Data Availability: While the model was fine-tuned on a Wolof dataset, the quality of the generated speech may vary depending on the complexity of the input text and the dataset used for training.
  • Vocabulary and Tokenizer Constraints: The tokenizer was specially trained for Wolof, so it may not handle out-of-vocabulary words or unknown characters effectively.

Training and evaluation data

The model was fine-tuned on a custom dataset consisting of text in the Wolof language. This dataset was used to adjust the model to generate speech that accurately reflects the phonetic and syntactic properties of Wolof.

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • Learning Rate: 1e-05
  • Training Batch Size: 8
  • Evaluation Batch Size: 2
  • Seed: 42
  • Gradient Accumulation Steps: 8
  • Total Train Batch Size: 64
  • Optimizer: Adam with betas=(0.9, 0.999) and epsilon=1e-08
  • Learning Rate Scheduler Type: Linear
  • Warmup Steps: 500
  • Training Steps: 255000
  • Mixed Precision Training: Native AMP

Training results

EpochTraining LossValidation Loss
260.38940.3687
270.38580.3712
280.38740.3669
290.38870.3685
300.38540.3670
320.38560.3697

The evaluation table only includes the last 5 epochs as requested.

Framework version

  • Transformers: 4.41.2
  • PyTorch: 2.4.0+cu121
  • Datasets: 3.2.0
  • Tokenizers: 0.19.1

Author

  • Bilal FAYE

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Можно запустить

Подбираем GPU…

Класс архитектуры
SpeechT5ForTextToSpeech
Ревизия весов
7e6c1ac

0 моделей