From 49024e65e217f80019c97ca4867cbbad12e9bfd3 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Tue, 20 Aug 2024 16:52:21 -0400 Subject: [PATCH] linting --- llmfoundry/models/hf/hf_base.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/llmfoundry/models/hf/hf_base.py b/llmfoundry/models/hf/hf_base.py index 36c9f2dd95..77356028cb 100644 --- a/llmfoundry/models/hf/hf_base.py +++ b/llmfoundry/models/hf/hf_base.py @@ -193,15 +193,13 @@ def build_metrics( """ from llmfoundry.utils.builders import build_metric - train_metric_names = list(cls.default_train_metrics) + ( - additional_train_metrics or [] - ) + train_metric_names = list(cls.default_train_metrics + ) + (additional_train_metrics or []) train_metrics = [ build_metric(metric, {}) for metric in train_metric_names ] if use_train_metrics else [] - eval_metric_names = list(cls.default_eval_metrics) + ( - additional_eval_metrics or [] - ) + eval_metric_names = list(cls.default_eval_metrics + ) + (additional_eval_metrics or []) eval_metrics = [ build_metric(metric, {}) for metric in eval_metric_names ] @@ -220,8 +218,7 @@ def build_inner_model( config_overrides: dict[str, Any], load_in_8bit: bool, pretrained: bool, - model_cls: Optional[Union[_BaseAutoModelClass, - PreTrainedModel]] = None, + model_cls: Optional[Union[_BaseAutoModelClass, PreTrainedModel]] = None, prepare_for_fsdp: bool = False, ) -> Union[PreTrainedModel, 'PeftModel']: """Builds the inner model for the ComposerHFCausalLM.