Upgrade transformers from 5.5.4 to 5.6.0 (#23525)
This commit is contained in:
@@ -72,7 +72,7 @@ dependencies = [
|
||||
"torchvision",
|
||||
"tqdm",
|
||||
"mistral_common>=1.11.0",
|
||||
"transformers==5.5.4",
|
||||
"transformers==5.6.0",
|
||||
"uvicorn",
|
||||
"uvloop",
|
||||
"watchfiles",
|
||||
|
||||
@@ -62,7 +62,7 @@ dependencies = [
|
||||
"torchvision==0.24.0",
|
||||
"tqdm",
|
||||
"mistral_common>=1.11.0",
|
||||
"transformers==5.5.4",
|
||||
"transformers==5.6.0",
|
||||
"triton==3.5.0",
|
||||
"uvicorn",
|
||||
"uvloop",
|
||||
|
||||
@@ -59,7 +59,7 @@ dependencies = [
|
||||
"torchao==0.9.0",
|
||||
"tqdm",
|
||||
"mistral_common>=1.11.0",
|
||||
"transformers==5.5.4",
|
||||
"transformers==5.6.0",
|
||||
"uvicorn",
|
||||
"uvloop",
|
||||
"xgrammar==0.1.32",
|
||||
|
||||
@@ -59,7 +59,7 @@ runtime_common = [
|
||||
"torchao==0.9.0",
|
||||
"tqdm",
|
||||
"mistral_common>=1.11.0",
|
||||
"transformers==5.5.4",
|
||||
"transformers==5.6.0",
|
||||
"uvicorn",
|
||||
"uvloop",
|
||||
"xgrammar==0.1.32",
|
||||
|
||||
@@ -63,7 +63,7 @@ dependencies = [
|
||||
"torchao==0.9.0+xpu",
|
||||
"tqdm",
|
||||
"mistral_common>=1.11.0",
|
||||
"transformers==5.5.4",
|
||||
"transformers==5.6.0",
|
||||
"uvicorn",
|
||||
"uvloop",
|
||||
# "xgrammar==0.1.24", , xgrammar depends on CUDA PyTorch and Triton only
|
||||
|
||||
@@ -931,6 +931,16 @@ class Gemma3TextModel(nn.Module):
|
||||
|
||||
|
||||
class Gemma3ForConditionalGeneration(nn.Module):
|
||||
# transformers 5.6.0 flattened SiglipVisionModel, dropping the
|
||||
# `vision_model` intermediate wrapper. Our reimpl keeps it, so remap
|
||||
# HF source keys back into our nested namespace when transferring weights.
|
||||
param_names_mapping = {
|
||||
r"^(vision_tower\.)(embeddings|encoder|post_layernorm|head)\.": r"\1vision_model.\2.",
|
||||
}
|
||||
reverse_param_names_mapping = {
|
||||
r"^(vision_tower\.)vision_model\.(embeddings|encoder|post_layernorm|head)\.": r"\1\2.",
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: Gemma3Config,
|
||||
|
||||
@@ -495,6 +495,9 @@ class LlavaBaseForCausalLM(nn.Module):
|
||||
"model.mm_projector.0": "multi_modal_projector.linear_1",
|
||||
"model.mm_projector.2": "multi_modal_projector.linear_2",
|
||||
"model.vision_tower.vision_tower": "vision_tower",
|
||||
# transformers 5.6.0 flattened CLIPVisionModel/SiglipVisionModel,
|
||||
# dropping the `vision_model` intermediate wrapper.
|
||||
"vision_tower.vision_model.": "vision_tower.",
|
||||
# Update the vision tower weights if we find them in the checkpoint (it may be finetuned).
|
||||
"model.image_newline": "language_model.model.image_newline",
|
||||
}
|
||||
|
||||
@@ -255,6 +255,9 @@ class LlavaVidForCausalLM(nn.Module):
|
||||
"model.vision_resampler.mm_projector.0": "multi_modal_projector.linear_1",
|
||||
"model.vision_resampler.mm_projector.2": "multi_modal_projector.linear_2",
|
||||
"model.vision_tower.vision_tower": "vision_tower",
|
||||
# transformers 5.6.0 flattened CLIPVisionModel/SiglipVisionModel,
|
||||
# dropping the `vision_model` intermediate wrapper.
|
||||
"vision_tower.vision_model.": "vision_tower.",
|
||||
# Update the vision tower weights if we find them in the checkpoint (it may be finetuned).
|
||||
"model.image_newline": "language_model.model.image_newline",
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ class YiVLForCausalLM(LlavaLlamaForCausalLM):
|
||||
"model.mm_projector.3": "multi_modal_projector.linear_2",
|
||||
"model.mm_projector.4": "multi_modal_projector.ln_2",
|
||||
"model.vision_tower.vision_tower": "vision_tower", # Update the vision tower weights if we find them in the checkpoint (it may be finetuned).
|
||||
# transformers 5.6.0 flattened CLIPVisionModel/SiglipVisionModel,
|
||||
# dropping the `vision_model` intermediate wrapper.
|
||||
"vision_tower.vision_model.": "vision_tower.",
|
||||
}
|
||||
params_dict = dict(self.named_parameters())
|
||||
weights = list(weights)
|
||||
|
||||
Reference in New Issue
Block a user