Make pipelines useful for training
@mthrok is already working on this.
Since Dec 13, 2022.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 799
- Avg merge
- 58m
- Merged PRs (30d)
- 3
Description
🚀 The feature
Currently, the pipelines seem to be focusing solely on feature extraction purposes as it sets model.eval() internally (at least in Wav2Vec2 code that I quickly checked). Is there any particular reason for this, or is there anything that avoids me to use the returned module as part of another module and do training?
Also, to couple the feature request, I think there should also be an argument to the bundle.get_model() methods that disables downloading the original checkpoint as once its fine-tuned, there is no longer a need for the vanilla checkpoint.
Proposed API:
self.backbone = bundle.get_model(training=True)
# train the model and save the weights with torch
# inference time
# training=False will skip setting .eval() and also should find a workaround for
# auto downloading of checkpoints from torch hub ideally.
self.backbone = bundle.get_model(training=False)
# load state dict of the full model which will bring weights associated to .backbone
Motivation, pitch
It is often desirable to fine-tune a particular pre-trained model on downstream tasks so it would be good if this is recognised by torchaudio pipelines as well.
Alternatives
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.