Skip to content

Instantly share code, notes, and snippets.

@zilunpeng
Created March 23, 2021 21:03
Show Gist options
  • Save zilunpeng/fa29cef75866c0dd31419e46418e1bea to your computer and use it in GitHub Desktop.
Save zilunpeng/fa29cef75866c0dd31419e46418e1bea to your computer and use it in GitHub Desktop.
Create and load weights into wav2vec 2.0. Code below is part of the wav2vec 2.0 inference notebook (https://git.io/JYeKX).
w2v = torch.load(model_path)
model = Wav2VecCtc.build_model(w2v["args"], target_dict)
model.load_state_dict(w2v["model"], strict=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment