pytorch / pytorch/audio

Make pipelines useful for training

Open
#2,898 3 comments 0 reactions 1 assignee View on GitHub

@mthrok is already working on this.

Since Dec 13, 2022.

triaged
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.