Unable to pass encoder_outputs to generate calls
See original GitHub issueEnvironment info
transformers
version: Github Main branch
Who can help
TextGeneration: @TevenLeScao
Information
Model I am using (Bert, XLNet …): T5
I’m unable to pass preconputed encoder_outputs to the .generate()
method.
I’ve tried defining:
model_kwargs = {"encoder_outputs": encoder_outputs}
output = model.generate(model_kwargs)
But I’ve noticed some validation errors for input_ids
. Even if I replace input_ids with dummy values, I’ve noticed the model_kwargs is always replaced here:
https://github.com/huggingface/transformers/blob/master/src/transformers/generation_utils.py#L448
I think it can be fixed (without optimization) by just replacing:
model_kwargs["encoder_outputs"] = encoder_outputs
with:
model_kwargs.setdefault("encoder_outputs", encoder_outputs)
If you agree I can try to open a PR to fix this.
Best,
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Encoder Signal Overview & Troubleshooting Common Issues
Encoder Signal Overview & How to Troubleshoot Common Issues. Encoder signal outputs are generated by a rotary encoder when the shaft or bore...
Read more >Four Steps to End Encoder Problems - YouTube
Your browser can't play this video. Learn more.
Read more >6 Simple Tips for Encoder Repair and Troubleshooting
1.Incorrect Output – Getting the wrong or distorted output? Random faults? This can be caused by several things including: loose wiring, ...
Read more >Unable to feed decoder output to encoder input using ...
Here I'm just ignoring the encoder output until I get this bunch of code error free. private boolean doEncoderOutput(MediaCodec.BufferInfo ...
Read more >Processing Data in the Encoder - Win32 apps - Microsoft Learn
The encoder starts processing and the data and produces one or more output media samples that must be retrieved by ProcessOutput as long...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @gabisurita - I understand that one might want to forward encoder_outputs in the generate function. However, adding such a possibility opens the door for many problems in case
beam_search
is chosen. We are currently working on a bigger refactor that should solve this problem by a better design choice ofgenerate()
. I’m afraid that this will still take ~3,4 weeks to complete though.This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.