Co-authored-by: Alex Nails <alex.nails@radixark.ai>
This commit is contained in:
co-authored by
Alex Nails
parent
878d77929d
commit
4597dd4d88
@@ -83,7 +83,7 @@ class LlamaForClassification(nn.Module):
|
||||
elif "lm_head" in name:
|
||||
continue
|
||||
else:
|
||||
LlamaForCausalLM.load_weights(self, [(name, loaded_weight)])
|
||||
LlamaForCausalLM._legacy_load_weights(self, [(name, loaded_weight)])
|
||||
|
||||
|
||||
EntryClass = LlamaForClassification
|
||||
|
||||
@@ -74,7 +74,7 @@ class LlamaForSequenceClassification(nn.Module):
|
||||
)
|
||||
|
||||
def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
|
||||
return LlamaForCausalLM.load_weights(self, weights)
|
||||
return LlamaForCausalLM._legacy_load_weights(self, weights)
|
||||
|
||||
|
||||
class LlamaForSequenceClassificationWithNormal_Weights(LlamaForSequenceClassification):
|
||||
|
||||
@@ -71,7 +71,7 @@ class Qwen2ForSequenceClassification(nn.Module):
|
||||
filtered_weights = [
|
||||
(name, w) for name, w in weights if not name.startswith("lm_head")
|
||||
]
|
||||
return Qwen2ForCausalLM.load_weights(self, filtered_weights)
|
||||
return Qwen2ForCausalLM._legacy_load_weights(self, filtered_weights)
|
||||
|
||||
|
||||
EntryClass = [
|
||||
|
||||
@@ -84,7 +84,7 @@ class Qwen2ForRewardModel(nn.Module):
|
||||
filtered_weights = [
|
||||
(name, w) for name, w in weights if not name.startswith("lm_head")
|
||||
]
|
||||
return Qwen2ForCausalLM.load_weights(self, filtered_weights)
|
||||
return Qwen2ForCausalLM._legacy_load_weights(self, filtered_weights)
|
||||
|
||||
|
||||
EntryClass = [
|
||||
|
||||
Reference in New Issue
Block a user