Adjust FF block only if it exists
This commit is contained in:
parent
3739a6b914
commit
7d27f1c4c1
@ -75,10 +75,11 @@ class WeightHandler:
|
|||||||
# Reshape and process the huggingface weights
|
# Reshape and process the huggingface weights
|
||||||
if "transformer_blocks" in weights:
|
if "transformer_blocks" in weights:
|
||||||
for block in weights["transformer_blocks"]:
|
for block in weights["transformer_blocks"]:
|
||||||
block["ff"] = {
|
if block.get("ff") is not None:
|
||||||
"linear1": block["ff"]["net"][0]["proj"],
|
block["ff"] = {
|
||||||
"linear2": block["ff"]["net"][2]
|
"linear1": block["ff"]["net"][0]["proj"],
|
||||||
}
|
"linear2": block["ff"]["net"][2]
|
||||||
|
}
|
||||||
if block.get("ff_context") is not None:
|
if block.get("ff_context") is not None:
|
||||||
block["ff_context"] = {
|
block["ff_context"] = {
|
||||||
"linear1": block["ff_context"]["net"][0]["proj"],
|
"linear1": block["ff_context"]["net"][0]["proj"],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user