Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/transformers/configuration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ class PreTrainedConfig(PushToHubMixin, RotaryEmbeddingConfigMixin):
# Common attributes for all models
output_hidden_states: bool | None = False
return_dict: bool | None = True
dtype: Union[str, "torch.dtype"] | None = None
# NOTE: annotated as Any (rather than Union[str, "torch.dtype"] | None) so that pydantic can
# build a schema for classes that include PreTrainedConfig as a field without needing torch
# in the resolution namespace. The runtime type is still Union[str, torch.dtype] | None.
# See https://github.com/huggingface/transformers/issues/45070
dtype: Any = None
chunk_size_feed_forward: int = 0
is_encoder_decoder: bool = False

Expand Down
Loading