Instructions to use facebook/hf-seamless-m4t-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/hf-seamless-m4t-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="facebook/hf-seamless-m4t-medium")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("facebook/hf-seamless-m4t-medium") model = AutoModel.from_pretrained("facebook/hf-seamless-m4t-medium", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -78,11 +78,11 @@ This time, let's translate to French.
|
|
| 78 |
```python
|
| 79 |
>>> # from audio
|
| 80 |
>>> output_tokens = model.generate(**audio_inputs, tgt_lang="fra", generate_speech=False)
|
| 81 |
-
>>> translated_text_from_audio = processor.decode(output_tokens[0].tolist()
|
| 82 |
|
| 83 |
>>> # from text
|
| 84 |
>>> output_tokens = model.generate(**text_inputs, tgt_lang="fra", generate_speech=False)
|
| 85 |
-
>>> translated_text_from_text = processor.decode(output_tokens[0].tolist()
|
| 86 |
```
|
| 87 |
|
| 88 |
### Tips
|
|
|
|
| 78 |
```python
|
| 79 |
>>> # from audio
|
| 80 |
>>> output_tokens = model.generate(**audio_inputs, tgt_lang="fra", generate_speech=False)
|
| 81 |
+
>>> translated_text_from_audio = processor.decode(output_tokens[0].tolist(), skip_special_tokens=True)
|
| 82 |
|
| 83 |
>>> # from text
|
| 84 |
>>> output_tokens = model.generate(**text_inputs, tgt_lang="fra", generate_speech=False)
|
| 85 |
+
>>> translated_text_from_text = processor.decode(output_tokens[0].tolist(), skip_special_tokens=True)
|
| 86 |
```
|
| 87 |
|
| 88 |
### Tips
|