facebook / hf-seamless-m4t-medium

huggingface.co
Total runs: 88.1K
24-hour runs: 0
7-day runs: -26.2K
30-day runs: -34.6K
Model's Last Updated: December 08 2023
text-to-speech

Introduction of hf-seamless-m4t-medium

Model Details of hf-seamless-m4t-medium

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 !

Runs of facebook hf-seamless-m4t-medium on huggingface.co

88.1K
Total runs
0
24-hour runs
-10.7K
3-day runs
-26.2K
7-day runs
-34.6K
30-day runs

More Information About hf-seamless-m4t-medium huggingface.co Model

More hf-seamless-m4t-medium license Visit here:

https://choosealicense.com/licenses/cc-by-nc-4.0

hf-seamless-m4t-medium huggingface.co

hf-seamless-m4t-medium huggingface.co is an AI model on huggingface.co that provides hf-seamless-m4t-medium's model effect (), which can be used instantly with this facebook hf-seamless-m4t-medium model. huggingface.co supports a free trial of the hf-seamless-m4t-medium model, and also provides paid use of the hf-seamless-m4t-medium. Support call hf-seamless-m4t-medium model through api, including Node.js, Python, http.

hf-seamless-m4t-medium huggingface.co Url

https://huggingface.co/facebook/hf-seamless-m4t-medium

facebook hf-seamless-m4t-medium online free

hf-seamless-m4t-medium huggingface.co is an online trial and call api platform, which integrates hf-seamless-m4t-medium's modeling effects, including api services, and provides a free online trial of hf-seamless-m4t-medium, you can try hf-seamless-m4t-medium online for free by clicking the link below.

facebook hf-seamless-m4t-medium online free url in huggingface.co:

https://huggingface.co/facebook/hf-seamless-m4t-medium

hf-seamless-m4t-medium install

hf-seamless-m4t-medium is an open source model from GitHub that offers a free installation service, and any user can find hf-seamless-m4t-medium on GitHub to install. At the same time, huggingface.co provides the effect of hf-seamless-m4t-medium install, users can directly use hf-seamless-m4t-medium installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

hf-seamless-m4t-medium install url in huggingface.co:

https://huggingface.co/facebook/hf-seamless-m4t-medium

Url of hf-seamless-m4t-medium

hf-seamless-m4t-medium huggingface.co Url

Provider of hf-seamless-m4t-medium huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 8.1M
Run Growth: 112.7K
Growth Rate: 1.39%
Updated:January 20 2022
huggingface.co

Total runs: 6.8M
Run Growth: -2.6M
Growth Rate: -38.41%
Updated:September 15 2023
huggingface.co

Total runs: 2.9M
Run Growth: -114.4K
Growth Rate: -3.97%
Updated:January 17 2024
huggingface.co

Total runs: 2.9M
Run Growth: -1.5M
Growth Rate: -52.74%
Updated:September 06 2023
huggingface.co

Total runs: 2.2M
Run Growth: 90.9K
Growth Rate: 4.19%
Updated:November 21 2025
huggingface.co

Total runs: 2.1M
Run Growth: -955.8K
Growth Rate: -44.83%
Updated:December 28 2021
huggingface.co

Total runs: 1.7M
Run Growth: -369.9K
Growth Rate: -21.58%
Updated:March 23 2023
huggingface.co

Total runs: 1.7M
Run Growth: -687.0K
Growth Rate: -41.19%
Updated:January 25 2024
huggingface.co

Total runs: 1.0M
Run Growth: 258.5K
Growth Rate: 25.57%
Updated:September 06 2023
huggingface.co

Total runs: 482.4K
Run Growth: 57.4K
Growth Rate: 11.90%
Updated:March 17 2025
huggingface.co

Total runs: 478.7K
Run Growth: -41.7K
Growth Rate: -8.71%
Updated:May 22 2023
huggingface.co

Total runs: 435.5K
Run Growth: 26.7K
Growth Rate: 6.13%
Updated:February 29 2024
huggingface.co

Total runs: 318.9K
Run Growth: -56.6K
Growth Rate: -17.74%
Updated:January 12 2024
huggingface.co

Total runs: 304.5K
Run Growth: 48.2K
Growth Rate: 15.84%
Updated:June 15 2023
huggingface.co

Total runs: 290.8K
Run Growth: 16.3K
Growth Rate: 5.61%
Updated:September 06 2023
huggingface.co

Total runs: 268.2K
Run Growth: -52.2K
Growth Rate: -19.45%
Updated:November 17 2022
huggingface.co

Total runs: 243.6K
Run Growth: -240.8K
Growth Rate: -98.82%
Updated:January 12 2024
huggingface.co

Total runs: 236.9K
Run Growth: 14.3K
Growth Rate: 6.02%
Updated:July 23 2024
huggingface.co

Total runs: 230.3K
Run Growth: 89.2K
Growth Rate: 38.73%
Updated:June 13 2023
huggingface.co

Total runs: 143.6K
Run Growth: -169.5K
Growth Rate: -118.02%
Updated:September 15 2023
huggingface.co

Total runs: 139.3K
Run Growth: -23.4K
Growth Rate: -16.77%
Updated:September 01 2023
huggingface.co

Total runs: 112.7K
Run Growth: -19.2K
Growth Rate: -17.08%
Updated:June 03 2022
huggingface.co

Total runs: 111.7K
Run Growth: -46.7K
Growth Rate: -41.80%
Updated:September 06 2023
huggingface.co

Total runs: 106.0K
Run Growth: -113.7K
Growth Rate: -107.21%
Updated:July 25 2023
huggingface.co

Total runs: 101.7K
Run Growth: -157.0K
Growth Rate: -154.39%
Updated:May 22 2023
huggingface.co

Total runs: 99.5K
Run Growth: 68.4K
Growth Rate: 68.74%
Updated:February 12 2023
huggingface.co

Total runs: 94.6K
Run Growth: -45.7K
Growth Rate: -48.25%
Updated:November 16 2023
huggingface.co

Total runs: 83.6K
Run Growth: -22.2K
Growth Rate: -26.55%
Updated:September 15 2023
huggingface.co

Total runs: 75.8K
Run Growth: -17.8K
Growth Rate: -23.49%
Updated:January 25 2023
huggingface.co

Total runs: 69.1K
Run Growth: -23.1K
Growth Rate: -33.44%
Updated:November 20 2023
huggingface.co

Total runs: 59.7K
Run Growth: -55.2K
Growth Rate: -92.49%
Updated:June 13 2023
huggingface.co

Total runs: 57.4K
Run Growth: 29.3K
Growth Rate: 51.12%
Updated:December 09 2025
huggingface.co

Total runs: 51.7K
Run Growth: -5.2K
Growth Rate: -10.02%
Updated:March 28 2026
huggingface.co

Total runs: 45.9K
Run Growth: -3.9K
Growth Rate: -8.41%
Updated:March 13 2024