xzuyn commited on
Commit
9c29586
·
verified ·
1 Parent(s): d1f4c03

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: zero-shot-image-classification
3
+ ---
4
+ ```py
5
+ import torch
6
+ from safetensors.torch import load_file, save_file
7
+
8
+
9
+ def newclip(original_path, new_path, combined_path):
10
+ original = load_file(original_path)
11
+ new = load_file(new_path)
12
+ combined = {}
13
+
14
+ for key in original.keys():
15
+ if key in new.keys():
16
+ combined[key] = new[key]
17
+ else:
18
+ combined[key] = original[key]
19
+
20
+ save_file(combined, combined_path)
21
+
22
+ newclip(
23
+ "./original-clip-l.safetensors",
24
+ "./new-llm2clip-clip-l.safetensors",
25
+ "./combined.safetensors"
26
+ )
27
+ ```