File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1893,6 +1893,7 @@ def load_lora_into_transformer(
1893
1893
state_dict = {
1894
1894
k .replace (f"{ cls .transformer_name } ." , "" ): v for k , v in state_dict .items () if k in transformer_keys
1895
1895
}
1896
+ print (f'{ any ("transformer_blocks." in k for k in state_dict )= } ' )
1896
1897
1897
1898
if len (state_dict .keys ()) > 0 :
1898
1899
# check with first key if is not in peft format
@@ -1944,17 +1945,19 @@ def load_lora_into_transformer(
1944
1945
# Check only for unexpected keys.
1945
1946
unexpected_keys = getattr (incompatible_keys , "unexpected_keys" , None )
1946
1947
if unexpected_keys :
1948
+ lora_unexpected_keys = [k for k in unexpected_keys if "lora" in k and adapter_name in k ]
1947
1949
logger .warning (
1948
1950
f"Loading adapter weights from state_dict led to unexpected keys not found in the model: "
1949
- f" { unexpected_keys } . "
1951
+ f" { lora_unexpected_keys } . "
1950
1952
)
1951
1953
1952
1954
# Filter missing keys specific to the current adapter.
1953
1955
missing_keys = getattr (incompatible_keys , "missing_keys" , None )
1954
1956
if missing_keys :
1957
+ lora_missing_keys = [k for k in missing_keys if "lora" in k and adapter_name in k ]
1955
1958
logger .warning (
1956
1959
f"Loading adapter weights from state_dict led to missing keys in the model: "
1957
- f" { missing_keys } . "
1960
+ f" { lora_missing_keys } . "
1958
1961
)
1959
1962
1960
1963
# Offload back.
You can’t perform that action at this time.
0 commit comments