diff --git a/egs/librispeech/SSL/local/convert_checkpoint_from_fairseq.py b/egs/librispeech/SSL/local/convert_checkpoint_from_fairseq.py index f06adb9e5..4212cd9c6 100644 --- a/egs/librispeech/SSL/local/convert_checkpoint_from_fairseq.py +++ b/egs/librispeech/SSL/local/convert_checkpoint_from_fairseq.py @@ -1,7 +1,8 @@ # simple script to convert a fairseq checkpoint into pytorch parameter state dict -import torch -from collections import OrderedDict from argparse import ArgumentParser +from collections import OrderedDict + +import torch parser = ArgumentParser() parser.add_argument("--src") @@ -13,5 +14,5 @@ tgt = args.tgt old_checkpoint = torch.load(src) new_checkpoint = OrderedDict() -new_checkpoint['model'] = old_checkpoint['model'] +new_checkpoint["model"] = old_checkpoint["model"] torch.save(new_checkpoint, tgt)