stukenov commited on
Commit
79c3d5c
·
verified ·
1 Parent(s): 77ec394

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -61,9 +61,11 @@ for name, repo in ASR_MODELS.items():
61
  w = hf_hub_download(repo, "model.pt")
62
  sd = torch.load(w, map_location="cpu", weights_only=True)
63
  info = mdl.load_state_dict(sd, strict=False)
64
- print(f" missing: {len(info.missing_keys)}, unexpected: {len(info.unexpected_keys)}")
 
 
65
  for k in info.missing_keys:
66
- if "rope" not in k and "inv_freq" not in k:
67
  print(f" MISSING: {k}")
68
  mdl.requires_grad_(False)
69
  loaded_asr[name] = mdl
 
61
  w = hf_hub_download(repo, "model.pt")
62
  sd = torch.load(w, map_location="cpu", weights_only=True)
63
  info = mdl.load_state_dict(sd, strict=False)
64
+ # lm_head not in checkpoint — it's tied to embed_tokens
65
+ mdl.lm_head.weight = mdl.embed_tokens.weight
66
+ print(f" missing: {len(info.missing_keys)}, unexpected: {len(info.unexpected_keys)}, lm_head tied")
67
  for k in info.missing_keys:
68
+ if "rope" not in k and "inv_freq" not in k and "lm_head" not in k:
69
  print(f" MISSING: {k}")
70
  mdl.requires_grad_(False)
71
  loaded_asr[name] = mdl