Skip to content

Commit ab4ce73

Browse files
committed
Fix GS1 CI and repository consistency
- Complete the GS1 modular model definitions and regenerate the matching modeling files. - Correct GS1 config defaults, auto-mapping order, model metadata, imports, and initialization conventions. - Add GS1 decision-loss regression coverage and document the public config and model classes.
1 parent 05aacd2 commit ab4ce73

7 files changed

Lines changed: 863 additions & 88 deletions

File tree

‎docs/source/en/model_doc/gs1.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ the compiled request and returns one score per candidate.
3535

3636
GS1 is developed by [BIGAI](https://gs1.mybigai.ac.cn). See the [open-source implementation](https://github.com/bigai-nlco/GS1)
3737
for the model and inference reference.
38+
39+
## GS1Config
40+
41+
[[autodoc]] GS1Config
42+
43+
## GS1ForDecision
44+
45+
[[autodoc]] GS1ForDecision
46+
- forward

‎src/transformers/models/auto/auto_mappings.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@
245245
("gemma4_assistant", "Gemma4AssistantConfig"),
246246
("gemma4_audio", "Gemma4AudioConfig"),
247247
("gemma4_text", "Gemma4TextConfig"),
248-
("gs1", "GS1Config"),
249248
("gemma4_unified", "Gemma4UnifiedConfig"),
250249
("gemma4_unified_assistant", "Gemma4UnifiedAssistantConfig"),
251250
("gemma4_unified_audio", "Gemma4UnifiedAudioConfig"),
@@ -311,6 +310,7 @@
311310
("groupvit", "GroupViTConfig"),
312311
("groupvit_text_model", "GroupViTTextConfig"),
313312
("groupvit_vision_model", "GroupViTVisionConfig"),
313+
("gs1", "GS1Config"),
314314
("gte", "GteConfig"),
315315
("helium", "HeliumConfig"),
316316
("hgnet_v2", "HGNetV2Config"),
@@ -1057,7 +1057,6 @@
10571057
("qwen3_5_moe_vision", "qwen3_5_moe"),
10581058
("qwen3_5_text", "qwen3_5"),
10591059
("qwen3_5_vision", "qwen3_5"),
1060-
("gs1", "gs1"),
10611060
("qwen3_asr_encoder", "qwen3_asr"),
10621061
("qwen3_omni_moe_audio_encoder", "qwen3_omni_moe"),
10631062
("qwen3_omni_moe_talker_code_predictor", "qwen3_omni_moe"),

‎src/transformers/models/gs1/configuration_gs1.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
# You may obtain a copy of the License at
1212
#
1313
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
1420

1521
import math
1622
from dataclasses import field
@@ -19,6 +25,8 @@
1925

2026
from ...configuration_utils import PreTrainedConfig, SubConfigSpec
2127
from ...utils import auto_docstring
28+
from ..auto import AutoConfig
29+
2230

2331
GS1_DEFAULTS = {
2432
"attnres": True,
@@ -50,8 +58,8 @@ class GS1Config(PreTrainedConfig):
5058

5159
model_type = "gs1"
5260
sub_configs_defaults = {
53-
"text_config": SubConfigSpec(model_type="qwen3_5_text"),
54-
"vision_config": SubConfigSpec(model_type="qwen3_5_vision"),
61+
"text_config": SubConfigSpec(config_class=AutoConfig, model_type="qwen3_5_text"),
62+
"vision_config": SubConfigSpec(config_class=AutoConfig, model_type="qwen3_5_vision"),
5563
}
5664

5765
text_config: dict | PreTrainedConfig | None = None
@@ -79,6 +87,10 @@ def __post_init__(self, **kwargs):
7987
raise ValueError("cross_attention_heads must divide the text hidden size")
8088
self.tie_word_embeddings = False
8189
self.text_config.use_cache = False
90+
self.text_config._attn_implementation = "sdpa"
91+
self.vision_config._attn_implementation = "sdpa"
92+
self.text_config._attn_implementation = "sdpa"
93+
self.vision_config._attn_implementation = "sdpa"
8294

8395

8496
__all__ = ["GS1Config"]

0 commit comments

Comments
 (0)