Hakurei Reimu commited on
Commit
4c4f051
1 Parent(s): 0dc7464

add pruned vae

Browse files
Files changed (2) hide show
  1. vae/kl-f8-anime2.ckpt +2 -2
  2. vae/pruner.py +15 -0
vae/kl-f8-anime2.ckpt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:72da9f22a79b6588565515084ba6ad0c0a16653cfc78cce3a68b3914f32079af
3
- size 1096241754
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df3c506e51b7ee1d7b5a6a2bb7142d47d488743c96aa778afb0f53a2cdc2d38d
3
+ size 404662241
vae/pruner.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import argparse
3
+
4
+ parser = argparse.ArgumentParser()
5
+ parser.add_argument('--input', '-I', type=str, help='Input file to prune', required = True)
6
+ args = parser.parse_args()
7
+ file = args.input
8
+
9
+ checkpoint = torch.load(file)
10
+ new_sd = dict()
11
+ for k in checkpoint.keys():
12
+ if k != 'optimizer_states':
13
+ new_sd[k] = checkpoint[k]
14
+
15
+ torch.save(new_sd, f'pruned-{file}')