File size: 264 Bytes
51f6859
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import torch
import argparse

parer = argparse.ArgumentParser()
parer.add_argument('source_file')
parer.add_argument('des_file')
args = parer.parse_args()

ckpt = torch.load(args.source_file, map_location='cpu')
ckpt = ckpt['model']
torch.save(ckpt, args.des_file)