AMAImedia/DeepSeek-V4-Flash-Vision-Exp main
Python json.load callCalls Python glob for file enumeration
SHA-2569410d1be5b9835b427cd5e5c74057b7174fc1d5aa9468b905c61737205d2d89e
MaleculeH₂(DbF₂)
Evidence
⋯6 lines
26 fp8_block_size = 128
27 fp4_block_size = 32
28 assert in_dim % fp8_block_size == 0 and out_dim % fp8_block_size == 0
29 assert scale.size(0) == out_dim and scale.size(1) == in_dim // fp4_block_size
30
⋯4 lines
71:71…
72
73 Args:
74 hf_ckpt_path (str): Path to the directory containing the input checkpoint files.
75 save_path (str): Path to the directory …
83:12… _experts = n_experts // mp
84 state_dicts = [{} for _ in range(mp)]
85
86 index_path = os.path.join(hf_ckpt_path, "model.safetensors.index.json")
87 expected_names = set(json.load(open(index_path))["weight_map"]) if os.path.exists(index_path) else None
88 seen_names = set()
89
90 for file_path in tqdm(glob(os.path.join(hf_ckpt_path, "*.safetensors"))):
91 with safe_open(file_path, framework="pt", device="cpu") as f:
92 for name in f.keys():
93 …
152:45… th, file)
153 if os.path.exists(old_file_path):
154 shutil.copyfile(old_file_path, new_file_path)
155
156
157if __name__ == "__main__":
158 parser = ArgumentParser()
159 parser.add_argument("--hf-ckpt-pat …