Instructions to use bezzam/xcodec2-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bezzam/xcodec2-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="bezzam/xcodec2-hf")# Load model directly from transformers import AutoFeatureExtractor, AutoModel extractor = AutoFeatureExtractor.from_pretrained("bezzam/xcodec2-hf") model = AutoModel.from_pretrained("bezzam/xcodec2-hf") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,7 +7,7 @@ tags:
|
|
| 7 |
- codec
|
| 8 |
---
|
| 9 |
|
| 10 |
-
# X-Codec2
|
| 11 |
|
| 12 |
The X-Codec2 model was proposed in [Llasa: Scaling Train-Time and Inference-Time Compute for Llama-based Speech Synthesis](https://huggingface.co/papers/2502.04128).
|
| 13 |
|
|
@@ -22,6 +22,14 @@ This model was contributed by [Eric Bezzam](https://huggingface.co/bezzam) and [
|
|
| 22 |
The original modeling code can be found [here](https://huggingface.co/HKUSTAudio/xcodec2/blob/main/modeling_xcodec2.py), while their training code is [here](https://github.com/zhenye234/X-Codec-2.0).
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
## Usage example
|
| 26 |
|
| 27 |
Here is a quick example of how to encode and decode an audio using this model:
|
|
|
|
| 7 |
- codec
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# X-Codec2 (Transformers-native)
|
| 11 |
|
| 12 |
The X-Codec2 model was proposed in [Llasa: Scaling Train-Time and Inference-Time Compute for Llama-based Speech Synthesis](https://huggingface.co/papers/2502.04128).
|
| 13 |
|
|
|
|
| 22 |
The original modeling code can be found [here](https://huggingface.co/HKUSTAudio/xcodec2/blob/main/modeling_xcodec2.py), while their training code is [here](https://github.com/zhenye234/X-Codec-2.0).
|
| 23 |
|
| 24 |
|
| 25 |
+
## Setup
|
| 26 |
+
|
| 27 |
+
X-Codec2 is supported natively in 🤗 Transformers. Until it is part of an official Transformers release, install from source:
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
pip install git+https://github.com/huggingface/transformers
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
## Usage example
|
| 34 |
|
| 35 |
Here is a quick example of how to encode and decode an audio using this model:
|