transformers¶
transformers
¶
TransformersModel
¶
TransformersModel(*args, config_model: Type[PretrainedConfig] = None, automodel: Type[AutoModel] = AutoModel, **kwargs)
Bases: HuggingFaceModel
NNsight wrapper for HuggingFace Transformers models.
Adds AutoConfig / AutoModel support on top of
:class:HuggingFaceModel. Handles config loading, meta-tensor
initialization via from_config, and full weight loading via
from_pretrained.
| PARAMETER | DESCRIPTION |
|---|---|
*args
|
Forwarded to :class:
DEFAULT:
|
config_model
|
An explicit
HuggingFace config instance to use instead of loading one
from the repo. Defaults to
TYPE:
|
automodel
|
The
TYPE:
|
**kwargs
|
Forwarded to
DEFAULT:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
config |
The model's HuggingFace configuration.
TYPE:
|
automodel |
The
TYPE:
|