Adds eval/hf/ so the checkpoint loads in a one-liner without any of our
repo on the user's machine:
model = AutoModelForCausalLM.from_pretrained(
"prometheus04/matilda-152m-v15-7.5B",
trust_remote_code=True, dtype="bfloat16").cuda().eval()
Verified bit-exact (max_abs_diff = 0.0, argmax agreement = 100%) against
the native matilda.model.Transformer on the same input.
Files:
- configuration_matilda.py — MatildaConfig(PretrainedConfig) mirroring our
ModelConfig (qk_norm, mlp_activation, final_logit_softcap, ...) with
auto_map populated for AutoConfig/AutoModel/AutoModelForCausalLM.
- modeling_matilda.py — MatildaForCausalLM(PreTrainedModel, GenerationMixin)
+ MatildaModel + MatildaBlock + MatildaAttention + ReLU2/SwiGLU FFNs.
Uses LigerRMSNorm when available, falls back to a plain RMSNorm on CPU.
Eager RoPE (same workaround as the training code).
- convert_to_hf.py — strips _orig_mod prefix, renames keys, clones
embed.weight into lm_head.weig…
eval: token-matched comparison vs Pythia-160M (10 ckpts x 5 tasks)