Skip to content

Commit

Permalink
fix missing variables for Phi/GPT2 weights loading
Browse files Browse the repository at this point in the history
  • Loading branch information
francoishernandez committed Dec 9, 2024
1 parent fb6ff84 commit 8d4c7ec
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion eole/bin/convert/convert_HF.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,16 @@ def build_first_shard(hf, eole_safetensor):

if w is not None:
if srcmap is not None:
w = eval("w" + srcmap).contiguous()
w = eval(
"w" + srcmap,
{
"w": w,
"hidden_size": model_config["hidden_size"],
"transformer_ff": model_config[
"transformer_ff"
],
},
).contiguous()
eole_safetensor[
eole_prefix + str(i) + target + param
] = w
Expand Down

0 comments on commit 8d4c7ec

Please sign in to comment.