Fix renaming on other model than Llama (#2762)
This commit is contained in:
parent
8a192b7d72
commit
3a7cf48532
8 changed files with 8 additions and 8 deletions
|
|
@ -466,7 +466,7 @@ class FastCohereModel(FastLlamaModel):
|
|||
CohereDecoderLayer .forward = CohereDecoderLayer_fast_forward
|
||||
CohereModel .forward = LlamaModel_fast_forward
|
||||
CohereForCausalLM .forward = CausalLM_fast_forward(CohereModel_fast_forward_inference)
|
||||
PeftModelForCausalLM .forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM .forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(CohereForCausalLM)
|
||||
|
||||
import transformers.models.cohere.modeling_cohere
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ class FastGemmaModel(FastLlamaModel):
|
|||
GemmaDecoderLayer .forward = GemmaDecoderLayer_fast_forward
|
||||
GemmaModel .forward = LlamaModel_fast_forward
|
||||
GemmaForCausalLM .forward = CausalLM_fast_forward(GemmaModel_fast_forward_inference)
|
||||
PeftModelForCausalLM.forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM.forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(GemmaForCausalLM)
|
||||
|
||||
# Solves https://github.com/unslothai/unsloth/issues/168
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ class FastGemma2Model(FastLlamaModel):
|
|||
Gemma2DecoderLayer .forward = Gemma2DecoderLayer_fast_forward
|
||||
Gemma2Model .forward = LlamaModel_fast_forward
|
||||
Gemma2ForCausalLM .forward = CausalLM_fast_forward(Gemma2Model_fast_forward_inference)
|
||||
PeftModelForCausalLM .forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM .forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(Gemma2ForCausalLM)
|
||||
|
||||
# Solves https://github.com/unslothai/unsloth/issues/168
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@ class FastGraniteModel(FastLlamaModel):
|
|||
GraniteModel .forward = LlamaModel_fast_forward
|
||||
GraniteForCausalLM .forward = CausalLM_fast_forward(GraniteModel_fast_forward_inference)
|
||||
GraniteForCausalLM .__init__ = patched_init(GraniteForCausalLM.__init__)
|
||||
PeftModelForCausalLM .forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM .forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(GraniteForCausalLM)
|
||||
|
||||
import transformers.models.granite.modeling_granite
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ class FastMistralModel(FastLlamaModel):
|
|||
MistralDecoderLayer .forward = LlamaDecoderLayer_fast_forward
|
||||
MistralModel .forward = LlamaModel_fast_forward
|
||||
MistralForCausalLM .forward = MistralForCausalLM_fast_forward
|
||||
PeftModelForCausalLM .forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM .forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(MistralForCausalLM)
|
||||
|
||||
# Solves https://github.com/unslothai/unsloth/issues/168
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class FastQwen2Model(FastLlamaModel):
|
|||
Qwen2DecoderLayer .forward = LlamaDecoderLayer_fast_forward
|
||||
Qwen2Model .forward = LlamaModel_fast_forward
|
||||
Qwen2ForCausalLM .forward = CausalLM_fast_forward(LlamaModel_fast_forward_inference)
|
||||
PeftModelForCausalLM.forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM.forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(Qwen2ForCausalLM)
|
||||
|
||||
# Solves https://github.com/unslothai/unsloth/issues/168
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ class FastQwen3Model(FastLlamaModel):
|
|||
Qwen3DecoderLayer .forward = LlamaDecoderLayer_fast_forward
|
||||
Qwen3Model .forward = LlamaModel_fast_forward
|
||||
Qwen3ForCausalLM .forward = CausalLM_fast_forward(_LlamaModel_fast_forward_inference(Qwen3Attention_fast_forward_inference))
|
||||
PeftModelForCausalLM.forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM.forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(Qwen3ForCausalLM)
|
||||
|
||||
# Solves https://github.com/unslothai/unsloth/issues/168
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class FastQwen3MoeModel(FastQwen3Model):
|
|||
Qwen3MoeDecoderLayer .forward = Qwen3MoeDecoderLayer_fast_forward
|
||||
Qwen3MoeModel .forward = LlamaModel_fast_forward
|
||||
Qwen3MoeForCausalLM .forward = CausalLM_fast_forward(LlamaModel_fast_forward_inference)
|
||||
PeftModelForCausalLM.forward = PeftModelForCausalLM_fast_forward
|
||||
PeftModelForCausalLM.forward = PeftModel_fast_forward
|
||||
fix_prepare_inputs_for_generation(Qwen3MoeForCausalLM)
|
||||
|
||||
# Solves https://github.com/unslothai/unsloth/issues/168
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue