fix config errors
Browse files- config.json +4 -0
- configuration_gemma3mm.py +1 -5
- modeling_gemma3mm.py +9 -29
- preprocessor_config-2.json +0 -0
- processor_config.json +3 -0
config.json
CHANGED
@@ -44,6 +44,10 @@
|
|
44 |
"torch_dtype": "bfloat16"
|
45 |
},
|
46 |
"audio_token_index": 262143,
|
|
|
|
|
|
|
|
|
47 |
"boa_token_index": 256001,
|
48 |
"boi_token_index": 255999,
|
49 |
"eoa_token_index": 256002,
|
|
|
44 |
"torch_dtype": "bfloat16"
|
45 |
},
|
46 |
"audio_token_index": 262143,
|
47 |
+
"auto_map": {
|
48 |
+
"AutoConfig": "configuration_gemma3mm.Gemma3MMConfig",
|
49 |
+
"AutoModel": "modeling_gemma3mm.Gemma3MMForConditionalGeneration"
|
50 |
+
},
|
51 |
"boa_token_index": 256001,
|
52 |
"boi_token_index": 255999,
|
53 |
"eoa_token_index": 256002,
|
configuration_gemma3mm.py
CHANGED
@@ -203,8 +203,4 @@ class Gemma3MMConfig(PretrainedConfig):
|
|
203 |
self.audio_token_index = audio_token_index
|
204 |
self.initializer_range = initializer_range
|
205 |
|
206 |
-
super().__init__(**kwargs)
|
207 |
-
|
208 |
-
|
209 |
-
AutoConfig.register("gemma3mm", Gemma3MMConfig)
|
210 |
-
Gemma3MMConfig.register_for_auto_class()
|
|
|
203 |
self.audio_token_index = audio_token_index
|
204 |
self.initializer_range = initializer_range
|
205 |
|
206 |
+
super().__init__(**kwargs)
|
|
|
|
|
|
|
|
modeling_gemma3mm.py
CHANGED
@@ -1,24 +1,3 @@
|
|
1 |
-
# π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨
|
2 |
-
# This file was automatically generated from src/transformers/models/gemma3/modular_gemma3.py.
|
3 |
-
# Do NOT edit this file manually as any edits will be overwritten by the generation of
|
4 |
-
# the file from the modular. If any change should be done, please apply the change to the
|
5 |
-
# modular_gemma3.py file directly. One of our CI enforces this.
|
6 |
-
# π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨π¨
|
7 |
-
# coding=utf-8
|
8 |
-
# Copyright 2025 Google Inc. HuggingFace Inc. team. All rights reserved.
|
9 |
-
#
|
10 |
-
#
|
11 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
12 |
-
# you may not use this file except in compliance with the License.
|
13 |
-
# You may obtain a copy of the License at
|
14 |
-
#
|
15 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
16 |
-
#
|
17 |
-
# Unless required by applicable law or agreed to in writing, software
|
18 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
19 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20 |
-
# See the License for the specific language governing permissions and
|
21 |
-
# limitations under the License.
|
22 |
import copy
|
23 |
from collections.abc import Callable
|
24 |
from dataclasses import dataclass
|
@@ -162,11 +141,18 @@ GEMMA3_INPUTS_DOCSTRING = r"""
|
|
162 |
the complete sequence length.
|
163 |
"""
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
@add_start_docstrings(
|
166 |
"""The GEMMA3 model which consists of a vision backbone and a language model.""",
|
167 |
GEMMA3_START_DOCSTRING,
|
168 |
)
|
169 |
-
class Gemma3MMForConditionalGeneration(
|
170 |
def __init__(self, config: Gemma3MMConfig):
|
171 |
super().__init__(config)
|
172 |
self.vision_tower = AutoModel.from_config(config=config.vision_config)
|
@@ -631,10 +617,4 @@ class Gemma3MMForConditionalGeneration(Gemma3PreTrainedModel, GenerationMixin):
|
|
631 |
return model_inputs
|
632 |
|
633 |
def tie_weights(self):
|
634 |
-
return self.language_model.tie_weights()
|
635 |
-
|
636 |
-
|
637 |
-
AutoConfig.register("gemma3mm", Gemma3MMConfig)
|
638 |
-
AutoModel.register("gemma3mm", Gemma3MMForConditionalGeneration)
|
639 |
-
Gemma3MMConfig.register_for_auto_class()
|
640 |
-
Gemma3MMForConditionalGeneration.register_for_auto_class()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import copy
|
2 |
from collections.abc import Callable
|
3 |
from dataclasses import dataclass
|
|
|
141 |
the complete sequence length.
|
142 |
"""
|
143 |
|
144 |
+
@add_start_docstrings(
|
145 |
+
"The bare Gemma3 Model outputting raw hidden-states without any specific head on top.",
|
146 |
+
GEMMA3_START_DOCSTRING,
|
147 |
+
)
|
148 |
+
class Gemma3MMPreTrainedModel(Gemma3PreTrainedModel):
|
149 |
+
config_class = Gemma3MMConfig
|
150 |
+
|
151 |
@add_start_docstrings(
|
152 |
"""The GEMMA3 model which consists of a vision backbone and a language model.""",
|
153 |
GEMMA3_START_DOCSTRING,
|
154 |
)
|
155 |
+
class Gemma3MMForConditionalGeneration(Gemma3MMPreTrainedModel, GenerationMixin):
|
156 |
def __init__(self, config: Gemma3MMConfig):
|
157 |
super().__init__(config)
|
158 |
self.vision_tower = AutoModel.from_config(config=config.vision_config)
|
|
|
617 |
return model_inputs
|
618 |
|
619 |
def tie_weights(self):
|
620 |
+
return self.language_model.tie_weights()
|
|
|
|
|
|
|
|
|
|
|
|
preprocessor_config-2.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
processor_config.json
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
{
|
|
|
|
|
|
|
2 |
"image_seq_length": 256,
|
3 |
"processor_class": "Gemma3MMProcessor"
|
4 |
}
|
|
|
1 |
{
|
2 |
+
"auto_map": {
|
3 |
+
"AutoProcessor": "processing_gemma3mm.Gemma3MMProcessor"
|
4 |
+
},
|
5 |
"image_seq_length": 256,
|
6 |
"processor_class": "Gemma3MMProcessor"
|
7 |
}
|