We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
transformers
from transformers import EncodecConfig, EncodecModel, EncodecFeatureExtractor import numpy as np import torch signal = [np.random.randn(1065473), np.random.randn(1065473) ] signal = EncodecFeatureExtractor()(signal) model = EncodecModel(EncodecConfig()) result = model(torch.tensor(signal.input_values), return_dict = True) print(type(result)) result2 = model(torch.tensor(signal.input_values), return_dict = False) print(type(result2))
will print <class 'transformers.models.encodec.modeling_encodec.EncodecOutput'> even when return_dict is set to False.
<class 'transformers.models.encodec.modeling_encodec.EncodecOutput'>
return_dict
It should return a tuple when return_dict is set to False.
cc @sanchit-gandhi
The text was updated successfully, but these errors were encountered:
transformers/src/transformers/models/encodec/modeling_encodec.py
Line 789 in dfaadfd
@kamilakesbi by default self.config.return_dict is true so the or condition is always maintained and the function returns a dict.
Sorry, something went wrong.
Hi @AbhinavJangra29,
Thanks for spotting the issue. @jla524 has opened a PR to fix it!
Successfully merging a pull request may close this issue.
System Info
transformers
version: 4.42.0.dev0Reproduction
will print
<class 'transformers.models.encodec.modeling_encodec.EncodecOutput'>
even whenreturn_dict
is set to False.Expected behavior
It should return a tuple when
return_dict
is set to False.cc @sanchit-gandhi
The text was updated successfully, but these errors were encountered: