Skip to content

Commit c97c9ba

Browse files
mtakeRobotSail
authored andcommitted
fix ruff errors
1 parent da1c034 commit c97c9ba

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/instructlab/training/gpt_oss_utils_correct.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ def is_gpt_oss(model_path_or_config: str | PretrainedConfig) -> bool:
411411
return getattr(model_config, "model_type", None) == "gpt_oss"
412412

413413

414-
def is_known_model(model_path_or_config: str | PretrainedConfig, known_model_type: str | list[str]) -> bool:
414+
def is_known_model(
415+
model_path_or_config: str | PretrainedConfig, known_model_type: str | list[str]
416+
) -> bool:
415417
"""
416418
Determine if the model is a known model.
417419
"""
@@ -425,7 +427,9 @@ def is_known_model(model_path_or_config: str | PretrainedConfig, known_model_typ
425427
if isinstance(model_path_or_config, str):
426428
model_config = AutoConfig.from_pretrained(model_path_or_config)
427429

428-
known_model_types = [known_model_type] if isinstance(known_model_type, str) else known_model_type
430+
known_model_types = (
431+
[known_model_type] if isinstance(known_model_type, str) else known_model_type
432+
)
429433
return getattr(model_config, "model_type", None) in known_model_types
430434

431435

src/instructlab/training/main_ds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def main(args):
346346
# GPT-OSS specifically
347347
# We don't want to use use_orig_params for GPT-OSS models
348348
fsdp_should_use_orig_params = False
349-
if m.is_gpt_oss or m.is_granitemoehybrid: # NOTE is this guard needed?
349+
if m.is_gpt_oss or m.is_granitemoehybrid:
350350
frozen_router_params = freeze_router_params(m)
351351
if frozen_router_params:
352352
logger.info("🎯 Detected an MoE model - frozen router parameters")

src/instructlab/training/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def compute_loss(
419419

420420
# add the MoE auxiliary loss (currently we only support this for GPT-OSS)
421421
if (
422-
(self.is_gpt_oss or self.is_granitemoehybrid) # NOTE is this guard needed?
422+
(self.is_gpt_oss or self.is_granitemoehybrid)
423423
and hasattr(output, "aux_loss")
424424
and output.aux_loss is not None
425425
):

0 commit comments

Comments
 (0)