Created
March 23, 2021 21:31
-
-
Save zilunpeng/8c530a0de99f190fe4b7bfab39020357 to your computer and use it in GitHub Desktop.
Quantize wav2vec 2.0. Code below is part of quantized wav2vec 2.0 demo notebook (https://git.io/JYe1o).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quantized_model = torch.quantization.quantize_dynamic(pt_wav2vec2, {torch.nn.Linear}, dtype=torch.qint8, inplace=True) | |
quantized_model.prepare_for_inference_after_quantization() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment