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

Fix SpeechT5 doctests #24483

Closed
wants to merge 1 commit into from
Closed

Fix SpeechT5 doctests #24483

wants to merge 1 commit into from

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Jun 26, 2023

What does this PR do?

PR #24434 changes np.random.uniform(0, 1) to torch.rand([]). In the forward method of SpeechT5ForSpeechToSpeech and SpeechT5ForTextToSpeech, the line dropout_probability = torch.rand([]) is executed no matter if we are in training/inference mode. So the new change in #24434 will change the random sequences even we set a seed in the beginning of generate, and we get different outputs now.

Hence this PR updates the expected values for doctest.

However, I believe we should only call dropout_probability = torch.rand([]) under the condition of being in training mode.
WDYT?

@ydshieh ydshieh requested a review from sgugger June 26, 2023 08:03
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 26, 2023

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

@sgugger
Copy link
Collaborator

sgugger commented Jun 26, 2023

Yes, that would be a better fix I agree.

@ydshieh
Copy link
Collaborator Author

ydshieh commented Jun 26, 2023

Thanks, I will follow the same fix in #24486 instead.

@ydshieh ydshieh closed this Jun 26, 2023
@ydshieh ydshieh deleted the fix_speech_doc branch June 29, 2023 13:45
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.

3 participants