c4ai-command-r-plus-GPTQ-ERQ / reconstitute.py
basiliskinstitute's picture
Upload reconstitute.py
c7a413d verified
raw
history blame
436 Bytes
import os
import json
def reconstruct_file(index_file, output_file):
with open(index_file, 'r') as f:
shards = json.load(f)
with open(output_file, 'wb') as output:
for shard in shards:
with open(shard, 'rb') as part:
output.write(part.read())
index_file = 'model.safetensors.index.json'
output_file = 'reconstructed_model.safetensors'
reconstruct_file(index_file, output_file)