Cheshire-AI
commited on
Commit
·
5c7d24c
1
Parent(s):
781902f
fixes
Browse files- model.safetensors.index.json +0 -1
- reconstitute.py +15 -0
model.safetensors.index.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
["model.safetensors.part0", "model.safetensors.part1", "model.safetensors.part2", "model.safetensors.part3", "model.safetensors.part4", "model.safetensors.part5", "model.safetensors.part6"]
|
|
|
|
reconstitute.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import json
|
3 |
+
|
4 |
+
def reconstruct_file(index_file, output_file):
|
5 |
+
with open(index_file, 'r') as f:
|
6 |
+
shards = json.load(f)
|
7 |
+
|
8 |
+
with open(output_file, 'wb') as output:
|
9 |
+
for shard in shards:
|
10 |
+
with open(shard, 'rb') as part:
|
11 |
+
output.write(part.read())
|
12 |
+
|
13 |
+
index_file = 'model.safetensors.index.json'
|
14 |
+
output_file = 'reconstructed_model.safetensors'
|
15 |
+
reconstruct_file(index_file, output_file)
|