mirror of
https://github.com/xiph/opus.git
synced 2025-05-16 08:28:29 +00:00
added LPCNet torch implementation
Signed-off-by: Jan Buethe <jbuethe@amazon.de>
This commit is contained in:
parent
90a171c1c2
commit
35ee397e06
38 changed files with 3200 additions and 0 deletions
25
dnn/torch/lpcnet/scripts/update_checkpoints.py
Normal file
25
dnn/torch/lpcnet/scripts/update_checkpoints.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
""" script for updating checkpoints with new setup entries
|
||||
|
||||
Use this script to update older outputs with newly introduced
|
||||
parameters. (Saves us the trouble of backward compatibility)
|
||||
"""
|
||||
|
||||
|
||||
import argparse
|
||||
|
||||
import torch
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('checkpoint_file', type=str, help='checkpoint to be updated')
|
||||
parser.add_argument('--model', type=str, help='model update', default=None)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
checkpoint = torch.load(args.checkpoint_file, map_location='cpu')
|
||||
|
||||
# update model entry
|
||||
if type(args.model) != type(None):
|
||||
checkpoint['setup']['lpcnet']['model'] = args.model
|
||||
|
||||
torch.save(checkpoint, args.checkpoint_file)
|
Loading…
Add table
Add a link
Reference in a new issue