Consistent speech model input names for the Seq2SeqTrainer generate function
See original GitHub issue🚀 Feature request
Could we maybe have a consistent naming convention for speech models? So far we have:
From what I can tell, these are mostly the same for the purposes of how the Seq2SeqTrainer
interprets them.
Motivation
This would prevent the need for custom Seq2SeqTrainer
classes and would make training more modular.
Your contribution
A change in param names would do the trick but could break a lot of code. Alternatively adding the capability to accept different key values in the generate
function here would work too using a (clunky) mapping such as INPUT_MAPPING_LABELS = {"input_features": "input_ids", "input_values": "input_ids", "input_ids": "input_ids"}
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Utilities for Generation - Hugging Face
This page lists all the utility functions used by generate(), greedy_search(), ... return_tensors="pt") generation_output = model.generate(**inputs, ...
Read more >transformers/seq2seq_trainer.py at main - GitHub
The inputs and targets of the model. The dictionary will be unpacked before being fed to the model. Most models expect the targets...
Read more >Building high‐quality datasets for abstractive text summarization
Training and evaluating text summarization models require datasets of sufficient size and quality. ... i are generated by the encoder as a function...
Read more >WikiDes: A Wikipedia-based dataset for generating short ...
They used Wikipedia's first paragraphs, Wikidata descriptions, and Wikidata instances as the input for the summarization. Their multilingual ...
Read more >How to Develop a Seq2Seq Model for Neural Machine ...
Instead, new models are required for the prediction step, specifically a model for encoding English input sequences of characters and a model ......
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
Great catch @OllieBroadhurst! I’ll include a fix in https://github.com/huggingface/transformers/pull/14856 . Hope to have it merged by tomorrow
Hey there. Looks cool! One super edge case is
SpeechEncoderDecoderModel
.For example, if we use a
Wav2Vec2Model
encoder and aXLMRobertaForCausalLM
decoder, we would have['input_ids', 'attention_mask']
when using eitherprocessor.tokenizer.model_input_names
for Wav2Vec2 ortokenizer.model_input_names
for XLMRoBERTa, when in fact the model requiresinput_values
in thegenerate
function.