-
Notifications
You must be signed in to change notification settings - Fork 31.5k
Closed
Labels
Description
System Info
transformersversion: 4.46.3- Platform: Linux-6.6.20-aufs-1-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.26.1
- Safetensors version: 0.4.5
- Accelerate version: 1.0.1
- Accelerate config: not found
- PyTorch version (GPU?): 2.5.1+cu124 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: No
- Using GPU in script?: Yes
- GPU type: NVIDIA A10
Who can help?
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
import torchaudio
from transformers import MimiModel, AutoFeatureExtractor
model = MimiModel.from_pretrained("kyutai/mimi", num_quantizers=8)
feature_extractor = AutoFeatureExtractor.from_pretrained("kyutai/mimi")
model.cuda()
# load some audio file
inputs = feature_extractor(raw_audio=[audio.squeeze(0).numpy(),audio.squeeze(0).numpy()] , sampling_rate=feature_extractor.sampling_rate, return_tensors="pt")
inputs = {key:value.cuda() for key,value in inputs.items()}
out_batch = model.encode(**inputs).audio_codes
inputs = feature_extractor(raw_audio=audio.squeeze(0).numpy(), sampling_rate=feature_extractor.sampling_rate, return_tensors="pt")
inputs = {key:value.cuda() for key,value in inputs.items()}
out = model.encode(**inputs).audio_codes
(out_batch[0] == out[0]).all() # prints tensor(False, device='cuda:0')
Expected behavior
the output for out_batch[0] and out[0] should be the same.