初始化项目,由ModelHub XC社区提供模型

Model: danish-foundation-models/dfm-decoder-open-v0-7b-pt
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-08-31 04:04:18 +08:00
commit c3096a2afd
58 changed files with 1371351 additions and 0 deletions

20
stage3/index.py Normal file
View File

@@ -0,0 +1,20 @@
import json
from safetensors.torch import load_file
path = "model.safetensors"
tensors = load_file(path)
weight_map = {}
total_size = 0
for name, tensor in tensors.items():
weight_map[name] = "model.safetensors"
total_size += tensor.element_size() * tensor.numel()
index = {
"metadata": {"total_size": str(total_size)},
"weight_map": weight_map,
}
with open("model.safetensors.index.json", "w") as f:
json.dump(index, f, indent=2)