I just followed this tutorial. but got error
https://huggingface.co/learn/audio-course/en/chapter2/tts_pipeline
from transformers import pipeline
pipe = pipeline("text-to-speech", model="suno/bark-small")
text = "Ladybugs have had important roles in culture and religion, being associated with luck, love, fertility and prophecy. "
output = pipe(text)
RuntimeError: Expected elements.dtype() == test_elements.dtype() to be true, but got false.
|
return torch.isin(elements, test_elements) |
so I just added this code. and works fine. when I took a log with bug code the elements.dtype shown 'int32' but others elements.dtype, and test_elements.dtype 'int64'
if elements.dtype != test_elements.dtype:
elements = elements.to(dtype=test_elements.dtype)
# Note: don't use named arguments in `torch.isin`, see https://github.com/pytorch/pytorch/issues/126045
return torch.isin(elements, test_elements)
my env:
macbook pro m1
conda
transformers-cli env
Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.
transformers version: 4.51.1
- Platform: macOS-15.3.1-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.30.2
- Safetensors version: 0.5.3
- Accelerate version: 1.6.0
- Accelerate config: not found
- DeepSpeed version: not installed
- PyTorch version (GPU?): 2.6.0 (False)
- 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. In fact. I don't know. I didn't set about these.
Who can help?
@gante
Information
Tasks
Reproduction
just run above code.
Expected behavior
RuntimeError
I just followed this tutorial. but got error
https://huggingface.co/learn/audio-course/en/chapter2/tts_pipeline
transformers/src/transformers/pytorch_utils.py
Line 334 in 7ecc5b8
so I just added this code. and works fine. when I took a log with bug code the elements.dtype shown 'int32' but others elements.dtype, and test_elements.dtype 'int64'
my env:
macbook pro m1
conda
transformers-cli env
Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.
transformersversion: 4.51.1Who can help?
@gante
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
just run above code.
Expected behavior
RuntimeError