Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tools/checkpoint/checkpoint_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,10 @@ def has_layer_index(key: str) -> bool:
@click.option(
"--param-to-param-group-map-json",
type=str,
default="{}",
help="JSON string representing the param to parameter group map."
default=None,
help="Path to a JSON file mapping parameter names to optimizer param group ids. "
"Required only if the source checkpoint has multiple optimizer param groups "
"(e.g. different LR/weight-decay per group). Leave unset for single-group checkpoints."
)
@click.option(
"--rename-mtp-keys",
Expand Down Expand Up @@ -921,8 +923,11 @@ def oom_observer(device, alloc, device_alloc, device_free):

ckpt_path = Path(input_dir)
output_dir = Path(output_dir)
with open(param_to_param_group_map_json, "r") as f:
param_to_param_group_map = json.load(f)
if param_to_param_group_map_json:
with open(param_to_param_group_map_json, "r") as f:
param_to_param_group_map = json.load(f)
else:
param_to_param_group_map = {}
_swiglu_modules = (
[m.strip() for m in swiglu_modules.split(",") if m.strip()]
if swiglu_modules is not None else None
Expand Down
Loading