Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VITS] Add to TTA pipeline #25906

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

sanchit-gandhi
Copy link
Contributor

What does this PR do?

Small changes to the TTA pipeline to allow for the VITS model

if self.model.can_generate():
output = self.model.generate(**model_inputs, **kwargs)
else:
output = self.model(**model_inputs, **kwargs)[0]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we generate, we return a torch tensor as our output.

If we do a forward pass, we return an instance of ModelOutput, where the 0-th element is our generated waveform

Hence, we slice here with [0] to get our waveform output

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 1, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@ylacombe ylacombe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Thanks for adding this model and correcting the forward case!

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

src/transformers/models/auto/modeling_auto.py Show resolved Hide resolved
tests/pipelines/test_pipelines_text_to_audio.py Outdated Show resolved Hide resolved
sanchit-gandhi added 2 commits September 1, 2023 14:58
# Conflicts:
#	tests/pipelines/test_pipelines_text_to_audio.py
@sanchit-gandhi sanchit-gandhi merged commit b439129 into huggingface:main Sep 1, 2023
@sanchit-gandhi sanchit-gandhi deleted the vits-pipeline branch September 1, 2023 15:51
parambharat pushed a commit to parambharat/transformers that referenced this pull request Sep 26, 2023
* [VITS] Add to TTA pipeline

* Update tests/pipelines/test_pipelines_text_to_audio.py

Co-authored-by: Yoach Lacombe <[email protected]>

* remove extra spaces

---------

Co-authored-by: Yoach Lacombe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants