question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickvonplatencommented, Dec 20, 2021

Great catch @OllieBroadhurst! I’ll include a fix in https://github.com/huggingface/transformers/pull/14856 . Hope to have it merged by tomorrow

1reaction
OllieBroadhurstcommented, Dec 20, 2021

Hey there. Looks cool! One super edge case is SpeechEncoderDecoderModel.

For example, if we use a Wav2Vec2Model encoder and a XLMRobertaForCausalLM decoder, we would have ['input_ids', 'attention_mask'] when using either processor.tokenizer.model_input_names for Wav2Vec2 or tokenizer.model_input_names for XLMRoBERTa, when in fact the model requires input_values in the generate function.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found