Skip to content

Commit

Permalink
fixing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gupta-abhay committed Aug 13, 2024
1 parent b5d1b0d commit e207a02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llmfoundry/models/hf/hf_causal_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
List,
Optional,
Tuple,
Type,
Union,
)

Expand All @@ -21,7 +22,6 @@
from torchmetrics import Metric
from transformers import (
AutoConfig,
AutoModel,
AutoModelForCausalLM,
GenerationConfig,
PreTrainedModel,
Expand Down Expand Up @@ -194,7 +194,7 @@ def build_inner_model(
config_overrides: Dict[str, Any],
load_in_8bit: bool,
pretrained: bool,
model_cls: Union[AutoModel, PreTrainedModel] = AutoModelForCausalLM,
model_cls: Union[Type, Type[PreTrainedModel]] = AutoModelForCausalLM,
prepare_for_fsdp: bool = False,
) -> Union[PreTrainedModel, 'PeftModel']:
"""Builds the inner model for the ComposerHFCausalLM.
Expand All @@ -209,7 +209,7 @@ def build_inner_model(
config_overrides (Dict[str, Any]): The configuration overrides.
load_in_8bit (bool): Whether to load in 8-bit.
pretrained (bool): Whether the model is pretrained.
model_cls (Union[AutoModel, PreTrainedModel]): HF class for models. Default: ``AutoModelForCausalLM``.
model_cls (Union[Type, Type[PreTrainedModel]]): HF class for models. Default: ``AutoModelForCausalLM``.
prepare_for_fsdp (bool, optional): Whether to prepare the model for FSDP wrapping. Default: ``False``.
Returns:
Expand Down Expand Up @@ -239,7 +239,7 @@ def build_inner_model(
hasattr(model_cls, 'from_config')
):
raise AttributeError(
f'{model_cls=} has missing `from_pretrained` and `from_config` support.',
f'{model_cls=} is missing `from_pretrained` and `from_config` support.',
)

# Hugging Face copies the modules into the
Expand Down

0 comments on commit e207a02

Please sign in to comment.