Skip to content

SeamlessM4TForTextToSpeech.generate not working if generation_config is passed #34811

@ydshieh

Description

@ydshieh

For SeamlessM4TForTextToSpeech with checkpoint "facebook/hf-seamless-m4t-medium",

model.generate(**model_inputs, tgt_lang="eng", generation_config=model.generation_config)

will fail with index error.

If not passing generation_config argument, it could run without error.

Reproduction

from transformers import AutoProcessor, SeamlessM4TForTextToSpeech

ckpt = "facebook/hf-seamless-m4t-medium"

processor = AutoProcessor.from_pretrained(ckpt)
model = SeamlessM4TForTextToSpeech.from_pretrained(ckpt)

model_inputs = processor(["This is a test"], return_tensors="pt")

# This works
outputs = model.generate(**model_inputs, tgt_lang="eng")
print(outputs)

# Index error
outputs2 = model.generate(**model_inputs, tgt_lang="eng", generation_config=model.generation_config)
print(outputs2)

Expected behavior

Should not fail if generation_config is passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions