Skip to content

Commit 75d6f17

Browse files
authored
Validate GptOssConfig rope config after it's fully initialized (#40474)
* Validate GptOssConfig rope config after it's fully initialized Fixes #40461 * Remove whitespaces
1 parent 80f4c0c commit 75d6f17

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/transformers/models/gpt_oss/configuration_gpt_oss.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,18 @@ def __init__(
9898
]
9999
layer_type_validation(self.layer_types)
100100

101+
self.attention_bias = True
102+
self.max_position_embeddings = max_position_embeddings
103+
self.router_aux_loss_coef = router_aux_loss_coef
104+
self.output_router_logits = output_router_logits
105+
self.use_cache = use_cache
106+
101107
# Validate the correctness of rotary position embeddings parameters
102108
# BC: if there is a 'type' field, copy it it to 'rope_type'.
103109
if self.rope_scaling is not None and "type" in self.rope_scaling:
104110
self.rope_scaling["rope_type"] = self.rope_scaling["type"]
105111
rope_config_validation(self)
106112

107-
self.attention_bias = True
108-
self.max_position_embeddings = max_position_embeddings
109-
self.router_aux_loss_coef = router_aux_loss_coef
110-
self.output_router_logits = output_router_logits
111-
self.use_cache = use_cache
112113
super().__init__(
113114
tie_word_embeddings=tie_word_embeddings,
114115
**kwargs,

0 commit comments

Comments
 (0)