Johnblick187 commited on
Commit
7ce31aa
·
verified ·
1 Parent(s): 9eb4e00

Update modeling_smartcoder_moe.py

Browse files
Files changed (1) hide show
  1. modeling_smartcoder_moe.py +1 -10
modeling_smartcoder_moe.py CHANGED
@@ -341,16 +341,7 @@ def load_smartcoder_moe(model_id="Johnblick187/SmartCoderMoE", dtype=torch.bfloa
341
  sf_files = sorted(Path(model_dir).glob("*.safetensors"))
342
  state_dict = {}
343
  for f in sf_files:
344
- state_dict.update(load_file(str(f)))
345
-
346
- # Expert key remap (.weight suffix in the checkpoint vs raw Parameter
347
- # here) is now handled by SmartCoderMoEMLP._load_from_state_dict
348
- # itself, so load_state_dict() needs no manual remapping here anymore.
349
- missing, unexpected = model.load_state_dict(state_dict, strict=False)
350
- if missing:
351
- print(f"Missing: {missing[:3]}{'...' if len(missing)>3 else ''}")
352
- if unexpected:
353
- print(f"Unexpected: {unexpected[:3]}{'...' if len(unexpected)>3 else ''}")
354
 
355
  model = model.to(dtype)
356
  print(f"Loaded! Params: {sum(p.numel() for p in model.parameters())/1e9:.2f}B")
 
341
  sf_files = sorted(Path(model_dir).glob("*.safetensors"))
342
  state_dict = {}
343
  for f in sf_files:
344
+ state_dict.update(load_file(str(f))))
 
 
 
 
 
 
 
 
 
345
 
346
  model = model.to(dtype)
347
  print(f"Loaded! Params: {sum(p.numel() for p in model.parameters())/1e9:.2f}B")