/ Модель

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

Контекст
4 096 токенов
Параметры
464 млн
Лицензия
CC BY-NC 4.0
Архитектура
seamless_m4t · dense
Библиотека
transformers
Опубликована
28 авг 2023

hf-seamless-m4t-medium

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

SeamlessM4T Medium — мультимодальная модель Meta для перевода между речью и текстом, распознавания речи и синтеза речи на многих языках.

50 937скачиваний за 30 дней33лайкавеса обновлены8 дек 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

SeamlessM4T Medium — мультимодальная модель перевода от Meta, представленная в реализации Hugging Face для Transformers. Вариант на 463,7 млн параметров поддерживает перевод речи и текста между языками, распознавание речи и синтез речи; для задач доступны общая модель и специализированные подмодели. В README указано, что модель принимает речь на 101 языке, текст на 196 языках и генерирует речь на 35 языках. Максимальная длина контекста по метаданным — 4096 токенов.

Модель подходит для перевода речи в речь или текст, перевода текста в текст или речь, а также для автоматического распознавания речи. При синтезе можно выбирать голос с помощью идентификатора говорящего и настраивать стратегию генерации. README отмечает, что SeamlessM4T v2 улучшает качество и скорость генерации речи по сравнению с этой версией. Репозиторий содержит веса PyTorch; лицензия CC BY-NC 4.0 разрешает использование с указанием авторства, но запрещает коммерческое применение.

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

  • перевод речи с одного языка на другой с озвучиванием
  • перевод речи в текст
  • перевод текста на другой язык
  • озвучивание переведённого текста
  • распознавание речи на поддерживаемых языках

Ограничения

По README, SeamlessM4T v2 превосходит эту версию по качеству и скорости генерации речи. Лицензия CC BY-NC 4.0 не допускает коммерческого использования.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

SeamlessM4T Medium

SeamlessM4T is a collection of models designed to provide high quality translation, allowing people from different linguistic communities to communicate effortlessly through speech and text.

This repository hosts 🤗 Hugging Face's implementation of SeamlessM4T. You can find the original weights, as well as a guide on how to run them in the original hub repositories (large and medium checkpoints).


🌟 SeamlessM4T v2, an improved version of this version with a novel architecture, has been released here. This new model improves over SeamlessM4T v1 in quality as well as inference speed in speech generation tasks.

SeamlessM4T v2 is also supported by 🤗 Transformers, more on it in the model card of this new version or directly in 🤗 Transformers docs.


SeamlessM4T Medium covers:

This is the "medium" variant of the unified model, which enables multiple tasks without relying on multiple separate models:

  • Speech-to-speech translation (S2ST)
  • Speech-to-text translation (S2TT)
  • Text-to-speech translation (T2ST)
  • Text-to-text translation (T2TT)
  • Automatic speech recognition (ASR)

You can perform all the above tasks from one single model, SeamlessM4TModel, but each task also has its own dedicated sub-model.

🤗 Usage

First, load the processor and a checkpoint of the model:

>>> from transformers import AutoProcessor, SeamlessM4TModel

>>> processor = AutoProcessor.from_pretrained("facebook/hf-seamless-m4t-medium")
>>> model = SeamlessM4TModel.from_pretrained("facebook/hf-seamless-m4t-medium")

You can seamlessly use this model on text or on audio, to generated either translated text or translated audio.

Here is how to use the processor to process text and audio:

>>> # let's load an audio sample from an Arabic speech corpus
>>> from datasets import load_dataset
>>> dataset = load_dataset("arabic_speech_corpus", split="test", streaming=True)
>>> audio_sample = next(iter(dataset))["audio"]

>>> # now, process it
>>> audio_inputs = processor(audios=audio_sample["array"], return_tensors="pt")

>>> # now, process some English test as well
>>> text_inputs = processor(text = "Hello, my dog is cute", src_lang="eng", return_tensors="pt")

Speech

SeamlessM4TModel can seamlessly generate text or speech with few or no changes. Let's target Russian voice translation:

>>> audio_array_from_text = model.generate(**text_inputs, tgt_lang="rus")[0].cpu().numpy().squeeze()
>>> audio_array_from_audio = model.generate(**audio_inputs, tgt_lang="rus")[0].cpu().numpy().squeeze()

With basically the same code, I've translated English text and Arabic speech to Russian speech samples.

Text

Similarly, you can generate translated text from audio files or from text with the same model. You only have to pass generate_speech=False to SeamlessM4TModel.generate. This time, let's translate to French.

>>> # from audio
>>> output_tokens = model.generate(**audio_inputs, tgt_lang="fra", generate_speech=False)
>>> translated_text_from_audio = processor.decode(output_tokens[0].tolist(), skip_special_tokens=True)

>>> # from text
>>> output_tokens = model.generate(**text_inputs, tgt_lang="fra", generate_speech=False)
>>> translated_text_from_text = processor.decode(output_tokens[0].tolist(), skip_special_tokens=True)

Tips

1. Use dedicated models

SeamlessM4TModel is transformers top level model to generate speech and text, but you can also use dedicated models that perform the task without additional components, thus reducing the memory footprint. For example, you can replace the audio-to-audio generation snippet with the model dedicated to the S2ST task, the rest is exactly the same code:

>>> from transformers import SeamlessM4TForSpeechToSpeech
>>> model = SeamlessM4TForSpeechToSpeech.from_pretrained("facebook/hf-seamless-m4t-medium")

Or you can replace the text-to-text generation snippet with the model dedicated to the T2TT task, you only have to remove generate_speech=False.

>>> from transformers import SeamlessM4TForTextToText
>>> model = SeamlessM4TForTextToText.from_pretrained("facebook/hf-seamless-m4t-medium")

Feel free to try out SeamlessM4TForSpeechToText and SeamlessM4TForTextToSpeech as well.

2. Change the speaker identity

You have the possibility to change the speaker used for speech synthesis with the spkr_id argument. Some spkr_id works better than other for some languages!

3. Change the generation strategy

You can use different generation strategies for speech and text generation, e.g .generate(input_ids=input_ids, text_num_beams=4, speech_do_sample=True) which will successively perform beam-search decoding on the text model, and multinomial sampling on the speech model.

4. Generate speech and text at the same time

Use return_intermediate_token_ids=True with SeamlessM4TModel to return both speech and text !

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
SeamlessM4TModel
Ревизия весов
ecf60d4

0 моделей