mirror of
https://github.com/karpathy/nanochat.git
synced 2025-12-06 04:12:13 +00:00
Fixing subtle bug: lstrip removes all matching characters, including potentially required ones. Use removeprefix instead.
This commit is contained in:
parent
b6da6982f6
commit
f1e15f5f4d
|
|
@ -72,7 +72,7 @@ def build_model(checkpoint_dir, step, device, phase):
|
|||
for k, v in model_data.items()
|
||||
}
|
||||
# Hack: fix torch compile issue, which prepends all keys with _orig_mod.
|
||||
model_data = {k.lstrip("_orig_mod."): v for k, v in model_data.items()}
|
||||
model_data = {k.removeprefix("_orig_mod."): v for k, v in model_data.items()}
|
||||
model_config_kwargs = meta_data["model_config"]
|
||||
log0(f"Building model with config: {model_config_kwargs}")
|
||||
model_config = GPTConfig(**model_config_kwargs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user