File size: 568 Bytes
ce13d72 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
"""Implements a Hugging Causal LM wrapped inside a :class:`.ComposerModel`."""
import logging
import os
import warnings
from typing import TYPE_CHECKING, Any, Dict, Mapping
from transformers import AutoConfig, AutoModelForCausalLM, PreTrainedModel, PreTrainedTokenizerBase
from .hf_fsdp import hf_get_init_device
from .model_wrapper import HuggingFaceModelWithFSDP
from .attention import is_flash_v2_installed
from .utils import init_empty_weights
from .config_utils import pop_config
if TYPE_CHECKING:
from peft import PeftConfig
log = logging.getLogger(__name__) |