Create co.py
Browse files
co.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from safetensors.torch import load_file, save_file
|
| 3 |
+
|
| 4 |
+
# Load all three models
|
| 5 |
+
model_1 = load_file("merged_model.safetensors")
|
| 6 |
+
model_2 = load_file("merged_model0.safetensors")
|
| 7 |
+
model_3 = load_file("merged_model2.safetensors")
|
| 8 |
+
|
| 9 |
+
# Combine the models into a single dictionary
|
| 10 |
+
combined_model = {**model_1, **model_2, **model_3}
|
| 11 |
+
|
| 12 |
+
# Save the combined model as flowgram.safetensors
|
| 13 |
+
save_file(combined_model, "flowgram.safetensors")
|
| 14 |
+
|
| 15 |
+
print("Successfully merged the models into flowgram.safetensors")
|