diff --git a/docs/source/ar/autoclass_tutorial.md b/docs/source/ar/autoclass_tutorial.md
index 9c7709e2d17..9cc4def18ab 100644
--- a/docs/source/ar/autoclass_tutorial.md
+++ b/docs/source/ar/autoclass_tutorial.md
@@ -52,7 +52,7 @@
الصورة توضح مخطط مراحل نموذج Swin.
-يسمح لك [`AutoBackbone`] باستخدام النماذج المُدربة مسبقًا كعمود فقري للحصول على خرائط ميزات من مراحل مختلفة من العمود الفقري. يجب عليك تحديد أحد المعلمات التالية في [`~PretrainedConfig.from_pretrained`]:
+يسمح لك [`AutoBackbone`] باستخدام النماذج المُدربة مسبقًا كعمود فقري للحصول على خرائط ميزات من مراحل مختلفة من العمود الفقري. يجب عليك تحديد أحد المعلمات التالية في [`~PreTrainedConfig.from_pretrained`]:
* `out_indices` هو فهرس الطبقة التي تريد الحصول على خريطة الميزات منها
* `out_features` هو اسم الطبقة التي تريد الحصول على خريطة الميزات منها
diff --git a/docs/source/ar/create_a_model.md b/docs/source/ar/create_a_model.md
index a2b49696f04..9908951c592 100644
--- a/docs/source/ar/create_a_model.md
+++ b/docs/source/ar/create_a_model.md
@@ -54,19 +54,19 @@ DistilBertConfig {
```
-يمكن تعديل خصائص النموذج المدرب مسبقًا في دالة [`~PretrainedConfig.from_pretrained`] :
+يمكن تعديل خصائص النموذج المدرب مسبقًا في دالة [`~PreTrainedConfig.from_pretrained`] :
```py
>>> my_config = DistilBertConfig.from_pretrained("distilbert/distilbert-base-uncased", activation="relu", attention_dropout=0.4)
```
-بمجرد أن تصبح راضيًا عن تكوين نموذجك، يمكنك حفظه باستخدام [`~PretrainedConfig.save_pretrained`]. يتم تخزين ملف التكوين الخاص بك على أنه ملف JSON في دليل الحفظ المحدد:
+بمجرد أن تصبح راضيًا عن تكوين نموذجك، يمكنك حفظه باستخدام [`~PreTrainedConfig.save_pretrained`]. يتم تخزين ملف التكوين الخاص بك على أنه ملف JSON في دليل الحفظ المحدد:
```py
>>> my_config.save_pretrained(save_directory="./your_model_save_path")
```
-لإعادة استخدام ملف التكوين، قم بتحميله باستخدام [`~PretrainedConfig.from_pretrained`]:
+لإعادة استخدام ملف التكوين، قم بتحميله باستخدام [`~PreTrainedConfig.from_pretrained`]:
```py
>>> my_config = DistilBertConfig.from_pretrained("./your_model_save_path/config.json")
diff --git a/docs/source/ar/custom_models.md b/docs/source/ar/custom_models.md
index d46df9cb729..cb4a4a3fae1 100644
--- a/docs/source/ar/custom_models.md
+++ b/docs/source/ar/custom_models.md
@@ -20,11 +20,11 @@
في مثالنا، سنعدّل بعض الوسائط في فئة ResNet التي قد نرغب في ضبطها. ستعطينا التكوينات المختلفة أنواع ResNets المختلفة الممكنة. سنقوم بتخزين هذه الوسائط بعد التحقق من صحته.
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -58,11 +58,11 @@ class ResnetConfig(PretrainedConfig):
```
الأشياء الثلاثة المهمة التي يجب تذكرها عند كتابة تكوينك الخاص هي:
-- يجب أن ترث من `PretrainedConfig`،
-- يجب أن تقبل دالة `__init__` الخاصة بـ `PretrainedConfig` أي معامﻻت إضافية kwargs،
+- يجب أن ترث من `PreTrainedConfig`،
+- يجب أن تقبل دالة `__init__` الخاصة بـ `PreTrainedConfig` أي معامﻻت إضافية kwargs،
- يجب تمرير هذه المعامﻻت الإضافية إلى دالة `__init__` فى الفئة الأساسية الاعلى.
-يضمن الإرث حصولك على جميع الوظائف من مكتبة 🤗 Transformers، في حين أن القيدين التانى والثالث يأتيان من حقيقة أن `PretrainedConfig` لديه المزيد من الحقول أكثر من تلك التي تقوم بتعيينها. عند إعادة تحميل تكوين باستخدام طريقة `from_pretrained`، يجب أن يقبل تكوينك هذه الحقول ثم إرسالها إلى الفئة الأساسية الأعلى.
+يضمن الإرث حصولك على جميع الوظائف من مكتبة 🤗 Transformers، في حين أن القيدين التانى والثالث يأتيان من حقيقة أن `PreTrainedConfig` لديه المزيد من الحقول أكثر من تلك التي تقوم بتعيينها. عند إعادة تحميل تكوين باستخدام طريقة `from_pretrained`، يجب أن يقبل تكوينك هذه الحقول ثم إرسالها إلى الفئة الأساسية الأعلى.
تحديد `model_type` لتكوينك (هنا `model_type="resnet"`) ليس إلزاميًا، ما لم ترغب في
تسجيل نموذجك باستخدام الفئات التلقائية (راجع القسم الأخير).
@@ -82,7 +82,7 @@ resnet50d_config.save_pretrained("custom-resnet")
resnet50d_config = ResnetConfig.from_pretrained("custom-resnet")
```
-يمكنك أيضًا استخدام أي طريقة أخرى من فئة [`PretrainedConfig`]، مثل [`~PretrainedConfig.push_to_hub`] لتحميل تكوينك مباشرة إلى Hub.
+يمكنك أيضًا استخدام أي طريقة أخرى من فئة [`PreTrainedConfig`]، مثل [`~PreTrainedConfig.push_to_hub`] لتحميل تكوينك مباشرة إلى Hub.
## كتابة نموذج مخصص
diff --git a/docs/source/de/add_new_model.md b/docs/source/de/add_new_model.md
index e5ef4234319..848dcbc3063 100644
--- a/docs/source/de/add_new_model.md
+++ b/docs/source/de/add_new_model.md
@@ -53,7 +53,7 @@ Lassen Sie uns daher ein wenig tiefer in das allgemeine Design der Bibliothek ei
### Überblick über die Modelle
Um ein Modell erfolgreich hinzuzufügen, ist es wichtig, die Interaktion zwischen Ihrem Modell und seiner Konfiguration zu verstehen,
-[`PreTrainedModel`] und [`PretrainedConfig`]. Als Beispiel werden wir
+[`PreTrainedModel`] und [`PreTrainedConfig`]. Als Beispiel werden wir
das Modell, das zu 🤗 Transformers hinzugefügt werden soll, `BrandNewBert` nennen.
Schauen wir uns das mal an:
@@ -81,10 +81,10 @@ model.config # model has access to its config
```
Ähnlich wie das Modell erbt die Konfiguration grundlegende Serialisierungs- und Deserialisierungsfunktionalitäten von
-[`PretrainedConfig`]. Beachten Sie, dass die Konfiguration und das Modell immer in zwei verschiedene Formate serialisiert werden
+[`PreTrainedConfig`]. Beachten Sie, dass die Konfiguration und das Modell immer in zwei verschiedene Formate serialisiert werden
unterschiedliche Formate serialisiert werden - das Modell in eine *pytorch_model.bin* Datei und die Konfiguration in eine *config.json* Datei. Aufruf von
[`~PreTrainedModel.save_pretrained`] wird automatisch
-[`~PretrainedConfig.save_pretrained`] auf, so dass sowohl das Modell als auch die Konfiguration gespeichert werden.
+[`~PreTrainedConfig.save_pretrained`] auf, so dass sowohl das Modell als auch die Konfiguration gespeichert werden.
### Code-Stil
diff --git a/docs/source/en/add_new_model.md b/docs/source/en/add_new_model.md
index 71176305641..a9d8168f750 100644
--- a/docs/source/en/add_new_model.md
+++ b/docs/source/en/add_new_model.md
@@ -51,7 +51,7 @@ This section describes how the model and configuration classes interact and the
### Model and configuration
-All Transformers' models inherit from a base [`PreTrainedModel`] and [`PretrainedConfig`] class. The configuration is the models blueprint.
+All Transformers' models inherit from a base [`PreTrainedModel`] and [`PreTrainedConfig`] class. The configuration is the models blueprint.
There is never more than two levels of abstraction for any model to keep the code readable. The example model here, BrandNewLlama, inherits from `BrandNewLlamaPreTrainedModel` and [`PreTrainedModel`]. It is important that a new model only depends on [`PreTrainedModel`] so that it can use the [`~PreTrainedModel.from_pretrained`] and [`~PreTrainedModel.save_pretrained`] methods.
@@ -66,9 +66,9 @@ model = BrandNewLlamaModel.from_pretrained("username/brand_new_llama")
model.config
```
-[`PretrainedConfig`] provides the [`~PretrainedConfig.from_pretrained`] and [`~PretrainedConfig.save_pretrained`] methods.
+[`PreTrainedConfig`] provides the [`~PreTrainedConfig.from_pretrained`] and [`~PreTrainedConfig.save_pretrained`] methods.
-When you use [`PreTrainedModel.save_pretrained`], it automatically calls [`PretrainedConfig.save_pretrained`] so that both the model and configuration are saved together.
+When you use [`PreTrainedModel.save_pretrained`], it automatically calls [`PreTrainedConfig.save_pretrained`] so that both the model and configuration are saved together.
A model is saved to a `model.safetensors` file and a configuration is saved to a `config.json` file.
diff --git a/docs/source/en/backbones.md b/docs/source/en/backbones.md
index 792b0b0d38f..c54dc1d00af 100644
--- a/docs/source/en/backbones.md
+++ b/docs/source/en/backbones.md
@@ -22,7 +22,7 @@ Higher-level computer visions tasks, such as object detection or image segmentat
-Load a backbone with [`~PretrainedConfig.from_pretrained`] and use the `out_indices` parameter to determine which layer, given by the index, to extract a feature map from.
+Load a backbone with [`~PreTrainedConfig.from_pretrained`] and use the `out_indices` parameter to determine which layer, given by the index, to extract a feature map from.
```py
from transformers import AutoBackbone
@@ -46,7 +46,7 @@ There are two ways to load a Transformers backbone, [`AutoBackbone`] and a model
-The [AutoClass](./model_doc/auto) API automatically loads a pretrained vision model with [`~PretrainedConfig.from_pretrained`] as a backbone if it's supported.
+The [AutoClass](./model_doc/auto) API automatically loads a pretrained vision model with [`~PreTrainedConfig.from_pretrained`] as a backbone if it's supported.
Set the `out_indices` parameter to the layer you'd like to get the feature map from. If you know the name of the layer, you could also use `out_features`. These parameters can be used interchangeably, but if you use both, make sure they refer to the same layer.
diff --git a/docs/source/en/custom_models.md b/docs/source/en/custom_models.md
index 68afc91531f..f1d5e1b94c4 100644
--- a/docs/source/en/custom_models.md
+++ b/docs/source/en/custom_models.md
@@ -25,12 +25,12 @@ This guide will show you how to customize a ResNet model, enable [AutoClass](./m
## Configuration
-A configuration, given by the base [`PretrainedConfig`] class, contains all the necessary information to build a model. This is where you'll configure the attributes of the custom ResNet model. Different attributes gives different ResNet model types.
+A configuration, given by the base [`PreTrainedConfig`] class, contains all the necessary information to build a model. This is where you'll configure the attributes of the custom ResNet model. Different attributes gives different ResNet model types.
The main rules for customizing a configuration are:
-1. A custom configuration must subclass [`PretrainedConfig`]. This ensures a custom model has all the functionality of a Transformers' model such as [`~PretrainedConfig.from_pretrained`], [`~PretrainedConfig.save_pretrained`], and [`~PretrainedConfig.push_to_hub`].
-2. The [`PretrainedConfig`] `__init__` must accept any `kwargs` and they must be passed to the superclass `__init__`. [`PretrainedConfig`] has more fields than the ones set in your custom configuration, so when you load a configuration with [`~PretrainedConfig.from_pretrained`], those fields need to be accepted by your configuration and passed to the superclass.
+1. A custom configuration must subclass [`PreTrainedConfig`]. This ensures a custom model has all the functionality of a Transformers' model such as [`~PreTrainedConfig.from_pretrained`], [`~PreTrainedConfig.save_pretrained`], and [`~PreTrainedConfig.push_to_hub`].
+2. The [`PreTrainedConfig`] `__init__` must accept any `kwargs` and they must be passed to the superclass `__init__`. [`PreTrainedConfig`] has more fields than the ones set in your custom configuration, so when you load a configuration with [`~PreTrainedConfig.from_pretrained`], those fields need to be accepted by your configuration and passed to the superclass.
> [!TIP]
> It is useful to check the validity of some of the parameters. In the example below, a check is implemented to ensure `block_type` and `stem_type` belong to one of the predefined values.
@@ -38,10 +38,10 @@ The main rules for customizing a configuration are:
> Add `model_type` to the configuration class to enable [AutoClass](./models#autoclass) support.
```py
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -74,7 +74,7 @@ class ResnetConfig(PretrainedConfig):
super().__init__(**kwargs)
```
-Save the configuration to a JSON file in your custom model folder, `custom-resnet`, with [`~PretrainedConfig.save_pretrained`].
+Save the configuration to a JSON file in your custom model folder, `custom-resnet`, with [`~PreTrainedConfig.save_pretrained`].
```py
resnet50d_config = ResnetConfig(block_type="bottleneck", stem_width=32, stem_type="deep", avg_down=True)
@@ -83,7 +83,7 @@ resnet50d_config.save_pretrained("custom-resnet")
## Model
-With the custom ResNet configuration, you can now create and customize the model. The model subclasses the base [`PreTrainedModel`] class. Like [`PretrainedConfig`], inheriting from [`PreTrainedModel`] and initializing the superclass with the configuration extends Transformers' functionalities such as saving and loading to the custom model.
+With the custom ResNet configuration, you can now create and customize the model. The model subclasses the base [`PreTrainedModel`] class. Like [`PreTrainedConfig`], inheriting from [`PreTrainedModel`] and initializing the superclass with the configuration extends Transformers' functionalities such as saving and loading to the custom model.
Transformers' models follow the convention of accepting a `config` object in the `__init__` method. This passes the entire `config` to the model sublayers, instead of breaking the `config` object into multiple arguments that are individually passed to the sublayers.
@@ -235,7 +235,7 @@ from resnet_model.configuration_resnet import ResnetConfig
from resnet_model.modeling_resnet import ResnetModel, ResnetModelForImageClassification
```
-Copy the code from the model and configuration files. To make sure the AutoClass objects are saved with [`~PreTrainedModel.save_pretrained`], call the [`~PretrainedConfig.register_for_auto_class`] method. This modifies the configuration JSON file to include the AutoClass objects and mapping.
+Copy the code from the model and configuration files. To make sure the AutoClass objects are saved with [`~PreTrainedModel.save_pretrained`], call the [`~PreTrainedConfig.register_for_auto_class`] method. This modifies the configuration JSON file to include the AutoClass objects and mapping.
For a model, pick the appropriate `AutoModelFor` class based on the task.
diff --git a/docs/source/en/main_classes/configuration.md b/docs/source/en/main_classes/configuration.md
index 933621f6a14..a690f30f9d6 100644
--- a/docs/source/en/main_classes/configuration.md
+++ b/docs/source/en/main_classes/configuration.md
@@ -16,7 +16,7 @@ rendered properly in your Markdown viewer.
# Configuration
-The base class [`PretrainedConfig`] implements the common methods for loading/saving a configuration
+The base class [`PreTrainedConfig`] implements the common methods for loading/saving a configuration
either from a local file or directory, or from a pretrained model configuration provided by the library (downloaded
from HuggingFace's AWS S3 repository).
@@ -24,8 +24,8 @@ Each derived config class implements model specific attributes. Common attribute
`hidden_size`, `num_attention_heads`, and `num_hidden_layers`. Text models further implement:
`vocab_size`.
-## PretrainedConfig
+## PreTrainedConfig
-[[autodoc]] PretrainedConfig
+[[autodoc]] PreTrainedConfig
- push_to_hub
- all
diff --git a/docs/source/en/model_doc/auto.md b/docs/source/en/model_doc/auto.md
index c1db5e2541a..09884bcb71d 100644
--- a/docs/source/en/model_doc/auto.md
+++ b/docs/source/en/model_doc/auto.md
@@ -48,7 +48,7 @@ You will then be able to use the auto classes like you would usually do!
-If your `NewModelConfig` is a subclass of [`~transformers.PretrainedConfig`], make sure its
+If your `NewModelConfig` is a subclass of [`~transformers.PreTrainedConfig`], make sure its
`model_type` attribute is set to the same key you use when registering the config (here `"new-model"`).
Likewise, if your `NewModel` is a subclass of [`PreTrainedModel`], make sure its
diff --git a/docs/source/en/quicktour.md b/docs/source/en/quicktour.md
index 15433787049..d6d823156b2 100755
--- a/docs/source/en/quicktour.md
+++ b/docs/source/en/quicktour.md
@@ -73,7 +73,7 @@ Each pretrained model inherits from three base classes.
| **Class** | **Description** |
|---|---|
-| [`PretrainedConfig`] | A file that specifies a models attributes such as the number of attention heads or vocabulary size. |
+| [`PreTrainedConfig`] | A file that specifies a models attributes such as the number of attention heads or vocabulary size. |
| [`PreTrainedModel`] | A model (or architecture) defined by the model attributes from the configuration file. A pretrained model only returns the raw hidden states. For a specific task, use the appropriate model head to convert the raw hidden states into a meaningful result (for example, [`LlamaModel`] versus [`LlamaForCausalLM`]). |
| Preprocessor | A class for converting raw inputs (text, images, audio, multimodal) into numerical inputs to the model. For example, [`PreTrainedTokenizer`] converts text into tensors and [`ImageProcessingMixin`] converts pixels into tensors. |
diff --git a/docs/source/en/torchscript.md b/docs/source/en/torchscript.md
index fa13fc6166a..fc854f94c2d 100644
--- a/docs/source/en/torchscript.md
+++ b/docs/source/en/torchscript.md
@@ -21,7 +21,7 @@ rendered properly in your Markdown viewer.
Transformers can export a model to TorchScript by:
1. creating dummy inputs to create a *trace* of the model to serialize to TorchScript
-2. enabling the `torchscript` parameter in either [`~PretrainedConfig.torchscript`] for a randomly initialized model or [`~PreTrainedModel.from_pretrained`] for a pretrained model
+2. enabling the `torchscript` parameter in either [`~PreTrainedConfig.torchscript`] for a randomly initialized model or [`~PreTrainedModel.from_pretrained`] for a pretrained model
## Dummy inputs
diff --git a/docs/source/en/transformers_as_backend.md b/docs/source/en/transformers_as_backend.md
index ce5152c2a4a..23b1e9a099d 100644
--- a/docs/source/en/transformers_as_backend.md
+++ b/docs/source/en/transformers_as_backend.md
@@ -135,9 +135,9 @@ class MyModel(PreTrainedModel):
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
-class MyConfig(PretrainedConfig):
+class MyConfig(PreTrainedConfig):
base_model_tp_plan = {
"layers.*.self_attn.k_proj": "colwise",
"layers.*.self_attn.v_proj": "colwise",
diff --git a/docs/source/es/create_a_model.md b/docs/source/es/create_a_model.md
index 4463952f484..9d9208d38d5 100644
--- a/docs/source/es/create_a_model.md
+++ b/docs/source/es/create_a_model.md
@@ -83,19 +83,19 @@ DistilBertConfig {
}
```
-Los atributos de los modelos preentrenados pueden ser modificados con la función [`~PretrainedConfig.from_pretrained`]:
+Los atributos de los modelos preentrenados pueden ser modificados con la función [`~PreTrainedConfig.from_pretrained`]:
```py
>>> my_config = DistilBertConfig.from_pretrained("distilbert/distilbert-base-uncased", activation="relu", attention_dropout=0.4)
```
-Cuando estés satisfecho con la configuración de tu modelo, puedes guardarlo con la función [`~PretrainedConfig.save_pretrained`]. Tu configuración se guardará en un archivo JSON dentro del directorio que le especifiques como parámetro.
+Cuando estés satisfecho con la configuración de tu modelo, puedes guardarlo con la función [`~PreTrainedConfig.save_pretrained`]. Tu configuración se guardará en un archivo JSON dentro del directorio que le especifiques como parámetro.
```py
>>> my_config.save_pretrained(save_directory="./your_model_save_path")
```
-Para volver a usar el archivo de configuración, puedes cargarlo usando [`~PretrainedConfig.from_pretrained`]:
+Para volver a usar el archivo de configuración, puedes cargarlo usando [`~PreTrainedConfig.from_pretrained`]:
```py
>>> my_config = DistilBertConfig.from_pretrained("./your_model_save_path/my_config.json")
diff --git a/docs/source/es/custom_models.md b/docs/source/es/custom_models.md
index fec50e4e7a1..ff093a6fecf 100644
--- a/docs/source/es/custom_models.md
+++ b/docs/source/es/custom_models.md
@@ -38,11 +38,11 @@ configuraciones nos darán los diferentes tipos de ResNet que son posibles. Lueg
después de verificar la validez de algunos de ellos.
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -76,12 +76,12 @@ class ResnetConfig(PretrainedConfig):
```
Las tres cosas importantes que debes recordar al escribir tu propia configuración son las siguientes:
-- tienes que heredar de `PretrainedConfig`,
-- el `__init__` de tu `PretrainedConfig` debe aceptar cualquier `kwargs`,
+- tienes que heredar de `PreTrainedConfig`,
+- el `__init__` de tu `PreTrainedConfig` debe aceptar cualquier `kwargs`,
- esos `kwargs` deben pasarse a la superclase `__init__`.
La herencia es para asegurarte de obtener toda la funcionalidad de la biblioteca 🤗 Transformers, mientras que las otras dos
-restricciones provienen del hecho de que una `PretrainedConfig` tiene más campos que los que estás configurando. Al recargar una
+restricciones provienen del hecho de que una `PreTrainedConfig` tiene más campos que los que estás configurando. Al recargar una
`config` con el método `from_pretrained`, esos campos deben ser aceptados por tu `config` y luego enviados a la superclase.
Definir un `model_type` para tu configuración (en este caso `model_type="resnet"`) no es obligatorio, a menos que quieras
@@ -102,7 +102,7 @@ con el método `from_pretrained`:
resnet50d_config = ResnetConfig.from_pretrained("custom-resnet")
```
-También puedes usar cualquier otro método de la clase [`PretrainedConfig`], como [`~PretrainedConfig.push_to_hub`], para cargar
+También puedes usar cualquier otro método de la clase [`PreTrainedConfig`], como [`~PreTrainedConfig.push_to_hub`], para cargar
directamente tu configuración en el Hub.
## Escribir un modelo personalizado
diff --git a/docs/source/fr/autoclass_tutorial.md b/docs/source/fr/autoclass_tutorial.md
index 3eaa2946d74..cec70285b48 100644
--- a/docs/source/fr/autoclass_tutorial.md
+++ b/docs/source/fr/autoclass_tutorial.md
@@ -71,7 +71,7 @@ Pour les tâches de vision, un processeur d'image traite l'image pour la formate
Un backbone Swin avec plusieurs étapes pour produire une carte de caractéristiques.
-[`AutoBackbone`] vous permet d'utiliser des modèles pré-entraînés comme backbones pour obtenir des cartes de caractéristiques à partir de différentes étapes du backbone. Vous devez spécifier l'un des paramètres suivants dans [`~PretrainedConfig.from_pretrained`] :
+[`AutoBackbone`] vous permet d'utiliser des modèles pré-entraînés comme backbones pour obtenir des cartes de caractéristiques à partir de différentes étapes du backbone. Vous devez spécifier l'un des paramètres suivants dans [`~PreTrainedConfig.from_pretrained`] :
* `out_indices` est l'index de la couche dont vous souhaitez obtenir la carte de caractéristiques
* `out_features` est le nom de la couche dont vous souhaitez obtenir la carte de caractéristiques
diff --git a/docs/source/it/add_new_model.md b/docs/source/it/add_new_model.md
index 1cd5da18c64..16e461e4deb 100644
--- a/docs/source/it/add_new_model.md
+++ b/docs/source/it/add_new_model.md
@@ -67,7 +67,7 @@ Tenendo questi principi in mente, immergiamoci nel design generale della libreri
### Panoramica sui modelli
Per aggiungere con successo un modello, é importante capire l'interazione tra il tuo modello e la sua configurazione,
-[`PreTrainedModel`], e [`PretrainedConfig`]. Per dare un esempio, chiameremo il modello da aggiungere a 🤗 Transformers
+[`PreTrainedModel`], e [`PreTrainedConfig`]. Per dare un esempio, chiameremo il modello da aggiungere a 🤗 Transformers
`BrandNewBert`.
Diamo un'occhiata:
@@ -94,9 +94,9 @@ model.config # il modello ha accesso al suo config
```
Analogamente al modello, la configurazione eredita le funzionalità base di serializzazione e deserializzazione da
-[`PretrainedConfig`]. É da notare che la configurazione e il modello sono sempre serializzati in due formati differenti -
+[`PreTrainedConfig`]. É da notare che la configurazione e il modello sono sempre serializzati in due formati differenti -
il modello é serializzato in un file *pytorch_model.bin* mentre la configurazione con *config.json*. Chiamando
-[`~PreTrainedModel.save_pretrained`] automaticamente chiamerà [`~PretrainedConfig.save_pretrained`], cosicché sia il
+[`~PreTrainedModel.save_pretrained`] automaticamente chiamerà [`~PreTrainedConfig.save_pretrained`], cosicché sia il
modello che la configurazione siano salvati.
diff --git a/docs/source/it/create_a_model.md b/docs/source/it/create_a_model.md
index 174083e73e6..d99a4ea02fb 100644
--- a/docs/source/it/create_a_model.md
+++ b/docs/source/it/create_a_model.md
@@ -83,19 +83,19 @@ DistilBertConfig {
}
```
-Nella funzione [`~PretrainedConfig.from_pretrained`] possono essere modificati gli attributi del modello pre-allenato:
+Nella funzione [`~PreTrainedConfig.from_pretrained`] possono essere modificati gli attributi del modello pre-allenato:
```py
>>> my_config = DistilBertConfig.from_pretrained("distilbert/distilbert-base-uncased", activation="relu", attention_dropout=0.4)
```
-Quando la configurazione del modello ti soddisfa, la puoi salvare con [`~PretrainedConfig.save_pretrained`]. Il file della tua configurazione è memorizzato come file JSON nella save directory specificata:
+Quando la configurazione del modello ti soddisfa, la puoi salvare con [`~PreTrainedConfig.save_pretrained`]. Il file della tua configurazione è memorizzato come file JSON nella save directory specificata:
```py
>>> my_config.save_pretrained(save_directory="./your_model_save_path")
```
-Per riutilizzare la configurazione del file, caricalo con [`~PretrainedConfig.from_pretrained`]:
+Per riutilizzare la configurazione del file, caricalo con [`~PreTrainedConfig.from_pretrained`]:
```py
>>> my_config = DistilBertConfig.from_pretrained("./your_model_save_path/my_config.json")
diff --git a/docs/source/it/custom_models.md b/docs/source/it/custom_models.md
index 5f3d4cade00..be2e1eada3e 100644
--- a/docs/source/it/custom_models.md
+++ b/docs/source/it/custom_models.md
@@ -37,11 +37,11 @@ Configurazioni differenti ci daranno quindi i differenti possibili tipi di ResNe
dopo averne controllato la validità.
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -75,12 +75,12 @@ class ResnetConfig(PretrainedConfig):
```
Le tre cose più importanti da ricordare quando scrivi le tue configurazioni sono le seguenti:
-- Devi ereditare da `Pretrainedconfig`,
-- Il metodo `__init__` del tuo `Pretrainedconfig` deve accettare i kwargs,
+- Devi ereditare da `PreTrainedConfig`,
+- Il metodo `__init__` del tuo `PreTrainedConfig` deve accettare i kwargs,
- I `kwargs` devono essere passati alla superclass `__init__`
L’eredità è importante per assicurarsi di ottenere tutte le funzionalità della libreria 🤗 transformers,
-mentre gli altri due vincoli derivano dal fatto che un `Pretrainedconfig` ha più campi di quelli che stai settando.
+mentre gli altri due vincoli derivano dal fatto che un `PreTrainedConfig` ha più campi di quelli che stai settando.
Quando ricarichi una config da un metodo `from_pretrained`, questi campi devono essere accettati dalla tua config e
poi inviati alla superclasse.
@@ -102,7 +102,7 @@ config con il metodo `from_pretrained`.
resnet50d_config = ResnetConfig.from_pretrained("custom-resnet")
```
-Puoi anche usare qualunque altro metodo della classe [`PretrainedConfig`], come [`~PretrainedConfig.push_to_hub`]
+Puoi anche usare qualunque altro metodo della classe [`PreTrainedConfig`], come [`~PreTrainedConfig.push_to_hub`]
per caricare direttamente la tua configurazione nell'hub.
## Scrivere un modello personalizzato
diff --git a/docs/source/ja/add_new_model.md b/docs/source/ja/add_new_model.md
index 000e4fd8592..75219dcb8f8 100644
--- a/docs/source/ja/add_new_model.md
+++ b/docs/source/ja/add_new_model.md
@@ -51,7 +51,7 @@ Hugging Faceチームのメンバーがサポートを提供するので、一
### Overview of models
-モデルを正常に追加するためには、モデルとその設定、[`PreTrainedModel`]、および[`PretrainedConfig`]の相互作用を理解することが重要です。
+モデルを正常に追加するためには、モデルとその設定、[`PreTrainedModel`]、および[`PreTrainedConfig`]の相互作用を理解することが重要です。
例示的な目的で、🤗 Transformersに追加するモデルを「BrandNewBert」と呼びます。
以下をご覧ください:
@@ -77,7 +77,7 @@ model = BrandNewBertModel.from_pretrained("brandy/brand_new_bert")
model.config # model has access to its config
```
-モデルと同様に、設定は[`PretrainedConfig`]から基本的なシリアル化および逆シリアル化の機能を継承しています。注意すべきは、設定とモデルは常に2つの異なる形式にシリアル化されることです - モデルは*pytorch_model.bin*ファイルに、設定は*config.json*ファイルにシリアル化されます。[`~PreTrainedModel.save_pretrained`]を呼び出すと、自動的に[`~PretrainedConfig.save_pretrained`]も呼び出され、モデルと設定の両方が保存されます。
+モデルと同様に、設定は[`PreTrainedConfig`]から基本的なシリアル化および逆シリアル化の機能を継承しています。注意すべきは、設定とモデルは常に2つの異なる形式にシリアル化されることです - モデルは*pytorch_model.bin*ファイルに、設定は*config.json*ファイルにシリアル化されます。[`~PreTrainedModel.save_pretrained`]を呼び出すと、自動的に[`~PreTrainedConfig.save_pretrained`]も呼び出され、モデルと設定の両方が保存されます。
### Code style
diff --git a/docs/source/ja/create_a_model.md b/docs/source/ja/create_a_model.md
index d708070c3da..98175dff7ba 100644
--- a/docs/source/ja/create_a_model.md
+++ b/docs/source/ja/create_a_model.md
@@ -86,19 +86,19 @@ DistilBertConfig {
}
```
-事前学習済みモデルの属性は、[`~PretrainedConfig.from_pretrained`] 関数で変更できます:
+事前学習済みモデルの属性は、[`~PreTrainedConfig.from_pretrained`] 関数で変更できます:
```py
>>> my_config = DistilBertConfig.from_pretrained("distilbert/distilbert-base-uncased", activation="relu", attention_dropout=0.4)
```
-Once you are satisfied with your model configuration, you can save it with [`PretrainedConfig.save_pretrained`]. Your configuration file is stored as a JSON file in the specified save directory.
+Once you are satisfied with your model configuration, you can save it with [`PreTrainedConfig.save_pretrained`]. Your configuration file is stored as a JSON file in the specified save directory.
```py
>>> my_config.save_pretrained(save_directory="./your_model_save_path")
```
-設定ファイルを再利用するには、[`~PretrainedConfig.from_pretrained`]を使用してそれをロードします:
+設定ファイルを再利用するには、[`~PreTrainedConfig.from_pretrained`]を使用してそれをロードします:
```py
>>> my_config = DistilBertConfig.from_pretrained("./your_model_save_path/config.json")
diff --git a/docs/source/ja/custom_models.md b/docs/source/ja/custom_models.md
index 737f5fd36d0..8b69500e231 100644
--- a/docs/source/ja/custom_models.md
+++ b/docs/source/ja/custom_models.md
@@ -29,11 +29,11 @@ rendered properly in your Markdown viewer.
この例では、ResNetクラスのいくつかの引数を取得し、調整したいかもしれないとします。異なる設定は、異なるタイプのResNetを提供します。その後、これらの引数を確認した後、それらの引数を単に格納します。
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -67,12 +67,12 @@ class ResnetConfig(PretrainedConfig):
```
重要なことを3つ覚えておくべきポイントは次のとおりです:
-- `PretrainedConfig` を継承する必要があります。
-- あなたの `PretrainedConfig` の `__init__` は任意の kwargs を受け入れる必要があります。
+- `PreTrainedConfig` を継承する必要があります。
+- あなたの `PreTrainedConfig` の `__init__` は任意の kwargs を受け入れる必要があります。
- これらの `kwargs` は親クラスの `__init__` に渡す必要があります。
継承は、🤗 Transformers ライブラリのすべての機能を取得できるようにするためです。他の2つの制約は、
-`PretrainedConfig` が設定しているフィールド以外にも多くのフィールドを持っていることから来ています。
+`PreTrainedConfig` が設定しているフィールド以外にも多くのフィールドを持っていることから来ています。
`from_pretrained` メソッドで設定を再ロードする場合、これらのフィールドはあなたの設定に受け入れられ、
その後、親クラスに送信される必要があります。
@@ -95,7 +95,7 @@ resnet50d_config.save_pretrained("custom-resnet")
resnet50d_config = ResnetConfig.from_pretrained("custom-resnet")
```
-また、[`PretrainedConfig`] クラスの他のメソッドを使用することもできます。たとえば、[`~PretrainedConfig.push_to_hub`] を使用して、設定を直接 Hub にアップロードできます。
+また、[`PreTrainedConfig`] クラスの他のメソッドを使用することもできます。たとえば、[`~PreTrainedConfig.push_to_hub`] を使用して、設定を直接 Hub にアップロードできます。
## Writing a custom model
diff --git a/docs/source/ja/main_classes/configuration.md b/docs/source/ja/main_classes/configuration.md
index 7fab5269e20..a9290ac4e98 100644
--- a/docs/source/ja/main_classes/configuration.md
+++ b/docs/source/ja/main_classes/configuration.md
@@ -16,7 +16,7 @@ rendered properly in your Markdown viewer.
# 構成
-基本クラス [`PretrainedConfig`] は、設定をロード/保存するための一般的なメソッドを実装します。
+基本クラス [`PreTrainedConfig`] は、設定をロード/保存するための一般的なメソッドを実装します。
ローカル ファイルまたはディレクトリから、またはライブラリ (ダウンロードされた) によって提供される事前トレーニング済みモデル構成から
HuggingFace の AWS S3 リポジトリから)。
@@ -24,8 +24,8 @@ HuggingFace の AWS S3 リポジトリから)。
`hidden_size`、`num_attention_heads`、および `num_hidden_layers`。テキスト モデルはさらに以下を実装します。
`vocab_size`。
-## PretrainedConfig
+## PreTrainedConfig
-[[autodoc]] PretrainedConfig
+[[autodoc]] PreTrainedConfig
- push_to_hub
- all
diff --git a/docs/source/ja/model_doc/auto.md b/docs/source/ja/model_doc/auto.md
index 1a36d2c9bb1..47453166d37 100644
--- a/docs/source/ja/model_doc/auto.md
+++ b/docs/source/ja/model_doc/auto.md
@@ -43,7 +43,7 @@ AutoModel.register(NewModelConfig, NewModel)
-あなたの`NewModelConfig`が[`~transformers.PretrainedConfig`]のサブクラスである場合、その`model_type`属性がコンフィグを登録するときに使用するキー(ここでは`"new-model"`)と同じに設定されていることを確認してください。
+あなたの`NewModelConfig`が[`~transformers.PreTrainedConfig`]のサブクラスである場合、その`model_type`属性がコンフィグを登録するときに使用するキー(ここでは`"new-model"`)と同じに設定されていることを確認してください。
同様に、あなたの`NewModel`が[`PreTrainedModel`]のサブクラスである場合、その`config_class`属性がモデルを登録する際に使用するクラス(ここでは`NewModelConfig`)と同じに設定されていることを確認してください。
diff --git a/docs/source/ko/add_new_model.md b/docs/source/ko/add_new_model.md
index e30c2dc9f0d..a75032c000d 100644
--- a/docs/source/ko/add_new_model.md
+++ b/docs/source/ko/add_new_model.md
@@ -46,7 +46,7 @@ Hugging Face 팀은 항상 도움을 줄 준비가 되어 있으므로 혼자가
### 모델 개요 [[overview-of-models]]
-모델을 성공적으로 추가하려면 모델과 해당 구성인 [`PreTrainedModel`] 및 [`PretrainedConfig`] 간의 상호작용을 이해하는 것이 중요합니다. 예를 들어, 🤗 Transformers에 추가하려는 모델을 `BrandNewBert`라고 부르겠습니다.
+모델을 성공적으로 추가하려면 모델과 해당 구성인 [`PreTrainedModel`] 및 [`PreTrainedConfig`] 간의 상호작용을 이해하는 것이 중요합니다. 예를 들어, 🤗 Transformers에 추가하려는 모델을 `BrandNewBert`라고 부르겠습니다.
다음을 살펴보겠습니다:
@@ -59,7 +59,7 @@ model = BrandNewBertModel.from_pretrained("brandy/brand_new_bert")
model.config # model has access to its config
```
-모델과 마찬가지로 구성은 [`PretrainedConfig`]에서 기본 직렬화 및 역직렬화 기능을 상속받습니다. 구성과 모델은 항상 *pytorch_model.bin* 파일과 *config.json* 파일로 각각 별도로 직렬화됩니다. [`~PreTrainedModel.save_pretrained`]를 호출하면 자동으로 [`~PretrainedConfig.save_pretrained`]도 호출되므로 모델과 구성이 모두 저장됩니다.
+모델과 마찬가지로 구성은 [`PreTrainedConfig`]에서 기본 직렬화 및 역직렬화 기능을 상속받습니다. 구성과 모델은 항상 *pytorch_model.bin* 파일과 *config.json* 파일로 각각 별도로 직렬화됩니다. [`~PreTrainedModel.save_pretrained`]를 호출하면 자동으로 [`~PreTrainedConfig.save_pretrained`]도 호출되므로 모델과 구성이 모두 저장됩니다.
### 코드 스타일 [[code-style]]
diff --git a/docs/source/ko/custom_models.md b/docs/source/ko/custom_models.md
index 1e76608b152..3108788a38e 100644
--- a/docs/source/ko/custom_models.md
+++ b/docs/source/ko/custom_models.md
@@ -36,11 +36,11 @@ rendered properly in your Markdown viewer.
그런 다음 몇 가지 유효성을 확인한 후 해당 인수를 저장합니다.
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -74,12 +74,12 @@ class ResnetConfig(PretrainedConfig):
```
사용자 정의 `configuration`을 작성할 때 기억해야 할 세 가지 중요한 사항은 다음과 같습니다:
-- `PretrainedConfig`을 상속해야 합니다.
-- `PretrainedConfig`의 `__init__`은 모든 kwargs를 허용해야 하고,
+- `PreTrainedConfig`을 상속해야 합니다.
+- `PreTrainedConfig`의 `__init__`은 모든 kwargs를 허용해야 하고,
- 이러한 `kwargs`는 상위 클래스 `__init__`에 전달되어야 합니다.
상속은 🤗 Transformers 라이브러리에서 모든 기능을 가져오는 것입니다.
-이러한 점으로부터 비롯되는 두 가지 제약 조건은 `PretrainedConfig`에 설정하는 것보다 더 많은 필드가 있습니다.
+이러한 점으로부터 비롯되는 두 가지 제약 조건은 `PreTrainedConfig`에 설정하는 것보다 더 많은 필드가 있습니다.
`from_pretrained` 메서드로 구성을 다시 로드할 때 해당 필드는 구성에서 수락한 후 상위 클래스로 보내야 합니다.
모델을 auto 클래스에 등록하지 않는 한, `configuration`에서 `model_type`을 정의(여기서 `model_type="resnet"`)하는 것은 필수 사항이 아닙니다 (마지막 섹션 참조).
@@ -99,7 +99,7 @@ resnet50d_config.save_pretrained("custom-resnet")
resnet50d_config = ResnetConfig.from_pretrained("custom-resnet")
```
-구성을 Hub에 직접 업로드하기 위해 [`PretrainedConfig`] 클래스의 [`~PretrainedConfig.push_to_hub`]와 같은 다른 메서드를 사용할 수 있습니다.
+구성을 Hub에 직접 업로드하기 위해 [`PreTrainedConfig`] 클래스의 [`~PreTrainedConfig.push_to_hub`]와 같은 다른 메서드를 사용할 수 있습니다.
## 사용자 정의 모델 작성하기[[writing-a-custom-model]]
diff --git a/docs/source/ko/main_classes/configuration.md b/docs/source/ko/main_classes/configuration.md
index 6c6278a0258..868dd2219ca 100644
--- a/docs/source/ko/main_classes/configuration.md
+++ b/docs/source/ko/main_classes/configuration.md
@@ -16,13 +16,13 @@ rendered properly in your Markdown viewer.
# 구성[[configuration]]
-기본 클래스 [`PretrainedConfig`]는 로컬 파일이나 디렉토리, 또는 라이브러리에서 제공하는 사전 학습된 모델 구성(HuggingFace의 AWS S3 저장소에서 다운로드됨)으로부터 구성을 불러오거나 저장하는 공통 메서드를 구현합니다. 각 파생 구성 클래스는 모델별 특성을 구현합니다.
+기본 클래스 [`PreTrainedConfig`]는 로컬 파일이나 디렉토리, 또는 라이브러리에서 제공하는 사전 학습된 모델 구성(HuggingFace의 AWS S3 저장소에서 다운로드됨)으로부터 구성을 불러오거나 저장하는 공통 메서드를 구현합니다. 각 파생 구성 클래스는 모델별 특성을 구현합니다.
모든 구성 클래스에 존재하는 공통 속성은 다음과 같습니다: `hidden_size`, `num_attention_heads`, `num_hidden_layers`. 텍스트 모델은 추가로 `vocab_size`를 구현합니다.
-## PretrainedConfig[[transformers.PretrainedConfig]]
+## PreTrainedConfig[[transformers.PreTrainedConfig]]
-[[autodoc]] PretrainedConfig
+[[autodoc]] PreTrainedConfig
- push_to_hub
- all
diff --git a/docs/source/ko/model_doc/auto.md b/docs/source/ko/model_doc/auto.md
index f928b190455..130d1e5eea4 100644
--- a/docs/source/ko/model_doc/auto.md
+++ b/docs/source/ko/model_doc/auto.md
@@ -44,7 +44,7 @@ AutoModel.register(NewModelConfig, NewModel)
-만약 `NewModelConfig`가 [`~transformers.PretrainedConfig`]의 서브클래스라면, 해당 `model_type` 속성이 등록할 때 사용하는 키(여기서는 `"new-model"`)와 동일하게 설정되어 있는지 확인하세요.
+만약 `NewModelConfig`가 [`~transformers.PreTrainedConfig`]의 서브클래스라면, 해당 `model_type` 속성이 등록할 때 사용하는 키(여기서는 `"new-model"`)와 동일하게 설정되어 있는지 확인하세요.
마찬가지로, `NewModel`이 [`PreTrainedModel`]의 서브클래스라면, 해당 `config_class` 속성이 등록할 때 사용하는 클래스(여기서는 `NewModelConfig`)와 동일하게 설정되어 있는지 확인하세요.
diff --git a/docs/source/pt/create_a_model.md b/docs/source/pt/create_a_model.md
index 3eec2233540..1d25c98efb6 100644
--- a/docs/source/pt/create_a_model.md
+++ b/docs/source/pt/create_a_model.md
@@ -83,19 +83,19 @@ DistilBertConfig {
}
```
-Atributos de um modelo pré-treinado podem ser modificados na função [`~PretrainedConfig.from_pretrained`]:
+Atributos de um modelo pré-treinado podem ser modificados na função [`~PreTrainedConfig.from_pretrained`]:
```py
>>> my_config = DistilBertConfig.from_pretrained("distilbert/distilbert-base-uncased", activation="relu", attention_dropout=0.4)
```
-Uma vez que você está satisfeito com as configurações do seu modelo, você consegue salvar elas com [`~PretrainedConfig.save_pretrained`]. Seu arquivo de configurações está salvo como um arquivo JSON no diretório especificado:
+Uma vez que você está satisfeito com as configurações do seu modelo, você consegue salvar elas com [`~PreTrainedConfig.save_pretrained`]. Seu arquivo de configurações está salvo como um arquivo JSON no diretório especificado:
```py
>>> my_config.save_pretrained(save_directory="./your_model_save_path")
```
-Para reusar o arquivo de configurações, carregue com [`~PretrainedConfig.from_pretrained`]:
+Para reusar o arquivo de configurações, carregue com [`~PreTrainedConfig.from_pretrained`]:
```py
>>> my_config = DistilBertConfig.from_pretrained("./your_model_save_path/my_config.json")
diff --git a/docs/source/pt/custom_models.md b/docs/source/pt/custom_models.md
index 1866cca182e..1e619736771 100644
--- a/docs/source/pt/custom_models.md
+++ b/docs/source/pt/custom_models.md
@@ -37,11 +37,11 @@ configurações nos dará os diferentes tipos de ResNets que são possíveis. Em
após verificar a validade de alguns deles.
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -75,12 +75,12 @@ class ResnetConfig(PretrainedConfig):
```
As três coisas importantes a serem lembradas ao escrever sua própria configuração são:
-- você tem que herdar de `PretrainedConfig`,
-- o `__init__` do seu `PretrainedConfig` deve aceitar quaisquer kwargs,
+- você tem que herdar de `PreTrainedConfig`,
+- o `__init__` do seu `PreTrainedConfig` deve aceitar quaisquer kwargs,
- esses `kwargs` precisam ser passados para a superclasse `__init__`.
A herança é para garantir que você obtenha todas as funcionalidades da biblioteca 🤗 Transformers, enquanto as outras duas
-restrições vêm do fato de um `PretrainedConfig` ter mais campos do que os que você está configurando. Ao recarregar um
+restrições vêm do fato de um `PreTrainedConfig` ter mais campos do que os que você está configurando. Ao recarregar um
config com o método `from_pretrained`, esses campos precisam ser aceitos pelo seu config e então enviados para a
superclasse.
@@ -102,7 +102,7 @@ método `from_pretrained`:
resnet50d_config = ResnetConfig.from_pretrained("custom-resnet")
```
-Você também pode usar qualquer outro método da classe [`PretrainedConfig`], como [`~PretrainedConfig.push_to_hub`] para
+Você também pode usar qualquer outro método da classe [`PreTrainedConfig`], como [`~PreTrainedConfig.push_to_hub`] para
carregar diretamente sua configuração para o Hub.
## Escrevendo um modelo customizado
diff --git a/docs/source/zh/create_a_model.md b/docs/source/zh/create_a_model.md
index a90b035a541..a072f1ffc65 100644
--- a/docs/source/zh/create_a_model.md
+++ b/docs/source/zh/create_a_model.md
@@ -84,19 +84,19 @@ DistilBertConfig {
}
```
-预训练模型的属性可以在 [`~PretrainedConfig.from_pretrained`] 函数中进行修改:
+预训练模型的属性可以在 [`~PreTrainedConfig.from_pretrained`] 函数中进行修改:
```py
>>> my_config = DistilBertConfig.from_pretrained("distilbert/distilbert-base-uncased", activation="relu", attention_dropout=0.4)
```
-当你对模型配置满意时,可以使用 [`~PretrainedConfig.save_pretrained`] 来保存配置。你的配置文件将以 JSON 文件的形式存储在指定的保存目录中:
+当你对模型配置满意时,可以使用 [`~PreTrainedConfig.save_pretrained`] 来保存配置。你的配置文件将以 JSON 文件的形式存储在指定的保存目录中:
```py
>>> my_config.save_pretrained(save_directory="./your_model_save_path")
```
-要重用配置文件,请使用 [`~PretrainedConfig.from_pretrained`] 进行加载:
+要重用配置文件,请使用 [`~PreTrainedConfig.from_pretrained`] 进行加载:
```py
>>> my_config = DistilBertConfig.from_pretrained("./your_model_save_path/config.json")
diff --git a/docs/source/zh/custom_models.md b/docs/source/zh/custom_models.md
index d38aaf4511f..0b134926209 100644
--- a/docs/source/zh/custom_models.md
+++ b/docs/source/zh/custom_models.md
@@ -29,11 +29,11 @@ rendered properly in your Markdown viewer.
我们将采用一些我们可能想要调整的 ResNet 类的参数举例。不同的配置将为我们提供不同类型可能的 ResNet 模型。在确认其中一些参数的有效性后,我们只需存储这些参数。
```python
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from typing import List
-class ResnetConfig(PretrainedConfig):
+class ResnetConfig(PreTrainedConfig):
model_type = "resnet"
def __init__(
@@ -67,11 +67,11 @@ class ResnetConfig(PretrainedConfig):
```
编写自定义配置时需要记住的三个重要事项如下:
-- 必须继承自 `PretrainedConfig`,
-- `PretrainedConfig` 的 `__init__` 方法必须接受任何 kwargs,
+- 必须继承自 `PreTrainedConfig`,
+- `PreTrainedConfig` 的 `__init__` 方法必须接受任何 kwargs,
- 这些 `kwargs` 需要传递给超类的 `__init__` 方法。
-继承是为了确保你获得来自 🤗 Transformers 库的所有功能,而另外两个约束源于 `PretrainedConfig` 的字段比你设置的字段多。在使用 `from_pretrained` 方法重新加载配置时,这些字段需要被你的配置接受,然后传递给超类。
+继承是为了确保你获得来自 🤗 Transformers 库的所有功能,而另外两个约束源于 `PreTrainedConfig` 的字段比你设置的字段多。在使用 `from_pretrained` 方法重新加载配置时,这些字段需要被你的配置接受,然后传递给超类。
为你的配置定义 `model_type`(此处为 `model_type="resnet"`)不是必须的,除非你想使用自动类注册你的模型(请参阅最后一节)。
@@ -88,7 +88,7 @@ resnet50d_config.save_pretrained("custom-resnet")
resnet50d_config = ResnetConfig.from_pretrained("custom-resnet")
```
-你还可以使用 [`PretrainedConfig`] 类的任何其他方法,例如 [`~PretrainedConfig.push_to_hub`],直接将配置上传到 Hub。
+你还可以使用 [`PreTrainedConfig`] 类的任何其他方法,例如 [`~PreTrainedConfig.push_to_hub`],直接将配置上传到 Hub。
## 编写自定义模型
diff --git a/docs/source/zh/main_classes/configuration.md b/docs/source/zh/main_classes/configuration.md
index 755a3170419..dc65efb7226 100644
--- a/docs/source/zh/main_classes/configuration.md
+++ b/docs/source/zh/main_classes/configuration.md
@@ -16,13 +16,13 @@ rendered properly in your Markdown viewer.
# Configuration
-基类[`PretrainedConfig`]实现了从本地文件或目录加载/保存配置的常见方法,或下载库提供的预训练模型配置(从HuggingFace的AWS S3库中下载)。
+基类[`PreTrainedConfig`]实现了从本地文件或目录加载/保存配置的常见方法,或下载库提供的预训练模型配置(从HuggingFace的AWS S3库中下载)。
每个派生的配置类都实现了特定于模型的属性。所有配置类中共同存在的属性有:`hidden_size`、`num_attention_heads` 和 `num_hidden_layers`。文本模型进一步添加了 `vocab_size`。
-## PretrainedConfig
+## PreTrainedConfig
-[[autodoc]] PretrainedConfig
+[[autodoc]] PreTrainedConfig
- push_to_hub
- all
diff --git a/examples/legacy/pytorch-lightning/lightning_base.py b/examples/legacy/pytorch-lightning/lightning_base.py
index 228fc87ca39..64d28135943 100644
--- a/examples/legacy/pytorch-lightning/lightning_base.py
+++ b/examples/legacy/pytorch-lightning/lightning_base.py
@@ -17,7 +17,7 @@ from transformers import (
AutoModelForTokenClassification,
AutoModelWithLMHead,
AutoTokenizer,
- PretrainedConfig,
+ PreTrainedConfig,
PreTrainedTokenizer,
is_torch_available,
)
@@ -93,7 +93,7 @@ class BaseTransformer(pl.LightningModule):
**config_kwargs,
)
else:
- self.config: PretrainedConfig = config
+ self.config: PreTrainedConfig = config
extra_model_params = ("encoder_layerdrop", "decoder_layerdrop", "dropout", "attention_dropout")
for p in extra_model_params:
diff --git a/examples/modular-transformers/configuration_duplicated_method.py b/examples/modular-transformers/configuration_duplicated_method.py
index ffe4079d4d4..534c9fd6616 100644
--- a/examples/modular-transformers/configuration_duplicated_method.py
+++ b/examples/modular-transformers/configuration_duplicated_method.py
@@ -5,19 +5,19 @@
# modular_duplicated_method.py file directly. One of our CI enforces this.
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class DuplicatedMethodConfig(PretrainedConfig):
+class DuplicatedMethodConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DuplicatedMethodModel`]. It is used to instantiate an DuplicatedMethod
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the DuplicatedMethod-7B.
e.g. [meta-duplicated_method/DuplicatedMethod-2-7b-hf](https://huggingface.co/meta-duplicated_method/DuplicatedMethod-2-7b-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/examples/modular-transformers/configuration_my_new_model.py b/examples/modular-transformers/configuration_my_new_model.py
index ff359fa416b..924e0cccadd 100644
--- a/examples/modular-transformers/configuration_my_new_model.py
+++ b/examples/modular-transformers/configuration_my_new_model.py
@@ -5,19 +5,19 @@
# modular_my_new_model.py file directly. One of our CI enforces this.
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class MyNewModelConfig(PretrainedConfig):
+class MyNewModelConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MyNewModelModel`]. It is used to instantiate an MyNewModel
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the MyNewModel-7B.
e.g. [meta-my_new_model/MyNewModel-2-7b-hf](https://huggingface.co/meta-my_new_model/MyNewModel-2-7b-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/examples/modular-transformers/configuration_my_new_model2.py b/examples/modular-transformers/configuration_my_new_model2.py
index a5364a85d53..f8e219f11eb 100644
--- a/examples/modular-transformers/configuration_my_new_model2.py
+++ b/examples/modular-transformers/configuration_my_new_model2.py
@@ -5,18 +5,18 @@
# modular_my_new_model2.py file directly. One of our CI enforces this.
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class MyNewModel2Config(PretrainedConfig):
+class MyNewModel2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GemmaModel`]. It is used to instantiate an Gemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma-7B.
e.g. [google/gemma-7b](https://huggingface.co/google/gemma-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
Vocabulary size of the Gemma model. Defines the number of different tokens that can be represented by the
diff --git a/examples/modular-transformers/configuration_new_model.py b/examples/modular-transformers/configuration_new_model.py
index 110e0176f6a..12bf09a9e34 100644
--- a/examples/modular-transformers/configuration_new_model.py
+++ b/examples/modular-transformers/configuration_new_model.py
@@ -6,17 +6,17 @@
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# Example where we only want to overwrite the defaults of an init
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class NewModelConfig(PretrainedConfig):
+class NewModelConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`NewModelModel`]. It is used to instantiate an NewModel
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the NewModel-7B.
e.g. [google/new_model-7b](https://huggingface.co/google/new_model-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
Vocabulary size of the NewModel model. Defines the number of different tokens that can be represented by the
diff --git a/examples/modular-transformers/modular_my_new_model.py b/examples/modular-transformers/modular_my_new_model.py
index 58b74cd7eb1..d6ae897e34f 100644
--- a/examples/modular-transformers/modular_my_new_model.py
+++ b/examples/modular-transformers/modular_my_new_model.py
@@ -9,8 +9,8 @@ class MyNewModelConfig(LlamaConfig):
defaults will yield a similar configuration to that of the MyNewModel-7B.
e.g. [meta-my_new_model/MyNewModel-2-7b-hf](https://huggingface.co/meta-my_new_model/MyNewModel-2-7b-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/examples/modular-transformers/modular_my_new_model2.py b/examples/modular-transformers/modular_my_new_model2.py
index 2e449e06b16..45b9427ed9e 100644
--- a/examples/modular-transformers/modular_my_new_model2.py
+++ b/examples/modular-transformers/modular_my_new_model2.py
@@ -9,8 +9,8 @@ class MyNewModel2Config(LlamaConfig):
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma-7B.
e.g. [google/gemma-7b](https://huggingface.co/google/gemma-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
Vocabulary size of the Gemma model. Defines the number of different tokens that can be represented by the
diff --git a/examples/pytorch/text-classification/run_glue.py b/examples/pytorch/text-classification/run_glue.py
index afa09d74604..866044bdce2 100755
--- a/examples/pytorch/text-classification/run_glue.py
+++ b/examples/pytorch/text-classification/run_glue.py
@@ -51,7 +51,7 @@ from transformers import (
DataCollatorWithPadding,
EvalPrediction,
HfArgumentParser,
- PretrainedConfig,
+ PreTrainedConfig,
Trainer,
TrainingArguments,
default_data_collator,
@@ -429,7 +429,7 @@ def main():
# Some models have set the order of the labels to use, so let's make sure we do use it.
label_to_id = None
if (
- model.config.label2id != PretrainedConfig(num_labels=num_labels).label2id
+ model.config.label2id != PreTrainedConfig(num_labels=num_labels).label2id
and data_args.task_name is not None
and not is_regression
):
diff --git a/examples/pytorch/text-classification/run_glue_no_trainer.py b/examples/pytorch/text-classification/run_glue_no_trainer.py
index 05c51eb8ae3..072e473dac2 100644
--- a/examples/pytorch/text-classification/run_glue_no_trainer.py
+++ b/examples/pytorch/text-classification/run_glue_no_trainer.py
@@ -53,7 +53,7 @@ from transformers import (
AutoModelForSequenceClassification,
AutoTokenizer,
DataCollatorWithPadding,
- PretrainedConfig,
+ PreTrainedConfig,
SchedulerType,
default_data_collator,
get_scheduler,
@@ -367,7 +367,7 @@ def main():
# Some models have set the order of the labels to use, so let's make sure we do use it.
label_to_id = None
if (
- model.config.label2id != PretrainedConfig(num_labels=num_labels).label2id
+ model.config.label2id != PreTrainedConfig(num_labels=num_labels).label2id
and args.task_name is not None
and not is_regression
):
diff --git a/examples/pytorch/token-classification/run_ner.py b/examples/pytorch/token-classification/run_ner.py
index 7620d697c12..1482394321c 100755
--- a/examples/pytorch/token-classification/run_ner.py
+++ b/examples/pytorch/token-classification/run_ner.py
@@ -48,7 +48,7 @@ from transformers import (
AutoTokenizer,
DataCollatorForTokenClassification,
HfArgumentParser,
- PretrainedConfig,
+ PreTrainedConfig,
PreTrainedTokenizerFast,
Trainer,
TrainingArguments,
@@ -413,7 +413,7 @@ def main():
)
# Model has labels -> use them.
- if model.config.label2id != PretrainedConfig(num_labels=num_labels).label2id:
+ if model.config.label2id != PreTrainedConfig(num_labels=num_labels).label2id:
if sorted(model.config.label2id.keys()) == sorted(label_list):
# Reorganize `label_list` to match the ordering of the model.
if labels_are_int:
diff --git a/examples/pytorch/token-classification/run_ner_no_trainer.py b/examples/pytorch/token-classification/run_ner_no_trainer.py
index 0d31cf46ab8..138c99b6d0c 100755
--- a/examples/pytorch/token-classification/run_ner_no_trainer.py
+++ b/examples/pytorch/token-classification/run_ner_no_trainer.py
@@ -57,7 +57,7 @@ from transformers import (
AutoModelForTokenClassification,
AutoTokenizer,
DataCollatorForTokenClassification,
- PretrainedConfig,
+ PreTrainedConfig,
SchedulerType,
default_data_collator,
get_scheduler,
@@ -454,7 +454,7 @@ def main():
model.resize_token_embeddings(len(tokenizer))
# Model has labels -> use them.
- if model.config.label2id != PretrainedConfig(num_labels=num_labels).label2id:
+ if model.config.label2id != PreTrainedConfig(num_labels=num_labels).label2id:
if sorted(model.config.label2id.keys()) == sorted(label_list):
# Reorganize `label_list` to match the ordering of the model.
if labels_are_int:
diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py
index 40e1339bd11..553e7ee0e53 100755
--- a/src/transformers/__init__.py
+++ b/src/transformers/__init__.py
@@ -59,7 +59,7 @@ logger = logging.get_logger(__name__) # pylint: disable=invalid-name
_import_structure = {
"audio_utils": [],
"commands": [],
- "configuration_utils": ["PretrainedConfig"],
+ "configuration_utils": ["PreTrainedConfig", "PretrainedConfig"],
"convert_slow_tokenizers_checkpoints_to_fast": [],
"data": [
"DataProcessor",
@@ -491,6 +491,7 @@ if TYPE_CHECKING:
from .cache_utils import StaticCache as StaticCache
from .cache_utils import StaticLayer as StaticLayer
from .cache_utils import StaticSlidingWindowLayer as StaticSlidingWindowLayer
+ from .configuration_utils import PreTrainedConfig as PreTrainedConfig
from .configuration_utils import PretrainedConfig as PretrainedConfig
from .convert_slow_tokenizer import SLOW_TO_FAST_CONVERTERS as SLOW_TO_FAST_CONVERTERS
from .convert_slow_tokenizer import convert_slow_tokenizer as convert_slow_tokenizer
diff --git a/src/transformers/cache_utils.py b/src/transformers/cache_utils.py
index 16d116849f5..aea93f0e770 100644
--- a/src/transformers/cache_utils.py
+++ b/src/transformers/cache_utils.py
@@ -4,7 +4,7 @@ from typing import Any, Optional
import torch
-from .configuration_utils import PretrainedConfig
+from .configuration_utils import PreTrainedConfig
from .utils import (
is_hqq_available,
is_quanto_greater,
@@ -923,7 +923,7 @@ class DynamicCache(Cache):
`map(gather_map, zip(*caches))`, i.e. each item in the iterable contains the key and value states
for a layer gathered across replicas by torch.distributed (shape=[global batch size, num_heads, seq_len, head_dim]).
Note: it needs to be the 1st arg as well to work correctly
- config (`PretrainedConfig`, *optional*):
+ config (`PreTrainedConfig`, *optional*):
The config of the model for which this Cache will be used. If passed, it will be used to check for sliding
or hybrid layer structure, greatly reducing the memory requirement of the cached tensors to
`[batch_size, num_heads, min(seq_len, sliding_window), head_dim]`.
@@ -953,7 +953,7 @@ class DynamicCache(Cache):
def __init__(
self,
ddp_cache_data: Optional[Iterable[tuple[torch.Tensor, torch.Tensor]]] = None,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
offloading: bool = False,
offload_only_non_sliding: bool = False,
):
@@ -1036,7 +1036,7 @@ class StaticCache(Cache):
See `Cache` for details on common methods that are implemented by all cache classes.
Args:
- config (`PretrainedConfig`):
+ config (`PreTrainedConfig`):
The config of the model for which this Cache will be used. It will be used to check for sliding
or hybrid layer structure, and initialize each layer accordingly.
max_cache_len (`int`):
@@ -1070,7 +1070,7 @@ class StaticCache(Cache):
# Pass-in kwargs as well to avoid crashing for BC (it used more arguments before)
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
max_cache_len: int,
offloading: bool = False,
offload_only_non_sliding: bool = True,
@@ -1124,7 +1124,7 @@ class QuantizedCache(Cache):
Args:
backend (`str`):
The quantization backend to use. One of `("quanto", "hqq").
- config (`PretrainedConfig`):
+ config (`PreTrainedConfig`):
The config of the model for which this Cache will be used.
nbits (`int`, *optional*, defaults to 4):
The number of bits for quantization.
@@ -1141,7 +1141,7 @@ class QuantizedCache(Cache):
def __init__(
self,
backend: str,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
nbits: int = 4,
axis_key: int = 0,
axis_value: int = 0,
@@ -1400,7 +1400,7 @@ class OffloadedCache(DynamicCache):
class OffloadedStaticCache(StaticCache):
- def __init__(self, config: PretrainedConfig, max_cache_len: int, *args, **kwargs):
+ def __init__(self, config: PreTrainedConfig, max_cache_len: int, *args, **kwargs):
logger.warning_once(
"`OffloadedStaticCache` is deprecated and will be removed in version v4.59 "
"Use `StaticCache(..., offloading=True)` instead"
@@ -1409,7 +1409,7 @@ class OffloadedStaticCache(StaticCache):
class SlidingWindowCache(StaticCache):
- def __init__(self, config: PretrainedConfig, max_cache_len: int, *args, **kwargs):
+ def __init__(self, config: PreTrainedConfig, max_cache_len: int, *args, **kwargs):
logger.warning_once(
"`SlidingWindowCache` is deprecated and will be removed in version v4.59 "
"Use `StaticCache(...)` instead which will correctly infer the type of each layer."
@@ -1418,7 +1418,7 @@ class SlidingWindowCache(StaticCache):
class HybridCache(StaticCache):
- def __init__(self, config: PretrainedConfig, max_cache_len: int, *args, **kwargs):
+ def __init__(self, config: PreTrainedConfig, max_cache_len: int, *args, **kwargs):
logger.warning_once(
"`HybridCache` is deprecated and will be removed in version v4.59 "
"Use `StaticCache(...)` instead which will correctly infer the type of each layer."
@@ -1427,7 +1427,7 @@ class HybridCache(StaticCache):
class HybridChunkedCache(StaticCache):
- def __init__(self, config: PretrainedConfig, max_cache_len: int, *args, **kwargs):
+ def __init__(self, config: PreTrainedConfig, max_cache_len: int, *args, **kwargs):
logger.warning_once(
"`HybridChunkedCache` is deprecated and will be removed in version v4.59 "
"Use `StaticCache(...)` instead which will correctly infer the type of each layer."
@@ -1436,7 +1436,7 @@ class HybridChunkedCache(StaticCache):
class OffloadedHybridCache(StaticCache):
- def __init__(self, config: PretrainedConfig, max_cache_len: int, *args, **kwargs):
+ def __init__(self, config: PreTrainedConfig, max_cache_len: int, *args, **kwargs):
logger.warning_once(
"`OffloadedHybridCache` is deprecated and will be removed in version v4.59 "
"Use `StaticCache(..., offload=True)` instead which will correctly infer the type of each layer."
@@ -1447,7 +1447,7 @@ class OffloadedHybridCache(StaticCache):
class QuantoQuantizedCache(QuantizedCache):
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
nbits: int = 4,
axis_key: int = 0,
axis_value: int = 0,
@@ -1464,7 +1464,7 @@ class QuantoQuantizedCache(QuantizedCache):
class HQQQuantizedCache(QuantizedCache):
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
nbits: int = 4,
axis_key: int = 0,
axis_value: int = 0,
diff --git a/src/transformers/configuration_utils.py b/src/transformers/configuration_utils.py
index 6957246f304..de1493d8b4f 100755
--- a/src/transformers/configuration_utils.py
+++ b/src/transformers/configuration_utils.py
@@ -46,11 +46,11 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-# type hinting: specifying the type of config class that inherits from PretrainedConfig
-SpecificPretrainedConfigType = TypeVar("SpecificPretrainedConfigType", bound="PretrainedConfig")
+# type hinting: specifying the type of config class that inherits from PreTrainedConfig
+SpecificPreTrainedConfigType = TypeVar("SpecificPreTrainedConfigType", bound="PreTrainedConfig")
-class PretrainedConfig(PushToHubMixin):
+class PreTrainedConfig(PushToHubMixin):
# no-format
r"""
Base class for all configuration classes. Handles a few parameters common to all models' configurations as well as
@@ -70,7 +70,7 @@ class PretrainedConfig(PushToHubMixin):
- **has_no_defaults_at_init** (`bool`) -- Whether the config class can be initialized without providing input arguments.
Some configurations requires inputs to be defined at init and have no default values, usually these are composite configs,
(but not necessarily) such as [`~transformers.EncoderDecoderConfig`] or [`~RagConfig`]. They have to be initialized from
- two or more configs of type [`~transformers.PretrainedConfig`].
+ two or more configs of type [`~transformers.PreTrainedConfig`].
- **keys_to_ignore_at_inference** (`list[str]`) -- A list of keys to ignore by default when looking at dictionary
outputs of the model during inference.
- **attribute_map** (`dict[str, str]`) -- A dict that maps model specific attribute names to the standardized
@@ -186,7 +186,7 @@ class PretrainedConfig(PushToHubMixin):
model_type: str = ""
base_config_key: str = ""
- sub_configs: dict[str, type["PretrainedConfig"]] = {}
+ sub_configs: dict[str, type["PreTrainedConfig"]] = {}
has_no_defaults_at_init: bool = False
attribute_map: dict[str, str] = {}
base_model_tp_plan: Optional[dict[str, Any]] = None
@@ -432,7 +432,7 @@ class PretrainedConfig(PushToHubMixin):
def save_pretrained(self, save_directory: Union[str, os.PathLike], push_to_hub: bool = False, **kwargs):
"""
Save a configuration object to the directory `save_directory`, so that it can be re-loaded using the
- [`~PretrainedConfig.from_pretrained`] class method.
+ [`~PreTrainedConfig.from_pretrained`] class method.
Args:
save_directory (`str` or `os.PathLike`):
@@ -522,7 +522,7 @@ class PretrainedConfig(PushToHubMixin):
@classmethod
def from_pretrained(
- cls: type[SpecificPretrainedConfigType],
+ cls: type[SpecificPreTrainedConfigType],
pretrained_model_name_or_path: Union[str, os.PathLike],
cache_dir: Optional[Union[str, os.PathLike]] = None,
force_download: bool = False,
@@ -530,9 +530,9 @@ class PretrainedConfig(PushToHubMixin):
token: Optional[Union[str, bool]] = None,
revision: str = "main",
**kwargs,
- ) -> SpecificPretrainedConfigType:
+ ) -> SpecificPreTrainedConfigType:
r"""
- Instantiate a [`PretrainedConfig`] (or a derived class) from a pretrained model configuration.
+ Instantiate a [`PreTrainedConfig`] (or a derived class) from a pretrained model configuration.
Args:
pretrained_model_name_or_path (`str` or `os.PathLike`):
@@ -541,7 +541,7 @@ class PretrainedConfig(PushToHubMixin):
- a string, the *model id* of a pretrained model configuration hosted inside a model repo on
huggingface.co.
- a path to a *directory* containing a configuration file saved using the
- [`~PretrainedConfig.save_pretrained`] method, e.g., `./my_model_directory/`.
+ [`~PreTrainedConfig.save_pretrained`] method, e.g., `./my_model_directory/`.
- a path or url to a saved configuration JSON *file*, e.g., `./my_model_directory/configuration.json`.
cache_dir (`str` or `os.PathLike`, *optional*):
Path to a directory in which a downloaded pretrained model configuration should be cached if the
@@ -581,12 +581,12 @@ class PretrainedConfig(PushToHubMixin):
by the `return_unused_kwargs` keyword parameter.
Returns:
- [`PretrainedConfig`]: The configuration object instantiated from this pretrained model.
+ [`PreTrainedConfig`]: The configuration object instantiated from this pretrained model.
Examples:
```python
- # We can't instantiate directly the base class *PretrainedConfig* so let's show the examples on a
+ # We can't instantiate directly the base class *PreTrainedConfig* so let's show the examples on a
# derived class: BertConfig
config = BertConfig.from_pretrained(
"google-bert/bert-base-uncased"
@@ -636,7 +636,7 @@ class PretrainedConfig(PushToHubMixin):
) -> tuple[dict[str, Any], dict[str, Any]]:
"""
From a `pretrained_model_name_or_path`, resolve to a dictionary of parameters, to be used for instantiating a
- [`PretrainedConfig`] using `from_dict`.
+ [`PreTrainedConfig`] using `from_dict`.
Parameters:
pretrained_model_name_or_path (`str` or `os.PathLike`):
@@ -761,20 +761,20 @@ class PretrainedConfig(PushToHubMixin):
@classmethod
def from_dict(
- cls: type[SpecificPretrainedConfigType], config_dict: dict[str, Any], **kwargs
- ) -> SpecificPretrainedConfigType:
+ cls: type[SpecificPreTrainedConfigType], config_dict: dict[str, Any], **kwargs
+ ) -> SpecificPreTrainedConfigType:
"""
- Instantiates a [`PretrainedConfig`] from a Python dictionary of parameters.
+ Instantiates a [`PreTrainedConfig`] from a Python dictionary of parameters.
Args:
config_dict (`dict[str, Any]`):
Dictionary that will be used to instantiate the configuration object. Such a dictionary can be
- retrieved from a pretrained checkpoint by leveraging the [`~PretrainedConfig.get_config_dict`] method.
+ retrieved from a pretrained checkpoint by leveraging the [`~PreTrainedConfig.get_config_dict`] method.
kwargs (`dict[str, Any]`):
Additional parameters from which to initialize the configuration object.
Returns:
- [`PretrainedConfig`]: The configuration object instantiated from those parameters.
+ [`PreTrainedConfig`]: The configuration object instantiated from those parameters.
"""
return_unused_kwargs = kwargs.pop("return_unused_kwargs", False)
# Those arguments may be passed along for our internal telemetry.
@@ -815,7 +815,7 @@ class PretrainedConfig(PushToHubMixin):
current_attr = getattr(config, key)
# To authorize passing a custom subconfig as kwarg in models that have nested configs.
# We need to update only custom kwarg values instead and keep other attributes in subconfig.
- if isinstance(current_attr, PretrainedConfig) and isinstance(value, dict):
+ if isinstance(current_attr, PreTrainedConfig) and isinstance(value, dict):
current_attr_updated = current_attr.to_dict()
current_attr_updated.update(value)
value = current_attr.__class__(**current_attr_updated)
@@ -833,17 +833,17 @@ class PretrainedConfig(PushToHubMixin):
@classmethod
def from_json_file(
- cls: type[SpecificPretrainedConfigType], json_file: Union[str, os.PathLike]
- ) -> SpecificPretrainedConfigType:
+ cls: type[SpecificPreTrainedConfigType], json_file: Union[str, os.PathLike]
+ ) -> SpecificPreTrainedConfigType:
"""
- Instantiates a [`PretrainedConfig`] from the path to a JSON file of parameters.
+ Instantiates a [`PreTrainedConfig`] from the path to a JSON file of parameters.
Args:
json_file (`str` or `os.PathLike`):
Path to the JSON file containing the parameters.
Returns:
- [`PretrainedConfig`]: The configuration object instantiated from that JSON file.
+ [`PreTrainedConfig`]: The configuration object instantiated from that JSON file.
"""
config_dict = cls._dict_from_json_file(json_file)
@@ -856,7 +856,7 @@ class PretrainedConfig(PushToHubMixin):
return json.loads(text)
def __eq__(self, other):
- return isinstance(other, PretrainedConfig) and (self.__dict__ == other.__dict__)
+ return isinstance(other, PreTrainedConfig) and (self.__dict__ == other.__dict__)
def __repr__(self):
return f"{self.__class__.__name__} {self.to_json_string()}"
@@ -876,7 +876,7 @@ class PretrainedConfig(PushToHubMixin):
config_dict = self.to_dict()
# Get the default config dict (from a fresh PreTrainedConfig instance)
- default_config_dict = PretrainedConfig().to_dict()
+ default_config_dict = PreTrainedConfig().to_dict()
# get class specific config dict
class_config_dict = self.__class__().to_dict() if not self.has_no_defaults_at_init else {}
@@ -887,7 +887,7 @@ class PretrainedConfig(PushToHubMixin):
# except always keep the 'config' attribute.
for key, value in config_dict.items():
if (
- isinstance(getattr(self, key, None), PretrainedConfig)
+ isinstance(getattr(self, key, None), PreTrainedConfig)
and key in class_config_dict
and isinstance(class_config_dict[key], dict)
or key in self.sub_configs
@@ -940,7 +940,7 @@ class PretrainedConfig(PushToHubMixin):
for key, value in output.items():
# Deal with nested configs like CLIP
- if isinstance(value, PretrainedConfig):
+ if isinstance(value, PreTrainedConfig):
value = value.to_dict()
del value["transformers_version"]
@@ -964,7 +964,7 @@ class PretrainedConfig(PushToHubMixin):
Args:
use_diff (`bool`, *optional*, defaults to `True`):
- If set to `True`, only the difference between the config instance and the default `PretrainedConfig()`
+ If set to `True`, only the difference between the config instance and the default `PreTrainedConfig()`
is serialized to JSON string.
Returns:
@@ -984,7 +984,7 @@ class PretrainedConfig(PushToHubMixin):
json_file_path (`str` or `os.PathLike`):
Path to the JSON file in which this configuration instance's parameters will be saved.
use_diff (`bool`, *optional*, defaults to `True`):
- If set to `True`, only the difference between the config instance and the default `PretrainedConfig()`
+ If set to `True`, only the difference between the config instance and the default `PreTrainedConfig()`
is serialized to JSON file.
"""
with open(json_file_path, "w", encoding="utf-8") as writer:
@@ -1137,7 +1137,7 @@ class PretrainedConfig(PushToHubMixin):
def _get_non_default_generation_parameters(self) -> dict[str, Any]:
"""
- Gets the non-default generation parameters on the PretrainedConfig instance
+ Gets the non-default generation parameters on the PreTrainedConfig instance
"""
non_default_generation_parameters = {}
decoder_attribute_name = None
@@ -1179,7 +1179,7 @@ class PretrainedConfig(PushToHubMixin):
return non_default_generation_parameters
- def get_text_config(self, decoder=None, encoder=None) -> "PretrainedConfig":
+ def get_text_config(self, decoder=None, encoder=None) -> "PreTrainedConfig":
"""
Returns the text config related to the text input (encoder) or text output (decoder) of the model. The
`decoder` and `encoder` input arguments can be used to specify which end of the model we are interested in,
@@ -1335,7 +1335,7 @@ def recursive_diff_dict(dict_a, dict_b, config_obj=None):
default = config_obj.__class__().to_dict() if config_obj is not None else {}
for key, value in dict_a.items():
obj_value = getattr(config_obj, str(key), None)
- if isinstance(obj_value, PretrainedConfig) and key in dict_b and isinstance(dict_b[key], dict):
+ if isinstance(obj_value, PreTrainedConfig) and key in dict_b and isinstance(dict_b[key], dict):
diff_value = recursive_diff_dict(value, dict_b[key], config_obj=obj_value)
diff[key] = diff_value
elif key not in dict_b or (value != default[key]):
@@ -1343,13 +1343,17 @@ def recursive_diff_dict(dict_a, dict_b, config_obj=None):
return diff
-PretrainedConfig.push_to_hub = copy_func(PretrainedConfig.push_to_hub)
-if PretrainedConfig.push_to_hub.__doc__ is not None:
- PretrainedConfig.push_to_hub.__doc__ = PretrainedConfig.push_to_hub.__doc__.format(
+PreTrainedConfig.push_to_hub = copy_func(PreTrainedConfig.push_to_hub)
+if PreTrainedConfig.push_to_hub.__doc__ is not None:
+ PreTrainedConfig.push_to_hub.__doc__ = PreTrainedConfig.push_to_hub.__doc__.format(
object="config", object_class="AutoConfig", object_files="configuration file"
)
+# The alias is only here for BC - we did not have the correct CamelCasing before
+PretrainedConfig = PreTrainedConfig
+
+
ALLOWED_LAYER_TYPES = (
"full_attention",
"sliding_attention",
diff --git a/src/transformers/dynamic_module_utils.py b/src/transformers/dynamic_module_utils.py
index 677aa41712d..2db48c1638c 100644
--- a/src/transformers/dynamic_module_utils.py
+++ b/src/transformers/dynamic_module_utils.py
@@ -613,7 +613,7 @@ def custom_object_save(obj: Any, folder: Union[str, os.PathLike], config: Option
Args:
obj (`Any`): The object for which to save the module files.
folder (`str` or `os.PathLike`): The folder where to save.
- config (`PretrainedConfig` or dictionary, `optional`):
+ config (`PreTrainedConfig` or dictionary, `optional`):
A config in which to register the auto_map corresponding to this custom object.
Returns:
diff --git a/src/transformers/generation/configuration_utils.py b/src/transformers/generation/configuration_utils.py
index be7bee4d3ac..4c5530ebe75 100644
--- a/src/transformers/generation/configuration_utils.py
+++ b/src/transformers/generation/configuration_utils.py
@@ -23,7 +23,7 @@ from dataclasses import dataclass, is_dataclass
from typing import TYPE_CHECKING, Any, Callable, Optional, Union
from .. import __version__
-from ..configuration_utils import PretrainedConfig
+from ..configuration_utils import PreTrainedConfig
from ..utils import (
GENERATION_CONFIG_NAME,
ExplicitEnum,
@@ -1101,13 +1101,13 @@ class GenerationConfig(PushToHubMixin):
writer.write(self.to_json_string(use_diff=use_diff))
@classmethod
- def from_model_config(cls, model_config: PretrainedConfig) -> "GenerationConfig":
+ def from_model_config(cls, model_config: PreTrainedConfig) -> "GenerationConfig":
"""
- Instantiates a [`GenerationConfig`] from a [`PretrainedConfig`]. This function is useful to convert legacy
- [`PretrainedConfig`] objects, which may contain generation parameters, into a stand-alone [`GenerationConfig`].
+ Instantiates a [`GenerationConfig`] from a [`PreTrainedConfig`]. This function is useful to convert legacy
+ [`PreTrainedConfig`] objects, which may contain generation parameters, into a stand-alone [`GenerationConfig`].
Args:
- model_config (`PretrainedConfig`):
+ model_config (`PreTrainedConfig`):
The model config that will be used to instantiate the generation config.
Returns:
diff --git a/src/transformers/generation/continuous_batching/cache.py b/src/transformers/generation/continuous_batching/cache.py
index 8d6e057be84..f46c6fa811f 100644
--- a/src/transformers/generation/continuous_batching/cache.py
+++ b/src/transformers/generation/continuous_batching/cache.py
@@ -18,14 +18,14 @@ from typing import Optional, Union
import torch
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation.configuration_utils import GenerationConfig
from ...utils.metrics import attach_tracer, traced
from .cache_manager import CacheAllocator, FullAttentionCacheAllocator, SlidingAttentionCacheAllocator
from .requests import get_device_and_memory_breakdown, logger
-def group_layers_by_attn_type(config: PretrainedConfig) -> tuple[list[list[int]], list[str]]:
+def group_layers_by_attn_type(config: PreTrainedConfig) -> tuple[list[list[int]], list[str]]:
"""
Group layers depending on the attention mix, according to VLLM's hybrid allocator rules:
- Layers in each group need to have the same type of attention
@@ -119,7 +119,7 @@ class PagedAttentionCache:
# TODO: this init is quite long, maybe a refactor is in order
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
generation_config: GenerationConfig,
device: torch.device,
dtype: torch.dtype = torch.float16,
diff --git a/src/transformers/generation/continuous_batching/continuous_api.py b/src/transformers/generation/continuous_batching/continuous_api.py
index 0d1801fa163..8fad631f391 100644
--- a/src/transformers/generation/continuous_batching/continuous_api.py
+++ b/src/transformers/generation/continuous_batching/continuous_api.py
@@ -25,7 +25,7 @@ import torch
from torch import nn
from tqdm import tqdm
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation.configuration_utils import GenerationConfig
from ...utils.logging import logging
from ...utils.metrics import ContinuousBatchProcessorMetrics, attach_tracer, traced
@@ -140,7 +140,7 @@ class ContinuousBatchProcessor:
def __init__(
self,
cache: PagedAttentionCache,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
generation_config: GenerationConfig,
input_queue: queue.Queue,
output_queue: queue.Queue,
diff --git a/src/transformers/generation/watermarking.py b/src/transformers/generation/watermarking.py
index df8a6ef7d48..ed8813b4b33 100644
--- a/src/transformers/generation/watermarking.py
+++ b/src/transformers/generation/watermarking.py
@@ -25,7 +25,7 @@ from torch.nn import BCELoss
from ..modeling_utils import PreTrainedModel
from ..utils import ModelOutput, logging
-from .configuration_utils import PretrainedConfig, WatermarkingConfig
+from .configuration_utils import PreTrainedConfig, WatermarkingConfig
from .logits_process import SynthIDTextWatermarkLogitsProcessor, WatermarkLogitsProcessor
@@ -75,7 +75,7 @@ class WatermarkDetector:
See [the paper](https://huggingface.co/papers/2306.04634) for more information.
Args:
- model_config (`PretrainedConfig`):
+ model_config (`PreTrainedConfig`):
The model config that will be used to get model specific arguments used when generating.
device (`str`):
The device which was used during watermarked text generation.
@@ -119,7 +119,7 @@ class WatermarkDetector:
def __init__(
self,
- model_config: PretrainedConfig,
+ model_config: PreTrainedConfig,
device: str,
watermarking_config: Union[WatermarkingConfig, dict],
ignore_repeated_ngrams: bool = False,
@@ -237,13 +237,13 @@ class WatermarkDetector:
return prediction
-class BayesianDetectorConfig(PretrainedConfig):
+class BayesianDetectorConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`BayesianDetectorModel`]. It is used to
instantiate a Bayesian Detector model according to the specified arguments.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
watermarking_depth (`int`, *optional*):
diff --git a/src/transformers/masking_utils.py b/src/transformers/masking_utils.py
index 0abf0043b4c..b47af98b8e3 100644
--- a/src/transformers/masking_utils.py
+++ b/src/transformers/masking_utils.py
@@ -19,7 +19,7 @@ import torch
import torch.nn.functional as F
from .cache_utils import Cache
-from .configuration_utils import PretrainedConfig
+from .configuration_utils import PreTrainedConfig
from .utils import is_torch_xpu_available, logging
from .utils.generic import GeneralInterface
from .utils.import_utils import is_torch_flex_attn_available, is_torch_greater_or_equal, is_torchdynamo_compiling
@@ -662,7 +662,7 @@ def find_packed_sequence_indices(position_ids: torch.Tensor) -> torch.Tensor:
def _preprocess_mask_arguments(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[Union[torch.Tensor, BlockMask]],
cache_position: torch.Tensor,
@@ -675,7 +675,7 @@ def _preprocess_mask_arguments(
key-value length and offsets, and if we should early exit or not.
Args:
- config (`PretrainedConfig`):
+ config (`PreTrainedConfig`):
The model config.
input_embeds (`torch.Tensor`):
The input embeddings of shape (batch_size, query_length, hidden_dim). This is used only to infer the
@@ -743,7 +743,7 @@ def _preprocess_mask_arguments(
def create_causal_mask(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
@@ -758,7 +758,7 @@ def create_causal_mask(
to what is needed in the `modeling_xxx.py` files).
Args:
- config (`PretrainedConfig`):
+ config (`PreTrainedConfig`):
The model config.
input_embeds (`torch.Tensor`):
The input embeddings of shape (batch_size, query_length, hidden_dim). This is used only to infer the
@@ -837,7 +837,7 @@ def create_causal_mask(
def create_sliding_window_causal_mask(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
@@ -853,7 +853,7 @@ def create_sliding_window_causal_mask(
`modeling_xxx.py` files).
Args:
- config (`PretrainedConfig`):
+ config (`PreTrainedConfig`):
The model config.
input_embeds (`torch.Tensor`):
The input embeddings of shape (batch_size, query_length, hidden_dim). This is used only to infer the
@@ -934,7 +934,7 @@ def create_sliding_window_causal_mask(
def create_chunked_causal_mask(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
@@ -950,7 +950,7 @@ def create_chunked_causal_mask(
`modeling_xxx.py` files).
Args:
- config (`PretrainedConfig`):
+ config (`PreTrainedConfig`):
The model config.
input_embeds (`torch.Tensor`):
The input embeddings of shape (batch_size, query_length, hidden_dim). This is used only to infer the
@@ -1063,7 +1063,7 @@ LAYER_PATTERN_TO_MASK_FUNCTION_MAPPING = {
def create_masks_for_generate(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
@@ -1078,7 +1078,7 @@ def create_masks_for_generate(
in order to easily create the masks in advance, when we compile the forwards with Static caches.
Args:
- config (`PretrainedConfig`):
+ config (`PreTrainedConfig`):
The model config.
input_embeds (`torch.Tensor`):
The input embeddings of shape (batch_size, query_length, hidden_dim). This is used only to infer the
diff --git a/src/transformers/modeling_rope_utils.py b/src/transformers/modeling_rope_utils.py
index c0070df6ee1..4e24fffe5fd 100644
--- a/src/transformers/modeling_rope_utils.py
+++ b/src/transformers/modeling_rope_utils.py
@@ -16,7 +16,7 @@ import math
from functools import wraps
from typing import Optional
-from .configuration_utils import PretrainedConfig
+from .configuration_utils import PreTrainedConfig
from .utils import is_torch_available, logging
@@ -90,14 +90,14 @@ def dynamic_rope_update(rope_forward):
def _compute_default_rope_parameters(
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
device: Optional["torch.device"] = None,
seq_len: Optional[int] = None,
) -> tuple["torch.Tensor", float]:
"""
Computes the inverse frequencies according to the original RoPE implementation
Args:
- config ([`~transformers.PretrainedConfig`]):
+ config ([`~transformers.PreTrainedConfig`]):
The model configuration. This function assumes that the config will provide at least the following
properties:
@@ -133,14 +133,14 @@ def _compute_default_rope_parameters(
def _compute_linear_scaling_rope_parameters(
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
device: Optional["torch.device"] = None,
seq_len: Optional[int] = None,
) -> tuple["torch.Tensor", float]:
"""
Computes the inverse frequencies with linear scaling. Credits to the Reddit user /u/kaiokendev
Args:
- config ([`~transformers.PretrainedConfig`]):
+ config ([`~transformers.PreTrainedConfig`]):
The model configuration. This function assumes that the config will provide at least the following
properties:
@@ -176,7 +176,7 @@ def _compute_linear_scaling_rope_parameters(
def _compute_dynamic_ntk_parameters(
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
device: Optional["torch.device"] = None,
seq_len: Optional[int] = None,
) -> tuple["torch.Tensor", float]:
@@ -184,7 +184,7 @@ def _compute_dynamic_ntk_parameters(
Computes the inverse frequencies with NTK scaling. Credits to the Reddit users /u/bloc97 and /u/emozilla
Args:
- config ([`~transformers.PretrainedConfig`]):
+ config ([`~transformers.PreTrainedConfig`]):
The model configuration. This function assumes that the config will provide at least the following
properties:
@@ -244,14 +244,14 @@ def _compute_dynamic_ntk_parameters(
def _compute_yarn_parameters(
- config: PretrainedConfig, device: "torch.device", seq_len: Optional[int] = None
+ config: PreTrainedConfig, device: "torch.device", seq_len: Optional[int] = None
) -> tuple["torch.Tensor", float]:
"""
Computes the inverse frequencies with NTK scaling. Please refer to the
[original paper](https://huggingface.co/papers/2309.00071)
Args:
- config ([`~transformers.PretrainedConfig`]):
+ config ([`~transformers.PreTrainedConfig`]):
The model configuration. This function assumes that the config will provide at least the following
properties:
@@ -369,14 +369,14 @@ def _compute_yarn_parameters(
def _compute_longrope_parameters(
- config: PretrainedConfig, device: "torch.device", seq_len: Optional[int] = None
+ config: PreTrainedConfig, device: "torch.device", seq_len: Optional[int] = None
) -> tuple["torch.Tensor", float]:
"""
Computes the inverse frequencies with LongRoPE scaling. Please refer to the
[original implementation](https://github.com/microsoft/LongRoPE)
Args:
- config ([`~transformers.PretrainedConfig`]):
+ config ([`~transformers.PreTrainedConfig`]):
The model configuration. This function assumes that the config will provide at least the following
properties:
@@ -451,13 +451,13 @@ def _compute_longrope_parameters(
def _compute_llama3_parameters(
- config: PretrainedConfig, device: "torch.device", seq_len: Optional[int] = None
+ config: PreTrainedConfig, device: "torch.device", seq_len: Optional[int] = None
) -> tuple["torch.Tensor", float]:
"""
Computes the inverse frequencies for llama 3.1.
Args:
- config ([`~transformers.PretrainedConfig`]):
+ config ([`~transformers.PreTrainedConfig`]):
The model configuration. This function assumes that the config will provide at least the following
properties:
@@ -557,7 +557,7 @@ def _check_received_keys(
logger.warning(f"Unrecognized keys in `rope_scaling` for 'rope_type'='{rope_type}': {unused_keys}")
-def _validate_default_rope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None):
+def _validate_default_rope_parameters(config: PreTrainedConfig, ignore_keys: Optional[set] = None):
rope_scaling = config.rope_scaling
rope_type = rope_scaling.get("rope_type", rope_scaling.get("type", None)) # BC: "rope_type" was originally "type"
required_keys = {"rope_type"}
@@ -565,7 +565,7 @@ def _validate_default_rope_parameters(config: PretrainedConfig, ignore_keys: Opt
_check_received_keys(rope_type, received_keys, required_keys, ignore_keys=ignore_keys)
-def _validate_linear_scaling_rope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None):
+def _validate_linear_scaling_rope_parameters(config: PreTrainedConfig, ignore_keys: Optional[set] = None):
rope_scaling = config.rope_scaling
rope_type = rope_scaling.get("rope_type", rope_scaling.get("type", None)) # BC: "rope_type" was originally "type"
required_keys = {"rope_type", "factor"}
@@ -577,7 +577,7 @@ def _validate_linear_scaling_rope_parameters(config: PretrainedConfig, ignore_ke
logger.warning(f"`rope_scaling`'s factor field must be a float >= 1, got {factor}")
-def _validate_dynamic_scaling_rope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None):
+def _validate_dynamic_scaling_rope_parameters(config: PreTrainedConfig, ignore_keys: Optional[set] = None):
rope_scaling = config.rope_scaling
rope_type = rope_scaling.get("rope_type", rope_scaling.get("type", None)) # BC: "rope_type" was originally "type"
required_keys = {"rope_type", "factor"}
@@ -591,7 +591,7 @@ def _validate_dynamic_scaling_rope_parameters(config: PretrainedConfig, ignore_k
logger.warning(f"`rope_scaling`'s factor field must be a float >= 1, got {factor}")
-def _validate_yarn_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None):
+def _validate_yarn_parameters(config: PreTrainedConfig, ignore_keys: Optional[set] = None):
rope_scaling = config.rope_scaling
rope_type = rope_scaling.get("rope_type", rope_scaling.get("type", None)) # BC: "rope_type" was originally "type"
required_keys = {"rope_type", "factor"}
@@ -657,7 +657,7 @@ def _validate_yarn_parameters(config: PretrainedConfig, ignore_keys: Optional[se
)
-def _validate_longrope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None):
+def _validate_longrope_parameters(config: PreTrainedConfig, ignore_keys: Optional[set] = None):
rope_scaling = config.rope_scaling
rope_type = rope_scaling.get("rope_type", rope_scaling.get("type", None)) # BC: "rope_type" was originally "type"
required_keys = {"rope_type", "short_factor", "long_factor"}
@@ -707,7 +707,7 @@ def _validate_longrope_parameters(config: PretrainedConfig, ignore_keys: Optiona
)
-def _validate_llama3_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None):
+def _validate_llama3_parameters(config: PreTrainedConfig, ignore_keys: Optional[set] = None):
rope_scaling = config.rope_scaling
rope_type = rope_scaling.get("rope_type", rope_scaling.get("type", None)) # BC: "rope_type" was originally "type"
required_keys = {"rope_type", "factor", "original_max_position_embeddings", "low_freq_factor", "high_freq_factor"}
@@ -754,11 +754,11 @@ ROPE_VALIDATION_FUNCTIONS = {
}
-def rope_config_validation(config: PretrainedConfig, ignore_keys: Optional[set] = None):
+def rope_config_validation(config: PreTrainedConfig, ignore_keys: Optional[set] = None):
"""
- Validate the RoPE config arguments, given a `PretrainedConfig` object
+ Validate the RoPE config arguments, given a `PreTrainedConfig` object
"""
- rope_scaling = getattr(config, "rope_scaling", None) # not a default parameter in `PretrainedConfig`
+ rope_scaling = getattr(config, "rope_scaling", None) # not a default parameter in `PreTrainedConfig`
if rope_scaling is None:
return
diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py
index 3f8c14aef5e..4ce8cd01de4 100644
--- a/src/transformers/modeling_utils.py
+++ b/src/transformers/modeling_utils.py
@@ -44,7 +44,7 @@ from torch import Tensor, nn
from torch.distributions import constraints
from torch.utils.checkpoint import checkpoint
-from .configuration_utils import PretrainedConfig
+from .configuration_utils import PreTrainedConfig
from .distributed import DistributedConfig
from .dynamic_module_utils import custom_object_save
from .generation import CompileConfig, GenerationConfig
@@ -1149,11 +1149,11 @@ def _get_dtype(
cls,
dtype: Optional[Union[str, torch.dtype, dict]],
checkpoint_files: Optional[list[str]],
- config: PretrainedConfig,
+ config: PreTrainedConfig,
sharded_metadata: Optional[dict],
state_dict: Optional[dict],
weights_only: bool,
-) -> tuple[PretrainedConfig, Optional[torch.dtype], Optional[torch.dtype]]:
+) -> tuple[PreTrainedConfig, Optional[torch.dtype], Optional[torch.dtype]]:
"""Find the correct `dtype` to use based on provided arguments. Also update the `config` based on the
inferred dtype. We do the following:
1. If dtype is not None, we use that dtype
@@ -1780,7 +1780,7 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
Class attributes (overridden by derived classes):
- - **config_class** ([`PretrainedConfig`]) -- A subclass of [`PretrainedConfig`] to use as configuration class
+ - **config_class** ([`PreTrainedConfig`]) -- A subclass of [`PreTrainedConfig`] to use as configuration class
for this model architecture.
- **base_model_prefix** (`str`) -- A string indicating the attribute associated to the base model in derived
classes of the same architecture adding modules on top of the base model.
@@ -1935,12 +1935,12 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
elif full_annotation is not None:
cls.config_class = full_annotation
- def __init__(self, config: PretrainedConfig, *inputs, **kwargs):
+ def __init__(self, config: PreTrainedConfig, *inputs, **kwargs):
super().__init__()
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
raise TypeError(
f"Parameter config in `{self.__class__.__name__}(config)` should be an instance of class "
- "`PretrainedConfig`. To create a model from a pretrained model use "
+ "`PreTrainedConfig`. To create a model from a pretrained model use "
f"`model = {self.__class__.__name__}.from_pretrained(PRETRAINED_MODEL_NAME)`"
)
self.config = config
@@ -4250,7 +4250,7 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
cls: type[SpecificPreTrainedModelType],
pretrained_model_name_or_path: Optional[Union[str, os.PathLike]],
*model_args,
- config: Optional[Union[PretrainedConfig, str, os.PathLike]] = None,
+ config: Optional[Union[PreTrainedConfig, str, os.PathLike]] = None,
cache_dir: Optional[Union[str, os.PathLike]] = None,
ignore_mismatched_sizes: bool = False,
force_download: bool = False,
@@ -4285,11 +4285,11 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
arguments `config` and `state_dict`).
model_args (sequence of positional arguments, *optional*):
All remaining positional arguments will be passed to the underlying model's `__init__` method.
- config (`Union[PretrainedConfig, str, os.PathLike]`, *optional*):
+ config (`Union[PreTrainedConfig, str, os.PathLike]`, *optional*):
Can be either:
- - an instance of a class derived from [`PretrainedConfig`],
- - a string or path valid as input to [`~PretrainedConfig.from_pretrained`].
+ - an instance of a class derived from [`PreTrainedConfig`],
+ - a string or path valid as input to [`~PreTrainedConfig.from_pretrained`].
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
@@ -4437,7 +4437,7 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
underlying model's `__init__` method (we assume all relevant updates to the configuration have
already been done)
- If a configuration is not provided, `kwargs` will be first passed to the configuration class
- initialization function ([`~PretrainedConfig.from_pretrained`]). Each key of `kwargs` that
+ initialization function ([`~PreTrainedConfig.from_pretrained`]). Each key of `kwargs` that
corresponds to a configuration attribute will be used to override said attribute with the
supplied `kwargs` value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model's `__init__` function.
@@ -4574,7 +4574,7 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
raise ValueError("accelerate is required when loading a GGUF file `pip install accelerate`.")
if commit_hash is None:
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
# We make a call to the config file first (which may be absent) to get the commit hash as soon as possible
resolved_config_file = cached_file(
pretrained_model_name_or_path,
@@ -4681,7 +4681,7 @@ class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToH
local_files_only = True
# Load config if we don't provide a configuration
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
config_path = config if config is not None else pretrained_model_name_or_path
config, model_kwargs = cls.config_class.from_pretrained(
config_path,
diff --git a/src/transformers/models/aimv2/configuration_aimv2.py b/src/transformers/models/aimv2/configuration_aimv2.py
index adab18c7447..ee2e1f2052b 100644
--- a/src/transformers/models/aimv2/configuration_aimv2.py
+++ b/src/transformers/models/aimv2/configuration_aimv2.py
@@ -21,22 +21,22 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Aimv2VisionConfig(PretrainedConfig):
+class Aimv2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Aimv2VisionModel`]. It is used to instantiate a
AIMv2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the AIMv2
[apple/aimv2-large-patch14-224](https://huggingface.co/apple/aimv2-large-patch14-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
@@ -127,15 +127,15 @@ class Aimv2VisionConfig(PretrainedConfig):
self.is_native = is_native
-class Aimv2TextConfig(PretrainedConfig):
+class Aimv2TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Aimv2TextModel`]. It is used to instantiate a
AIMv2 text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the text encoder of the AIMv2
[apple/aimv2-large-patch14-224-lit](https://huggingface.co/apple/aimv2-large-patch14-224-lit) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 49408):
@@ -212,15 +212,15 @@ class Aimv2TextConfig(PretrainedConfig):
self.rms_norm_eps = rms_norm_eps
-class Aimv2Config(PretrainedConfig):
+class Aimv2Config(PreTrainedConfig):
r"""
[`Aimv2Config`] is the configuration class to store the configuration of a [`Aimv2Model`]. It is used to
instantiate a AIMv2 model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the AIMv2
[apple/aimv2-large-patch14-224-lit](https://huggingface.co/apple/aimv2-large-patch14-224-lit) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/aimv2/modular_aimv2.py b/src/transformers/models/aimv2/modular_aimv2.py
index 0bf1cdd346a..e60a3d1db27 100644
--- a/src/transformers/models/aimv2/modular_aimv2.py
+++ b/src/transformers/models/aimv2/modular_aimv2.py
@@ -47,8 +47,8 @@ class Aimv2VisionConfig(SiglipVisionConfig):
configuration with the defaults will yield a similar configuration to that of the vision encoder of the AIMv2
[apple/aimv2-large-patch14-224](https://huggingface.co/apple/aimv2-large-patch14-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
@@ -147,8 +147,8 @@ class Aimv2TextConfig(SiglipTextConfig):
configuration with the defaults will yield a similar configuration to that of the text encoder of the AIMv2
[apple/aimv2-large-patch14-224-lit](https://huggingface.co/apple/aimv2-large-patch14-224-lit) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 49408):
@@ -238,8 +238,8 @@ class Aimv2Config(SiglipConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the AIMv2
[apple/aimv2-large-patch14-224-lit](https://huggingface.co/apple/aimv2-large-patch14-224-lit) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/albert/configuration_albert.py b/src/transformers/models/albert/configuration_albert.py
index b60c19d504f..2ca9c141849 100644
--- a/src/transformers/models/albert/configuration_albert.py
+++ b/src/transformers/models/albert/configuration_albert.py
@@ -18,19 +18,19 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
-class AlbertConfig(PretrainedConfig):
+class AlbertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`AlbertModel`] or a [`TFAlbertModel`]. It is used
to instantiate an ALBERT model according to the specified arguments, defining the model architecture. Instantiating
a configuration with the defaults will yield a similar configuration to that of the ALBERT
[albert/albert-xxlarge-v2](https://huggingface.co/albert/albert-xxlarge-v2) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30000):
diff --git a/src/transformers/models/align/configuration_align.py b/src/transformers/models/align/configuration_align.py
index b924d85a6ca..f1c7ff16ad0 100644
--- a/src/transformers/models/align/configuration_align.py
+++ b/src/transformers/models/align/configuration_align.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""ALIGN model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class AlignTextConfig(PretrainedConfig):
+class AlignTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`AlignTextModel`]. It is used to instantiate a
ALIGN text encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -29,8 +29,8 @@ class AlignTextConfig(PretrainedConfig):
[kakaobrain/align-base](https://huggingface.co/kakaobrain/align-base) architecture. The default values here are
copied from BERT.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
@@ -128,7 +128,7 @@ class AlignTextConfig(PretrainedConfig):
self.pad_token_id = pad_token_id
-class AlignVisionConfig(PretrainedConfig):
+class AlignVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`AlignVisionModel`]. It is used to instantiate a
ALIGN vision encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -136,8 +136,8 @@ class AlignVisionConfig(PretrainedConfig):
[kakaobrain/align-base](https://huggingface.co/kakaobrain/align-base) architecture. The default values are copied
from EfficientNet (efficientnet-b7)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
@@ -250,15 +250,15 @@ class AlignVisionConfig(PretrainedConfig):
self.num_hidden_layers = sum(num_block_repeats) * 4
-class AlignConfig(PretrainedConfig):
+class AlignConfig(PreTrainedConfig):
r"""
[`AlignConfig`] is the configuration class to store the configuration of a [`AlignModel`]. It is used to
instantiate a ALIGN model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the ALIGN
[kakaobrain/align-base](https://huggingface.co/kakaobrain/align-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/altclip/configuration_altclip.py b/src/transformers/models/altclip/configuration_altclip.py
index 474fc48081b..af1ae041edd 100755
--- a/src/transformers/models/altclip/configuration_altclip.py
+++ b/src/transformers/models/altclip/configuration_altclip.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""AltCLIP model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class AltCLIPTextConfig(PretrainedConfig):
+class AltCLIPTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`AltCLIPTextModel`]. It is used to instantiate a
AltCLIP text model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the AltCLIP
[BAAI/AltCLIP](https://huggingface.co/BAAI/AltCLIP) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -139,15 +139,15 @@ class AltCLIPTextConfig(PretrainedConfig):
self.project_dim = project_dim
-class AltCLIPVisionConfig(PretrainedConfig):
+class AltCLIPVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`AltCLIPModel`]. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the AltCLIP
[BAAI/AltCLIP](https://huggingface.co/BAAI/AltCLIP) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -232,15 +232,15 @@ class AltCLIPVisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class AltCLIPConfig(PretrainedConfig):
+class AltCLIPConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`AltCLIPModel`]. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the AltCLIP
[BAAI/AltCLIP](https://huggingface.co/BAAI/AltCLIP) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/apertus/configuration_apertus.py b/src/transformers/models/apertus/configuration_apertus.py
index 180ad756dc8..c8380ee29bc 100644
--- a/src/transformers/models/apertus/configuration_apertus.py
+++ b/src/transformers/models/apertus/configuration_apertus.py
@@ -20,19 +20,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class ApertusConfig(PretrainedConfig):
+class ApertusConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ApertusModel`]. It is used to instantiate a Apertus
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Apertus-8B.
e.g. [swiss-ai/Apertus-8B](https://huggingface.co/swiss-ai/Apertus-8B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/apertus/modular_apertus.py b/src/transformers/models/apertus/modular_apertus.py
index e8d1e3f815c..d13dbb69f0f 100644
--- a/src/transformers/models/apertus/modular_apertus.py
+++ b/src/transformers/models/apertus/modular_apertus.py
@@ -48,8 +48,8 @@ class ApertusConfig(LlamaConfig):
defaults will yield a similar configuration to that of the Apertus-8B.
e.g. [swiss-ai/Apertus-8B](https://huggingface.co/swiss-ai/Apertus-8B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/arcee/configuration_arcee.py b/src/transformers/models/arcee/configuration_arcee.py
index 5793697311b..9f61687ea8f 100644
--- a/src/transformers/models/arcee/configuration_arcee.py
+++ b/src/transformers/models/arcee/configuration_arcee.py
@@ -19,11 +19,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class ArceeConfig(PretrainedConfig):
+class ArceeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ArceeModel`]. It is used to instantiate an Arcee
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -33,8 +33,8 @@ class ArceeConfig(PretrainedConfig):
[arcee-ai/AFM-4.5B](https://huggingface.co/arcee-ai/AFM-4.5B)
and were used to build the examples below.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
diff --git a/src/transformers/models/arcee/modular_arcee.py b/src/transformers/models/arcee/modular_arcee.py
index 3a35ee8a137..3fb38fcb4ce 100644
--- a/src/transformers/models/arcee/modular_arcee.py
+++ b/src/transformers/models/arcee/modular_arcee.py
@@ -39,8 +39,8 @@ class ArceeConfig(LlamaConfig):
[arcee-ai/AFM-4.5B](https://huggingface.co/arcee-ai/AFM-4.5B)
and were used to build the examples below.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
diff --git a/src/transformers/models/aria/configuration_aria.py b/src/transformers/models/aria/configuration_aria.py
index 67f023e1dbf..451acad6520 100644
--- a/src/transformers/models/aria/configuration_aria.py
+++ b/src/transformers/models/aria/configuration_aria.py
@@ -20,12 +20,12 @@
# limitations under the License.
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ..auto import CONFIG_MAPPING, AutoConfig
-class AriaTextConfig(PretrainedConfig):
+class AriaTextConfig(PreTrainedConfig):
r"""
This class handles the configuration for the text component of the Aria model.
Instantiating a configuration with the defaults will yield a similar configuration to that of the model of the Aria
@@ -220,15 +220,15 @@ class AriaTextConfig(PretrainedConfig):
self.moe_num_shared_experts = moe_num_shared_experts
-class AriaConfig(PretrainedConfig):
+class AriaConfig(PreTrainedConfig):
r"""
This class handles the configuration for both vision and text components of the Aria model,
as well as additional parameters for image token handling and projector mapping.
Instantiating a configuration with the defaults will yield a similar configuration to that of the model of the Aria
[rhymes-ai/Aria](https://huggingface.co/rhymes-ai/Aria) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`AriaVisionConfig` or `dict`, *optional*):
diff --git a/src/transformers/models/aria/modular_aria.py b/src/transformers/models/aria/modular_aria.py
index e0c2b67fcc9..1d820c00cf0 100644
--- a/src/transformers/models/aria/modular_aria.py
+++ b/src/transformers/models/aria/modular_aria.py
@@ -21,7 +21,7 @@ from torch import nn
from ...activations import ACT2FN
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_patch_output_size, select_best_resolution
from ...image_transforms import PaddingMode, convert_to_rgb, pad, resize, to_channel_dimension_format
from ...image_utils import (
@@ -221,15 +221,15 @@ class AriaTextConfig(LlamaConfig):
self.moe_num_shared_experts = moe_num_shared_experts
-class AriaConfig(PretrainedConfig):
+class AriaConfig(PreTrainedConfig):
r"""
This class handles the configuration for both vision and text components of the Aria model,
as well as additional parameters for image token handling and projector mapping.
Instantiating a configuration with the defaults will yield a similar configuration to that of the model of the Aria
[rhymes-ai/Aria](https://huggingface.co/rhymes-ai/Aria) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`AriaVisionConfig` or `dict`, *optional*):
diff --git a/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py b/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py
index ecd8f4858fe..a7165c3f8af 100644
--- a/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py
+++ b/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py
@@ -16,14 +16,14 @@
from typing import Any
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ASTConfig(PretrainedConfig):
+class ASTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ASTModel`]. It is used to instantiate an AST
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -31,8 +31,8 @@ class ASTConfig(PretrainedConfig):
[MIT/ast-finetuned-audioset-10-10-0.4593](https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
diff --git a/src/transformers/models/auto/auto_factory.py b/src/transformers/models/auto/auto_factory.py
index f91a4c5981a..ee67f203b66 100644
--- a/src/transformers/models/auto/auto_factory.py
+++ b/src/transformers/models/auto/auto_factory.py
@@ -23,7 +23,7 @@ from collections import OrderedDict
from collections.abc import Iterator
from typing import Any, TypeVar, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...utils import (
CONFIG_NAME,
@@ -65,7 +65,7 @@ FROM_CONFIG_DOCSTRING = """
model's configuration. Use [`~BaseAutoModelClass.from_pretrained`] to load the model weights.
Args:
- config ([`PretrainedConfig`]):
+ config ([`PreTrainedConfig`]):
The model class to instantiate is selected based on the configuration class:
List options
@@ -104,7 +104,7 @@ FROM_PRETRAINED_TORCH_DOCSTRING = """
[`~PreTrainedModel.save_pretrained`], e.g., `./my_model_directory/`.
model_args (additional positional arguments, *optional*):
Will be passed along to the underlying model `__init__()` method.
- config ([`PretrainedConfig`], *optional*):
+ config ([`PreTrainedConfig`], *optional*):
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
@@ -155,7 +155,7 @@ FROM_PRETRAINED_TORCH_DOCSTRING = """
underlying model's `__init__` method (we assume all relevant updates to the configuration have
already been done)
- If a configuration is not provided, `kwargs` will be first passed to the configuration class
- initialization function ([`~PretrainedConfig.from_pretrained`]). Each key of `kwargs` that
+ initialization function ([`~PreTrainedConfig.from_pretrained`]). Each key of `kwargs` that
corresponds to a configuration attribute will be used to override said attribute with the
supplied `kwargs` value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model's `__init__` function.
@@ -243,7 +243,7 @@ class _BaseAutoModelClass:
)
@classmethod
- def _prepare_config_for_auto_class(cls, config: PretrainedConfig) -> PretrainedConfig:
+ def _prepare_config_for_auto_class(cls, config: PreTrainedConfig) -> PreTrainedConfig:
"""Additional autoclass-specific config post-loading manipulation. May be overridden in subclasses."""
return config
@@ -284,7 +284,7 @@ class _BaseAutoModelClass:
hub_kwargs["token"] = token
if commit_hash is None:
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
# We make a call to the config file first (which may be absent) to get the commit hash as soon as possible
resolved_config_file = cached_file(
pretrained_model_name_or_path,
@@ -315,7 +315,7 @@ class _BaseAutoModelClass:
adapter_kwargs["_adapter_model_path"] = pretrained_model_name_or_path
pretrained_model_name_or_path = adapter_config["base_model_name_or_path"]
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
kwargs_orig = copy.deepcopy(kwargs)
# ensure not to pollute the config object with dtype="auto" - since it's
# meaningless in the context of the config object - torch.dtype values are acceptable
@@ -396,7 +396,7 @@ class _BaseAutoModelClass:
Register a new model for this class.
Args:
- config_class ([`PretrainedConfig`]):
+ config_class ([`PreTrainedConfig`]):
The configuration corresponding to the model to register.
model_class ([`PreTrainedModel`]):
The model to register.
@@ -553,7 +553,7 @@ def add_generation_mixin_to_remote_model(model_class):
return model_class
-class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue]):
+class _LazyAutoMapping(OrderedDict[type[PreTrainedConfig], _LazyAutoMappingValue]):
"""
" A mapping config to object (model or tokenizer for instance) that will load keys and values when it is accessed.
@@ -574,7 +574,7 @@ class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue
common_keys = set(self._config_mapping.keys()).intersection(self._model_mapping.keys())
return len(common_keys) + len(self._extra_content)
- def __getitem__(self, key: type[PretrainedConfig]) -> _LazyAutoMappingValue:
+ def __getitem__(self, key: type[PreTrainedConfig]) -> _LazyAutoMappingValue:
if key in self._extra_content:
return self._extra_content[key]
model_type = self._reverse_config_mapping[key.__name__]
@@ -596,7 +596,7 @@ class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue
self._modules[module_name] = importlib.import_module(f".{module_name}", "transformers.models")
return getattribute_from_module(self._modules[module_name], attr)
- def keys(self) -> list[type[PretrainedConfig]]:
+ def keys(self) -> list[type[PreTrainedConfig]]:
mapping_keys = [
self._load_attr_from_module(key, name)
for key, name in self._config_mapping.items()
@@ -604,7 +604,7 @@ class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue
]
return mapping_keys + list(self._extra_content.keys())
- def get(self, key: type[PretrainedConfig], default: _T) -> Union[_LazyAutoMappingValue, _T]:
+ def get(self, key: type[PreTrainedConfig], default: _T) -> Union[_LazyAutoMappingValue, _T]:
try:
return self.__getitem__(key)
except KeyError:
@@ -621,7 +621,7 @@ class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue
]
return mapping_values + list(self._extra_content.values())
- def items(self) -> list[tuple[type[PretrainedConfig], _LazyAutoMappingValue]]:
+ def items(self) -> list[tuple[type[PreTrainedConfig], _LazyAutoMappingValue]]:
mapping_items = [
(
self._load_attr_from_module(key, self._config_mapping[key]),
@@ -632,7 +632,7 @@ class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue
]
return mapping_items + list(self._extra_content.items())
- def __iter__(self) -> Iterator[type[PretrainedConfig]]:
+ def __iter__(self) -> Iterator[type[PreTrainedConfig]]:
return iter(self.keys())
def __contains__(self, item: type) -> bool:
@@ -643,7 +643,7 @@ class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue
model_type = self._reverse_config_mapping[item.__name__]
return model_type in self._model_mapping
- def register(self, key: type[PretrainedConfig], value: _LazyAutoMappingValue, exist_ok=False) -> None:
+ def register(self, key: type[PreTrainedConfig], value: _LazyAutoMappingValue, exist_ok=False) -> None:
"""
Register a new model in this mapping.
"""
diff --git a/src/transformers/models/auto/configuration_auto.py b/src/transformers/models/auto/configuration_auto.py
index c641645d565..a2e4f05bae5 100644
--- a/src/transformers/models/auto/configuration_auto.py
+++ b/src/transformers/models/auto/configuration_auto.py
@@ -22,7 +22,7 @@ from collections import OrderedDict
from collections.abc import Callable, Iterator, KeysView, ValuesView
from typing import Any, TypeVar, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...utils import CONFIG_NAME, logging
@@ -1031,7 +1031,7 @@ def config_class_to_model_type(config) -> Union[str, None]:
return None
-class _LazyConfigMapping(OrderedDict[str, type[PretrainedConfig]]):
+class _LazyConfigMapping(OrderedDict[str, type[PreTrainedConfig]]):
"""
A dictionary that lazily load its values when they are requested.
"""
@@ -1041,7 +1041,7 @@ class _LazyConfigMapping(OrderedDict[str, type[PretrainedConfig]]):
self._extra_content = {}
self._modules = {}
- def __getitem__(self, key: str) -> type[PretrainedConfig]:
+ def __getitem__(self, key: str) -> type[PreTrainedConfig]:
if key in self._extra_content:
return self._extra_content[key]
if key not in self._mapping:
@@ -1061,10 +1061,10 @@ class _LazyConfigMapping(OrderedDict[str, type[PretrainedConfig]]):
def keys(self) -> list[str]:
return list(self._mapping.keys()) + list(self._extra_content.keys())
- def values(self) -> list[type[PretrainedConfig]]:
+ def values(self) -> list[type[PreTrainedConfig]]:
return [self[k] for k in self._mapping] + list(self._extra_content.values())
- def items(self) -> list[tuple[str, type[PretrainedConfig]]]:
+ def items(self) -> list[tuple[str, type[PreTrainedConfig]]]:
return [(k, self[k]) for k in self._mapping] + list(self._extra_content.items())
def __iter__(self) -> Iterator[str]:
@@ -1073,7 +1073,7 @@ class _LazyConfigMapping(OrderedDict[str, type[PretrainedConfig]]):
def __contains__(self, item: object) -> bool:
return item in self._mapping or item in self._extra_content
- def register(self, key: str, value: type[PretrainedConfig], exist_ok=False) -> None:
+ def register(self, key: str, value: type[PreTrainedConfig], exist_ok=False) -> None:
"""
Register a new configuration in this mapping.
"""
@@ -1219,7 +1219,7 @@ class AutoConfig:
)
@classmethod
- def for_model(cls, model_type: str, *args, **kwargs) -> PretrainedConfig:
+ def for_model(cls, model_type: str, *args, **kwargs) -> PreTrainedConfig:
if model_type in CONFIG_MAPPING:
config_class = CONFIG_MAPPING[model_type]
return config_class(*args, **kwargs)
@@ -1245,7 +1245,7 @@ class AutoConfig:
- A string, the *model id* of a pretrained model configuration hosted inside a model repo on
huggingface.co.
- A path to a *directory* containing a configuration file saved using the
- [`~PretrainedConfig.save_pretrained`] method, or the [`~PreTrainedModel.save_pretrained`] method,
+ [`~PreTrainedConfig.save_pretrained`] method, or the [`~PreTrainedModel.save_pretrained`] method,
e.g., `./my_model_directory/`.
- A path or url to a saved configuration JSON *file*, e.g.,
`./my_model_directory/configuration.json`.
@@ -1326,7 +1326,7 @@ class AutoConfig:
trust_remote_code = kwargs.pop("trust_remote_code", None)
code_revision = kwargs.pop("code_revision", None)
- config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
+ config_dict, unused_kwargs = PreTrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
has_remote_code = "auto_map" in config_dict and "AutoConfig" in config_dict["auto_map"]
has_local_code = "model_type" in config_dict and config_dict["model_type"] in CONFIG_MAPPING
if has_remote_code:
@@ -1387,9 +1387,9 @@ class AutoConfig:
Args:
model_type (`str`): The model type like "bert" or "gpt".
- config ([`PretrainedConfig`]): The config to register.
+ config ([`PreTrainedConfig`]): The config to register.
"""
- if issubclass(config, PretrainedConfig) and config.model_type != model_type:
+ if issubclass(config, PreTrainedConfig) and config.model_type != model_type:
raise ValueError(
"The config you are passing has a `model_type` attribute that is not consistent with the model type "
f"you passed (config has {config.model_type} and you passed {model_type}. Fix one of those so they "
diff --git a/src/transformers/models/auto/feature_extraction_auto.py b/src/transformers/models/auto/feature_extraction_auto.py
index 0d3dab2e8fd..38f09a5a3ee 100644
--- a/src/transformers/models/auto/feature_extraction_auto.py
+++ b/src/transformers/models/auto/feature_extraction_auto.py
@@ -22,7 +22,7 @@ from collections import OrderedDict
from typing import Optional, Union
# Build the list of all feature extractors
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...feature_extraction_utils import FeatureExtractionMixin
from ...utils import CONFIG_NAME, FEATURE_EXTRACTOR_NAME, cached_file, logging
@@ -309,7 +309,7 @@ class AutoFeatureExtractor:
# If we don't find the feature extractor class in the feature extractor config, let's try the model config.
if feature_extractor_class is None and feature_extractor_auto_map is None:
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
config = AutoConfig.from_pretrained(
pretrained_model_name_or_path, trust_remote_code=trust_remote_code, **kwargs
)
@@ -358,7 +358,7 @@ class AutoFeatureExtractor:
Register a new feature extractor for this class.
Args:
- config_class ([`PretrainedConfig`]):
+ config_class ([`PreTrainedConfig`]):
The configuration corresponding to the model to register.
feature_extractor_class ([`FeatureExtractorMixin`]): The feature extractor to register.
"""
diff --git a/src/transformers/models/auto/image_processing_auto.py b/src/transformers/models/auto/image_processing_auto.py
index e07aa3ee7d2..eeea333aa2e 100644
--- a/src/transformers/models/auto/image_processing_auto.py
+++ b/src/transformers/models/auto/image_processing_auto.py
@@ -22,7 +22,7 @@ from collections import OrderedDict
from typing import TYPE_CHECKING, Optional, Union
# Build the list of all image processors
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...image_processing_utils import ImageProcessingMixin
from ...image_processing_utils_fast import BaseImageProcessorFast
@@ -502,7 +502,7 @@ class AutoImageProcessor:
# If we don't find the image processor class in the image processor config, let's try the model config.
if image_processor_type is None and image_processor_auto_map is None:
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
config = AutoConfig.from_pretrained(
pretrained_model_name_or_path,
trust_remote_code=trust_remote_code,
@@ -629,7 +629,7 @@ class AutoImageProcessor:
Register a new image processor for this class.
Args:
- config_class ([`PretrainedConfig`]):
+ config_class ([`PreTrainedConfig`]):
The configuration corresponding to the model to register.
image_processor_class ([`ImageProcessingMixin`]): The image processor to register.
"""
diff --git a/src/transformers/models/auto/processing_auto.py b/src/transformers/models/auto/processing_auto.py
index 46254c26484..cb2eb94cecd 100644
--- a/src/transformers/models/auto/processing_auto.py
+++ b/src/transformers/models/auto/processing_auto.py
@@ -21,7 +21,7 @@ import warnings
from collections import OrderedDict
# Build the list of all feature extractors
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...feature_extraction_utils import FeatureExtractionMixin
from ...image_processing_utils import ImageProcessingMixin
@@ -356,7 +356,7 @@ class AutoProcessor:
if processor_class is None:
# Otherwise, load config, if it can be loaded.
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
config = AutoConfig.from_pretrained(
pretrained_model_name_or_path, trust_remote_code=trust_remote_code, **kwargs
)
@@ -430,7 +430,7 @@ class AutoProcessor:
Register a new processor for this class.
Args:
- config_class ([`PretrainedConfig`]):
+ config_class ([`PreTrainedConfig`]):
The configuration corresponding to the model to register.
processor_class ([`ProcessorMixin`]): The processor to register.
"""
diff --git a/src/transformers/models/auto/tokenization_auto.py b/src/transformers/models/auto/tokenization_auto.py
index 2de3cda52f9..0b9f97c2ba2 100644
--- a/src/transformers/models/auto/tokenization_auto.py
+++ b/src/transformers/models/auto/tokenization_auto.py
@@ -23,7 +23,7 @@ from typing import Any, Optional, Union
from transformers.utils.import_utils import is_mistral_common_available
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...modeling_gguf_pytorch_utils import load_gguf_checkpoint
from ...tokenization_utils import PreTrainedTokenizer
@@ -962,7 +962,7 @@ class AutoTokenizer:
applicable to all derived classes)
inputs (additional positional arguments, *optional*):
Will be passed along to the Tokenizer `__init__()` method.
- config ([`PretrainedConfig`], *optional*)
+ config ([`PreTrainedConfig`], *optional*)
The configuration object used to determine the tokenizer class to instantiate.
cache_dir (`str` or `os.PathLike`, *optional*):
Path to a directory in which a downloaded pretrained model configuration should be cached if the
@@ -1076,7 +1076,7 @@ class AutoTokenizer:
# If that did not work, let's try to use the config.
if config_tokenizer_class is None:
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
if gguf_file:
gguf_path = cached_file(pretrained_model_name_or_path, gguf_file, **kwargs)
config_dict = load_gguf_checkpoint(gguf_path, return_tensors=False)["config"]
@@ -1170,7 +1170,7 @@ class AutoTokenizer:
Args:
- config_class ([`PretrainedConfig`]):
+ config_class ([`PreTrainedConfig`]):
The configuration corresponding to the model to register.
slow_tokenizer_class ([`PretrainedTokenizer`], *optional*):
The slow tokenizer to register.
diff --git a/src/transformers/models/auto/video_processing_auto.py b/src/transformers/models/auto/video_processing_auto.py
index 9671c6195fa..751112e150d 100644
--- a/src/transformers/models/auto/video_processing_auto.py
+++ b/src/transformers/models/auto/video_processing_auto.py
@@ -22,7 +22,7 @@ from collections import OrderedDict
from typing import TYPE_CHECKING, Optional, Union
# Build the list of all video processors
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...utils import CONFIG_NAME, VIDEO_PROCESSOR_NAME, cached_file, is_torchvision_available, logging
from ...utils.import_utils import requires
@@ -321,7 +321,7 @@ class AutoVideoProcessor:
# If we don't find the video processor class in the video processor config, let's try the model config.
if video_processor_class is None and video_processor_auto_map is None:
- if not isinstance(config, PretrainedConfig):
+ if not isinstance(config, PreTrainedConfig):
config = AutoConfig.from_pretrained(
pretrained_model_name_or_path, trust_remote_code=trust_remote_code, **kwargs
)
@@ -374,7 +374,7 @@ class AutoVideoProcessor:
Register a new video processor for this class.
Args:
- config_class ([`PretrainedConfig`]):
+ config_class ([`PreTrainedConfig`]):
The configuration corresponding to the model to register.
video_processor_class ([`BaseVideoProcessor`]):
The video processor to register.
diff --git a/src/transformers/models/autoformer/configuration_autoformer.py b/src/transformers/models/autoformer/configuration_autoformer.py
index 24f0f37a8c8..57baeb42c9f 100644
--- a/src/transformers/models/autoformer/configuration_autoformer.py
+++ b/src/transformers/models/autoformer/configuration_autoformer.py
@@ -16,14 +16,14 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class AutoformerConfig(PretrainedConfig):
+class AutoformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`AutoformerModel`]. It is used to instantiate an
Autoformer model according to the specified arguments, defining the model architecture. Instantiating a
@@ -31,8 +31,8 @@ class AutoformerConfig(PretrainedConfig):
[huggingface/autoformer-tourism-monthly](https://huggingface.co/huggingface/autoformer-tourism-monthly)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
prediction_length (`int`):
diff --git a/src/transformers/models/aya_vision/configuration_aya_vision.py b/src/transformers/models/aya_vision/configuration_aya_vision.py
index a8c1965ec46..c08053b2fe9 100644
--- a/src/transformers/models/aya_vision/configuration_aya_vision.py
+++ b/src/transformers/models/aya_vision/configuration_aya_vision.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""AyaVision model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -22,15 +22,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class AyaVisionConfig(PretrainedConfig):
+class AyaVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`AyaVisionForConditionalGeneration`]. It is used to instantiate an
AyaVision model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of AyaVision.
e.g. [CohereForAI/aya-vision-8b](https://huggingface.co/CohereForAI/aya-vision-8b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `SiglipVisionConfig`):
diff --git a/src/transformers/models/bamba/configuration_bamba.py b/src/transformers/models/bamba/configuration_bamba.py
index efa9d5f3d08..dd31dba5949 100644
--- a/src/transformers/models/bamba/configuration_bamba.py
+++ b/src/transformers/models/bamba/configuration_bamba.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""Bamba model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class BambaConfig(PretrainedConfig):
+class BambaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BambaModel`]. It is used to instantiate a
BambaModel model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -30,8 +30,8 @@ class BambaConfig(PretrainedConfig):
The BambaModel is a hybrid [mamba2](https://github.com/state-spaces/mamba) architecture with SwiGLU.
The checkpoints are jointly trained by IBM, Princeton, and UIUC.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 128000):
diff --git a/src/transformers/models/bark/configuration_bark.py b/src/transformers/models/bark/configuration_bark.py
index 25787a90d61..d5ec180c459 100644
--- a/src/transformers/models/bark/configuration_bark.py
+++ b/src/transformers/models/bark/configuration_bark.py
@@ -16,7 +16,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import add_start_docstrings, logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -30,8 +30,8 @@ BARK_SUBMODELCONFIG_START_DOCSTRING = """
defaults will yield a similar configuration to that of the Bark [suno/bark](https://huggingface.co/suno/bark)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
block_size (`int`, *optional*, defaults to 1024):
@@ -62,7 +62,7 @@ BARK_SUBMODELCONFIG_START_DOCSTRING = """
"""
-class BarkSubModelConfig(PretrainedConfig):
+class BarkSubModelConfig(PreTrainedConfig):
keys_to_ignore_at_inference = ["past_key_values"]
attribute_map = {
@@ -180,7 +180,7 @@ class BarkFineConfig(BarkSubModelConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class BarkConfig(PretrainedConfig):
+class BarkConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`BarkModel`]. It is used to instantiate a Bark
model according to the specified sub-models configurations, defining the model architecture.
@@ -188,8 +188,8 @@ class BarkConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the Bark
[suno/bark](https://huggingface.co/suno/bark) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
semantic_config ([`BarkSemanticConfig`], *optional*):
@@ -282,7 +282,7 @@ class BarkConfig(PretrainedConfig):
semantic_config: BarkSemanticConfig,
coarse_acoustics_config: BarkCoarseConfig,
fine_acoustics_config: BarkFineConfig,
- codec_config: PretrainedConfig,
+ codec_config: PreTrainedConfig,
**kwargs,
):
r"""
diff --git a/src/transformers/models/bark/generation_configuration_bark.py b/src/transformers/models/bark/generation_configuration_bark.py
index 0fa68184c88..d82669a8785 100644
--- a/src/transformers/models/bark/generation_configuration_bark.py
+++ b/src/transformers/models/bark/generation_configuration_bark.py
@@ -315,7 +315,7 @@ class BarkGenerationConfig(GenerationConfig):
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`].
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`].
Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
diff --git a/src/transformers/models/bart/configuration_bart.py b/src/transformers/models/bart/configuration_bart.py
index e560bfa7d4a..0e9c3b3b931 100644
--- a/src/transformers/models/bart/configuration_bart.py
+++ b/src/transformers/models/bart/configuration_bart.py
@@ -20,7 +20,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeq2SeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import is_torch_available, logging
@@ -29,15 +29,15 @@ from ...utils import is_torch_available, logging
logger = logging.get_logger(__name__)
-class BartConfig(PretrainedConfig):
+class BartConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BartModel`]. It is used to instantiate a BART
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the BART
[facebook/bart-large](https://huggingface.co/facebook/bart-large) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/beit/configuration_beit.py b/src/transformers/models/beit/configuration_beit.py
index 4bea72b7bd0..c8a4a2e51a5 100644
--- a/src/transformers/models/beit/configuration_beit.py
+++ b/src/transformers/models/beit/configuration_beit.py
@@ -20,12 +20,12 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
-class BeitConfig(BackboneConfigMixin, PretrainedConfig):
+class BeitConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BeitModel`]. It is used to instantiate an BEiT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
diff --git a/src/transformers/models/bert/configuration_bert.py b/src/transformers/models/bert/configuration_bert.py
index e7e51d3295e..3a313fd3b6b 100644
--- a/src/transformers/models/bert/configuration_bert.py
+++ b/src/transformers/models/bert/configuration_bert.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -26,15 +26,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class BertConfig(PretrainedConfig):
+class BertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BertModel`] or a [`TFBertModel`]. It is used to
instantiate a BERT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the BERT
[google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/bert_generation/configuration_bert_generation.py b/src/transformers/models/bert_generation/configuration_bert_generation.py
index e6cf054cc5e..b709660be77 100644
--- a/src/transformers/models/bert_generation/configuration_bert_generation.py
+++ b/src/transformers/models/bert_generation/configuration_bert_generation.py
@@ -14,10 +14,10 @@
# limitations under the License.
"""BertGeneration model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class BertGenerationConfig(PretrainedConfig):
+class BertGenerationConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BertGenerationPreTrainedModel`]. It is used to
instantiate a BertGeneration model according to the specified arguments, defining the model architecture.
@@ -25,8 +25,8 @@ class BertGenerationConfig(PretrainedConfig):
[google/bert_for_seq_generation_L-24_bbc_encoder](https://huggingface.co/google/bert_for_seq_generation_L-24_bbc_encoder)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50358):
diff --git a/src/transformers/models/big_bird/configuration_big_bird.py b/src/transformers/models/big_bird/configuration_big_bird.py
index 8e29439bc4b..a7b44f98def 100644
--- a/src/transformers/models/big_bird/configuration_big_bird.py
+++ b/src/transformers/models/big_bird/configuration_big_bird.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class BigBirdConfig(PretrainedConfig):
+class BigBirdConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BigBirdModel`]. It is used to instantiate an
BigBird model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the BigBird
[google/bigbird-roberta-base](https://huggingface.co/google/bigbird-roberta-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py b/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py
index dc32c34e0d2..252c714994b 100644
--- a/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py
+++ b/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeq2SeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import is_torch_available, logging
@@ -28,15 +28,15 @@ from ...utils import is_torch_available, logging
logger = logging.get_logger(__name__)
-class BigBirdPegasusConfig(PretrainedConfig):
+class BigBirdPegasusConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BigBirdPegasusModel`]. It is used to instantiate
an BigBirdPegasus model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the BigBirdPegasus
[google/bigbird-pegasus-large-arxiv](https://huggingface.co/google/bigbird-pegasus-large-arxiv) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/biogpt/configuration_biogpt.py b/src/transformers/models/biogpt/configuration_biogpt.py
index e773290efc0..2e2b5c140e9 100644
--- a/src/transformers/models/biogpt/configuration_biogpt.py
+++ b/src/transformers/models/biogpt/configuration_biogpt.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""BioGPT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class BioGptConfig(PretrainedConfig):
+class BioGptConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BioGptModel`]. It is used to instantiate an
BioGPT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the BioGPT
[microsoft/biogpt](https://huggingface.co/microsoft/biogpt) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/bit/configuration_bit.py b/src/transformers/models/bit/configuration_bit.py
index 2b1f24fa068..db9f2d2b898 100644
--- a/src/transformers/models/bit/configuration_bit.py
+++ b/src/transformers/models/bit/configuration_bit.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""BiT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class BitConfig(BackboneConfigMixin, PretrainedConfig):
+class BitConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BitModel`]. It is used to instantiate an BiT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the BiT
[google/bit-50](https://huggingface.co/google/bit-50) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/bitnet/configuration_bitnet.py b/src/transformers/models/bitnet/configuration_bitnet.py
index 6df31b5b820..5e467443f28 100644
--- a/src/transformers/models/bitnet/configuration_bitnet.py
+++ b/src/transformers/models/bitnet/configuration_bitnet.py
@@ -13,22 +13,22 @@
# See the License for the specific language governing permissions and
"""BitNet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class BitNetConfig(PretrainedConfig):
+class BitNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BitNetModel`]. It is used to instantiate an BitNet
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of
BitNet b1.58 2B4T [microsoft/bitnet-b1.58-2B-4T](https://huggingface.co/microsoft/bitnet-b1.58-2B-4T).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/blenderbot/configuration_blenderbot.py b/src/transformers/models/blenderbot/configuration_blenderbot.py
index 8e4e4812aaf..ec0862b1c4a 100644
--- a/src/transformers/models/blenderbot/configuration_blenderbot.py
+++ b/src/transformers/models/blenderbot/configuration_blenderbot.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...file_utils import is_torch_available
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeq2SeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
@@ -29,15 +29,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class BlenderbotConfig(PretrainedConfig):
+class BlenderbotConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BlenderbotModel`]. It is used to instantiate an
Blenderbot model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Blenderbot
[facebook/blenderbot-3B](https://huggingface.co/facebook/blenderbot-3B) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py b/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py
index 6cd7f7275c1..d609611bd90 100644
--- a/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py
+++ b/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...file_utils import is_torch_available
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeq2SeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
@@ -29,15 +29,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class BlenderbotSmallConfig(PretrainedConfig):
+class BlenderbotSmallConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BlenderbotSmallModel`]. It is used to instantiate
an BlenderbotSmall model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the BlenderbotSmall
[facebook/blenderbot_small-90M](https://huggingface.co/facebook/blenderbot_small-90M) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/blip/configuration_blip.py b/src/transformers/models/blip/configuration_blip.py
index 6e0a5590c3f..66e918499d5 100644
--- a/src/transformers/models/blip/configuration_blip.py
+++ b/src/transformers/models/blip/configuration_blip.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Blip model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class BlipTextConfig(PretrainedConfig):
+class BlipTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BlipTextModel`]. It is used to instantiate a BLIP
text model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the `BlipText` used by the [base
architectures](https://huggingface.co/Salesforce/blip-vqa-base).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -145,15 +145,15 @@ class BlipTextConfig(PretrainedConfig):
self.label_smoothing = label_smoothing
-class BlipVisionConfig(PretrainedConfig):
+class BlipVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BlipVisionModel`]. It is used to instantiate a
BLIP vision model according to the specified arguments, defining the model architecture. Instantiating a
configuration defaults will yield a similar configuration to that of the Blip-base
[Salesforce/blip-vqa-base](https://huggingface.co/Salesforce/blip-vqa-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -227,15 +227,15 @@ class BlipVisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class BlipConfig(PretrainedConfig):
+class BlipConfig(PreTrainedConfig):
r"""
[`BlipConfig`] is the configuration class to store the configuration of a [`BlipModel`]. It is used to instantiate
a BLIP model according to the specified arguments, defining the text model and vision model configs. Instantiating
a configuration with the defaults will yield a similar configuration to that of the BLIP-base
[Salesforce/blip-vqa-base](https://huggingface.co/Salesforce/blip-vqa-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/blip_2/configuration_blip_2.py b/src/transformers/models/blip_2/configuration_blip_2.py
index 23145ffc543..1d4e38cd118 100644
--- a/src/transformers/models/blip_2/configuration_blip_2.py
+++ b/src/transformers/models/blip_2/configuration_blip_2.py
@@ -16,7 +16,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...models.auto.modeling_auto import MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -25,15 +25,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class Blip2VisionConfig(PretrainedConfig):
+class Blip2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Blip2VisionModel`]. It is used to instantiate a
BLIP-2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration defaults will yield a similar configuration to that of the BLIP-2
[Salesforce/blip2-opt-2.7b](https://huggingface.co/Salesforce/blip2-opt-2.7b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1408):
@@ -107,14 +107,14 @@ class Blip2VisionConfig(PretrainedConfig):
self.qkv_bias = qkv_bias
-class Blip2QFormerConfig(PretrainedConfig):
+class Blip2QFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Blip2QFormerModel`]. It is used to instantiate a
BLIP-2 Querying Transformer (Q-Former) model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the BLIP-2
[Salesforce/blip2-opt-2.7b](https://huggingface.co/Salesforce/blip2-opt-2.7b) architecture. Configuration objects
- inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from
- [`PretrainedConfig`] for more information.
+ inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the documentation from
+ [`PreTrainedConfig`] for more information.
Note that [`Blip2QFormerModel`] is very similar to [`BertLMHeadModel`] with interleaved cross-attention.
@@ -215,15 +215,15 @@ class Blip2QFormerConfig(PretrainedConfig):
self.use_qformer_text_input = use_qformer_text_input
-class Blip2Config(PretrainedConfig):
+class Blip2Config(PreTrainedConfig):
r"""
[`Blip2Config`] is the configuration class to store the configuration of a [`Blip2ForConditionalGeneration`]. It is
used to instantiate a BLIP-2 model according to the specified arguments, defining the vision model, Q-Former model
and language model configs. Instantiating a configuration with the defaults will yield a similar configuration to
that of the BLIP-2 [Salesforce/blip2-opt-2.7b](https://huggingface.co/Salesforce/blip2-opt-2.7b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`dict`, *optional*):
@@ -231,7 +231,7 @@ class Blip2Config(PretrainedConfig):
qformer_config (`dict`, *optional*):
Dictionary of configuration options used to initialize [`Blip2QFormerConfig`].
text_config (`dict`, *optional*):
- Dictionary of configuration options used to initialize any [`PretrainedConfig`].
+ Dictionary of configuration options used to initialize any [`PreTrainedConfig`].
num_query_tokens (`int`, *optional*, defaults to 32):
The number of query tokens passed through the Transformer.
image_text_hidden_size (`int`, *optional*, defaults to 256):
@@ -262,7 +262,7 @@ class Blip2Config(PretrainedConfig):
>>> # Accessing the model configuration
>>> configuration = model.config
- >>> # We can also initialize a Blip2Config from a Blip2VisionConfig, Blip2QFormerConfig and any PretrainedConfig
+ >>> # We can also initialize a Blip2Config from a Blip2VisionConfig, Blip2QFormerConfig and any PreTrainedConfig
>>> # Initializing BLIP-2 vision, BLIP-2 Q-Former and language model configurations
>>> vision_config = Blip2VisionConfig()
@@ -321,7 +321,7 @@ class Blip2Config(PretrainedConfig):
cls,
vision_config: Blip2VisionConfig,
qformer_config: Blip2QFormerConfig,
- text_config: Optional[PretrainedConfig] = None,
+ text_config: Optional[PreTrainedConfig] = None,
**kwargs,
):
r"""
@@ -334,7 +334,7 @@ class Blip2Config(PretrainedConfig):
qformer_config (`dict`):
Dictionary of configuration options used to initialize [`Blip2QFormerConfig`].
text_config (`dict`, *optional*):
- Dictionary of configuration options used to initialize any [`PretrainedConfig`].
+ Dictionary of configuration options used to initialize any [`PreTrainedConfig`].
Returns:
[`Blip2Config`]: An instance of a configuration object
diff --git a/src/transformers/models/bloom/configuration_bloom.py b/src/transformers/models/bloom/configuration_bloom.py
index 8d5fa7656a7..b963a5ebe56 100644
--- a/src/transformers/models/bloom/configuration_bloom.py
+++ b/src/transformers/models/bloom/configuration_bloom.py
@@ -24,7 +24,7 @@ from packaging import version
if TYPE_CHECKING:
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import is_torch_available, logging
@@ -32,15 +32,15 @@ from ...utils import is_torch_available, logging
logger = logging.get_logger(__name__)
-class BloomConfig(PretrainedConfig):
+class BloomConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`BloomModel`]. It is used to instantiate a Bloom
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to the Bloom architecture
[bigscience/bloom](https://huggingface.co/bigscience/bloom).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -147,7 +147,7 @@ class BloomOnnxConfig(OnnxConfigWithPast):
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
task: str = "default",
patching_specs: Optional[list[PatchingSpec]] = None,
use_past: bool = False,
diff --git a/src/transformers/models/blt/configuration_blt.py b/src/transformers/models/blt/configuration_blt.py
index 0bc6718e5bd..35c087cc82b 100644
--- a/src/transformers/models/blt/configuration_blt.py
+++ b/src/transformers/models/blt/configuration_blt.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""Blt model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class BltLocalEncoderConfig(PretrainedConfig):
+class BltLocalEncoderConfig(PreTrainedConfig):
"""
Configuration class for the Blt Local Encoder component.
"""
@@ -71,7 +71,7 @@ class BltLocalEncoderConfig(PretrainedConfig):
super().__init__(**kwargs, tie_word_embeddings=False)
-class BltLocalDecoderConfig(PretrainedConfig):
+class BltLocalDecoderConfig(PreTrainedConfig):
"""
Configuration class for the Blt Local Decoder component.
"""
@@ -121,7 +121,7 @@ class BltLocalDecoderConfig(PretrainedConfig):
super().__init__(**kwargs, tie_word_embeddings=False)
-class BltGlobalTransformerConfig(PretrainedConfig):
+class BltGlobalTransformerConfig(PreTrainedConfig):
"""
Configuration class for the Blt Global Transformer component.
"""
@@ -163,7 +163,7 @@ class BltGlobalTransformerConfig(PretrainedConfig):
super().__init__(**kwargs, tie_word_embeddings=False)
-class BltPatcherConfig(PretrainedConfig):
+class BltPatcherConfig(PreTrainedConfig):
r"""
Configuration class for the Blt Patcher/Entropy model component.
@@ -239,13 +239,13 @@ class BltPatcherConfig(PretrainedConfig):
super().__init__(**kwargs, tie_word_embeddings=False)
-class BltConfig(PretrainedConfig):
+class BltConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BltModel`]. It is used to instantiate a
Blt model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 260):
diff --git a/src/transformers/models/bridgetower/configuration_bridgetower.py b/src/transformers/models/bridgetower/configuration_bridgetower.py
index 4c84b0a294d..f2ae05304e4 100644
--- a/src/transformers/models/bridgetower/configuration_bridgetower.py
+++ b/src/transformers/models/bridgetower/configuration_bridgetower.py
@@ -14,21 +14,21 @@
# limitations under the License.
"""BridgeTower model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class BridgeTowerVisionConfig(PretrainedConfig):
+class BridgeTowerVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the vision configuration of a [`BridgeTowerModel`]. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
[BridgeTower/bridgetower-base](https://huggingface.co/BridgeTower/bridgetower-base/) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -94,15 +94,15 @@ class BridgeTowerVisionConfig(PretrainedConfig):
self.remove_last_layer = remove_last_layer
-class BridgeTowerTextConfig(PretrainedConfig):
+class BridgeTowerTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the text configuration of a [`BridgeTowerModel`]. The default values here
are copied from RoBERTa. Instantiating a configuration with the defaults will yield a similar configuration to that
of the bridgetower-base [BridegTower/bridgetower-base](https://huggingface.co/BridgeTower/bridgetower-base/)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50265):
@@ -202,15 +202,15 @@ class BridgeTowerTextConfig(PretrainedConfig):
self.eos_token_id = eos_token_id
-class BridgeTowerConfig(PretrainedConfig):
+class BridgeTowerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BridgeTowerModel`]. It is used to instantiate a
BridgeTower model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the bridgetower-base
[BridgeTower/bridgetower-base](https://huggingface.co/BridgeTower/bridgetower-base/) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
share_cross_modal_transformer_layers (`bool`, *optional*, defaults to `True`):
diff --git a/src/transformers/models/bros/configuration_bros.py b/src/transformers/models/bros/configuration_bros.py
index 84c9989f309..d6dbee9b324 100644
--- a/src/transformers/models/bros/configuration_bros.py
+++ b/src/transformers/models/bros/configuration_bros.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Bros model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class BrosConfig(PretrainedConfig):
+class BrosConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`BrosModel`] or a [`TFBrosModel`]. It is used to
instantiate a Bros model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Bros
[jinho8345/bros-base-uncased](https://huggingface.co/jinho8345/bros-base-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
diff --git a/src/transformers/models/camembert/configuration_camembert.py b/src/transformers/models/camembert/configuration_camembert.py
index 3979e548744..44008254c0d 100644
--- a/src/transformers/models/camembert/configuration_camembert.py
+++ b/src/transformers/models/camembert/configuration_camembert.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -26,15 +26,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class CamembertConfig(PretrainedConfig):
+class CamembertConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`CamembertModel`] or a [`TFCamembertModel`]. It is
used to instantiate a Camembert model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Camembert
[almanach/camembert-base](https://huggingface.co/almanach/camembert-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/canine/configuration_canine.py b/src/transformers/models/canine/configuration_canine.py
index 29e90327d08..13aded9a1b2 100644
--- a/src/transformers/models/canine/configuration_canine.py
+++ b/src/transformers/models/canine/configuration_canine.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""CANINE model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class CanineConfig(PretrainedConfig):
+class CanineConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CanineModel`]. It is used to instantiate an
CANINE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CANINE
[google/canine-s](https://huggingface.co/google/canine-s) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/chameleon/configuration_chameleon.py b/src/transformers/models/chameleon/configuration_chameleon.py
index 34436a5288c..dc75c173043 100644
--- a/src/transformers/models/chameleon/configuration_chameleon.py
+++ b/src/transformers/models/chameleon/configuration_chameleon.py
@@ -16,19 +16,19 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ChameleonVQVAEConfig(PretrainedConfig):
+class ChameleonVQVAEConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ChameleonVQModel`]. It is used to instantiate a
`ChameleonVQModel` according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Instantiating a
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Instantiating a
configuration with the defaults will yield a similar configuration to the VQModel of the
[meta/chameleon-7B](https://huggingface.co/meta/chameleon-7B).
@@ -97,15 +97,15 @@ class ChameleonVQVAEConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class ChameleonConfig(PretrainedConfig):
+class ChameleonConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ChameleonModel`]. It is used to instantiate a
chameleon model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[meta/chameleon-7B](https://huggingface.co/meta/chameleon-7B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/chinese_clip/configuration_chinese_clip.py b/src/transformers/models/chinese_clip/configuration_chinese_clip.py
index 776df308a89..68631dd18a3 100644
--- a/src/transformers/models/chinese_clip/configuration_chinese_clip.py
+++ b/src/transformers/models/chinese_clip/configuration_chinese_clip.py
@@ -22,7 +22,7 @@ from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from ...processing_utils import ProcessorMixin
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -30,7 +30,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class ChineseCLIPTextConfig(PretrainedConfig):
+class ChineseCLIPTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ChineseCLIPModel`]. It is used to instantiate a
Chinese CLIP model according to the specified arguments, defining the model architecture. Instantiating a
@@ -38,8 +38,8 @@ class ChineseCLIPTextConfig(PretrainedConfig):
[OFA-Sys/chinese-clip-vit-base-patch16](https:
//huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -142,15 +142,15 @@ class ChineseCLIPTextConfig(PretrainedConfig):
self.use_cache = use_cache
-class ChineseCLIPVisionConfig(PretrainedConfig):
+class ChineseCLIPVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ChineseCLIPModel`]. It is used to instantiate an
ChineseCLIP model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the ChineseCLIP
[OFA-Sys/chinese-clip-vit-base-patch16](https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -233,7 +233,7 @@ class ChineseCLIPVisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class ChineseCLIPConfig(PretrainedConfig):
+class ChineseCLIPConfig(PreTrainedConfig):
r"""
[`ChineseCLIPConfig`] is the configuration class to store the configuration of a [`ChineseCLIPModel`]. It is used
to instantiate Chinese-CLIP model according to the specified arguments, defining the text model and vision model
@@ -241,8 +241,8 @@ class ChineseCLIPConfig(PretrainedConfig):
Chinese-CLIP [OFA-Sys/chinese-clip-vit-base-patch16](https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/clap/configuration_clap.py b/src/transformers/models/clap/configuration_clap.py
index 900e8d373f5..029b93a67f8 100644
--- a/src/transformers/models/clap/configuration_clap.py
+++ b/src/transformers/models/clap/configuration_clap.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""CLAP model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ClapTextConfig(PretrainedConfig):
+class ClapTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ClapTextModel`]. It is used to instantiate a CLAP
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the CLAP
[calp-hsat-fused](https://huggingface.co/laion/clap-hsat-fused) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -136,15 +136,15 @@ class ClapTextConfig(PretrainedConfig):
self.projection_dim = projection_dim
-class ClapAudioConfig(PretrainedConfig):
+class ClapAudioConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ClapAudioModel`]. It is used to instantiate a
CLAP audio encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the audio encoder of the CLAP
[laion/clap-htsat-fused](https://huggingface.co/laion/clap-htsat-fused) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
window_size (`int`, *optional*, defaults to 8):
@@ -289,15 +289,15 @@ class ClapAudioConfig(PretrainedConfig):
self.projection_hidden_act = projection_hidden_act
-class ClapConfig(PretrainedConfig):
+class ClapConfig(PreTrainedConfig):
r"""
[`ClapConfig`] is the configuration class to store the configuration of a [`ClapModel`]. It is used to instantiate
a CLAP model according to the specified arguments, defining the text model and audio model configs. Instantiating a
configuration with the defaults will yield a similar configuration to that of the CLAP
[laion/clap-htsat-fused](https://huggingface.co/laion/clap-htsat-fused) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/clip/configuration_clip.py b/src/transformers/models/clip/configuration_clip.py
index ae5c6bcaa8c..84dbbb6ac7a 100644
--- a/src/transformers/models/clip/configuration_clip.py
+++ b/src/transformers/models/clip/configuration_clip.py
@@ -22,7 +22,7 @@ from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from ...processing_utils import ProcessorMixin
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -30,15 +30,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class CLIPTextConfig(PretrainedConfig):
+class CLIPTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CLIPTextModel`]. It is used to instantiate a CLIP
text encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the text encoder of the CLIP
[openai/clip-vit-base-patch32](https://huggingface.co/openai/clip-vit-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 49408):
@@ -131,15 +131,15 @@ class CLIPTextConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class CLIPVisionConfig(PretrainedConfig):
+class CLIPVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CLIPVisionModel`]. It is used to instantiate a
CLIP vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the CLIP
[openai/clip-vit-base-patch32](https://huggingface.co/openai/clip-vit-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -223,15 +223,15 @@ class CLIPVisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class CLIPConfig(PretrainedConfig):
+class CLIPConfig(PreTrainedConfig):
r"""
[`CLIPConfig`] is the configuration class to store the configuration of a [`CLIPModel`]. It is used to instantiate
a CLIP model according to the specified arguments, defining the text model and vision model configs. Instantiating
a configuration with the defaults will yield a similar configuration to that of the CLIP
[openai/clip-vit-base-patch32](https://huggingface.co/openai/clip-vit-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/clipseg/configuration_clipseg.py b/src/transformers/models/clipseg/configuration_clipseg.py
index e338d278577..74345502e41 100644
--- a/src/transformers/models/clipseg/configuration_clipseg.py
+++ b/src/transformers/models/clipseg/configuration_clipseg.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""CLIPSeg model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class CLIPSegTextConfig(PretrainedConfig):
+class CLIPSegTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CLIPSegModel`]. It is used to instantiate an
CLIPSeg model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CLIPSeg
[CIDAS/clipseg-rd64](https://huggingface.co/CIDAS/clipseg-rd64) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 49408):
@@ -116,15 +116,15 @@ class CLIPSegTextConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class CLIPSegVisionConfig(PretrainedConfig):
+class CLIPSegVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CLIPSegModel`]. It is used to instantiate an
CLIPSeg model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CLIPSeg
[CIDAS/clipseg-rd64](https://huggingface.co/CIDAS/clipseg-rd64) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -204,15 +204,15 @@ class CLIPSegVisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class CLIPSegConfig(PretrainedConfig):
+class CLIPSegConfig(PreTrainedConfig):
r"""
[`CLIPSegConfig`] is the configuration class to store the configuration of a [`CLIPSegModel`]. It is used to
instantiate a CLIPSeg model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the CLIPSeg
[CIDAS/clipseg-rd64](https://huggingface.co/CIDAS/clipseg-rd64) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/clvp/configuration_clvp.py b/src/transformers/models/clvp/configuration_clvp.py
index e5d9957cbd4..6fac97a4012 100644
--- a/src/transformers/models/clvp/configuration_clvp.py
+++ b/src/transformers/models/clvp/configuration_clvp.py
@@ -17,22 +17,22 @@
import os
from typing import Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ClvpEncoderConfig(PretrainedConfig):
+class ClvpEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ClvpEncoder`]. It is used to instantiate a CLVP
text or CLVP speech encoder according to the specified arguments. Instantiating a configuration with the defaults
will yield a similar configuration to that of the encoder of the CLVP
[susnato/clvp_dev](https://huggingface.co/susnato/clvp_dev) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256):
@@ -156,15 +156,15 @@ class ClvpEncoderConfig(PretrainedConfig):
return cls.from_dict(config_dict, **kwargs)
-class ClvpDecoderConfig(PretrainedConfig):
+class ClvpDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ClvpDecoder`]. It is used to instantiate a CLVP
Decoder Model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Decoder part of the CLVP
[susnato/clvp_dev](https://huggingface.co/susnato/clvp_dev) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
The architecture is similar to GPT2.
@@ -313,15 +313,15 @@ class ClvpDecoderConfig(PretrainedConfig):
super().__init__(bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs)
-class ClvpConfig(PretrainedConfig):
+class ClvpConfig(PreTrainedConfig):
r"""
[`ClvpConfig`] is the configuration class to store the configuration of a [`ClvpModelForConditionalGeneration`]. It
is used to instantiate a CLVP model according to the specified arguments, defining the text model, speech model and
decoder model configs. Instantiating a configuration with the defaults will yield a similar configuration to that
of the CLVP [susnato/clvp_dev](https://huggingface.co/susnato/clvp_dev) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/codegen/configuration_codegen.py b/src/transformers/models/codegen/configuration_codegen.py
index 658f3cfca1a..7c78672959d 100644
--- a/src/transformers/models/codegen/configuration_codegen.py
+++ b/src/transformers/models/codegen/configuration_codegen.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any, Optional
from ... import PreTrainedTokenizer, is_torch_available
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging
@@ -27,14 +27,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class CodeGenConfig(PretrainedConfig):
+class CodeGenConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CodeGenModel`]. It is used to instantiate a
CodeGen model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CodeGen
[Salesforce/codegen-2B-mono](https://huggingface.co/Salesforce/codegen-2B-mono) architecture. Configuration objects
- inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from
- [`PretrainedConfig`] for more information.
+ inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the documentation from
+ [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50400):
@@ -150,7 +150,7 @@ class CodeGenConfig(PretrainedConfig):
class CodeGenOnnxConfig(OnnxConfigWithPast):
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
task: str = "default",
patching_specs: Optional[list[PatchingSpec]] = None,
use_past: bool = False,
diff --git a/src/transformers/models/cohere/configuration_cohere.py b/src/transformers/models/cohere/configuration_cohere.py
index c78d1e9bf8a..00e97e42533 100644
--- a/src/transformers/models/cohere/configuration_cohere.py
+++ b/src/transformers/models/cohere/configuration_cohere.py
@@ -19,7 +19,7 @@
# limitations under the License.
"""Cohere model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -27,13 +27,13 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class CohereConfig(PretrainedConfig):
+class CohereConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CohereModel`]. It is used to instantiate an Cohere
model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Instantiating a configuration
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [CohereForAI/c4ai-command-r-v01](https://huggingface.co/CohereForAI/c4ai-command-r-v01) model.
diff --git a/src/transformers/models/cohere2/configuration_cohere2.py b/src/transformers/models/cohere2/configuration_cohere2.py
index c92f63cad31..bfd00c5e853 100644
--- a/src/transformers/models/cohere2/configuration_cohere2.py
+++ b/src/transformers/models/cohere2/configuration_cohere2.py
@@ -19,17 +19,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
-class Cohere2Config(PretrainedConfig):
+class Cohere2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CohereModel`]. It is used to instantiate an Cohere
model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Instantiating a configuration
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [CohereForAI/c4ai-command-r-v01](https://huggingface.co/CohereForAI/c4ai-command-r-v01) model.
diff --git a/src/transformers/models/cohere2/modular_cohere2.py b/src/transformers/models/cohere2/modular_cohere2.py
index 91ed748e036..16c8b23d8bf 100644
--- a/src/transformers/models/cohere2/modular_cohere2.py
+++ b/src/transformers/models/cohere2/modular_cohere2.py
@@ -19,7 +19,7 @@ import torch
import torch.nn as nn
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...masking_utils import create_causal_mask, create_sliding_window_causal_mask
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_outputs import BaseModelOutputWithPast
@@ -44,13 +44,13 @@ from ..gemma2.modeling_gemma2 import Gemma2Model
logger = logging.get_logger(__name__)
-class Cohere2Config(PretrainedConfig):
+class Cohere2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CohereModel`]. It is used to instantiate an Cohere
model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Instantiating a configuration
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [CohereForAI/c4ai-command-r-v01](https://huggingface.co/CohereForAI/c4ai-command-r-v01) model.
diff --git a/src/transformers/models/cohere2_vision/configuration_cohere2_vision.py b/src/transformers/models/cohere2_vision/configuration_cohere2_vision.py
index acc40fcf857..688da89165c 100644
--- a/src/transformers/models/cohere2_vision/configuration_cohere2_vision.py
+++ b/src/transformers/models/cohere2_vision/configuration_cohere2_vision.py
@@ -12,19 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class Cohere2VisionConfig(PretrainedConfig):
+class Cohere2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Cohere2VisionForConditionalGeneration`]. It is used to instantiate an
Cohere2 Vision model according to the specified arguments, defining the model architecture.
[CohereLabs/command-a-vision-07-2025](https://huggingface.co/CohereLabs/command-a-vision-07-2025)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `SiglipVisionConfig`):
diff --git a/src/transformers/models/colpali/configuration_colpali.py b/src/transformers/models/colpali/configuration_colpali.py
index be7eaf47b42..bcdbca3610e 100644
--- a/src/transformers/models/colpali/configuration_colpali.py
+++ b/src/transformers/models/colpali/configuration_colpali.py
@@ -17,14 +17,14 @@
import logging
from copy import deepcopy
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.getLogger(__name__)
-class ColPaliConfig(PretrainedConfig):
+class ColPaliConfig(PreTrainedConfig):
r"""
Configuration class to store the configuration of a [`ColPaliForRetrieval`]. It is used to instantiate an instance
of `ColPaliForRetrieval` according to the specified arguments, defining the model architecture following the methodology
@@ -36,13 +36,13 @@ class ColPaliConfig(PretrainedConfig):
Note that contrarily to what the class name suggests (actually the name refers to the ColPali **methodology**), you can
use a different VLM backbone model than PaliGemma by passing the corresponding VLM configuration to the class constructor.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- vlm_config (`PretrainedConfig`, *optional*):
+ vlm_config (`PreTrainedConfig`, *optional*):
Configuration of the VLM backbone model.
- text_config (`PretrainedConfig`, *optional*):
+ text_config (`PreTrainedConfig`, *optional*):
Configuration of the text backbone model. Overrides the `text_config` attribute of the `vlm_config` if provided.
embedding_dim (`int`, *optional*, defaults to 128):
Dimension of the multi-vector embeddings produced by the model.
@@ -58,7 +58,7 @@ class ColPaliConfig(PretrainedConfig):
"""
model_type = "colpali"
- sub_configs = {"vlm_config": PretrainedConfig, "text_config": AutoConfig}
+ sub_configs = {"vlm_config": PreTrainedConfig, "text_config": AutoConfig}
def __init__(
self,
@@ -83,9 +83,9 @@ class ColPaliConfig(PretrainedConfig):
f"The model type `{vlm_config['model_type']}` is not supported. Please provide a valid model type."
)
vlm_config = CONFIG_MAPPING[vlm_config["model_type"]](**vlm_config)
- elif not isinstance(vlm_config, PretrainedConfig):
+ elif not isinstance(vlm_config, PreTrainedConfig):
raise TypeError(
- f"Invalid type for `vlm_config`. Expected `PretrainedConfig`, `dict`, or `None`, but got {type(vlm_config)}."
+ f"Invalid type for `vlm_config`. Expected `PreTrainedConfig`, `dict`, or `None`, but got {type(vlm_config)}."
)
self.vlm_config = vlm_config
diff --git a/src/transformers/models/colqwen2/configuration_colqwen2.py b/src/transformers/models/colqwen2/configuration_colqwen2.py
index 21f6e46f1f0..bc5256fa5ff 100644
--- a/src/transformers/models/colqwen2/configuration_colqwen2.py
+++ b/src/transformers/models/colqwen2/configuration_colqwen2.py
@@ -16,7 +16,7 @@
from copy import deepcopy
from typing import Any
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING
@@ -24,7 +24,7 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class ColQwen2Config(PretrainedConfig):
+class ColQwen2Config(PreTrainedConfig):
r"""
Configuration class to store the configuration of a [`ColQ2en2ForRetrieval`]. It is used to instantiate an instance
of `ColQwen2ForRetrieval` according to the specified arguments, defining the model architecture following the methodology
@@ -33,11 +33,11 @@ class ColQwen2Config(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to the vision encoder used by the pre-trained
ColQwen2-v1.0 model, e.g. [vidore/colqwen2-v1.0-hf](https://huggingface.co/vidore/colqwen2-v1.0-hf).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- vlm_config (`PretrainedConfig`, *optional*):
+ vlm_config (`PreTrainedConfig`, *optional*):
Configuration of the VLM backbone model.
embedding_dim (`int`, *optional*, defaults to 128):
Dimension of the multi-vector embeddings produced by the model.
@@ -54,7 +54,7 @@ class ColQwen2Config(PretrainedConfig):
"""
model_type = "colqwen2"
- sub_configs: dict[str, Any] = {"vlm_config": PretrainedConfig}
+ sub_configs: dict[str, Any] = {"vlm_config": PreTrainedConfig}
def __init__(
self,
@@ -75,9 +75,9 @@ class ColQwen2Config(PretrainedConfig):
"The `model_type` key is missing in the `vlm_config` dictionary. Please provide the model type."
)
vlm_config = CONFIG_MAPPING[vlm_config["model_type"]](**vlm_config)
- elif not isinstance(vlm_config, PretrainedConfig):
+ elif not isinstance(vlm_config, PreTrainedConfig):
raise TypeError(
- f"Invalid type for `vlm_config`. Expected `PretrainedConfig`, `dict`, or `None`, but got {type(vlm_config)}."
+ f"Invalid type for `vlm_config`. Expected `PreTrainedConfig`, `dict`, or `None`, but got {type(vlm_config)}."
)
self.vlm_config = vlm_config
@@ -85,7 +85,7 @@ class ColQwen2Config(PretrainedConfig):
self.initializer_range = initializer_range
super().__init__(**kwargs)
- def get_text_config(self, *args, **kwargs) -> PretrainedConfig:
+ def get_text_config(self, *args, **kwargs) -> PreTrainedConfig:
return self.vlm_config.get_text_config(*args, **kwargs)
diff --git a/src/transformers/models/conditional_detr/configuration_conditional_detr.py b/src/transformers/models/conditional_detr/configuration_conditional_detr.py
index 26a8ed05140..3b794d73195 100644
--- a/src/transformers/models/conditional_detr/configuration_conditional_detr.py
+++ b/src/transformers/models/conditional_detr/configuration_conditional_detr.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
@@ -29,21 +29,21 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class ConditionalDetrConfig(PretrainedConfig):
+class ConditionalDetrConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ConditionalDetrModel`]. It is used to instantiate
a Conditional DETR model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Conditional DETR
[microsoft/conditional-detr-resnet-50](https://huggingface.co/microsoft/conditional-detr-resnet-50) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_timm_backbone (`bool`, *optional*, defaults to `True`):
Whether or not to use the `timm` library for the backbone. If set to `False`, will use the [`AutoBackbone`]
API.
- backbone_config (`PretrainedConfig` or `dict`, *optional*):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*):
The configuration of the backbone model. Only used in case `use_timm_backbone` is set to `False` in which
case it will default to `ResNetConfig()`.
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/convbert/configuration_convbert.py b/src/transformers/models/convbert/configuration_convbert.py
index a107c7209e9..397f1aa6629 100644
--- a/src/transformers/models/convbert/configuration_convbert.py
+++ b/src/transformers/models/convbert/configuration_convbert.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class ConvBertConfig(PretrainedConfig):
+class ConvBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ConvBertModel`]. It is used to instantiate an
ConvBERT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ConvBERT
[YituTech/conv-bert-base](https://huggingface.co/YituTech/conv-bert-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/convnext/configuration_convnext.py b/src/transformers/models/convnext/configuration_convnext.py
index f54cba58cf2..034fe648cdd 100644
--- a/src/transformers/models/convnext/configuration_convnext.py
+++ b/src/transformers/models/convnext/configuration_convnext.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -28,15 +28,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class ConvNextConfig(BackboneConfigMixin, PretrainedConfig):
+class ConvNextConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ConvNextModel`]. It is used to instantiate an
ConvNeXT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ConvNeXT
[facebook/convnext-tiny-224](https://huggingface.co/facebook/convnext-tiny-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/convnextv2/configuration_convnextv2.py b/src/transformers/models/convnextv2/configuration_convnextv2.py
index 53f1825ca57..99c55fedcc4 100644
--- a/src/transformers/models/convnextv2/configuration_convnextv2.py
+++ b/src/transformers/models/convnextv2/configuration_convnextv2.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""ConvNeXTV2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class ConvNextV2Config(BackboneConfigMixin, PretrainedConfig):
+class ConvNextV2Config(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ConvNextV2Model`]. It is used to instantiate an
ConvNeXTV2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the ConvNeXTV2
[facebook/convnextv2-tiny-1k-224](https://huggingface.co/facebook/convnextv2-tiny-1k-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/cpmant/configuration_cpmant.py b/src/transformers/models/cpmant/configuration_cpmant.py
index c3368d67af7..db210ab5797 100644
--- a/src/transformers/models/cpmant/configuration_cpmant.py
+++ b/src/transformers/models/cpmant/configuration_cpmant.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""CPMAnt model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class CpmAntConfig(PretrainedConfig):
+class CpmAntConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CpmAntModel`]. It is used to instantiate an
CPMAnt model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CPMAnt
[openbmb/cpm-ant-10b](https://huggingface.co/openbmb/cpm-ant-10b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30720):
diff --git a/src/transformers/models/csm/configuration_csm.py b/src/transformers/models/csm/configuration_csm.py
index 6e56c5f7686..5771fa57314 100644
--- a/src/transformers/models/csm/configuration_csm.py
+++ b/src/transformers/models/csm/configuration_csm.py
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
@@ -22,7 +22,7 @@ from ..auto.configuration_auto import AutoConfig
logger = logging.get_logger(__name__)
-class CsmDepthDecoderConfig(PretrainedConfig):
+class CsmDepthDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CsmDepthDecoderModel`]. It is used to instantiate an CSM depth decoder
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield
@@ -30,8 +30,8 @@ class CsmDepthDecoderConfig(PretrainedConfig):
e.g. [sesame/csm-1b](https://huggingface.co/sesame/csm-1b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -204,7 +204,7 @@ class CsmDepthDecoderConfig(PretrainedConfig):
rope_config_validation(self)
-class CsmConfig(PretrainedConfig):
+class CsmConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CsmForConditionalGeneration`]. It is used to instantiate an CSM
model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -212,8 +212,8 @@ class CsmConfig(PretrainedConfig):
e.g. [sesame/csm-1b](https://huggingface.co/sesame/csm-1b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_codebooks (`int`, *optional*, defaults to 32):
@@ -313,7 +313,7 @@ class CsmConfig(PretrainedConfig):
Whether to tie the codebook tokens embeddings of the backbone model to the codebook tokens embeddings of the depth decoder.
depth_decoder_config (`CsmDepthDecoderConfig`, *optional*):
Configuration for the depth decoder.
- codec_config (`PretrainedConfig`, *optional*):
+ codec_config (`PreTrainedConfig`, *optional*):
Configuration for the codec.
```python
@@ -394,7 +394,7 @@ class CsmConfig(PretrainedConfig):
logger.info("codec_config is None, using default audio encoder config.")
elif isinstance(codec_config, dict):
self.codec_config = AutoConfig.for_model(**codec_config)
- elif isinstance(codec_config, PretrainedConfig):
+ elif isinstance(codec_config, PreTrainedConfig):
self.codec_config = codec_config
self.text_vocab_size = text_vocab_size
diff --git a/src/transformers/models/ctrl/configuration_ctrl.py b/src/transformers/models/ctrl/configuration_ctrl.py
index 7a812f0b556..89257003ef3 100644
--- a/src/transformers/models/ctrl/configuration_ctrl.py
+++ b/src/transformers/models/ctrl/configuration_ctrl.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Salesforce CTRL configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class CTRLConfig(PretrainedConfig):
+class CTRLConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`CTRLModel`] or a [`TFCTRLModel`]. It is used to
instantiate a CTRL model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[Salesforce/ctrl](https://huggingface.co/Salesforce/ctrl) architecture from SalesForce.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 246534):
diff --git a/src/transformers/models/cvt/configuration_cvt.py b/src/transformers/models/cvt/configuration_cvt.py
index ba3f6b33962..453c93ad0d9 100644
--- a/src/transformers/models/cvt/configuration_cvt.py
+++ b/src/transformers/models/cvt/configuration_cvt.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""CvT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class CvtConfig(PretrainedConfig):
+class CvtConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`CvtModel`]. It is used to instantiate a CvT model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the CvT
[microsoft/cvt-13](https://huggingface.co/microsoft/cvt-13) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/d_fine/configuration_d_fine.py b/src/transformers/models/d_fine/configuration_d_fine.py
index 7484d9a347e..beb3cf6c056 100644
--- a/src/transformers/models/d_fine/configuration_d_fine.py
+++ b/src/transformers/models/d_fine/configuration_d_fine.py
@@ -18,7 +18,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -29,13 +29,13 @@ logger = logging.get_logger(__name__)
# TODO: Attribute map assignment logic should be fixed in modular
# as well as super() call parsing because otherwise we cannot re-write args after initialization
-class DFineConfig(PretrainedConfig):
+class DFineConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`DFineModel`]. It is used to instantiate a D-FINE
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of D-FINE-X-COCO "[ustc-community/dfine-xlarge-coco"](https://huggingface.co/ustc-community/dfine-xlarge-coco").
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
initializer_range (`float`, *optional*, defaults to 0.01):
@@ -413,12 +413,12 @@ class DFineConfig(PretrainedConfig):
)
@classmethod
- def from_backbone_configs(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_configs(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`DFineConfig`] (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
diff --git a/src/transformers/models/d_fine/modular_d_fine.py b/src/transformers/models/d_fine/modular_d_fine.py
index 9a41fb23308..a7d9f241e71 100644
--- a/src/transformers/models/d_fine/modular_d_fine.py
+++ b/src/transformers/models/d_fine/modular_d_fine.py
@@ -21,7 +21,7 @@ import torch.nn.init as init
from torch import nn
from ...activations import ACT2CLS
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...image_transforms import corners_to_center_format
from ...utils import is_torchdynamo_compiling, logging
from ...utils.backbone_utils import verify_backbone_config_arguments
@@ -48,13 +48,13 @@ logger = logging.get_logger(__name__)
# TODO: Attribute map assignment logic should be fixed in modular
# as well as super() call parsing because otherwise we cannot re-write args after initialization
-class DFineConfig(PretrainedConfig):
+class DFineConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`DFineModel`]. It is used to instantiate a D-FINE
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of D-FINE-X-COCO "[ustc-community/dfine-xlarge-coco"](https://huggingface.co/ustc-community/dfine-xlarge-coco").
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
initializer_range (`float`, *optional*, defaults to 0.01):
@@ -432,12 +432,12 @@ class DFineConfig(PretrainedConfig):
)
@classmethod
- def from_backbone_configs(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_configs(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`DFineConfig`] (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
diff --git a/src/transformers/models/dab_detr/configuration_dab_detr.py b/src/transformers/models/dab_detr/configuration_dab_detr.py
index e53d7783a6f..a5116765f91 100644
--- a/src/transformers/models/dab_detr/configuration_dab_detr.py
+++ b/src/transformers/models/dab_detr/configuration_dab_detr.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""DAB-DETR model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -23,21 +23,21 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class DabDetrConfig(PretrainedConfig):
+class DabDetrConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DabDetrModel`]. It is used to instantiate
a DAB-DETR model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the DAB-DETR
[IDEA-Research/dab_detr-base](https://huggingface.co/IDEA-Research/dab_detr-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_timm_backbone (`bool`, *optional*, defaults to `True`):
Whether or not to use the `timm` library for the backbone. If set to `False`, will use the [`AutoBackbone`]
API.
- backbone_config (`PretrainedConfig` or `dict`, *optional*):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*):
The configuration of the backbone model. Only used in case `use_timm_backbone` is set to `False` in which
case it will default to `ResNetConfig()`.
backbone (`str`, *optional*, defaults to `"resnet50"`):
diff --git a/src/transformers/models/dac/configuration_dac.py b/src/transformers/models/dac/configuration_dac.py
index bdf07cef45b..b7a2d50a3b7 100644
--- a/src/transformers/models/dac/configuration_dac.py
+++ b/src/transformers/models/dac/configuration_dac.py
@@ -18,22 +18,22 @@ import math
import numpy as np
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DacConfig(PretrainedConfig):
+class DacConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`DacModel`]. It is used to instantiate a
Dac model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[descript/dac_16khz](https://huggingface.co/descript/dac_16khz) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
encoder_hidden_size (`int`, *optional*, defaults to 64):
diff --git a/src/transformers/models/data2vec/configuration_data2vec_audio.py b/src/transformers/models/data2vec/configuration_data2vec_audio.py
index 3d88a9de654..d9283bae130 100644
--- a/src/transformers/models/data2vec/configuration_data2vec_audio.py
+++ b/src/transformers/models/data2vec/configuration_data2vec_audio.py
@@ -16,22 +16,22 @@
import math
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Data2VecAudioConfig(PretrainedConfig):
+class Data2VecAudioConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Data2VecAudioModel`]. It is used to instantiate
an Data2VecAudio model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Data2VecAudio
[facebook/data2vec-audio-base-960h](https://huggingface.co/facebook/data2vec-audio-base-960h) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/data2vec/configuration_data2vec_text.py b/src/transformers/models/data2vec/configuration_data2vec_text.py
index f9518d67bf6..938b70f12fe 100644
--- a/src/transformers/models/data2vec/configuration_data2vec_text.py
+++ b/src/transformers/models/data2vec/configuration_data2vec_text.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Data2VecTextConfig(PretrainedConfig):
+class Data2VecTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Data2VecTextModel`] and [`Data2VecTextModel`]. It
is used to instantiate a Data2VecText model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Data2VecText
[facebook/data2vec-text-base](https://huggingface.co/facebook/data2vec-text-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/data2vec/configuration_data2vec_vision.py b/src/transformers/models/data2vec/configuration_data2vec_vision.py
index 2de256f9d7d..970da97e284 100644
--- a/src/transformers/models/data2vec/configuration_data2vec_vision.py
+++ b/src/transformers/models/data2vec/configuration_data2vec_vision.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,7 +27,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Data2VecVisionConfig(PretrainedConfig):
+class Data2VecVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Data2VecVisionModel`]. It is used to instantiate
an Data2VecVision model according to the specified arguments, defining the model architecture. Instantiating a
diff --git a/src/transformers/models/dbrx/configuration_dbrx.py b/src/transformers/models/dbrx/configuration_dbrx.py
index dce1fbdaffb..bb4888f3ee8 100644
--- a/src/transformers/models/dbrx/configuration_dbrx.py
+++ b/src/transformers/models/dbrx/configuration_dbrx.py
@@ -16,21 +16,21 @@
from typing import Any, Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DbrxAttentionConfig(PretrainedConfig):
+class DbrxAttentionConfig(PreTrainedConfig):
"""Configuration class for Dbrx Attention.
[`DbrxAttention`] class. It is used to instantiate attention layers
according to the specified arguments, defining the layers architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
attn_pdrop (`float`, *optional*, defaults to 0.0):
@@ -56,14 +56,14 @@ class DbrxAttentionConfig(PretrainedConfig):
self.kv_n_heads = kv_n_heads
-class DbrxFFNConfig(PretrainedConfig):
+class DbrxFFNConfig(PreTrainedConfig):
"""Configuration class for Dbrx FFN.
[`DbrxFFN`] class. It is used to instantiate feedforward layers according to
the specified arguments, defining the layers architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
ffn_act_fn (`dict`, *optional*, defaults to `None`): A dict specifying activation function for the FFN.
@@ -110,15 +110,15 @@ class DbrxFFNConfig(PretrainedConfig):
raise ValueError(f"Found unknown {kwargs=}")
-class DbrxConfig(PretrainedConfig):
+class DbrxConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DbrxModel`]. It is used to instantiate a Dbrx model according to the
specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a different configuration to that of the [databricks/dbrx-instruct](https://huggingface.co/databricks/dbrx-instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deberta/configuration_deberta.py b/src/transformers/models/deberta/configuration_deberta.py
index 49015eb7cc5..768085916fc 100644
--- a/src/transformers/models/deberta/configuration_deberta.py
+++ b/src/transformers/models/deberta/configuration_deberta.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -30,15 +30,15 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class DebertaConfig(PretrainedConfig):
+class DebertaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DebertaModel`] or a [`TFDebertaModel`]. It is
used to instantiate a DeBERTa model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the DeBERTa
[microsoft/deberta-base](https://huggingface.co/microsoft/deberta-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 50265):
diff --git a/src/transformers/models/deberta_v2/configuration_deberta_v2.py b/src/transformers/models/deberta_v2/configuration_deberta_v2.py
index 43576e815d0..055c0e176a0 100644
--- a/src/transformers/models/deberta_v2/configuration_deberta_v2.py
+++ b/src/transformers/models/deberta_v2/configuration_deberta_v2.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -30,15 +30,15 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class DebertaV2Config(PretrainedConfig):
+class DebertaV2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DebertaV2Model`]. It is used to instantiate a
DeBERTa-v2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the DeBERTa
[microsoft/deberta-v2-xlarge](https://huggingface.co/microsoft/deberta-v2-xlarge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 128100):
diff --git a/src/transformers/models/decision_transformer/configuration_decision_transformer.py b/src/transformers/models/decision_transformer/configuration_decision_transformer.py
index 436834c7e5e..12268319991 100644
--- a/src/transformers/models/decision_transformer/configuration_decision_transformer.py
+++ b/src/transformers/models/decision_transformer/configuration_decision_transformer.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""Decision Transformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DecisionTransformerConfig(PretrainedConfig):
+class DecisionTransformerConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`DecisionTransformerModel`]. It is used to
instantiate a Decision Transformer model according to the specified arguments, defining the model architecture.
@@ -29,8 +29,8 @@ class DecisionTransformerConfig(PretrainedConfig):
DecisionTransformer architecture. Many of the config options are used to instantiate the GPT2 model that is used as
part of the architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deepseek_v2/configuration_deepseek_v2.py b/src/transformers/models/deepseek_v2/configuration_deepseek_v2.py
index 4cc0d07a094..32401bcb8a6 100644
--- a/src/transformers/models/deepseek_v2/configuration_deepseek_v2.py
+++ b/src/transformers/models/deepseek_v2/configuration_deepseek_v2.py
@@ -20,17 +20,17 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class DeepseekV2Config(PretrainedConfig):
+class DeepseekV2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DeepseekV2Model`]. It is used to instantiate a DeepSeek
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of DeepSeek-V2-Lite" [deepseek-ai/DeepSeek-V2-Lite"](https://huggingface.co/deepseek-ai/DeepSeek-V2-Lite").
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
diff --git a/src/transformers/models/deepseek_v2/modular_deepseek_v2.py b/src/transformers/models/deepseek_v2/modular_deepseek_v2.py
index d5b3d992685..af8c9417965 100644
--- a/src/transformers/models/deepseek_v2/modular_deepseek_v2.py
+++ b/src/transformers/models/deepseek_v2/modular_deepseek_v2.py
@@ -49,8 +49,8 @@ class DeepseekV2Config(LlamaConfig):
This is the configuration class to store the configuration of a [`DeepseekV2Model`]. It is used to instantiate a DeepSeek
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of DeepSeek-V2-Lite" [deepseek-ai/DeepSeek-V2-Lite"](https://huggingface.co/deepseek-ai/DeepSeek-V2-Lite").
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
diff --git a/src/transformers/models/deepseek_v3/configuration_deepseek_v3.py b/src/transformers/models/deepseek_v3/configuration_deepseek_v3.py
index 54b32c7a60c..1469ae71861 100644
--- a/src/transformers/models/deepseek_v3/configuration_deepseek_v3.py
+++ b/src/transformers/models/deepseek_v3/configuration_deepseek_v3.py
@@ -16,21 +16,21 @@
# limitations under the License.
"""DeepSeekV3 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
-class DeepseekV3Config(PretrainedConfig):
+class DeepseekV3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DeepseekV3Model`]. It is used to instantiate an DeepSeek
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the DeepSeek-V3.
e.g. [bzantium/tiny-deepseek-v3](https://huggingface.co/bzantium/tiny-deepseek-v3)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deepseek_vl/configuration_deepseek_vl.py b/src/transformers/models/deepseek_vl/configuration_deepseek_vl.py
index b3abae5af0a..4fe3a5e4d82 100644
--- a/src/transformers/models/deepseek_vl/configuration_deepseek_vl.py
+++ b/src/transformers/models/deepseek_vl/configuration_deepseek_vl.py
@@ -20,7 +20,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -28,15 +28,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class DeepseekVLConfig(PretrainedConfig):
+class DeepseekVLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DeepseekVLModel`]. It is used to instantiate a
DeepseekVL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DeepseekVL
[deepseek-community/deepseek-vl-1.3b-chat](https://huggingface.co/deepseek-community/deepseek-vl-1.3b-chat) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `LlamaConfig`):
diff --git a/src/transformers/models/deepseek_vl/modular_deepseek_vl.py b/src/transformers/models/deepseek_vl/modular_deepseek_vl.py
index ce2f9be16ae..ed5f7d655e3 100644
--- a/src/transformers/models/deepseek_vl/modular_deepseek_vl.py
+++ b/src/transformers/models/deepseek_vl/modular_deepseek_vl.py
@@ -17,7 +17,7 @@ from typing import Optional, Union
import torch
import torch.nn as nn
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...image_processing_utils import BatchFeature
from ...image_utils import ImageInput
from ...processing_utils import ProcessingKwargs, ProcessorMixin, Unpack
@@ -39,15 +39,15 @@ from ..janus.modeling_janus import JanusForConditionalGeneration, JanusModel, Ja
logger = logging.get_logger(__name__)
-class DeepseekVLConfig(PretrainedConfig):
+class DeepseekVLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DeepseekVLModel`]. It is used to instantiate a
DeepseekVL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DeepseekVL
[deepseek-community/deepseek-vl-1.3b-chat](https://huggingface.co/deepseek-community/deepseek-vl-1.3b-chat) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `LlamaConfig`):
diff --git a/src/transformers/models/deepseek_vl_hybrid/configuration_deepseek_vl_hybrid.py b/src/transformers/models/deepseek_vl_hybrid/configuration_deepseek_vl_hybrid.py
index e8c6e2df6ea..6a99cc4dab9 100644
--- a/src/transformers/models/deepseek_vl_hybrid/configuration_deepseek_vl_hybrid.py
+++ b/src/transformers/models/deepseek_vl_hybrid/configuration_deepseek_vl_hybrid.py
@@ -20,7 +20,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -28,15 +28,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class DeepseekVLHybridConfig(PretrainedConfig):
+class DeepseekVLHybridConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DeepseekVLHybridModel`]. It is used to instantiate a
DeepseekVLHybrid model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DeepseekVLHybrid
[deepseek-community/deepseek-vl-7b-chat](https://huggingface.co/deepseek-community/deepseek-vl-7b-chat) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `LlamaConfig`):
diff --git a/src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py b/src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py
index 1507c9f3d02..7c7dddd1d28 100644
--- a/src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py
+++ b/src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py
@@ -86,8 +86,8 @@ class DeepseekVLHybridConfig(DeepseekVLConfig):
with the defaults will yield a similar configuration to that of the DeepseekVLHybrid
[deepseek-community/deepseek-vl-7b-chat](https://huggingface.co/deepseek-community/deepseek-vl-7b-chat) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `LlamaConfig`):
diff --git a/src/transformers/models/deformable_detr/configuration_deformable_detr.py b/src/transformers/models/deformable_detr/configuration_deformable_detr.py
index b85a7399908..ccd546b979d 100644
--- a/src/transformers/models/deformable_detr/configuration_deformable_detr.py
+++ b/src/transformers/models/deformable_detr/configuration_deformable_detr.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Deformable DETR model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -23,21 +23,21 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class DeformableDetrConfig(PretrainedConfig):
+class DeformableDetrConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DeformableDetrModel`]. It is used to instantiate
a Deformable DETR model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Deformable DETR
[SenseTime/deformable-detr](https://huggingface.co/SenseTime/deformable-detr) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_timm_backbone (`bool`, *optional*, defaults to `True`):
Whether or not to use the `timm` library for the backbone. If set to `False`, will use the [`AutoBackbone`]
API.
- backbone_config (`PretrainedConfig` or `dict`, *optional*):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*):
The configuration of the backbone model. Only used in case `use_timm_backbone` is set to `False` in which
case it will default to `ResNetConfig()`.
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/deit/configuration_deit.py b/src/transformers/models/deit/configuration_deit.py
index 8909fe5aff6..984d93eea92 100644
--- a/src/transformers/models/deit/configuration_deit.py
+++ b/src/transformers/models/deit/configuration_deit.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,7 +27,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class DeiTConfig(PretrainedConfig):
+class DeiTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DeiTModel`]. It is used to instantiate an DeiT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -35,8 +35,8 @@ class DeiTConfig(PretrainedConfig):
[facebook/deit-base-distilled-patch16-224](https://huggingface.co/facebook/deit-base-distilled-patch16-224)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/deta/configuration_deta.py b/src/transformers/models/deprecated/deta/configuration_deta.py
index 2109902ac06..e4861ff0f0f 100644
--- a/src/transformers/models/deprecated/deta/configuration_deta.py
+++ b/src/transformers/models/deprecated/deta/configuration_deta.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""DETA model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
from ...auto import CONFIG_MAPPING
@@ -22,18 +22,18 @@ from ...auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class DetaConfig(PretrainedConfig):
+class DetaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DetaModel`]. It is used to instantiate a DETA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the DETA
[SenseTime/deformable-detr](https://huggingface.co/SenseTime/deformable-detr) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
diff --git a/src/transformers/models/deprecated/efficientformer/configuration_efficientformer.py b/src/transformers/models/deprecated/efficientformer/configuration_efficientformer.py
index 9aaee649ba0..feb173c3d88 100644
--- a/src/transformers/models/deprecated/efficientformer/configuration_efficientformer.py
+++ b/src/transformers/models/deprecated/efficientformer/configuration_efficientformer.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""EfficientFormer model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class EfficientFormerConfig(PretrainedConfig):
+class EfficientFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`EfficientFormerModel`]. It is used to
instantiate an EfficientFormer model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the EfficientFormer
[snap-research/efficientformer-l1](https://huggingface.co/snap-research/efficientformer-l1) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
depths (`List(int)`, *optional*, defaults to `[3, 2, 6, 4]`)
diff --git a/src/transformers/models/deprecated/ernie_m/configuration_ernie_m.py b/src/transformers/models/deprecated/ernie_m/configuration_ernie_m.py
index 839b17b11bf..aa08a1d05c7 100644
--- a/src/transformers/models/deprecated/ernie_m/configuration_ernie_m.py
+++ b/src/transformers/models/deprecated/ernie_m/configuration_ernie_m.py
@@ -17,10 +17,10 @@
from __future__ import annotations
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
-class ErnieMConfig(PretrainedConfig):
+class ErnieMConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ErnieMModel`]. It is used to instantiate a
Ernie-M model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -28,8 +28,8 @@ class ErnieMConfig(PretrainedConfig):
[susnato/ernie-m-base_pytorch](https://huggingface.co/susnato/ernie-m-base_pytorch) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 250002):
diff --git a/src/transformers/models/deprecated/gptsan_japanese/configuration_gptsan_japanese.py b/src/transformers/models/deprecated/gptsan_japanese/configuration_gptsan_japanese.py
index a7d1e23e080..424a35b241d 100644
--- a/src/transformers/models/deprecated/gptsan_japanese/configuration_gptsan_japanese.py
+++ b/src/transformers/models/deprecated/gptsan_japanese/configuration_gptsan_japanese.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""GPTSAN-japanese model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class GPTSanJapaneseConfig(PretrainedConfig):
+class GPTSanJapaneseConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GPTSanJapaneseModel`]. It is used to instantiate
a GPTSANJapanese model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the GPTSANJapanese
[Tanrei/GPTSAN-japanese](https://huggingface.co/Tanrei/GPTSAN-japanese) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 36000):
diff --git a/src/transformers/models/deprecated/graphormer/configuration_graphormer.py b/src/transformers/models/deprecated/graphormer/configuration_graphormer.py
index 81c13c6a802..1a2bb9587d5 100644
--- a/src/transformers/models/deprecated/graphormer/configuration_graphormer.py
+++ b/src/transformers/models/deprecated/graphormer/configuration_graphormer.py
@@ -16,22 +16,22 @@
from typing import Optional
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class GraphormerConfig(PretrainedConfig):
+class GraphormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`~GraphormerModel`]. It is used to instantiate an
Graphormer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Graphormer
[graphormer-base-pcqm4mv1](https://huggingface.co/graphormer-base-pcqm4mv1) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/jukebox/configuration_jukebox.py b/src/transformers/models/deprecated/jukebox/configuration_jukebox.py
index 9bb2e3da54a..1c9b44cebe4 100644
--- a/src/transformers/models/deprecated/jukebox/configuration_jukebox.py
+++ b/src/transformers/models/deprecated/jukebox/configuration_jukebox.py
@@ -17,7 +17,7 @@
import os
from typing import Union
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
@@ -136,7 +136,7 @@ ATTENTION_PATTERNS = {
}
-class JukeboxPriorConfig(PretrainedConfig):
+class JukeboxPriorConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`JukeboxPrior`]. It is used to instantiate a
`JukeboxPrior` according to the specified arguments, defining the model architecture. Instantiating a
@@ -144,8 +144,8 @@ class JukeboxPriorConfig(PretrainedConfig):
[openai/jukebox-1b-lyrics](https://huggingface.co/openai/jukebox
-1b-lyrics) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
@@ -364,15 +364,15 @@ class JukeboxPriorConfig(PretrainedConfig):
return cls.from_dict(config_dict, **kwargs)
-class JukeboxVQVAEConfig(PretrainedConfig):
+class JukeboxVQVAEConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`JukeboxVQVAE`]. It is used to instantiate a
`JukeboxVQVAE` according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VQVAE from
[openai/jukebox-1b-lyrics](https://huggingface.co/openai/jukebox-1b-lyrics) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
act_fn (`str`, *optional*, defaults to `"relu"`):
@@ -488,12 +488,12 @@ class JukeboxVQVAEConfig(PretrainedConfig):
return cls.from_dict(config_dict, **kwargs)
-class JukeboxConfig(PretrainedConfig):
+class JukeboxConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`JukeboxModel`].
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Instantiating a configuration with the defaults will
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Instantiating a configuration with the defaults will
yield a similar configuration to that of
[openai/jukebox-1b-lyrics](https://huggingface.co/openai/jukebox-1b-lyrics) architecture.
diff --git a/src/transformers/models/deprecated/mctct/configuration_mctct.py b/src/transformers/models/deprecated/mctct/configuration_mctct.py
index 984dca4a62b..b6767ec9b65 100644
--- a/src/transformers/models/deprecated/mctct/configuration_mctct.py
+++ b/src/transformers/models/deprecated/mctct/configuration_mctct.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""M-CTC-T model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class MCTCTConfig(PretrainedConfig):
+class MCTCTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MCTCTModel`]. It is used to instantiate an
M-CTC-T model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the M-CTC-T
[speechbrain/m-ctc-t-large](https://huggingface.co/speechbrain/m-ctc-t-large) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/mega/configuration_mega.py b/src/transformers/models/deprecated/mega/configuration_mega.py
index 0ede2cac66b..6ec419e2493 100644
--- a/src/transformers/models/deprecated/mega/configuration_mega.py
+++ b/src/transformers/models/deprecated/mega/configuration_mega.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....onnx import OnnxConfig
from ....utils import logging
@@ -25,15 +25,15 @@ from ....utils import logging
logger = logging.get_logger(__name__)
-class MegaConfig(PretrainedConfig):
+class MegaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MegaModel`]. It is used to instantiate a Mega
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Mega
[mnaylor/mega-base-wikitext](https://huggingface.co/mnaylor/mega-base-wikitext) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/nat/configuration_nat.py b/src/transformers/models/deprecated/nat/configuration_nat.py
index 002eaa7f82b..c4de795e057 100644
--- a/src/transformers/models/deprecated/nat/configuration_nat.py
+++ b/src/transformers/models/deprecated/nat/configuration_nat.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Neighborhood Attention Transformer model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
from ....utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ....utils.backbone_utils import BackboneConfigMixin, get_aligned_output_fea
logger = logging.get_logger(__name__)
-class NatConfig(BackboneConfigMixin, PretrainedConfig):
+class NatConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`NatModel`]. It is used to instantiate a Nat model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Nat
[shi-labs/nat-mini-in1k-224](https://huggingface.co/shi-labs/nat-mini-in1k-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
patch_size (`int`, *optional*, defaults to 4):
diff --git a/src/transformers/models/deprecated/nezha/configuration_nezha.py b/src/transformers/models/deprecated/nezha/configuration_nezha.py
index 00d193cd1ae..77ed0c2f66d 100644
--- a/src/transformers/models/deprecated/nezha/configuration_nezha.py
+++ b/src/transformers/models/deprecated/nezha/configuration_nezha.py
@@ -1,15 +1,15 @@
-from .... import PretrainedConfig
+from .... import PreTrainedConfig
-class NezhaConfig(PretrainedConfig):
+class NezhaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`NezhaModel`]. It is used to instantiate an Nezha
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Nezha
[sijunhe/nezha-cn-base](https://huggingface.co/sijunhe/nezha-cn-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/open_llama/configuration_open_llama.py b/src/transformers/models/deprecated/open_llama/configuration_open_llama.py
index b4bc9cc72a7..32827d00775 100644
--- a/src/transformers/models/deprecated/open_llama/configuration_open_llama.py
+++ b/src/transformers/models/deprecated/open_llama/configuration_open_llama.py
@@ -19,22 +19,22 @@
# limitations under the License.
"""Open-Llama model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class OpenLlamaConfig(PretrainedConfig):
+class OpenLlamaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`OpenLlamaModel`]. It is used to instantiate an
Open-Llama model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[s-JoL/Open-Llama-V1](https://huggingface.co/s-JoL/Open-Llama-V1).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/qdqbert/configuration_qdqbert.py b/src/transformers/models/deprecated/qdqbert/configuration_qdqbert.py
index 91ac82bc5a0..20e65ba2340 100644
--- a/src/transformers/models/deprecated/qdqbert/configuration_qdqbert.py
+++ b/src/transformers/models/deprecated/qdqbert/configuration_qdqbert.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""QDQBERT model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class QDQBertConfig(PretrainedConfig):
+class QDQBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`QDQBertModel`]. It is used to instantiate an
QDQBERT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the BERT
[google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/realm/configuration_realm.py b/src/transformers/models/deprecated/realm/configuration_realm.py
index fbf32378a60..6c6f9d4cea7 100644
--- a/src/transformers/models/deprecated/realm/configuration_realm.py
+++ b/src/transformers/models/deprecated/realm/configuration_realm.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""REALM model configuration."""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class RealmConfig(PretrainedConfig):
+class RealmConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of
@@ -37,8 +37,8 @@ class RealmConfig(PretrainedConfig):
[google/realm-cc-news-pretrained-embedder](https://huggingface.co/google/realm-cc-news-pretrained-embedder)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/retribert/configuration_retribert.py b/src/transformers/models/deprecated/retribert/configuration_retribert.py
index 80d755a1696..cfa30aa2ad6 100644
--- a/src/transformers/models/deprecated/retribert/configuration_retribert.py
+++ b/src/transformers/models/deprecated/retribert/configuration_retribert.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""RetriBERT model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class RetriBertConfig(PretrainedConfig):
+class RetriBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RetriBertModel`]. It is used to instantiate a
RetriBertModel model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the RetriBERT
[yjernite/retribert-base-uncased](https://huggingface.co/yjernite/retribert-base-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/speech_to_text_2/configuration_speech_to_text_2.py b/src/transformers/models/deprecated/speech_to_text_2/configuration_speech_to_text_2.py
index a7cde922740..9128840ce9d 100644
--- a/src/transformers/models/deprecated/speech_to_text_2/configuration_speech_to_text_2.py
+++ b/src/transformers/models/deprecated/speech_to_text_2/configuration_speech_to_text_2.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Speech2Text model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class Speech2Text2Config(PretrainedConfig):
+class Speech2Text2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Speech2Text2ForCausalLM`]. It is used to
instantiate an Speech2Text2 model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Speech2Text2
[facebook/s2t-wav2vec2-large-en-de](https://huggingface.co/facebook/s2t-wav2vec2-large-en-de) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py b/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py
index 5a267cc4c4b..1e3a5f5ddb1 100644
--- a/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py
+++ b/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""TrajectoryTransformer model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class TrajectoryTransformerConfig(PretrainedConfig):
+class TrajectoryTransformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TrajectoryTransformerModel`]. It is used to
instantiate an TrajectoryTransformer model according to the specified arguments, defining the model architecture.
@@ -30,8 +30,8 @@ class TrajectoryTransformerConfig(PretrainedConfig):
[CarlCochet/trajectory-transformer-halfcheetah-medium-v2](https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py
index b7926246c4c..4b349a76eb3 100644
--- a/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py
+++ b/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py
@@ -15,22 +15,22 @@
# limitations under the License.
"""Transformer XL configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class TransfoXLConfig(PretrainedConfig):
+class TransfoXLConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`TransfoXLModel`] or a [`TFTransfoXLModel`]. It is
used to instantiate a Transformer-XL model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the TransfoXL
[transfo-xl/transfo-xl-wt103](https://huggingface.co/transfo-xl/transfo-xl-wt103) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 267735):
diff --git a/src/transformers/models/deprecated/tvlt/configuration_tvlt.py b/src/transformers/models/deprecated/tvlt/configuration_tvlt.py
index 57144e349f5..e3cd88760cb 100644
--- a/src/transformers/models/deprecated/tvlt/configuration_tvlt.py
+++ b/src/transformers/models/deprecated/tvlt/configuration_tvlt.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""TVLT model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class TvltConfig(PretrainedConfig):
+class TvltConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TvltModel`]. It is used to instantiate a TVLT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the TVLT
[ZinengTang/tvlt-base](https://huggingface.co/ZinengTang/tvlt-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/deprecated/van/configuration_van.py b/src/transformers/models/deprecated/van/configuration_van.py
index be94e45ec63..33ffea192dd 100644
--- a/src/transformers/models/deprecated/van/configuration_van.py
+++ b/src/transformers/models/deprecated/van/configuration_van.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""VAN model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class VanConfig(PretrainedConfig):
+class VanConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VanModel`]. It is used to instantiate a VAN model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the VAN
[Visual-Attention-Network/van-base](https://huggingface.co/Visual-Attention-Network/van-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/deprecated/vit_hybrid/configuration_vit_hybrid.py b/src/transformers/models/deprecated/vit_hybrid/configuration_vit_hybrid.py
index e96c6c4a1b5..534c5f463b8 100644
--- a/src/transformers/models/deprecated/vit_hybrid/configuration_vit_hybrid.py
+++ b/src/transformers/models/deprecated/vit_hybrid/configuration_vit_hybrid.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""ViT Hybrid model configuration"""
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
from ...auto.configuration_auto import CONFIG_MAPPING
from ...bit import BitConfig
@@ -23,18 +23,18 @@ from ...bit import BitConfig
logger = logging.get_logger(__name__)
-class ViTHybridConfig(PretrainedConfig):
+class ViTHybridConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ViTHybridModel`]. It is used to instantiate a ViT
Hybrid model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ViT Hybrid
[google/vit-hybrid-base-bit-384](https://huggingface.co/google/vit-hybrid-base-bit-384) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*):
+ backbone_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*):
The configuration of the backbone in a dictionary or the config object of the backbone.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
diff --git a/src/transformers/models/deprecated/xlm_prophetnet/configuration_xlm_prophetnet.py b/src/transformers/models/deprecated/xlm_prophetnet/configuration_xlm_prophetnet.py
index 59f42577c59..ba019716437 100644
--- a/src/transformers/models/deprecated/xlm_prophetnet/configuration_xlm_prophetnet.py
+++ b/src/transformers/models/deprecated/xlm_prophetnet/configuration_xlm_prophetnet.py
@@ -16,14 +16,14 @@
from typing import Callable, Optional, Union
-from ....configuration_utils import PretrainedConfig
+from ....configuration_utils import PreTrainedConfig
from ....utils import logging
logger = logging.get_logger(__name__)
-class XLMProphetNetConfig(PretrainedConfig):
+class XLMProphetNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`XLMProphetNetModel`]. It is used to instantiate a
XLMProphetNet model according to the specified arguments, defining the model architecture. Instantiating a
@@ -31,8 +31,8 @@ class XLMProphetNetConfig(PretrainedConfig):
[microsoft/xprophetnet-large-wiki100-cased](https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
activation_dropout (`float`, *optional*, defaults to 0.1):
diff --git a/src/transformers/models/depth_anything/configuration_depth_anything.py b/src/transformers/models/depth_anything/configuration_depth_anything.py
index 65884fe67c3..bf8b70f03fd 100644
--- a/src/transformers/models/depth_anything/configuration_depth_anything.py
+++ b/src/transformers/models/depth_anything/configuration_depth_anything.py
@@ -16,7 +16,7 @@
import copy
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto.configuration_auto import CONFIG_MAPPING
@@ -25,18 +25,18 @@ from ..auto.configuration_auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class DepthAnythingConfig(PretrainedConfig):
+class DepthAnythingConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DepthAnythingModel`]. It is used to instantiate a DepthAnything
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the DepthAnything
[LiheYoung/depth-anything-small-hf](https://huggingface.co/LiheYoung/depth-anything-small-hf) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*):
+ backbone_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*):
The configuration of the backbone model. Only used in case `is_hybrid` is `True` or in case you want to
leverage the [`AutoBackbone`] API.
backbone (`str`, *optional*):
@@ -161,7 +161,7 @@ class DepthAnythingConfig(PretrainedConfig):
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`]. Returns:
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`]. Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
"""
output = copy.deepcopy(self.__dict__)
diff --git a/src/transformers/models/depth_pro/configuration_depth_pro.py b/src/transformers/models/depth_pro/configuration_depth_pro.py
index 69bfffeb93f..8817420dffe 100644
--- a/src/transformers/models/depth_pro/configuration_depth_pro.py
+++ b/src/transformers/models/depth_pro/configuration_depth_pro.py
@@ -16,7 +16,7 @@
from copy import deepcopy
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING, AutoConfig
@@ -24,15 +24,15 @@ from ..auto.configuration_auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class DepthProConfig(PretrainedConfig):
+class DepthProConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DepthProModel`]. It is used to instantiate a
DepthPro model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DepthPro
[apple/DepthPro](https://huggingface.co/apple/DepthPro) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
fusion_hidden_size (`int`, *optional*, defaults to 256):
@@ -61,13 +61,13 @@ class DepthProConfig(PretrainedConfig):
Whether to use `DepthProFovModel` to generate the field of view.
num_fov_head_layers (`int`, *optional*, defaults to 2):
Number of convolution layers in the head of `DepthProFovModel`.
- image_model_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*):
+ image_model_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*):
The configuration of the image encoder model, which is loaded using the [`AutoModel`] API.
By default, Dinov2 model is used as backbone.
- patch_model_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*):
+ patch_model_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*):
The configuration of the patch encoder model, which is loaded using the [`AutoModel`] API.
By default, Dinov2 model is used as backbone.
- fov_model_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*):
+ fov_model_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*):
The configuration of the fov encoder model, which is loaded using the [`AutoModel`] API.
By default, Dinov2 model is used as backbone.
@@ -187,7 +187,7 @@ class DepthProConfig(PretrainedConfig):
)
sub_config.update({"image_size": patch_size})
sub_config = CONFIG_MAPPING[sub_config["model_type"]](**sub_config)
- elif isinstance(sub_config, PretrainedConfig):
+ elif isinstance(sub_config, PreTrainedConfig):
image_size = getattr(sub_config, "image_size", None)
if image_size != patch_size:
raise ValueError(
@@ -195,7 +195,7 @@ class DepthProConfig(PretrainedConfig):
)
else:
raise TypeError(
- f"Invalid type for `sub_config`. Expected `PretrainedConfig`, `dict`, or `None`, but got {type(sub_config)}."
+ f"Invalid type for `sub_config`. Expected `PreTrainedConfig`, `dict`, or `None`, but got {type(sub_config)}."
)
setattr(self, sub_config_key, sub_config)
diff --git a/src/transformers/models/detr/configuration_detr.py b/src/transformers/models/detr/configuration_detr.py
index c9540382927..f7c80b704ce 100644
--- a/src/transformers/models/detr/configuration_detr.py
+++ b/src/transformers/models/detr/configuration_detr.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
@@ -29,21 +29,21 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class DetrConfig(PretrainedConfig):
+class DetrConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DetrModel`]. It is used to instantiate a DETR
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the DETR
[facebook/detr-resnet-50](https://huggingface.co/facebook/detr-resnet-50) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_timm_backbone (`bool`, *optional*, defaults to `True`):
Whether or not to use the `timm` library for the backbone. If set to `False`, will use the [`AutoBackbone`]
API.
- backbone_config (`PretrainedConfig` or `dict`, *optional*):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*):
The configuration of the backbone model. Only used in case `use_timm_backbone` is set to `False` in which
case it will default to `ResNetConfig()`.
num_channels (`int`, *optional*, defaults to 3):
@@ -261,11 +261,11 @@ class DetrConfig(PretrainedConfig):
)
@classmethod
- def from_backbone_config(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_config(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`DetrConfig`] (or a derived class) from a pre-trained backbone model configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
[`DetrConfig`]: An instance of a configuration object
diff --git a/src/transformers/models/dia/configuration_dia.py b/src/transformers/models/dia/configuration_dia.py
index d4dec60b3e4..c487781fc94 100644
--- a/src/transformers/models/dia/configuration_dia.py
+++ b/src/transformers/models/dia/configuration_dia.py
@@ -16,7 +16,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -24,13 +24,13 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class DiaEncoderConfig(PretrainedConfig):
+class DiaEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DiaEncoder`]. It is used to instantiate a Dia
encoder according to the specified arguments, defining the encoder architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
max_position_embeddings (`int`, *optional*, defaults to 1024):
@@ -138,13 +138,13 @@ class DiaEncoderConfig(PretrainedConfig):
super().__init__(**kwargs)
-class DiaDecoderConfig(PretrainedConfig):
+class DiaDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DiaDecoder`]. It is used to instantiate a Dia
decoder according to the specified arguments, defining the decoder architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
max_position_embeddings (`int`, *optional*, defaults to 3072):
@@ -279,15 +279,15 @@ class DiaDecoderConfig(PretrainedConfig):
super().__init__(is_encoder_decoder=is_encoder_decoder, **kwargs)
-class DiaConfig(PretrainedConfig):
+class DiaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DiaModel`]. It is used to instantiate a
Dia model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[nari-labs/Dia-1.6B](https://huggingface.co/nari-labs/Dia-1.6B) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
encoder_config (`DiaEncoderConfig`, *optional*):
diff --git a/src/transformers/models/diffllama/configuration_diffllama.py b/src/transformers/models/diffllama/configuration_diffllama.py
index 21060727192..26902fcc278 100644
--- a/src/transformers/models/diffllama/configuration_diffllama.py
+++ b/src/transformers/models/diffllama/configuration_diffllama.py
@@ -17,18 +17,18 @@
# limitations under the License.
"""DiffLlama model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class DiffLlamaConfig(PretrainedConfig):
+class DiffLlamaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DiffLlamaModel`]. It is used to instantiate an DiffLlama
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults
will yield a similar configuration to that of the [kajuma/DiffLlama-0.3B-handcut](https://huggingface.co/kajuma/DiffLlama-0.3B-handcut).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/dinat/configuration_dinat.py b/src/transformers/models/dinat/configuration_dinat.py
index f7d7fa509c5..35307e6a42f 100644
--- a/src/transformers/models/dinat/configuration_dinat.py
+++ b/src/transformers/models/dinat/configuration_dinat.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Dilated Neighborhood Attention Transformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class DinatConfig(BackboneConfigMixin, PretrainedConfig):
+class DinatConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DinatModel`]. It is used to instantiate a Dinat
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Dinat
[shi-labs/dinat-mini-in1k-224](https://huggingface.co/shi-labs/dinat-mini-in1k-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
patch_size (`int`, *optional*, defaults to 4):
diff --git a/src/transformers/models/dinov2/configuration_dinov2.py b/src/transformers/models/dinov2/configuration_dinov2.py
index 55fa0539a23..f00d0fc6c24 100644
--- a/src/transformers/models/dinov2/configuration_dinov2.py
+++ b/src/transformers/models/dinov2/configuration_dinov2.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -28,15 +28,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class Dinov2Config(BackboneConfigMixin, PretrainedConfig):
+class Dinov2Config(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Dinov2Model`]. It is used to instantiate an
Dinov2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Dinov2
[google/dinov2-base-patch16-224](https://huggingface.co/google/dinov2-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
diff --git a/src/transformers/models/dinov2_with_registers/configuration_dinov2_with_registers.py b/src/transformers/models/dinov2_with_registers/configuration_dinov2_with_registers.py
index ec4f446fc68..8bcd5936d78 100644
--- a/src/transformers/models/dinov2_with_registers/configuration_dinov2_with_registers.py
+++ b/src/transformers/models/dinov2_with_registers/configuration_dinov2_with_registers.py
@@ -20,19 +20,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
-class Dinov2WithRegistersConfig(BackboneConfigMixin, PretrainedConfig):
+class Dinov2WithRegistersConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Dinov2WithRegistersModel`]. It is used to instantiate an
Dinov2WithRegisters model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DINOv2 with Registers
[facebook/dinov2-with-registers-base](https://huggingface.co/facebook/dinov2-with-registers-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
diff --git a/src/transformers/models/dinov2_with_registers/modular_dinov2_with_registers.py b/src/transformers/models/dinov2_with_registers/modular_dinov2_with_registers.py
index 02c33e33d26..05a843361db 100644
--- a/src/transformers/models/dinov2_with_registers/modular_dinov2_with_registers.py
+++ b/src/transformers/models/dinov2_with_registers/modular_dinov2_with_registers.py
@@ -27,7 +27,7 @@ from ....transformers.models.dinov2.modeling_dinov2 import (
Dinov2PatchEmbeddings,
Dinov2PreTrainedModel,
)
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_outputs import BackboneOutput, BaseModelOutput, BaseModelOutputWithPooling, ImageClassifierOutput
from ...processing_utils import Unpack
from ...utils import TransformersKwargs, logging, torch_int
@@ -37,15 +37,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class Dinov2WithRegistersConfig(BackboneConfigMixin, PretrainedConfig):
+class Dinov2WithRegistersConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Dinov2WithRegistersModel`]. It is used to instantiate an
Dinov2WithRegisters model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DINOv2 with Registers
[facebook/dinov2-with-registers-base](https://huggingface.co/facebook/dinov2-with-registers-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
diff --git a/src/transformers/models/dinov3_convnext/configuration_dinov3_convnext.py b/src/transformers/models/dinov3_convnext/configuration_dinov3_convnext.py
index fa593e10ec1..e2422545c46 100644
--- a/src/transformers/models/dinov3_convnext/configuration_dinov3_convnext.py
+++ b/src/transformers/models/dinov3_convnext/configuration_dinov3_convnext.py
@@ -16,22 +16,22 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DINOv3ConvNextConfig(PretrainedConfig):
+class DINOv3ConvNextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DINOv3ConvNextModel`]. It is used to instantiate an
DINOv3ConvNext model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DINOv3ConvNext
[facebook/dinov3-convnext-tiny-pretrain-lvd1689m](https://huggingface.co/facebook/dinov3-convnext-tiny-pretrain-lvd1689m) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/dinov3_vit/configuration_dinov3_vit.py b/src/transformers/models/dinov3_vit/configuration_dinov3_vit.py
index 78cbd200ce6..ce1fd939e18 100644
--- a/src/transformers/models/dinov3_vit/configuration_dinov3_vit.py
+++ b/src/transformers/models/dinov3_vit/configuration_dinov3_vit.py
@@ -16,22 +16,22 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DINOv3ViTConfig(PretrainedConfig):
+class DINOv3ViTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DINOv3Model`]. It is used to instantiate an
DINOv3 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the DINOv3
[facebook/dinov3-vits16-pretrain-lvd1689m](https://huggingface.co/facebook/dinov3-vits16-pretrain-lvd1689m) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
patch_size (`int`, *optional*, defaults to 16):
diff --git a/src/transformers/models/distilbert/configuration_distilbert.py b/src/transformers/models/distilbert/configuration_distilbert.py
index 0aa6d2dfd7c..93b38a32d53 100644
--- a/src/transformers/models/distilbert/configuration_distilbert.py
+++ b/src/transformers/models/distilbert/configuration_distilbert.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class DistilBertConfig(PretrainedConfig):
+class DistilBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DistilBertModel`] or a [`TFDistilBertModel`]. It
is used to instantiate a DistilBERT model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the DistilBERT
[distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
diff --git a/src/transformers/models/distilbert/modeling_distilbert.py b/src/transformers/models/distilbert/modeling_distilbert.py
index 48fc12cbcbf..f6e220e9f11 100755
--- a/src/transformers/models/distilbert/modeling_distilbert.py
+++ b/src/transformers/models/distilbert/modeling_distilbert.py
@@ -26,7 +26,7 @@ from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
from ...activations import get_activation
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...integrations.deepspeed import is_deepspeed_zero3_enabled
from ...modeling_attn_mask_utils import _prepare_4d_attention_mask, _prepare_4d_attention_mask_for_sdpa
from ...modeling_layers import GradientCheckpointingLayer
@@ -85,7 +85,7 @@ def _create_sinusoidal_embeddings(n_pos: int, dim: int, out: torch.Tensor):
class Embeddings(nn.Module):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__()
self.word_embeddings = nn.Embedding(config.vocab_size, config.dim, padding_idx=config.pad_token_id)
self.position_embeddings = nn.Embedding(config.max_position_embeddings, config.dim)
@@ -153,7 +153,7 @@ def eager_attention_forward(
class DistilBertSelfAttention(nn.Module):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__()
self.config = config
@@ -227,7 +227,7 @@ class DistilBertSelfAttention(nn.Module):
class FFN(nn.Module):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__()
self.dropout = nn.Dropout(p=config.dropout)
self.chunk_size_feed_forward = config.chunk_size_feed_forward
@@ -248,7 +248,7 @@ class FFN(nn.Module):
class TransformerBlock(GradientCheckpointingLayer):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__()
# Have an even number of Configure multi-heads
@@ -283,7 +283,7 @@ class TransformerBlock(GradientCheckpointingLayer):
class Transformer(nn.Module):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__()
self.n_layers = config.n_layers
self.layer = nn.ModuleList([TransformerBlock(config) for _ in range(config.n_layers)])
@@ -341,7 +341,7 @@ class DistilBertPreTrainedModel(PreTrainedModel):
@auto_docstring
class DistilBertModel(DistilBertPreTrainedModel):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__(config)
self.embeddings = Embeddings(config) # Embeddings
@@ -481,7 +481,7 @@ class DistilBertModel(DistilBertPreTrainedModel):
class DistilBertForMaskedLM(DistilBertPreTrainedModel):
_tied_weights_keys = ["vocab_projector.weight"]
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__(config)
self.activation = get_activation(config.activation)
@@ -583,7 +583,7 @@ class DistilBertForMaskedLM(DistilBertPreTrainedModel):
"""
)
class DistilBertForSequenceClassification(DistilBertPreTrainedModel):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__(config)
self.num_labels = config.num_labels
self.config = config
@@ -681,7 +681,7 @@ class DistilBertForSequenceClassification(DistilBertPreTrainedModel):
@auto_docstring
class DistilBertForQuestionAnswering(DistilBertPreTrainedModel):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__(config)
self.distilbert = DistilBertModel(config)
@@ -783,7 +783,7 @@ class DistilBertForQuestionAnswering(DistilBertPreTrainedModel):
@auto_docstring
class DistilBertForTokenClassification(DistilBertPreTrainedModel):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__(config)
self.num_labels = config.num_labels
@@ -858,7 +858,7 @@ class DistilBertForTokenClassification(DistilBertPreTrainedModel):
@auto_docstring
class DistilBertForMultipleChoice(DistilBertPreTrainedModel):
- def __init__(self, config: PretrainedConfig):
+ def __init__(self, config: PreTrainedConfig):
super().__init__(config)
self.distilbert = DistilBertModel(config)
diff --git a/src/transformers/models/doge/configuration_doge.py b/src/transformers/models/doge/configuration_doge.py
index f3a93fa198f..4cbc2b866c1 100644
--- a/src/transformers/models/doge/configuration_doge.py
+++ b/src/transformers/models/doge/configuration_doge.py
@@ -20,17 +20,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class DogeConfig(PretrainedConfig):
+class DogeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DogeModel`]. It is used to instantiate an Doge
model according to the specified arguments, defining the model architecture like [SmallDoge/Doge-320M](https://huggingface.co/SmallDoge/Doge-320M).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32768):
diff --git a/src/transformers/models/doge/modular_doge.py b/src/transformers/models/doge/modular_doge.py
index 0d1a1e06afb..efe9cbb0cad 100644
--- a/src/transformers/models/doge/modular_doge.py
+++ b/src/transformers/models/doge/modular_doge.py
@@ -25,7 +25,7 @@ from torch import nn
from ...activations import ACT2FN
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...integrations.flex_attention import compile_friendly_flex_attention
from ...modeling_layers import GradientCheckpointingLayer
from ...modeling_outputs import MoeCausalLMOutputWithPast, MoeModelOutputWithPast
@@ -52,13 +52,13 @@ if is_torch_flex_attn_available():
from torch.nn.attention.flex_attention import BlockMask
-class DogeConfig(PretrainedConfig):
+class DogeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DogeModel`]. It is used to instantiate an Doge
model according to the specified arguments, defining the model architecture like [SmallDoge/Doge-320M](https://huggingface.co/SmallDoge/Doge-320M).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32768):
diff --git a/src/transformers/models/donut/configuration_donut_swin.py b/src/transformers/models/donut/configuration_donut_swin.py
index 9aac07dace7..fc99888ae73 100644
--- a/src/transformers/models/donut/configuration_donut_swin.py
+++ b/src/transformers/models/donut/configuration_donut_swin.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Donut Swin Transformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DonutSwinConfig(PretrainedConfig):
+class DonutSwinConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DonutSwinModel`]. It is used to instantiate a
Donut model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Donut
[naver-clova-ix/donut-base](https://huggingface.co/naver-clova-ix/donut-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/dots1/configuration_dots1.py b/src/transformers/models/dots1/configuration_dots1.py
index cabe44f391b..092662e004f 100644
--- a/src/transformers/models/dots1/configuration_dots1.py
+++ b/src/transformers/models/dots1/configuration_dots1.py
@@ -12,22 +12,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...utils import logging
logger = logging.get_logger(__name__)
-class Dots1Config(PretrainedConfig):
+class Dots1Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Dots1Model`]. It is used to instantiate a
`dots.llm1` model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of
[rednote-hilab/dots.llm1.base](https://huggingface.co/rednote-hilab/dots.llm1.base).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 152064):
diff --git a/src/transformers/models/dpr/configuration_dpr.py b/src/transformers/models/dpr/configuration_dpr.py
index 03b16900249..dc2fd4833b6 100644
--- a/src/transformers/models/dpr/configuration_dpr.py
+++ b/src/transformers/models/dpr/configuration_dpr.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""DPR model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DPRConfig(PretrainedConfig):
+class DPRConfig(PreTrainedConfig):
r"""
[`DPRConfig`] is the configuration class to store the configuration of a *DPRModel*.
diff --git a/src/transformers/models/dpt/configuration_dpt.py b/src/transformers/models/dpt/configuration_dpt.py
index 37bfa25ff6c..a217616a8b3 100644
--- a/src/transformers/models/dpt/configuration_dpt.py
+++ b/src/transformers/models/dpt/configuration_dpt.py
@@ -16,7 +16,7 @@
import copy
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto.configuration_auto import CONFIG_MAPPING
@@ -26,15 +26,15 @@ from ..bit import BitConfig
logger = logging.get_logger(__name__)
-class DPTConfig(PretrainedConfig):
+class DPTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`DPTModel`]. It is used to instantiate an DPT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the DPT
[Intel/dpt-large](https://huggingface.co/Intel/dpt-large) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -104,7 +104,7 @@ class DPTConfig(PretrainedConfig):
Used only for the `hybrid` embedding type. The shape of the feature maps of the backbone.
neck_ignore_stages (`list[int]`, *optional*, defaults to `[0, 1]`):
Used only for the `hybrid` embedding type. The stages of the readout layers to ignore.
- backbone_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*):
+ backbone_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*):
The configuration of the backbone model. Only used in case `is_hybrid` is `True` or in case you want to
leverage the [`AutoBackbone`] API.
backbone (`str`, *optional*):
@@ -200,9 +200,9 @@ class DPTConfig(PretrainedConfig):
if isinstance(backbone_config, dict):
logger.info("Initializing the config with a `BiT` backbone.")
backbone_config = BitConfig(**backbone_config)
- elif not isinstance(backbone_config, PretrainedConfig):
+ elif not isinstance(backbone_config, PreTrainedConfig):
raise ValueError(
- f"backbone_config must be a dictionary or a `PretrainedConfig`, got {backbone_config.__class__}."
+ f"backbone_config must be a dictionary or a `PreTrainedConfig`, got {backbone_config.__class__}."
)
self.backbone_config = backbone_config
self.backbone_featmap_shape = backbone_featmap_shape
@@ -277,7 +277,7 @@ class DPTConfig(PretrainedConfig):
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`]. Returns:
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`]. Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
"""
output = copy.deepcopy(self.__dict__)
diff --git a/src/transformers/models/edgetam/configuration_edgetam.py b/src/transformers/models/edgetam/configuration_edgetam.py
index 07ccee36e93..a260b279bac 100644
--- a/src/transformers/models/edgetam/configuration_edgetam.py
+++ b/src/transformers/models/edgetam/configuration_edgetam.py
@@ -19,22 +19,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class EdgeTamVisionConfig(PretrainedConfig):
+class EdgeTamVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EdgeTamVisionModel`]. It is used to instantiate a SAM
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
defaults will yield a similar configuration to that of SAM 2.1 Hiera-tiny
[facebook/EdgeTAM](https://huggingface.co/facebook/EdgeTAM) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`Union[dict, "PretrainedConfig"]`, *optional*):
+ backbone_config (`Union[dict, "PreTrainedConfig"]`, *optional*):
Configuration for the vision backbone. This is used to instantiate the backbone using
`AutoModel.from_config`.
backbone_channel_list (`List[int]`, *optional*, defaults to `[384, 192, 96, 48]`):
@@ -120,13 +120,13 @@ class EdgeTamVisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class EdgeTamPromptEncoderConfig(PretrainedConfig):
+class EdgeTamPromptEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EdgeTamPromptEncoder`]. The [`EdgeTamPromptEncoder`]
module is used to encode the input 2D points and bounding boxes.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -172,13 +172,13 @@ class EdgeTamPromptEncoderConfig(PretrainedConfig):
self.scale = scale
-class EdgeTamMaskDecoderConfig(PretrainedConfig):
+class EdgeTamMaskDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EdgeTamMaskDecoder`]. It is used to instantiate a EDGETAM
memory encoder according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -245,15 +245,15 @@ class EdgeTamMaskDecoderConfig(PretrainedConfig):
self.attention_downsample_rate = attention_downsample_rate
-class EdgeTamConfig(PretrainedConfig):
+class EdgeTamConfig(PreTrainedConfig):
r"""
[`EdgeTamConfig`] is the configuration class to store the configuration of a [`EdgeTamModel`]. It is used to instantiate a
EDGETAM model according to the specified arguments, defining the memory attention, memory encoder, and image encoder
configs. Instantiating a configuration defaults will yield a similar configuration to that of the SAM 2.1 Hiera-tiny
[facebook/edgetam.1-hiera-tiny](https://huggingface.co/facebook/edgetam.1-hiera-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `EdgeTamVisionConfig`], *optional*):
diff --git a/src/transformers/models/edgetam/modular_edgetam.py b/src/transformers/models/edgetam/modular_edgetam.py
index e26d58d96b8..2489a57c11c 100644
--- a/src/transformers/models/edgetam/modular_edgetam.py
+++ b/src/transformers/models/edgetam/modular_edgetam.py
@@ -33,7 +33,7 @@ from transformers.models.sam2.modeling_sam2 import (
)
from transformers.utils.generic import TransformersKwargs, check_model_inputs
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...processing_utils import Unpack
from ...utils import (
auto_docstring,
@@ -46,18 +46,18 @@ if True:
from transformers.models.timm_wrapper.modeling_timm_wrapper import TimmWrapperModel
-class EdgeTamVisionConfig(PretrainedConfig):
+class EdgeTamVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EdgeTamVisionModel`]. It is used to instantiate a SAM
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
defaults will yield a similar configuration to that of SAM 2.1 Hiera-tiny
[facebook/EdgeTAM](https://huggingface.co/facebook/EdgeTAM) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`Union[dict, "PretrainedConfig"]`, *optional*):
+ backbone_config (`Union[dict, "PreTrainedConfig"]`, *optional*):
Configuration for the vision backbone. This is used to instantiate the backbone using
`AutoModel.from_config`.
backbone_channel_list (`List[int]`, *optional*, defaults to `[384, 192, 96, 48]`):
diff --git a/src/transformers/models/edgetam_video/configuration_edgetam_video.py b/src/transformers/models/edgetam_video/configuration_edgetam_video.py
index 954864397dc..01d62318a25 100644
--- a/src/transformers/models/edgetam_video/configuration_edgetam_video.py
+++ b/src/transformers/models/edgetam_video/configuration_edgetam_video.py
@@ -19,17 +19,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class EdgeTamVideoPromptEncoderConfig(PretrainedConfig):
+class EdgeTamVideoPromptEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EdgeTamVideoPromptEncoder`]. The [`EdgeTamVideoPromptEncoder`]
module is used to encode the input 2D points and bounding boxes.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -75,13 +75,13 @@ class EdgeTamVideoPromptEncoderConfig(PretrainedConfig):
self.scale = scale
-class EdgeTamVideoMaskDecoderConfig(PretrainedConfig):
+class EdgeTamVideoMaskDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EdgeTamVideoMaskDecoder`]. It is used to instantiate a EDGETAM_VIDEO
memory encoder according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -148,15 +148,15 @@ class EdgeTamVideoMaskDecoderConfig(PretrainedConfig):
self.attention_downsample_rate = attention_downsample_rate
-class EdgeTamVideoConfig(PretrainedConfig):
+class EdgeTamVideoConfig(PreTrainedConfig):
r"""
[`EdgeTamVideoConfig`] is the configuration class to store the configuration of a [`EdgeTamVideoModel`]. It is used to instantiate a
EDGETAM model according to the specified arguments, defining the memory attention, memory encoder, and image encoder
configs. Instantiating a configuration defaults will yield a similar configuration to that of the SAM 2.1 Hiera-tiny
[facebook/EdgeTAM](https://huggingface.co/facebook/EdgeTAM) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `EdgeTamVideoVisionConfig`], *optional*):
diff --git a/src/transformers/models/edgetam_video/modular_edgetam_video.py b/src/transformers/models/edgetam_video/modular_edgetam_video.py
index b520cd5a756..0ea22587111 100644
--- a/src/transformers/models/edgetam_video/modular_edgetam_video.py
+++ b/src/transformers/models/edgetam_video/modular_edgetam_video.py
@@ -28,7 +28,7 @@ from transformers.models.sam2.modeling_sam2 import (
from transformers.utils.generic import OutputRecorder
from ...activations import ACT2FN
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS
from ...processing_utils import Unpack
@@ -75,8 +75,8 @@ class EdgeTamVideoConfig(Sam2VideoConfig):
configs. Instantiating a configuration defaults will yield a similar configuration to that of the SAM 2.1 Hiera-tiny
[facebook/EdgeTAM](https://huggingface.co/facebook/EdgeTAM) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `EdgeTamVideoVisionConfig`], *optional*):
@@ -274,7 +274,7 @@ class EdgeTamVideoConfig(Sam2VideoConfig):
memory_fuser_hidden_act="gelu",
**kwargs,
):
- PretrainedConfig.__init__(**kwargs)
+ PreTrainedConfig.__init__(**kwargs)
vision_config = vision_config if vision_config is not None else {}
prompt_encoder_config = prompt_encoder_config if prompt_encoder_config is not None else {}
mask_decoder_config = mask_decoder_config if mask_decoder_config is not None else {}
diff --git a/src/transformers/models/efficientloftr/configuration_efficientloftr.py b/src/transformers/models/efficientloftr/configuration_efficientloftr.py
index d2dff4de374..09d7a7b9a07 100644
--- a/src/transformers/models/efficientloftr/configuration_efficientloftr.py
+++ b/src/transformers/models/efficientloftr/configuration_efficientloftr.py
@@ -13,19 +13,19 @@
# limitations under the License.
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class EfficientLoFTRConfig(PretrainedConfig):
+class EfficientLoFTRConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EfficientLoFTRFromKeypointMatching`].
It is used to instantiate a EfficientLoFTR model according to the specified arguments, defining the model
architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the
EfficientLoFTR [zju-community/efficientloftr](https://huggingface.co/zju-community/efficientloftr) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
stage_num_blocks (`List`, *optional*, defaults to [1, 2, 4, 14]):
diff --git a/src/transformers/models/efficientnet/configuration_efficientnet.py b/src/transformers/models/efficientnet/configuration_efficientnet.py
index 54931190290..1520c99b6d1 100644
--- a/src/transformers/models/efficientnet/configuration_efficientnet.py
+++ b/src/transformers/models/efficientnet/configuration_efficientnet.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class EfficientNetConfig(PretrainedConfig):
+class EfficientNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EfficientNetModel`]. It is used to instantiate an
EfficientNet model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the EfficientNet
[google/efficientnet-b7](https://huggingface.co/google/efficientnet-b7) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/electra/configuration_electra.py b/src/transformers/models/electra/configuration_electra.py
index f12756d976b..fc577e42e75 100644
--- a/src/transformers/models/electra/configuration_electra.py
+++ b/src/transformers/models/electra/configuration_electra.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -26,15 +26,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class ElectraConfig(PretrainedConfig):
+class ElectraConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ElectraModel`] or a [`TFElectraModel`]. It is
used to instantiate a ELECTRA model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the ELECTRA
[google/electra-small-discriminator](https://huggingface.co/google/electra-small-discriminator) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/emu3/configuration_emu3.py b/src/transformers/models/emu3/configuration_emu3.py
index 79407bfbf0d..3d737806ee1 100644
--- a/src/transformers/models/emu3/configuration_emu3.py
+++ b/src/transformers/models/emu3/configuration_emu3.py
@@ -16,18 +16,18 @@
from typing import Any, Optional, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class Emu3VQVAEConfig(PretrainedConfig):
+class Emu3VQVAEConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Emu3VQVAE`]. It is used to instantiate an VQ-VAE
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a configuration to the VQ model presented in Emu3 paper.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
codebook_size (`int`, *optional*, defaults to 32768):
Codebook size of the VQ model.
@@ -110,15 +110,15 @@ class Emu3VQVAEConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class Emu3TextConfig(PretrainedConfig):
+class Emu3TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Emu3TextModel`]. It is used to instantiate a
emu3 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[Emu3-community/Emu3-Chat-hf](https://huggingface.co/Emu3-community/Emu3-Chat-hf).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -276,15 +276,15 @@ class Emu3TextConfig(PretrainedConfig):
)
-class Emu3Config(PretrainedConfig):
+class Emu3Config(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`Emu3Model`]. It is used to instantiate a
emu3 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[Emu3-community/Emu3-Chat-hf](https://huggingface.co/Emu3-community/Emu3-Chat-hf).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/encodec/configuration_encodec.py b/src/transformers/models/encodec/configuration_encodec.py
index b4bb7b11a40..fe3e03b0022 100644
--- a/src/transformers/models/encodec/configuration_encodec.py
+++ b/src/transformers/models/encodec/configuration_encodec.py
@@ -19,22 +19,22 @@ from typing import Optional
import numpy as np
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class EncodecConfig(PretrainedConfig):
+class EncodecConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`EncodecModel`]. It is used to instantiate a
Encodec model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[facebook/encodec_24khz](https://huggingface.co/facebook/encodec_24khz) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
target_bandwidths (`list[float]`, *optional*, defaults to `[1.5, 3.0, 6.0, 12.0, 24.0]`):
diff --git a/src/transformers/models/encoder_decoder/configuration_encoder_decoder.py b/src/transformers/models/encoder_decoder/configuration_encoder_decoder.py
index af57b2596ce..041c653bad1 100644
--- a/src/transformers/models/encoder_decoder/configuration_encoder_decoder.py
+++ b/src/transformers/models/encoder_decoder/configuration_encoder_decoder.py
@@ -15,7 +15,7 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import AutoConfig
@@ -23,22 +23,22 @@ from ..auto import AutoConfig
logger = logging.get_logger(__name__)
-class EncoderDecoderConfig(PretrainedConfig):
+class EncoderDecoderConfig(PreTrainedConfig):
r"""
[`EncoderDecoderConfig`] is the configuration class to store the configuration of a [`EncoderDecoderModel`]. It is
used to instantiate an Encoder Decoder model according to the specified arguments, defining the encoder and decoder
configs.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **encoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the encoder config.
- - **decoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **decoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the decoder config.
Examples:
@@ -92,8 +92,8 @@ class EncoderDecoderConfig(PretrainedConfig):
@classmethod
def from_encoder_decoder_configs(
- cls, encoder_config: PretrainedConfig, decoder_config: PretrainedConfig, **kwargs
- ) -> PretrainedConfig:
+ cls, encoder_config: PreTrainedConfig, decoder_config: PreTrainedConfig, **kwargs
+ ) -> PreTrainedConfig:
r"""
Instantiate a [`EncoderDecoderConfig`] (or a derived class) from a pre-trained encoder model configuration and
decoder model configuration.
diff --git a/src/transformers/models/encoder_decoder/modeling_encoder_decoder.py b/src/transformers/models/encoder_decoder/modeling_encoder_decoder.py
index 37e3cb7a1d6..5e35cc4f3b2 100644
--- a/src/transformers/models/encoder_decoder/modeling_encoder_decoder.py
+++ b/src/transformers/models/encoder_decoder/modeling_encoder_decoder.py
@@ -23,7 +23,7 @@ from torch import nn
from torch.nn import CrossEntropyLoss
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...modeling_outputs import BaseModelOutput, Seq2SeqLMOutput
from ...modeling_utils import PreTrainedModel
@@ -82,7 +82,7 @@ class EncoderDecoderModel(PreTrainedModel, GenerationMixin):
def __init__(
self,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
encoder: Optional[PreTrainedModel] = None,
decoder: Optional[PreTrainedModel] = None,
):
diff --git a/src/transformers/models/eomt/configuration_eomt.py b/src/transformers/models/eomt/configuration_eomt.py
index 67025072115..58cb35d2762 100644
--- a/src/transformers/models/eomt/configuration_eomt.py
+++ b/src/transformers/models/eomt/configuration_eomt.py
@@ -19,10 +19,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class EomtConfig(PretrainedConfig):
+class EomtConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EomtForUniversalSegmentation`]. It is used to instantiate an EoMT model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -30,8 +30,8 @@ class EomtConfig(PretrainedConfig):
[tue-mps/coco_panoptic_eomt_large_640](https://huggingface.co/tue-mps/coco_panoptic_eomt_large_640)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
diff --git a/src/transformers/models/eomt/modular_eomt.py b/src/transformers/models/eomt/modular_eomt.py
index 807a130c764..823cf59d98d 100644
--- a/src/transformers/models/eomt/modular_eomt.py
+++ b/src/transformers/models/eomt/modular_eomt.py
@@ -56,8 +56,8 @@ class EomtConfig(ViTConfig):
[tue-mps/coco_panoptic_eomt_large_640](https://huggingface.co/tue-mps/coco_panoptic_eomt_large_640)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
diff --git a/src/transformers/models/ernie/configuration_ernie.py b/src/transformers/models/ernie/configuration_ernie.py
index abf300f0ce5..f39af6b3479 100644
--- a/src/transformers/models/ernie/configuration_ernie.py
+++ b/src/transformers/models/ernie/configuration_ernie.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -26,15 +26,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class ErnieConfig(PretrainedConfig):
+class ErnieConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ErnieModel`] or a [`TFErnieModel`]. It is used to
instantiate a ERNIE model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the ERNIE
[nghuyong/ernie-3.0-base-zh](https://huggingface.co/nghuyong/ernie-3.0-base-zh) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/ernie4_5/configuration_ernie4_5.py b/src/transformers/models/ernie4_5/configuration_ernie4_5.py
index e6e2795b5da..c8539c1adf9 100644
--- a/src/transformers/models/ernie4_5/configuration_ernie4_5.py
+++ b/src/transformers/models/ernie4_5/configuration_ernie4_5.py
@@ -13,19 +13,19 @@
# limitations under the License.
"""Ernie 4.5 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class Ernie4_5Config(PretrainedConfig):
+class Ernie4_5Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Ernie4_5Model`]. It is used to instantiate an Ernie 4.5
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Ernie 4.5 0.3B.
e.g. [baidu/ERNIE-4.5-0.3B-PT](https://huggingface.co/baidu/ERNIE-4.5-0.3B-PT)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/ernie4_5_moe/configuration_ernie4_5_moe.py b/src/transformers/models/ernie4_5_moe/configuration_ernie4_5_moe.py
index 294ccfc638c..e7ebe24e0e8 100644
--- a/src/transformers/models/ernie4_5_moe/configuration_ernie4_5_moe.py
+++ b/src/transformers/models/ernie4_5_moe/configuration_ernie4_5_moe.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""Ernie 4.5 MoE model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -21,14 +21,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Ernie4_5_MoeConfig(PretrainedConfig):
+class Ernie4_5_MoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Ernie4_5_MoeModel`]. It is used to instantiate a
Ernie 4.5 MoE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of [baidu/ERNIE-4.5-21B-A3B-PT](https://huggingface.co/baidu/ERNIE-4.5-21B-A3B-PT).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/esm/configuration_esm.py b/src/transformers/models/esm/configuration_esm.py
index fabfb4ebd6d..a156e678045 100644
--- a/src/transformers/models/esm/configuration_esm.py
+++ b/src/transformers/models/esm/configuration_esm.py
@@ -17,7 +17,7 @@
from dataclasses import asdict, dataclass
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
@@ -26,15 +26,15 @@ logger = logging.get_logger(__name__)
# TODO Update this
-class EsmConfig(PretrainedConfig):
+class EsmConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ESMModel`]. It is used to instantiate a ESM model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ESM
[facebook/esm-1b](https://huggingface.co/facebook/esm-1b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -159,7 +159,7 @@ class EsmConfig(PretrainedConfig):
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`].
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`].
Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
@@ -193,7 +193,7 @@ class EsmFoldConfig:
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`].
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`].
Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
@@ -258,7 +258,7 @@ class TrunkConfig:
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`].
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`].
Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
diff --git a/src/transformers/models/evolla/configuration_evolla.py b/src/transformers/models/evolla/configuration_evolla.py
index f6d0361e95f..01d95d1c586 100644
--- a/src/transformers/models/evolla/configuration_evolla.py
+++ b/src/transformers/models/evolla/configuration_evolla.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Evolla model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,12 +22,12 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class SaProtConfig(PretrainedConfig):
+class SaProtConfig(PreTrainedConfig):
r"""This is the configuration class to store the configuration of a [`EvollaSaProtProteinEncoder`]. It is used to instantiate a
SaProt model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 446):
@@ -97,7 +97,7 @@ class SaProtConfig(PretrainedConfig):
self.token_dropout = token_dropout
-class EvollaConfig(PretrainedConfig):
+class EvollaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`EvollaModel`]. It is used to instantiate an
Evolla model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -105,8 +105,8 @@ class EvollaConfig(PretrainedConfig):
e.g. [westlake-repl/Evolla-10B-hf](https://huggingface.co/westlake-repl/Evolla-10B-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
protein_encoder_config (`dict`, *optional*):
diff --git a/src/transformers/models/exaone4/configuration_exaone4.py b/src/transformers/models/exaone4/configuration_exaone4.py
index 8c3c07ecb41..7eac2bd588c 100644
--- a/src/transformers/models/exaone4/configuration_exaone4.py
+++ b/src/transformers/models/exaone4/configuration_exaone4.py
@@ -19,17 +19,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
-class Exaone4Config(PretrainedConfig):
+class Exaone4Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Exaone4Model`]. It is used to
instantiate a EXAONE 4.0 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the EXAONE-4.0-32B [LGAI-EXAONE/EXAONE-4.0-32B](https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-32B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model
- outputs. Read the documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model
+ outputs. Read the documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 102400):
diff --git a/src/transformers/models/exaone4/modular_exaone4.py b/src/transformers/models/exaone4/modular_exaone4.py
index 7530a68f322..20f59e4bc34 100644
--- a/src/transformers/models/exaone4/modular_exaone4.py
+++ b/src/transformers/models/exaone4/modular_exaone4.py
@@ -23,7 +23,7 @@ from torch import nn
from transformers.utils.generic import check_model_inputs
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...masking_utils import create_causal_mask, create_sliding_window_causal_mask
from ...modeling_outputs import (
BaseModelOutputWithPast,
@@ -57,14 +57,14 @@ _CHECKPOINT_FOR_DOC = "LGAI-EXAONE/EXAONE-4.0-32B"
_CONFIG_FOR_DOC = "Exaone4Config"
-class Exaone4Config(PretrainedConfig):
+class Exaone4Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Exaone4Model`]. It is used to
instantiate a EXAONE 4.0 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the EXAONE-4.0-32B [LGAI-EXAONE/EXAONE-4.0-32B](https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-32B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model
- outputs. Read the documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model
+ outputs. Read the documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 102400):
diff --git a/src/transformers/models/falcon/configuration_falcon.py b/src/transformers/models/falcon/configuration_falcon.py
index d3155c8eb9c..27e12b43dca 100644
--- a/src/transformers/models/falcon/configuration_falcon.py
+++ b/src/transformers/models/falcon/configuration_falcon.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Falcon configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class FalconConfig(PretrainedConfig):
+class FalconConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FalconModel`]. It is used to instantiate a Falcon
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the
[tiiuae/falcon-7b](https://huggingface.co/tiiuae/falcon-7b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/falcon_h1/configuration_falcon_h1.py b/src/transformers/models/falcon_h1/configuration_falcon_h1.py
index 8e9aaaf3405..fc46100ab92 100644
--- a/src/transformers/models/falcon_h1/configuration_falcon_h1.py
+++ b/src/transformers/models/falcon_h1/configuration_falcon_h1.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""FalconH1 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class FalconH1Config(PretrainedConfig):
+class FalconH1Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FalconH1Model`]. It is used to instantiate a
FalconH1Model model according to the specified arguments, defining the model architecture. Instantiating a configuration
with defaults taken from [ibm-fms/FalconH1-9.8b-2.2T-hf](https://huggingface.co/ibm-fms/FalconH1-9.8b-2.2T-hf).
The FalconH1Model is a hybrid [mamba2](https://github.com/state-spaces/mamba) architecture with SwiGLU.
The checkpoints are jointly trained by IBM, Princeton, and UIUC.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 128000):
Vocabulary size of the FalconH1 model. Defines the number of different tokens that can be represented by the
diff --git a/src/transformers/models/falcon_mamba/configuration_falcon_mamba.py b/src/transformers/models/falcon_mamba/configuration_falcon_mamba.py
index 7630ebd6343..93730940c9a 100644
--- a/src/transformers/models/falcon_mamba/configuration_falcon_mamba.py
+++ b/src/transformers/models/falcon_mamba/configuration_falcon_mamba.py
@@ -21,18 +21,18 @@
import math
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class FalconMambaConfig(PretrainedConfig):
+class FalconMambaConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`FalconMambaModel`]. It is used to instantiate a FALCON_MAMBA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the FALCON_MAMBA
[tiiuae/falcon-mamba-7b](https://huggingface.co/tiiuae/falcon-mamba-7b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py b/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py
index 2cd4f21a928..71011df8798 100644
--- a/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py
+++ b/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py
@@ -28,7 +28,7 @@ from torch import nn
from torch.nn import CrossEntropyLoss
from ...activations import ACT2FN
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...modeling_layers import GradientCheckpointingLayer
from ...modeling_utils import PreTrainedModel
@@ -64,7 +64,7 @@ class FalconMambaCache:
Cache for falcon_mamba model which does not have attention mechanism and key value states.
Arguments:
- config (`PretrainedConfig):
+ config (`PreTrainedConfig):
The configuration file defining the shape-related attributes required to initialize the static cache.
max_batch_size (`int`):
The maximum batch size with which the model will be used. Note that a new instance must be instantiated if
@@ -98,7 +98,7 @@ class FalconMambaCache:
# TODO (joao): add layer_device_map arg and update code in `generate` accordingly
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
max_batch_size: int,
dtype: torch.dtype = torch.float16,
device: Union[torch.device, str, None] = None,
diff --git a/src/transformers/models/falcon_mamba/modular_falcon_mamba.py b/src/transformers/models/falcon_mamba/modular_falcon_mamba.py
index 6df2be3a265..5370e5fe19d 100644
--- a/src/transformers/models/falcon_mamba/modular_falcon_mamba.py
+++ b/src/transformers/models/falcon_mamba/modular_falcon_mamba.py
@@ -64,8 +64,8 @@ class FalconMambaConfig(MambaConfig):
defaults will yield a similar configuration to that of the FALCON_MAMBA
[tiiuae/falcon-mamba-7b](https://huggingface.co/tiiuae/falcon-mamba-7b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -205,7 +205,7 @@ class FalconMambaCache(MambaCache):
Cache for falcon_mamba model which does not have attention mechanism and key value states.
Arguments:
- config (`PretrainedConfig):
+ config (`PreTrainedConfig):
The configuration file defining the shape-related attributes required to initialize the static cache.
max_batch_size (`int`):
The maximum batch size with which the model will be used. Note that a new instance must be instantiated if
diff --git a/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py b/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py
index 89d65a261c6..64c6a4eac8d 100644
--- a/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py
+++ b/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py
@@ -16,14 +16,14 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class FastSpeech2ConformerConfig(PretrainedConfig):
+class FastSpeech2ConformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FastSpeech2ConformerModel`]. It is used to
instantiate a FastSpeech2Conformer model according to the specified arguments, defining the model architecture.
@@ -31,8 +31,8 @@ class FastSpeech2ConformerConfig(PretrainedConfig):
FastSpeech2Conformer [espnet/fastspeech2_conformer](https://huggingface.co/espnet/fastspeech2_conformer)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 384):
@@ -325,7 +325,7 @@ class FastSpeech2ConformerConfig(PretrainedConfig):
)
-class FastSpeech2ConformerHifiGanConfig(PretrainedConfig):
+class FastSpeech2ConformerHifiGanConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FastSpeech2ConformerHifiGanModel`]. It is used to
instantiate a FastSpeech2Conformer HiFi-GAN vocoder model according to the specified arguments, defining the model
@@ -333,8 +333,8 @@ class FastSpeech2ConformerHifiGanConfig(PretrainedConfig):
FastSpeech2Conformer
[espnet/fastspeech2_conformer_hifigan](https://huggingface.co/espnet/fastspeech2_conformer_hifigan) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
model_in_dim (`int`, *optional*, defaults to 80):
@@ -405,7 +405,7 @@ class FastSpeech2ConformerHifiGanConfig(PretrainedConfig):
super().__init__(**kwargs)
-class FastSpeech2ConformerWithHifiGanConfig(PretrainedConfig):
+class FastSpeech2ConformerWithHifiGanConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`FastSpeech2ConformerWithHifiGan`]. It is used to
instantiate a `FastSpeech2ConformerWithHifiGanModel` model according to the specified sub-models configurations,
@@ -416,8 +416,8 @@ class FastSpeech2ConformerWithHifiGanConfig(PretrainedConfig):
FastSpeech2ConformerHifiGan
[espnet/fastspeech2_conformer_hifigan](https://huggingface.co/espnet/fastspeech2_conformer_hifigan) architectures.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
model_config (`typing.Dict`, *optional*):
diff --git a/src/transformers/models/flaubert/configuration_flaubert.py b/src/transformers/models/flaubert/configuration_flaubert.py
index 071a74fe69b..d0773d7b2e4 100644
--- a/src/transformers/models/flaubert/configuration_flaubert.py
+++ b/src/transformers/models/flaubert/configuration_flaubert.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class FlaubertConfig(PretrainedConfig):
+class FlaubertConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`FlaubertModel`] or a [`TFFlaubertModel`]. It is
used to instantiate a FlauBERT model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the FlauBERT
[flaubert/flaubert_base_uncased](https://huggingface.co/flaubert/flaubert_base_uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
pre_norm (`bool`, *optional*, defaults to `False`):
diff --git a/src/transformers/models/flava/configuration_flava.py b/src/transformers/models/flava/configuration_flava.py
index b7bcb920e47..b5fcee2374f 100644
--- a/src/transformers/models/flava/configuration_flava.py
+++ b/src/transformers/models/flava/configuration_flava.py
@@ -16,14 +16,14 @@
from typing import Any, Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class FlavaImageConfig(PretrainedConfig):
+class FlavaImageConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FlavaImageModel`]. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.
@@ -31,8 +31,8 @@ class FlavaImageConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
[facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -125,7 +125,7 @@ class FlavaImageConfig(PretrainedConfig):
self.vocab_size = vocab_size
-class FlavaTextConfig(PretrainedConfig):
+class FlavaTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FlavaTextModel`]. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.
@@ -133,8 +133,8 @@ class FlavaTextConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
[facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -238,7 +238,7 @@ class FlavaTextConfig(PretrainedConfig):
self.pad_token_id = pad_token_id
-class FlavaMultimodalConfig(PretrainedConfig):
+class FlavaMultimodalConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FlavaMultimodalModel`]. It is used to instantiate
an FLAVA model according to the specified arguments, defining the model architecture.
@@ -246,8 +246,8 @@ class FlavaMultimodalConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
[facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -324,7 +324,7 @@ class FlavaMultimodalConfig(PretrainedConfig):
self.use_cls_token = use_cls_token
-class FlavaImageCodebookConfig(PretrainedConfig):
+class FlavaImageCodebookConfig(PreTrainedConfig):
model_type = "flava_image_codebook"
base_config_key = "image_codebook_config"
@@ -334,8 +334,8 @@ class FlavaImageCodebookConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
[facebook/flava-image-codebook](https://huggingface.co/facebook/flava-image-codebook) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_groups (`int`, *optional*, defaults to 4):
@@ -392,15 +392,15 @@ class FlavaImageCodebookConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class FlavaConfig(PretrainedConfig):
+class FlavaConfig(PreTrainedConfig):
r"""
[`FlavaConfig`] is the configuration class to store the configuration of a [`FlavaModel`]. It is used to
instantiate FLAVA model according to the specified arguments, defining the text model, image model, image codebook
and multimodal model configs. Instantiating a configuration with the defaults will yield a similar configuration to
that of the FLAVA [facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/flex_olmo/configuration_flex_olmo.py b/src/transformers/models/flex_olmo/configuration_flex_olmo.py
index ae4704770e3..f762e56a86b 100644
--- a/src/transformers/models/flex_olmo/configuration_flex_olmo.py
+++ b/src/transformers/models/flex_olmo/configuration_flex_olmo.py
@@ -20,18 +20,18 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class FlexOlmoConfig(PretrainedConfig):
+class FlexOlmoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FlexOlmoModel`]. It is used to instantiate an FlexOlmo
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/FlexOlmo-7x7B-1T](https://huggingface.co/allenai/FlexOlmo-7x7B-1T).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/flex_olmo/modular_flex_olmo.py b/src/transformers/models/flex_olmo/modular_flex_olmo.py
index adaa1e7a159..9ccec9454f5 100644
--- a/src/transformers/models/flex_olmo/modular_flex_olmo.py
+++ b/src/transformers/models/flex_olmo/modular_flex_olmo.py
@@ -41,8 +41,8 @@ class FlexOlmoConfig(OlmoeConfig):
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/FlexOlmo-7x7B-1T](https://huggingface.co/allenai/FlexOlmo-7x7B-1T).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/florence2/configuration_florence2.py b/src/transformers/models/florence2/configuration_florence2.py
index 4bbd4b3a03e..6a32f47223d 100644
--- a/src/transformers/models/florence2/configuration_florence2.py
+++ b/src/transformers/models/florence2/configuration_florence2.py
@@ -18,7 +18,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -26,14 +26,14 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class Florence2VisionConfig(PretrainedConfig):
+class Florence2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Florence2VisionModel`]. It is used to instantiate a Florence2VisionModel
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Florence2VisionModel architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
in_channels (`int`, *optional*, defaults to 3):
@@ -134,7 +134,7 @@ class Florence2VisionConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Florence2Config(PretrainedConfig):
+class Florence2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Florence2ForConditionalGeneration`]. It is used to instantiate an
Florence-2 model according to the specified arguments, defining the model architecture.
@@ -142,8 +142,8 @@ class Florence2Config(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the Florence-2
[microsoft/Florence-2-base](https://huggingface.co/microsoft/Florence-2-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/florence2/modular_florence2.py b/src/transformers/models/florence2/modular_florence2.py
index 949e7f23f55..64b2c307533 100644
--- a/src/transformers/models/florence2/modular_florence2.py
+++ b/src/transformers/models/florence2/modular_florence2.py
@@ -23,7 +23,7 @@ import torch.nn.functional as F
from ...activations import ACT2FN
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...feature_extraction_utils import BatchFeature
from ...image_utils import ImageInput
from ...modeling_outputs import Seq2SeqLMOutput, Seq2SeqModelOutput
@@ -45,14 +45,14 @@ if is_torch_available():
logger = logging.get_logger(__name__)
-class Florence2VisionConfig(PretrainedConfig):
+class Florence2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Florence2VisionModel`]. It is used to instantiate a Florence2VisionModel
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Florence2VisionModel architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
in_channels (`int`, *optional*, defaults to 3):
@@ -153,7 +153,7 @@ class Florence2VisionConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Florence2Config(PretrainedConfig):
+class Florence2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Florence2ForConditionalGeneration`]. It is used to instantiate an
Florence-2 model according to the specified arguments, defining the model architecture.
@@ -161,8 +161,8 @@ class Florence2Config(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the Florence-2
[microsoft/Florence-2-base](https://huggingface.co/microsoft/Florence-2-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/fnet/configuration_fnet.py b/src/transformers/models/fnet/configuration_fnet.py
index 24a57832856..9ffc125e8ef 100644
--- a/src/transformers/models/fnet/configuration_fnet.py
+++ b/src/transformers/models/fnet/configuration_fnet.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""FNet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class FNetConfig(PretrainedConfig):
+class FNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FNetModel`]. It is used to instantiate an FNet
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the FNet
[google/fnet-base](https://huggingface.co/google/fnet-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/focalnet/configuration_focalnet.py b/src/transformers/models/focalnet/configuration_focalnet.py
index e412e3824e1..eabc9a8ba0a 100644
--- a/src/transformers/models/focalnet/configuration_focalnet.py
+++ b/src/transformers/models/focalnet/configuration_focalnet.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""FocalNet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class FocalNetConfig(BackboneConfigMixin, PretrainedConfig):
+class FocalNetConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FocalNetModel`]. It is used to instantiate a
FocalNet model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the FocalNet
[microsoft/focalnet-tiny](https://huggingface.co/microsoft/focalnet-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/fsmt/configuration_fsmt.py b/src/transformers/models/fsmt/configuration_fsmt.py
index 7aec2662293..a1075016c3f 100644
--- a/src/transformers/models/fsmt/configuration_fsmt.py
+++ b/src/transformers/models/fsmt/configuration_fsmt.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""FSMT configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class DecoderConfig(PretrainedConfig):
+class DecoderConfig(PreTrainedConfig):
r"""
Configuration class for FSMT's decoder specific things. note: this is a private helper class
"""
@@ -35,15 +35,15 @@ class DecoderConfig(PretrainedConfig):
self.is_encoder_decoder = is_encoder_decoder
-class FSMTConfig(PretrainedConfig):
+class FSMTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FSMTModel`]. It is used to instantiate a FSMT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the FSMT
[facebook/wmt19-en-ru](https://huggingface.co/facebook/wmt19-en-ru) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
langs (`list[str]`):
diff --git a/src/transformers/models/funnel/configuration_funnel.py b/src/transformers/models/funnel/configuration_funnel.py
index 212a976f278..8e09c4886c5 100644
--- a/src/transformers/models/funnel/configuration_funnel.py
+++ b/src/transformers/models/funnel/configuration_funnel.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Funnel Transformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class FunnelConfig(PretrainedConfig):
+class FunnelConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FunnelModel`] or a [`TFBertModel`]. It is used to
instantiate a Funnel Transformer model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Funnel
Transformer [funnel-transformer/small](https://huggingface.co/funnel-transformer/small) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
diff --git a/src/transformers/models/fuyu/configuration_fuyu.py b/src/transformers/models/fuyu/configuration_fuyu.py
index 40da84e2e78..c13208e8825 100644
--- a/src/transformers/models/fuyu/configuration_fuyu.py
+++ b/src/transformers/models/fuyu/configuration_fuyu.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Fuyu model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -22,15 +22,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class FuyuConfig(PretrainedConfig):
+class FuyuConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`FuyuForCausalLM`]. It is used to instantiate an
Fuyu model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[adept/fuyu-8b](https://huggingface.co/adept/fuyu-8b).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/gemma/configuration_gemma.py b/src/transformers/models/gemma/configuration_gemma.py
index 7910f27dcfe..6b248b76f3c 100644
--- a/src/transformers/models/gemma/configuration_gemma.py
+++ b/src/transformers/models/gemma/configuration_gemma.py
@@ -19,17 +19,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
-class GemmaConfig(PretrainedConfig):
+class GemmaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GemmaModel`]. It is used to instantiate an Gemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma-7B.
e.g. [google/gemma-7b](https://huggingface.co/google/gemma-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
diff --git a/src/transformers/models/gemma/modular_gemma.py b/src/transformers/models/gemma/modular_gemma.py
index e17545822da..7ba39f9490d 100644
--- a/src/transformers/models/gemma/modular_gemma.py
+++ b/src/transformers/models/gemma/modular_gemma.py
@@ -20,7 +20,7 @@ import torch
from torch import nn
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...masking_utils import create_causal_mask
from ...modeling_outputs import BaseModelOutputWithPast
from ...modeling_utils import PreTrainedModel
@@ -52,14 +52,14 @@ SPIECE_UNDERLINE = "▁"
logger = logging.get_logger(__name__)
-class GemmaConfig(PretrainedConfig):
+class GemmaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GemmaModel`]. It is used to instantiate an Gemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma-7B.
e.g. [google/gemma-7b](https://huggingface.co/google/gemma-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
diff --git a/src/transformers/models/gemma2/configuration_gemma2.py b/src/transformers/models/gemma2/configuration_gemma2.py
index 58749515169..ef55c16e5d4 100644
--- a/src/transformers/models/gemma2/configuration_gemma2.py
+++ b/src/transformers/models/gemma2/configuration_gemma2.py
@@ -19,17 +19,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
-class Gemma2Config(PretrainedConfig):
+class Gemma2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma2Model`]. It is used to instantiate an Gemma2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma2-7B.
e.g. [google/gemma2-7b](https://huggingface.co/google/gemma2-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
diff --git a/src/transformers/models/gemma2/modular_gemma2.py b/src/transformers/models/gemma2/modular_gemma2.py
index 0fc87b992a7..61db13152c1 100644
--- a/src/transformers/models/gemma2/modular_gemma2.py
+++ b/src/transformers/models/gemma2/modular_gemma2.py
@@ -20,7 +20,7 @@ import torch.nn as nn
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...masking_utils import create_causal_mask, create_sliding_window_causal_mask
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_layers import GradientCheckpointingLayer
@@ -47,14 +47,14 @@ from ..gemma.modeling_gemma import (
logger = logging.get_logger(__name__)
-class Gemma2Config(PretrainedConfig):
+class Gemma2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma2Model`]. It is used to instantiate an Gemma2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma2-7B.
e.g. [google/gemma2-7b](https://huggingface.co/google/gemma2-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
diff --git a/src/transformers/models/gemma3/configuration_gemma3.py b/src/transformers/models/gemma3/configuration_gemma3.py
index 893d0626dfd..04483c5c38f 100644
--- a/src/transformers/models/gemma3/configuration_gemma3.py
+++ b/src/transformers/models/gemma3/configuration_gemma3.py
@@ -21,7 +21,7 @@
# limitations under the License.
from typing import Any, Optional, Union
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
from ..siglip import SiglipVisionConfig
@@ -30,14 +30,14 @@ from ..siglip import SiglipVisionConfig
logger = logging.get_logger(__name__)
-class Gemma3TextConfig(PretrainedConfig):
+class Gemma3TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3TextModel`]. It is used to instantiate an Gemma3Text
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma3Text-7B.
e.g. [google/gemma3_text-7b](https://huggingface.co/google/gemma3_text-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 262208):
@@ -245,7 +245,7 @@ class Gemma3TextConfig(PretrainedConfig):
layer_type_validation(self.layer_types, self.num_hidden_layers)
-class Gemma3Config(PretrainedConfig):
+class Gemma3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3ForConditionalGeneration`]. It is used to instantiate an
Gemma3ForConditionalGeneration according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -253,8 +253,8 @@ class Gemma3Config(PretrainedConfig):
e.g. [google/gemma-3-4b](https://huggingface.co/google/gemma-3-4b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[Gemma3TextConfig, dict]`, *optional*):
diff --git a/src/transformers/models/gemma3/modeling_gemma3.py b/src/transformers/models/gemma3/modeling_gemma3.py
index ed9c8318005..d136b44e2f6 100644
--- a/src/transformers/models/gemma3/modeling_gemma3.py
+++ b/src/transformers/models/gemma3/modeling_gemma3.py
@@ -29,7 +29,7 @@ import torch.nn as nn
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...masking_utils import create_causal_mask, create_masks_for_generate, create_sliding_window_causal_mask
from ...modeling_flash_attention_utils import FlashAttentionKwargs
@@ -759,7 +759,7 @@ def token_type_ids_mask_function(
def create_causal_mask_mapping(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
@@ -1214,7 +1214,7 @@ class Gemma3ForConditionalGeneration(Gemma3PreTrainedModel, GenerationMixin):
@staticmethod
def create_masks_for_generate(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
diff --git a/src/transformers/models/gemma3/modular_gemma3.py b/src/transformers/models/gemma3/modular_gemma3.py
index 5d5e6dcf79f..826b04a3898 100644
--- a/src/transformers/models/gemma3/modular_gemma3.py
+++ b/src/transformers/models/gemma3/modular_gemma3.py
@@ -21,7 +21,7 @@ import torch
import torch.nn as nn
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...masking_utils import create_causal_mask, create_masks_for_generate, create_sliding_window_causal_mask
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_layers import GenericForSequenceClassification, GradientCheckpointingLayer
@@ -56,14 +56,14 @@ from ..siglip import SiglipVisionConfig
logger = logging.get_logger(__name__)
-class Gemma3TextConfig(Gemma2Config, PretrainedConfig):
+class Gemma3TextConfig(Gemma2Config, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3TextModel`]. It is used to instantiate an Gemma3Text
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Gemma3Text-7B.
e.g. [google/gemma3_text-7b](https://huggingface.co/google/gemma3_text-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 262208):
@@ -210,7 +210,7 @@ class Gemma3TextConfig(Gemma2Config, PretrainedConfig):
use_bidirectional_attention=False,
**kwargs,
):
- PretrainedConfig.__init__(
+ PreTrainedConfig.__init__(
pad_token_id=pad_token_id,
bos_token_id=bos_token_id,
eos_token_id=eos_token_id,
@@ -256,7 +256,7 @@ class Gemma3TextConfig(Gemma2Config, PretrainedConfig):
layer_type_validation(self.layer_types, self.num_hidden_layers)
-class Gemma3Config(PretrainedConfig):
+class Gemma3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3ForConditionalGeneration`]. It is used to instantiate an
Gemma3ForConditionalGeneration according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -264,8 +264,8 @@ class Gemma3Config(PretrainedConfig):
e.g. [google/gemma-3-4b](https://huggingface.co/google/gemma-3-4b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[Gemma3TextConfig, dict]`, *optional*):
@@ -725,7 +725,7 @@ class Gemma3MultiModalProjector(nn.Module):
def create_causal_mask_mapping(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
diff --git a/src/transformers/models/gemma3n/configuration_gemma3n.py b/src/transformers/models/gemma3n/configuration_gemma3n.py
index 47b5b47d363..838baa0b496 100644
--- a/src/transformers/models/gemma3n/configuration_gemma3n.py
+++ b/src/transformers/models/gemma3n/configuration_gemma3n.py
@@ -22,7 +22,7 @@
from collections.abc import Sequence
from typing import Any, Optional, Union
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import is_timm_available, logging, requires_backends
@@ -34,7 +34,7 @@ if is_timm_available():
logger = logging.get_logger(__name__)
-class Gemma3nTextConfig(PretrainedConfig):
+class Gemma3nTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3nTextModel`]. It is used to instantiate an
Gemma3nTextModel model according to the specified arguments, defining the model architecture. Instantiating a
@@ -301,7 +301,7 @@ class Gemma3nTextConfig(PretrainedConfig):
self.activation_sparsity_pattern = activation_sparsity_pattern
-class Gemma3nAudioConfig(PretrainedConfig):
+class Gemma3nAudioConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3nAudioEncoder`]. It is used to instantiate
an `Gemma3nAudioEncoder` model according to the specified arguments, defining the model architecture. Instantiating
@@ -440,7 +440,7 @@ class Gemma3nAudioConfig(PretrainedConfig):
self.sscp_conv_stride_size = sscp_conv_stride_size
-class Gemma3nVisionConfig(PretrainedConfig):
+class Gemma3nVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration for a timm backbone [`TimmWrapper`]. It is used to
instantiate an timm model model according to the specified arguments, defining the model architecture.
@@ -558,7 +558,7 @@ class Gemma3nVisionConfig(PretrainedConfig):
return output
-class Gemma3nConfig(PretrainedConfig):
+class Gemma3nConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3nForConditionalGeneration`]. It is used to
instantiate a Gemma3nForConditionalGeneration according to the specified arguments, defining the model
@@ -567,8 +567,8 @@ class Gemma3nConfig(PretrainedConfig):
e.g. [google/gemma-3n-E4B](https://huggingface.co/google/gemma-3n-E4B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[Gemma3nTextConfig, dict]`, *optional*):
diff --git a/src/transformers/models/gemma3n/modular_gemma3n.py b/src/transformers/models/gemma3n/modular_gemma3n.py
index 5b778672bd3..95e891d9ad2 100644
--- a/src/transformers/models/gemma3n/modular_gemma3n.py
+++ b/src/transformers/models/gemma3n/modular_gemma3n.py
@@ -24,7 +24,7 @@ import torch.nn.functional as F
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...masking_utils import create_causal_mask, create_sliding_window_causal_mask
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_outputs import BaseModelOutputWithPast
@@ -62,7 +62,7 @@ from ..timm_wrapper.configuration_timm_wrapper import TimmWrapperConfig
logger = logging.get_logger(__name__)
-class Gemma3nTextConfig(Gemma2Config, PretrainedConfig):
+class Gemma3nTextConfig(Gemma2Config, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3nTextModel`]. It is used to instantiate an
Gemma3nTextModel model according to the specified arguments, defining the model architecture. Instantiating a
@@ -244,7 +244,7 @@ class Gemma3nTextConfig(Gemma2Config, PretrainedConfig):
activation_sparsity_pattern: Optional[Union[float, Sequence[float]]] = None,
**kwargs,
):
- PretrainedConfig.__init__(
+ PreTrainedConfig.__init__(
pad_token_id=pad_token_id,
bos_token_id=bos_token_id,
eos_token_id=eos_token_id,
@@ -314,7 +314,7 @@ class Gemma3nTextConfig(Gemma2Config, PretrainedConfig):
self.activation_sparsity_pattern = activation_sparsity_pattern
-class Gemma3nAudioConfig(PretrainedConfig):
+class Gemma3nAudioConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3nAudioEncoder`]. It is used to instantiate
an `Gemma3nAudioEncoder` model according to the specified arguments, defining the model architecture. Instantiating
@@ -522,7 +522,7 @@ class Gemma3nVisionConfig(TimmWrapperConfig):
self.rms_norm_eps = rms_norm_eps
-class Gemma3nConfig(PretrainedConfig):
+class Gemma3nConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Gemma3nForConditionalGeneration`]. It is used to
instantiate a Gemma3nForConditionalGeneration according to the specified arguments, defining the model
@@ -531,8 +531,8 @@ class Gemma3nConfig(PretrainedConfig):
e.g. [google/gemma-3n-E4B](https://huggingface.co/google/gemma-3n-E4B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[Gemma3nTextConfig, dict]`, *optional*):
diff --git a/src/transformers/models/git/configuration_git.py b/src/transformers/models/git/configuration_git.py
index 86c85854ff9..cd8b1c92255 100644
--- a/src/transformers/models/git/configuration_git.py
+++ b/src/transformers/models/git/configuration_git.py
@@ -14,22 +14,22 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class GitVisionConfig(PretrainedConfig):
+class GitVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GitVisionModel`]. It is used to instantiate a GIT
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the GIT
[microsoft/git-base](https://huggingface.co/microsoft/git-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -102,15 +102,15 @@ class GitVisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class GitConfig(PretrainedConfig):
+class GitConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GitModel`]. It is used to instantiate a GIT model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the GIT
[microsoft/git-base](https://huggingface.co/microsoft/git-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`dict`, *optional*):
diff --git a/src/transformers/models/glm/configuration_glm.py b/src/transformers/models/glm/configuration_glm.py
index 4d61dc6fa15..66a38610beb 100644
--- a/src/transformers/models/glm/configuration_glm.py
+++ b/src/transformers/models/glm/configuration_glm.py
@@ -14,17 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class GlmConfig(PretrainedConfig):
+class GlmConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GlmModel`]. It is used to instantiate an Glm
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Glm-4-9b-chat.
e.g. [THUDM/glm-4-9b-chat](https://huggingface.co/THUDM/glm-4-9b-chat)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151552):
Vocabulary size of the Glm model. Defines the number of different tokens that can be represented by the
diff --git a/src/transformers/models/glm4/configuration_glm4.py b/src/transformers/models/glm4/configuration_glm4.py
index 46dc929826e..10017e6d2ad 100644
--- a/src/transformers/models/glm4/configuration_glm4.py
+++ b/src/transformers/models/glm4/configuration_glm4.py
@@ -14,17 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class Glm4Config(PretrainedConfig):
+class Glm4Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4Model`]. It is used to instantiate an Glm4
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Glm4-4-9b-chat.
e.g. [THUDM/GLM-4-9B-0414](https://huggingface.co/THUDM/GLM-4-9B-0414)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151552):
Vocabulary size of the Glm4 model. Defines the number of different tokens that can be represented by the
diff --git a/src/transformers/models/glm4_moe/configuration_glm4_moe.py b/src/transformers/models/glm4_moe/configuration_glm4_moe.py
index 77b162efa3b..c86066daa98 100644
--- a/src/transformers/models/glm4_moe/configuration_glm4_moe.py
+++ b/src/transformers/models/glm4_moe/configuration_glm4_moe.py
@@ -19,18 +19,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class Glm4MoeConfig(PretrainedConfig):
+class Glm4MoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4MoeModel`]. It is used to instantiate a
Glm4Moe model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of [THUDM/GLM-4-100B-A10B](https://huggingface.co/THUDM/GLM-4-100B-A10B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/glm4_moe/modular_glm4_moe.py b/src/transformers/models/glm4_moe/modular_glm4_moe.py
index b671f9b2403..56cf3f08dd7 100644
--- a/src/transformers/models/glm4_moe/modular_glm4_moe.py
+++ b/src/transformers/models/glm4_moe/modular_glm4_moe.py
@@ -19,7 +19,7 @@ from typing import Optional
import torch
from torch import nn
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
from ..cohere.modeling_cohere import CohereAttention
@@ -38,14 +38,14 @@ from ..gpt_neox.modeling_gpt_neox import apply_rotary_pos_emb # noqa
logger = logging.get_logger(__name__)
-class Glm4MoeConfig(PretrainedConfig):
+class Glm4MoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4MoeModel`]. It is used to instantiate a
Glm4Moe model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of [THUDM/GLM-4-100B-A10B](https://huggingface.co/THUDM/GLM-4-100B-A10B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/glm4v/configuration_glm4v.py b/src/transformers/models/glm4v/configuration_glm4v.py
index 4c417020fa8..8128065148c 100644
--- a/src/transformers/models/glm4v/configuration_glm4v.py
+++ b/src/transformers/models/glm4v/configuration_glm4v.py
@@ -18,11 +18,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class Glm4vVisionConfig(PretrainedConfig):
+class Glm4vVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vVisionModel`]. It is used to instantiate an Glm4vVisionModel
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield
@@ -119,15 +119,15 @@ class Glm4vVisionConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class Glm4vTextConfig(PretrainedConfig):
+class Glm4vTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vModel`]. It is used to instantiate a
GLM-4.1V model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of
GLM-4.1V-9B-Thinking [THUDM/GLM-4.1V-9B-Thinking](https://huggingface.co/THUDM/GLM-4.1V-9B-Thinking).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151552):
@@ -272,15 +272,15 @@ class Glm4vTextConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Glm4vConfig(PretrainedConfig):
+class Glm4vConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vModel`]. It is used to instantiate a
GLM-4.1V model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of
GLM-4.1V-9B-Thinking [THUDM/GLM-4.1V-9B-Thinking](https://huggingface.co/THUDM/GLM-4.1V-9B-Thinking).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/glm4v/modular_glm4v.py b/src/transformers/models/glm4v/modular_glm4v.py
index ac2885a4a9f..05beda2de1b 100644
--- a/src/transformers/models/glm4v/modular_glm4v.py
+++ b/src/transformers/models/glm4v/modular_glm4v.py
@@ -23,7 +23,7 @@ from torch.nn import LayerNorm
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...feature_extraction_utils import BatchFeature
from ...image_utils import ImageInput
from ...masking_utils import create_causal_mask
@@ -61,7 +61,7 @@ from ..qwen2_vl.processing_qwen2_vl import (
logger = logging.get_logger(__name__)
-class Glm4vVisionConfig(PretrainedConfig):
+class Glm4vVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vVisionModel`]. It is used to instantiate an Glm4vVisionModel
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield
@@ -158,15 +158,15 @@ class Glm4vVisionConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class Glm4vTextConfig(PretrainedConfig):
+class Glm4vTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vModel`]. It is used to instantiate a
GLM-4.1V model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of
GLM-4.1V-9B-Thinking [THUDM/GLM-4.1V-9B-Thinking](https://huggingface.co/THUDM/GLM-4.1V-9B-Thinking).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151552):
@@ -311,15 +311,15 @@ class Glm4vTextConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Glm4vConfig(PretrainedConfig):
+class Glm4vConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vModel`]. It is used to instantiate a
GLM-4.1V model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of
GLM-4.1V-9B-Thinking [THUDM/GLM-4.1V-9B-Thinking](https://huggingface.co/THUDM/GLM-4.1V-9B-Thinking).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/glm4v_moe/configuration_glm4v_moe.py b/src/transformers/models/glm4v_moe/configuration_glm4v_moe.py
index 425edd64bbe..51ba96d96be 100644
--- a/src/transformers/models/glm4v_moe/configuration_glm4v_moe.py
+++ b/src/transformers/models/glm4v_moe/configuration_glm4v_moe.py
@@ -18,11 +18,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class Glm4vMoeVisionConfig(PretrainedConfig):
+class Glm4vMoeVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vMoeVisionModel`]. It is used to instantiate an Glm4vMoeVisionModel
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield
@@ -119,15 +119,15 @@ class Glm4vMoeVisionConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class Glm4vMoeTextConfig(PretrainedConfig):
+class Glm4vMoeTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vMoeModel`]. It is used to instantiate a
GLM-4.5V model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of
GLM-4.5V [zai-org/GLM-4.5V](https://huggingface.co/zai-org/GLM-4.5V).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151424):
@@ -307,15 +307,15 @@ class Glm4vMoeTextConfig(PretrainedConfig):
self.norm_topk_prob = norm_topk_prob
-class Glm4vMoeConfig(PretrainedConfig):
+class Glm4vMoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Glm4vMoeModel`]. It is used to instantiate a
GLM-4.5V model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of
GLM-4.5V [zai-org/GLM-4.5V](https://huggingface.co/zai-org/GLM-4.5V).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/glm4v_moe/modular_glm4v_moe.py b/src/transformers/models/glm4v_moe/modular_glm4v_moe.py
index 201814df3f4..2130b460d88 100644
--- a/src/transformers/models/glm4v_moe/modular_glm4v_moe.py
+++ b/src/transformers/models/glm4v_moe/modular_glm4v_moe.py
@@ -18,7 +18,7 @@ import torch
import torch.nn as nn
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_rope_utils import rope_config_validation
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS
@@ -57,8 +57,8 @@ class Glm4vMoeTextConfig(Glm4MoeConfig):
configuration with the defaults will yield a similar configuration to that of
GLM-4.5V [zai-org/GLM-4.5V](https://huggingface.co/zai-org/GLM-4.5V).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151424):
@@ -199,7 +199,7 @@ class Glm4vMoeTextConfig(Glm4MoeConfig):
norm_topk_prob=True,
**kwargs,
):
- PretrainedConfig.__init__(self, tie_word_embeddings=tie_word_embeddings, **kwargs)
+ PreTrainedConfig.__init__(self, tie_word_embeddings=tie_word_embeddings, **kwargs)
self.vocab_size = vocab_size
self.max_position_embeddings = max_position_embeddings
self.hidden_size = hidden_size
@@ -242,8 +242,8 @@ class Glm4vMoeConfig(Glm4vConfig):
configuration with the defaults will yield a similar configuration to that of
GLM-4.5V [zai-org/GLM-4.5V](https://huggingface.co/zai-org/GLM-4.5V).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/glpn/configuration_glpn.py b/src/transformers/models/glpn/configuration_glpn.py
index 6fb35bb0b08..9df5e8d77c3 100644
--- a/src/transformers/models/glpn/configuration_glpn.py
+++ b/src/transformers/models/glpn/configuration_glpn.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""GLPN model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class GLPNConfig(PretrainedConfig):
+class GLPNConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GLPNModel`]. It is used to instantiate an GLPN
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the GLPN
[vinvino02/glpn-kitti](https://huggingface.co/vinvino02/glpn-kitti) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/got_ocr2/configuration_got_ocr2.py b/src/transformers/models/got_ocr2/configuration_got_ocr2.py
index eb039f95895..524226b099b 100644
--- a/src/transformers/models/got_ocr2/configuration_got_ocr2.py
+++ b/src/transformers/models/got_ocr2/configuration_got_ocr2.py
@@ -20,19 +20,19 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class GotOcr2VisionConfig(PretrainedConfig):
+class GotOcr2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GotOcr2VisionModel`]. It is used to instantiate a GOT_OCR2
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
defaults will yield a similar configuration to that of the SAM ViT-h
[facebook/sam-vit-huge](https://huggingface.co/facebook/sam-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -115,7 +115,7 @@ class GotOcr2VisionConfig(PretrainedConfig):
self.mlp_dim = mlp_dim
-class GotOcr2Config(PretrainedConfig):
+class GotOcr2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GotOcr2ForConditionalGeneration`]. It is used to instantiate a
GotOcr2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -123,8 +123,8 @@ class GotOcr2Config(PretrainedConfig):
e.g [stepfun-ai/GOT-OCR-2.0-hf](https://huggingface.co/stepfun-ai/GOT-OCR-2.0-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/got_ocr2/modular_got_ocr2.py b/src/transformers/models/got_ocr2/modular_got_ocr2.py
index 0ecf39fcd03..9c3bce47fff 100644
--- a/src/transformers/models/got_ocr2/modular_got_ocr2.py
+++ b/src/transformers/models/got_ocr2/modular_got_ocr2.py
@@ -20,7 +20,7 @@ import torch
import torch.nn as nn
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_utils import PreTrainedModel
from ...processing_utils import Unpack
from ...utils import auto_docstring, can_return_tuple, logging
@@ -45,15 +45,15 @@ from ..sam.modeling_sam import (
logger = logging.get_logger(__name__)
-class GotOcr2VisionConfig(PretrainedConfig):
+class GotOcr2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GotOcr2VisionModel`]. It is used to instantiate a GOT_OCR2
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
defaults will yield a similar configuration to that of the SAM ViT-h
[facebook/sam-vit-huge](https://huggingface.co/facebook/sam-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -136,7 +136,7 @@ class GotOcr2VisionConfig(PretrainedConfig):
self.mlp_dim = mlp_dim
-class GotOcr2Config(PretrainedConfig):
+class GotOcr2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GotOcr2ForConditionalGeneration`]. It is used to instantiate a
GotOcr2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -144,8 +144,8 @@ class GotOcr2Config(PretrainedConfig):
e.g [stepfun-ai/GOT-OCR-2.0-hf](https://huggingface.co/stepfun-ai/GOT-OCR-2.0-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/gpt2/configuration_gpt2.py b/src/transformers/models/gpt2/configuration_gpt2.py
index 0fa19ada1c9..a6667d8a57c 100644
--- a/src/transformers/models/gpt2/configuration_gpt2.py
+++ b/src/transformers/models/gpt2/configuration_gpt2.py
@@ -20,7 +20,7 @@ from collections.abc import Mapping
from typing import Any, Optional
from ... import PreTrainedTokenizer, is_torch_available
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging
@@ -28,15 +28,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GPT2Config(PretrainedConfig):
+class GPT2Config(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`GPT2Model`] or a [`TFGPT2Model`]. It is used to
instantiate a GPT-2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the GPT-2
[openai-community/gpt2](https://huggingface.co/openai-community/gpt2) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -193,7 +193,7 @@ class GPT2Config(PretrainedConfig):
class GPT2OnnxConfig(OnnxConfigWithPast):
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
task: str = "default",
patching_specs: Optional[list[PatchingSpec]] = None,
use_past: bool = False,
diff --git a/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py b/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py
index 127a0eed473..b243964d40c 100644
--- a/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py
+++ b/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""GPTBigCode configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class GPTBigCodeConfig(PretrainedConfig):
+class GPTBigCodeConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`GPTBigCodeModel`]. It is used to instantiate a
GPTBigCode model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the GPTBigCode
[gpt_bigcode](https://huggingface.co/gpt_bigcode) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/gpt_neo/configuration_gpt_neo.py b/src/transformers/models/gpt_neo/configuration_gpt_neo.py
index a9bbfcd33ef..ff0e8c56805 100644
--- a/src/transformers/models/gpt_neo/configuration_gpt_neo.py
+++ b/src/transformers/models/gpt_neo/configuration_gpt_neo.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer, is_torch_available
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfigWithPast
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GPTNeoConfig(PretrainedConfig):
+class GPTNeoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GPTNeoModel`]. It is used to instantiate a GPT
Neo model according to the specified arguments, defining the model architecture. Instantiating a configuration with
the defaults will yield a similar configuration to that of the GPTNeo
[EleutherAI/gpt-neo-1.3B](https://huggingface.co/EleutherAI/gpt-neo-1.3B) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/gpt_neox/configuration_gpt_neox.py b/src/transformers/models/gpt_neox/configuration_gpt_neox.py
index 80323914db3..1e1210be711 100644
--- a/src/transformers/models/gpt_neox/configuration_gpt_neox.py
+++ b/src/transformers/models/gpt_neox/configuration_gpt_neox.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""GPTNeoX model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GPTNeoXConfig(PretrainedConfig):
+class GPTNeoXConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GPTNeoXModel`]. It is used to instantiate an
GPTNeoX model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the GPTNeoX
[EleutherAI/gpt-neox-20b](https://huggingface.co/EleutherAI/gpt-neox-20b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py b/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py
index 32015733453..b8343b73510 100644
--- a/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py
+++ b/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""GPTNeoX Japanese model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GPTNeoXJapaneseConfig(PretrainedConfig):
+class GPTNeoXJapaneseConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GPTNeoXModelJapanese`]. It is used to instantiate
a GPTNeoX model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the GPTNeoXJapanese
[abeja/gpt-neox-japanese-2.7b](https://huggingface.co/abeja/gpt-neox-japanese-2.7b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Default configs is set as 2.7B model
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Default configs is set as 2.7B model
Args:
vocab_size (`int`, *optional*, defaults to 32000):
diff --git a/src/transformers/models/gpt_oss/configuration_gpt_oss.py b/src/transformers/models/gpt_oss/configuration_gpt_oss.py
index 6459e9a7fd4..65e6606a6be 100644
--- a/src/transformers/models/gpt_oss/configuration_gpt_oss.py
+++ b/src/transformers/models/gpt_oss/configuration_gpt_oss.py
@@ -14,11 +14,11 @@
# limitations under the License.
"""openai model configuration"""
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
-class GptOssConfig(PretrainedConfig):
+class GptOssConfig(PreTrainedConfig):
r"""
This will yield a configuration to that of the BERT
[google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) architecture.
diff --git a/src/transformers/models/gptj/configuration_gptj.py b/src/transformers/models/gptj/configuration_gptj.py
index 278bfbf0be9..44ed7aea8f1 100644
--- a/src/transformers/models/gptj/configuration_gptj.py
+++ b/src/transformers/models/gptj/configuration_gptj.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any, Optional
from ... import PreTrainedTokenizer, is_torch_available
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging
@@ -27,13 +27,13 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GPTJConfig(PretrainedConfig):
+class GPTJConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GPTJModel`]. It is used to instantiate a GPT-J
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the GPT-J
[EleutherAI/gpt-j-6B](https://huggingface.co/EleutherAI/gpt-j-6B) architecture. Configuration objects inherit from
- [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from [`PretrainedConfig`]
+ [`PreTrainedConfig`] and can be used to control the model outputs. Read the documentation from [`PreTrainedConfig`]
for more information.
Args:
@@ -139,7 +139,7 @@ class GPTJConfig(PretrainedConfig):
class GPTJOnnxConfig(OnnxConfigWithPast):
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
task: str = "default",
patching_specs: Optional[list[PatchingSpec]] = None,
use_past: bool = False,
diff --git a/src/transformers/models/granite/configuration_granite.py b/src/transformers/models/granite/configuration_granite.py
index 61d3ba9e7bb..04c797ecbfd 100644
--- a/src/transformers/models/granite/configuration_granite.py
+++ b/src/transformers/models/granite/configuration_granite.py
@@ -19,7 +19,7 @@
# limitations under the License.
"""Granite model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -27,14 +27,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GraniteConfig(PretrainedConfig):
+class GraniteConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GraniteModel`]. It is used to instantiate an Granite
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Granite-3B.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/granite_speech/configuration_granite_speech.py b/src/transformers/models/granite_speech/configuration_granite_speech.py
index fede07b7b7e..8487ab9de6e 100644
--- a/src/transformers/models/granite_speech/configuration_granite_speech.py
+++ b/src/transformers/models/granite_speech/configuration_granite_speech.py
@@ -14,19 +14,19 @@
# limitations under the License.
"""Config class for Granite Speech."""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class GraniteSpeechEncoderConfig(PretrainedConfig):
+class GraniteSpeechEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GraniteSpeechCTCEncoder`]. It is used to instantiate
a Granite Speech audio encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the dfefaults will yield a similar configuration to that of the audio encoder of the Granite Speech
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
input_dim (`int`, *optional*, defaults to 160):
@@ -104,13 +104,13 @@ class GraniteSpeechEncoderConfig(PretrainedConfig):
self.max_pos_emb = max_pos_emb
-class GraniteSpeechConfig(PretrainedConfig):
+class GraniteSpeechConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GraniteSpeechForConditionalGeneration`]. It is used to instantiate an
Granite Speech model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `GraniteConfig`):
diff --git a/src/transformers/models/granitemoe/configuration_granitemoe.py b/src/transformers/models/granitemoe/configuration_granitemoe.py
index 94893cf4b7b..beb4e7d7b0a 100644
--- a/src/transformers/models/granitemoe/configuration_granitemoe.py
+++ b/src/transformers/models/granitemoe/configuration_granitemoe.py
@@ -19,7 +19,7 @@
# limitations under the License.
"""GraniteMoe model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -27,14 +27,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GraniteMoeConfig(PretrainedConfig):
+class GraniteMoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GraniteMoeModel`]. It is used to instantiate an GraniteMoe
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the GraniteMoe-3B.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/granitemoehybrid/configuration_granitemoehybrid.py b/src/transformers/models/granitemoehybrid/configuration_granitemoehybrid.py
index 7b8cc9e6568..eed40cd6f01 100644
--- a/src/transformers/models/granitemoehybrid/configuration_granitemoehybrid.py
+++ b/src/transformers/models/granitemoehybrid/configuration_granitemoehybrid.py
@@ -15,20 +15,20 @@
# limitations under the License.
"""GraniteMoeHybrid model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class GraniteMoeHybridConfig(PretrainedConfig):
+class GraniteMoeHybridConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GraniteMoeHybridConfig`]. It is used to
instantiate an GraniteMoeHybrid model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/granitemoeshared/configuration_granitemoeshared.py b/src/transformers/models/granitemoeshared/configuration_granitemoeshared.py
index cd1c4a5ca69..e75688a6f45 100644
--- a/src/transformers/models/granitemoeshared/configuration_granitemoeshared.py
+++ b/src/transformers/models/granitemoeshared/configuration_granitemoeshared.py
@@ -19,7 +19,7 @@
# limitations under the License.
"""GraniteMoeShared model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -27,14 +27,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class GraniteMoeSharedConfig(PretrainedConfig):
+class GraniteMoeSharedConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GraniteMoeSharedModel`]. It is used to instantiate an GraniteMoeShared
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [ibm-research/moe-7b-1b-active-shared-experts](https://huggingface.co/ibm-research/moe-7b-1b-active-shared-experts).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/grounding_dino/configuration_grounding_dino.py b/src/transformers/models/grounding_dino/configuration_grounding_dino.py
index 838a897f70a..0944bfc015b 100644
--- a/src/transformers/models/grounding_dino/configuration_grounding_dino.py
+++ b/src/transformers/models/grounding_dino/configuration_grounding_dino.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Grounding DINO model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -23,18 +23,18 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class GroundingDinoConfig(PretrainedConfig):
+class GroundingDinoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GroundingDinoModel`]. It is used to instantiate a
Grounding DINO model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Grounding DINO
[IDEA-Research/grounding-dino-tiny](https://huggingface.co/IDEA-Research/grounding-dino-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
@@ -299,9 +299,9 @@ class GroundingDinoConfig(PretrainedConfig):
sub_configs = {}
backbone_config = getattr(self, "backbone_config", None)
text_config = getattr(self, "text_config", None)
- if isinstance(backbone_config, PretrainedConfig):
+ if isinstance(backbone_config, PreTrainedConfig):
sub_configs["backbone_config"] = type(backbone_config)
- if isinstance(text_config, PretrainedConfig):
+ if isinstance(text_config, PreTrainedConfig):
sub_configs["text_config"] = type(self.text_config)
return sub_configs
diff --git a/src/transformers/models/groupvit/configuration_groupvit.py b/src/transformers/models/groupvit/configuration_groupvit.py
index 8366b3a08c0..0f432e621b5 100644
--- a/src/transformers/models/groupvit/configuration_groupvit.py
+++ b/src/transformers/models/groupvit/configuration_groupvit.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -30,15 +30,15 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class GroupViTTextConfig(PretrainedConfig):
+class GroupViTTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GroupViTTextModel`]. It is used to instantiate an
GroupViT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the GroupViT
[nvidia/groupvit-gcc-yfcc](https://huggingface.co/nvidia/groupvit-gcc-yfcc) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 49408):
@@ -122,15 +122,15 @@ class GroupViTTextConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class GroupViTVisionConfig(PretrainedConfig):
+class GroupViTVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`GroupViTVisionModel`]. It is used to instantiate
an GroupViT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the GroupViT
[nvidia/groupvit-gcc-yfcc](https://huggingface.co/nvidia/groupvit-gcc-yfcc) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 384):
@@ -230,15 +230,15 @@ class GroupViTVisionConfig(PretrainedConfig):
self.assign_mlp_ratio = assign_mlp_ratio
-class GroupViTConfig(PretrainedConfig):
+class GroupViTConfig(PreTrainedConfig):
r"""
[`GroupViTConfig`] is the configuration class to store the configuration of a [`GroupViTModel`]. It is used to
instantiate a GroupViT model according to the specified arguments, defining the text model and vision model
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the GroupViT
[nvidia/groupvit-gcc-yfcc](https://huggingface.co/nvidia/groupvit-gcc-yfcc) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/helium/configuration_helium.py b/src/transformers/models/helium/configuration_helium.py
index bee324fbb72..a76a553e142 100644
--- a/src/transformers/models/helium/configuration_helium.py
+++ b/src/transformers/models/helium/configuration_helium.py
@@ -14,17 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class HeliumConfig(PretrainedConfig):
+class HeliumConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`HeliumModel`]. It is used to instantiate an Helium
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Helium 2b model.
e.g. [kyutai/helium-2b](https://huggingface.co/kyutai/helium-2b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 48000):
diff --git a/src/transformers/models/hgnet_v2/configuration_hgnet_v2.py b/src/transformers/models/hgnet_v2/configuration_hgnet_v2.py
index 09ce13dec29..74cee382360 100644
--- a/src/transformers/models/hgnet_v2/configuration_hgnet_v2.py
+++ b/src/transformers/models/hgnet_v2/configuration_hgnet_v2.py
@@ -20,19 +20,19 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
# TODO: Modular conversion for resnet must be fixed as
# it provides incorrect import for configuration like resnet_resnet
-class HGNetV2Config(BackboneConfigMixin, PretrainedConfig):
+class HGNetV2Config(BackboneConfigMixin, PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`HGNetV2Backbone`]. It is used to instantiate a HGNet-V2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of D-FINE-X-COCO B4 "[ustc-community/dfine_x_coco"](https://huggingface.co/ustc-community/dfine_x_coco").
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/hgnet_v2/modular_hgnet_v2.py b/src/transformers/models/hgnet_v2/modular_hgnet_v2.py
index b0c46d68805..627c6aed625 100644
--- a/src/transformers/models/hgnet_v2/modular_hgnet_v2.py
+++ b/src/transformers/models/hgnet_v2/modular_hgnet_v2.py
@@ -20,7 +20,7 @@ import torch
import torch.nn.functional as F
from torch import Tensor, nn
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_outputs import (
BackboneOutput,
BaseModelOutputWithNoAttention,
@@ -36,13 +36,13 @@ from ..rt_detr.modeling_rt_detr_resnet import RTDetrResNetConvLayer
# TODO: Modular conversion for resnet must be fixed as
# it provides incorrect import for configuration like resnet_resnet
-class HGNetV2Config(BackboneConfigMixin, PretrainedConfig):
+class HGNetV2Config(BackboneConfigMixin, PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`HGNetV2Backbone`]. It is used to instantiate a HGNet-V2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of D-FINE-X-COCO B4 "[ustc-community/dfine_x_coco"](https://huggingface.co/ustc-community/dfine_x_coco").
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/hiera/configuration_hiera.py b/src/transformers/models/hiera/configuration_hiera.py
index 2342d7e562a..11e220ab8e1 100644
--- a/src/transformers/models/hiera/configuration_hiera.py
+++ b/src/transformers/models/hiera/configuration_hiera.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Hiera model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class HieraConfig(BackboneConfigMixin, PretrainedConfig):
+class HieraConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`HieraModel`]. It is used to instantiate a Hiera
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Hiera
[facebook/hiera-base-224](https://huggingface.co/facebook/hiera-base-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
embed_dim (`int`, *optional*, defaults to 96):
diff --git a/src/transformers/models/hubert/configuration_hubert.py b/src/transformers/models/hubert/configuration_hubert.py
index c8af7b5a0f3..b0486a9e763 100644
--- a/src/transformers/models/hubert/configuration_hubert.py
+++ b/src/transformers/models/hubert/configuration_hubert.py
@@ -17,22 +17,22 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class HubertConfig(PretrainedConfig):
+class HubertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`HubertModel`]. It is used to instantiate an
Hubert model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Hubert
[facebook/hubert-base-ls960](https://huggingface.co/facebook/hubert-base-ls960) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/hunyuan_v1_dense/configuration_hunyuan_v1_dense.py b/src/transformers/models/hunyuan_v1_dense/configuration_hunyuan_v1_dense.py
index 064b0a9702c..083fb8e3c40 100644
--- a/src/transformers/models/hunyuan_v1_dense/configuration_hunyuan_v1_dense.py
+++ b/src/transformers/models/hunyuan_v1_dense/configuration_hunyuan_v1_dense.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""HunYuanDenseV1 model configuration"""
-from transformers.configuration_utils import PretrainedConfig
+from transformers.configuration_utils import PreTrainedConfig
from transformers.utils import logging
logger = logging.get_logger(__name__)
-class HunYuanDenseV1Config(PretrainedConfig):
+class HunYuanDenseV1Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`HunYuanDenseV1Config`]. It is used to instantiate an
HunYuan model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the HunYuan-7B.
Hunyuan-7B-Instruct [tencent/Hunyuan-7B-Instruct](https://huggingface.co/tencent/Hunyuan-7B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/hunyuan_v1_moe/configuration_hunyuan_v1_moe.py b/src/transformers/models/hunyuan_v1_moe/configuration_hunyuan_v1_moe.py
index db853145f7e..431e19861ab 100644
--- a/src/transformers/models/hunyuan_v1_moe/configuration_hunyuan_v1_moe.py
+++ b/src/transformers/models/hunyuan_v1_moe/configuration_hunyuan_v1_moe.py
@@ -16,22 +16,22 @@
from typing import Union
-from transformers.configuration_utils import PretrainedConfig
+from transformers.configuration_utils import PreTrainedConfig
from transformers.utils import logging
logger = logging.get_logger(__name__)
-class HunYuanMoEV1Config(PretrainedConfig):
+class HunYuanMoEV1Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`HunYuanMoEV1Model`]. It is used to instantiate an
HunYuan model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the HunYuan-7B.
Hunyuan-A13B-Instruct [tencent/Hunyuan-A13B-Instruct](https://huggingface.co/tencent/Hunyuan-A13B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/ibert/configuration_ibert.py b/src/transformers/models/ibert/configuration_ibert.py
index 963e6e6c9ed..5653daafc9b 100644
--- a/src/transformers/models/ibert/configuration_ibert.py
+++ b/src/transformers/models/ibert/configuration_ibert.py
@@ -19,7 +19,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class IBertConfig(PretrainedConfig):
+class IBertConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`IBertModel`]. It is used to instantiate a I-BERT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the IBERT
[kssteven/ibert-roberta-base](https://huggingface.co/kssteven/ibert-roberta-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
diff --git a/src/transformers/models/idefics/configuration_idefics.py b/src/transformers/models/idefics/configuration_idefics.py
index e8320b98725..833ef91dcd4 100644
--- a/src/transformers/models/idefics/configuration_idefics.py
+++ b/src/transformers/models/idefics/configuration_idefics.py
@@ -19,14 +19,14 @@
# limitations under the License.
"""Idefics model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class IdeficsVisionConfig(PretrainedConfig):
+class IdeficsVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`IdeficsModel`]. It is used to instantiate an
Idefics model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -34,8 +34,8 @@ class IdeficsVisionConfig(PretrainedConfig):
e.g. [HuggingFaceM4/idefics-9b](https://huggingface.co/HuggingFaceM4/idefics-9b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
embed_dim (`int`, *optional*, defaults to 768):
@@ -103,7 +103,7 @@ class IdeficsVisionConfig(PretrainedConfig):
super().__init__(**kwargs)
-class IdeficsPerceiverConfig(PretrainedConfig):
+class IdeficsPerceiverConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`IdeficsModel`]. It is used to instantiate an
Idefics model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -111,8 +111,8 @@ class IdeficsPerceiverConfig(PretrainedConfig):
e.g. [HuggingFaceM4/idefics-9b](https://huggingface.co/HuggingFaceM4/idefics-9b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_resampler (`bool`, *optional*, defaults to `False`):
@@ -151,7 +151,7 @@ class IdeficsPerceiverConfig(PretrainedConfig):
super().__init__(**kwargs)
-class IdeficsConfig(PretrainedConfig):
+class IdeficsConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`IdeficsModel`]. It is used to instantiate an
Idefics model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -159,8 +159,8 @@ class IdeficsConfig(PretrainedConfig):
e.g. [HuggingFaceM4/idefics-9b](https://huggingface.co/HuggingFaceM4/idefics-9b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
additional_vocab_size (`int`, *optional*, defaults to 0):
@@ -316,7 +316,7 @@ class IdeficsConfig(PretrainedConfig):
)
# IMPORTANT: Do not do any __init__ args-based checks in the constructor, since
- # PretrainedConfig.from_dict first instantiates the class with the config dict and only then
+ # PreTrainedConfig.from_dict first instantiates the class with the config dict and only then
# updates the config object with `kwargs` from from_pretrained, so during the instantiation
# of this object many attributes have default values and haven't yet been overridden.
# Do any required checks inside `from_pretrained` once the superclass' `from_pretrained` was run.
diff --git a/src/transformers/models/idefics/modeling_idefics.py b/src/transformers/models/idefics/modeling_idefics.py
index d2d5db61f73..5d730a03cf1 100644
--- a/src/transformers/models/idefics/modeling_idefics.py
+++ b/src/transformers/models/idefics/modeling_idefics.py
@@ -32,7 +32,7 @@ from ...generation import GenerationMixin
from ...masking_utils import create_causal_mask
from ...modeling_layers import GradientCheckpointingLayer
from ...modeling_outputs import ModelOutput
-from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PretrainedConfig, PreTrainedModel
+from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedConfig, PreTrainedModel
from ...processing_utils import Unpack
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple, logging
from ...utils.deprecation import deprecate_kwarg
@@ -485,7 +485,7 @@ class IdeficsAttention(nn.Module):
num_heads: int,
dropout: float = 0.0,
is_cross_attention: bool = False,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
qk_layer_norms: bool = False,
layer_idx: Optional[int] = None,
):
diff --git a/src/transformers/models/idefics2/configuration_idefics2.py b/src/transformers/models/idefics2/configuration_idefics2.py
index a8fa442a1db..2edb798a053 100644
--- a/src/transformers/models/idefics2/configuration_idefics2.py
+++ b/src/transformers/models/idefics2/configuration_idefics2.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""Idefics2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,7 +21,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class Idefics2VisionConfig(PretrainedConfig):
+class Idefics2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Idefics2VisionModel`]. It is used to instantiate a
Idefics2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -29,8 +29,8 @@ class Idefics2VisionConfig(PretrainedConfig):
[google/siglip-base-patch16-224](https://huggingface.co/google/siglip-base-patch16-224) used in the Idefics2 model
[HuggingFaceM4/idefics2-8b](https://huggingface.co/HuggingFaceM4/idefics2-8b).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -106,10 +106,10 @@ class Idefics2VisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Idefics2PerceiverConfig(PretrainedConfig):
+class Idefics2PerceiverConfig(PreTrainedConfig):
r"""
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
@@ -168,15 +168,15 @@ class Idefics2PerceiverConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Idefics2Config(PretrainedConfig):
+class Idefics2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Idefics2Model`]. It is used to instantiate a
Idefics2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the model of the Idefics2
[HuggingFaceM4/idefics2-8b](https://huggingface.co/HuggingFaceM4/idefics2-8b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_cache (`bool`, *optional*, defaults to `True`):
diff --git a/src/transformers/models/idefics3/configuration_idefics3.py b/src/transformers/models/idefics3/configuration_idefics3.py
index 97a2e57f1d8..159fa48a4f5 100644
--- a/src/transformers/models/idefics3/configuration_idefics3.py
+++ b/src/transformers/models/idefics3/configuration_idefics3.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""Idefics3 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,7 +21,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class Idefics3VisionConfig(PretrainedConfig):
+class Idefics3VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Idefics3VisionModel`]. It is used to instantiate a
Idefics3 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -29,8 +29,8 @@ class Idefics3VisionConfig(PretrainedConfig):
[google/siglip-base-patch16-224](https://huggingface.co/google/siglip-base-patch16-224) used in the Idefics3 model
[HuggingFaceM4/Idefics3-8B-Llama3](https://huggingface.co/HuggingFaceM4/Idefics3-8B-Llama3).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1152):
@@ -106,15 +106,15 @@ class Idefics3VisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Idefics3Config(PretrainedConfig):
+class Idefics3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Idefics3Model`]. It is used to instantiate a
Idefics3 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the model of the Idefics3
[HuggingFaceM4/Idefics3-8B-Llama3](https://huggingface.co/HuggingFaceM4/Idefics3-8B-Llama3) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_cache (`bool`, *optional*, defaults to `True`):
@@ -126,7 +126,7 @@ class Idefics3Config(PretrainedConfig):
Whether or not to tie the word embeddings with the token embeddings.
vision_config (`IdeficsVisionConfig` or `dict`, *optional*, defaults to `IdeficsVisionConfig`):
Custom vision config or dict for the vision tower
- text_config (`PretrainedConfig` or `dict`, *optional*, defaults to `LlamaConfig`):
+ text_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `LlamaConfig`):
Custom text config or dict for the text model
scale_factor (`int`, *optional*, defaults to 2):
The scale factor for the image encoder.
diff --git a/src/transformers/models/ijepa/configuration_ijepa.py b/src/transformers/models/ijepa/configuration_ijepa.py
index 084a7d8f3d9..c5568374e3d 100644
--- a/src/transformers/models/ijepa/configuration_ijepa.py
+++ b/src/transformers/models/ijepa/configuration_ijepa.py
@@ -14,18 +14,18 @@
# limitations under the License.
"""I-JEPA model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class IJepaConfig(PretrainedConfig):
+class IJepaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`IJepaModel`]. It is used to instantiate an IJEPA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the I-JEPA
[facebook/ijepa_vith14_1k](https://huggingface.co/facebook/ijepa_vith14_1k) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/imagegpt/configuration_imagegpt.py b/src/transformers/models/imagegpt/configuration_imagegpt.py
index 435324721d8..abd07c5feb4 100644
--- a/src/transformers/models/imagegpt/configuration_imagegpt.py
+++ b/src/transformers/models/imagegpt/configuration_imagegpt.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -29,15 +29,15 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class ImageGPTConfig(PretrainedConfig):
+class ImageGPTConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`ImageGPTModel`] or a [`TFImageGPTModel`]. It is
used to instantiate a GPT-2 model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the ImageGPT
[openai/imagegpt-small](https://huggingface.co/openai/imagegpt-small) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/informer/configuration_informer.py b/src/transformers/models/informer/configuration_informer.py
index f62417358c8..7a3c5949ada 100644
--- a/src/transformers/models/informer/configuration_informer.py
+++ b/src/transformers/models/informer/configuration_informer.py
@@ -16,22 +16,22 @@
from typing import Optional, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class InformerConfig(PretrainedConfig):
+class InformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`InformerModel`]. It is used to instantiate an
Informer model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Informer
[huggingface/informer-tourism-monthly](https://huggingface.co/huggingface/informer-tourism-monthly) architecture.
- Configuration objects inherit from [`PretrainedConfig`] can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
prediction_length (`int`):
diff --git a/src/transformers/models/instructblip/configuration_instructblip.py b/src/transformers/models/instructblip/configuration_instructblip.py
index 9b8323f15f0..ac8dd063740 100644
--- a/src/transformers/models/instructblip/configuration_instructblip.py
+++ b/src/transformers/models/instructblip/configuration_instructblip.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""InstructBLIP model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...models.auto.modeling_auto import MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -23,15 +23,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class InstructBlipVisionConfig(PretrainedConfig):
+class InstructBlipVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`InstructBlipVisionModel`]. It is used to
instantiate a InstructBLIP vision encoder according to the specified arguments, defining the model architecture.
Instantiating a configuration defaults will yield a similar configuration to that of the InstructBLIP
[Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1408):
@@ -107,14 +107,14 @@ class InstructBlipVisionConfig(PretrainedConfig):
self.qkv_bias = qkv_bias
-class InstructBlipQFormerConfig(PretrainedConfig):
+class InstructBlipQFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`InstructBlipQFormerModel`]. It is used to
instantiate a InstructBLIP Querying Transformer (Q-Former) model according to the specified arguments, defining the
model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of
the InstructBLIP [Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5)
- architecture. Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs.
- Read the documentation from [`PretrainedConfig`] for more information.
+ architecture. Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs.
+ Read the documentation from [`PreTrainedConfig`] for more information.
Note that [`InstructBlipQFormerModel`] is very similar to [`BertLMHeadModel`] with interleaved cross-attention.
@@ -211,7 +211,7 @@ class InstructBlipQFormerConfig(PretrainedConfig):
self.encoder_hidden_size = encoder_hidden_size
-class InstructBlipConfig(PretrainedConfig):
+class InstructBlipConfig(PreTrainedConfig):
r"""
[`InstructBlipConfig`] is the configuration class to store the configuration of a
[`InstructBlipForConditionalGeneration`]. It is used to instantiate a InstructBLIP model according to the specified
@@ -219,8 +219,8 @@ class InstructBlipConfig(PretrainedConfig):
the defaults will yield a similar configuration to that of the InstructBLIP
[Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`dict`, *optional*):
@@ -228,7 +228,7 @@ class InstructBlipConfig(PretrainedConfig):
qformer_config (`dict`, *optional*):
Dictionary of configuration options used to initialize [`InstructBlipQFormerConfig`].
text_config (`dict`, *optional*):
- Dictionary of configuration options used to initialize any [`PretrainedConfig`].
+ Dictionary of configuration options used to initialize any [`PreTrainedConfig`].
num_query_tokens (`int`, *optional*, defaults to 32):
The number of query tokens passed through the Transformer.
@@ -257,7 +257,7 @@ class InstructBlipConfig(PretrainedConfig):
>>> # Accessing the model configuration
>>> configuration = model.config
- >>> # We can also initialize a InstructBlipConfig from a InstructBlipVisionConfig, InstructBlipQFormerConfig and any PretrainedConfig
+ >>> # We can also initialize a InstructBlipConfig from a InstructBlipVisionConfig, InstructBlipQFormerConfig and any PreTrainedConfig
>>> # Initializing InstructBLIP vision, InstructBLIP Q-Former and language model configurations
>>> vision_config = InstructBlipVisionConfig()
@@ -317,7 +317,7 @@ class InstructBlipConfig(PretrainedConfig):
cls,
vision_config: InstructBlipVisionConfig,
qformer_config: InstructBlipQFormerConfig,
- text_config: PretrainedConfig,
+ text_config: PreTrainedConfig,
**kwargs,
):
r"""
diff --git a/src/transformers/models/instructblipvideo/configuration_instructblipvideo.py b/src/transformers/models/instructblipvideo/configuration_instructblipvideo.py
index af2acc83387..89c45472b88 100644
--- a/src/transformers/models/instructblipvideo/configuration_instructblipvideo.py
+++ b/src/transformers/models/instructblipvideo/configuration_instructblipvideo.py
@@ -20,7 +20,7 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...models.auto.modeling_auto import MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -29,15 +29,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class InstructBlipVideoVisionConfig(PretrainedConfig):
+class InstructBlipVideoVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`InstructBlipVideoVisionModel`]. It is used to
instantiate a InstructBlipVideo vision encoder according to the specified arguments, defining the model architecture.
Instantiating a configuration defaults will yield a similar configuration to that of the InstructBlipVideo
[Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1408):
@@ -113,14 +113,14 @@ class InstructBlipVideoVisionConfig(PretrainedConfig):
self.qkv_bias = qkv_bias
-class InstructBlipVideoQFormerConfig(PretrainedConfig):
+class InstructBlipVideoQFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`InstructBlipVideoQFormerModel`]. It is used to
instantiate a InstructBlipVideo Querying Transformer (Q-Former) model according to the specified arguments, defining the
model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of
the InstructBlipVideo [Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5)
- architecture. Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs.
- Read the documentation from [`PretrainedConfig`] for more information.
+ architecture. Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs.
+ Read the documentation from [`PreTrainedConfig`] for more information.
Note that [`InstructBlipVideoQFormerModel`] is very similar to [`BertLMHeadModel`] with interleaved cross-attention.
@@ -217,7 +217,7 @@ class InstructBlipVideoQFormerConfig(PretrainedConfig):
self.encoder_hidden_size = encoder_hidden_size
-class InstructBlipVideoConfig(PretrainedConfig):
+class InstructBlipVideoConfig(PreTrainedConfig):
r"""
[`InstructBlipVideoConfig`] is the configuration class to store the configuration of a
[`InstructBlipVideoForConditionalGeneration`]. It is used to instantiate a Instructblipvideo model according to the specified
@@ -225,8 +225,8 @@ class InstructBlipVideoConfig(PretrainedConfig):
the defaults will yield a similar configuration to that of the Instructblipvideo
[Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`dict`, *optional*):
@@ -234,7 +234,7 @@ class InstructBlipVideoConfig(PretrainedConfig):
qformer_config (`dict`, *optional*):
Dictionary of configuration options used to initialize [`InstructBlipVideoQFormerConfig`].
text_config (`dict`, *optional*):
- Dictionary of configuration options used to initialize any [`PretrainedConfig`].
+ Dictionary of configuration options used to initialize any [`PreTrainedConfig`].
num_query_tokens (`int`, *optional*, defaults to 32):
The number of query tokens passed through the Transformer.
@@ -263,7 +263,7 @@ class InstructBlipVideoConfig(PretrainedConfig):
>>> # Accessing the model configuration
>>> configuration = model.config
- >>> # We can also initialize a InstructBlipVideoConfig from a InstructBlipVideoVisionConfig, InstructBlipVideoQFormerConfig and any PretrainedConfig
+ >>> # We can also initialize a InstructBlipVideoConfig from a InstructBlipVideoVisionConfig, InstructBlipVideoQFormerConfig and any PreTrainedConfig
>>> # Initializing Instructblipvideo vision, Instructblipvideo Q-Former and language model configurations
>>> vision_config = InstructBlipVideoVisionConfig()
@@ -323,7 +323,7 @@ class InstructBlipVideoConfig(PretrainedConfig):
cls,
vision_config: InstructBlipVideoVisionConfig,
qformer_config: InstructBlipVideoQFormerConfig,
- text_config: PretrainedConfig,
+ text_config: PreTrainedConfig,
**kwargs,
):
r"""
diff --git a/src/transformers/models/instructblipvideo/modular_instructblipvideo.py b/src/transformers/models/instructblipvideo/modular_instructblipvideo.py
index 5619c2e79b9..3f96eb3f88a 100644
--- a/src/transformers/models/instructblipvideo/modular_instructblipvideo.py
+++ b/src/transformers/models/instructblipvideo/modular_instructblipvideo.py
@@ -31,7 +31,7 @@ from transformers.models.instructblip.modeling_instructblip import (
TransformersKwargs,
)
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...models.auto.modeling_auto import MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
from ...processing_utils import Unpack
@@ -50,7 +50,7 @@ class InstructBlipVideoQFormerConfig(InstructBlipQFormerConfig):
pass
-class InstructBlipVideoConfig(PretrainedConfig):
+class InstructBlipVideoConfig(PreTrainedConfig):
r"""
[`InstructBlipVideoConfig`] is the configuration class to store the configuration of a
[`InstructBlipVideoForConditionalGeneration`]. It is used to instantiate a Instructblipvideo model according to the specified
@@ -58,8 +58,8 @@ class InstructBlipVideoConfig(PretrainedConfig):
the defaults will yield a similar configuration to that of the Instructblipvideo
[Salesforce/instruct-blip-flan-t5](https://huggingface.co/Salesforce/instruct-blip-flan-t5) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`dict`, *optional*):
@@ -67,7 +67,7 @@ class InstructBlipVideoConfig(PretrainedConfig):
qformer_config (`dict`, *optional*):
Dictionary of configuration options used to initialize [`InstructBlipVideoQFormerConfig`].
text_config (`dict`, *optional*):
- Dictionary of configuration options used to initialize any [`PretrainedConfig`].
+ Dictionary of configuration options used to initialize any [`PreTrainedConfig`].
num_query_tokens (`int`, *optional*, defaults to 32):
The number of query tokens passed through the Transformer.
@@ -96,7 +96,7 @@ class InstructBlipVideoConfig(PretrainedConfig):
>>> # Accessing the model configuration
>>> configuration = model.config
- >>> # We can also initialize a InstructBlipVideoConfig from a InstructBlipVideoVisionConfig, InstructBlipVideoQFormerConfig and any PretrainedConfig
+ >>> # We can also initialize a InstructBlipVideoConfig from a InstructBlipVideoVisionConfig, InstructBlipVideoQFormerConfig and any PreTrainedConfig
>>> # Initializing Instructblipvideo vision, Instructblipvideo Q-Former and language model configurations
>>> vision_config = InstructBlipVideoVisionConfig()
@@ -156,7 +156,7 @@ class InstructBlipVideoConfig(PretrainedConfig):
cls,
vision_config: InstructBlipVideoVisionConfig,
qformer_config: InstructBlipVideoQFormerConfig,
- text_config: PretrainedConfig,
+ text_config: PreTrainedConfig,
**kwargs,
):
r"""
diff --git a/src/transformers/models/internvl/configuration_internvl.py b/src/transformers/models/internvl/configuration_internvl.py
index 17be5388b6a..a5849c1d69c 100644
--- a/src/transformers/models/internvl/configuration_internvl.py
+++ b/src/transformers/models/internvl/configuration_internvl.py
@@ -14,11 +14,11 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class InternVLVisionConfig(PretrainedConfig):
+class InternVLVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`InternVLVisionModel`]. It is used to instantiate an InternVLVisionModel
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield
@@ -139,15 +139,15 @@ class InternVLVisionConfig(PretrainedConfig):
self.use_mean_pooling = use_mean_pooling
-class InternVLConfig(PretrainedConfig):
+class InternVLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`InternVLForConditionalGeneration`]. It is used to instantiate a
InternVL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of InternVL3-1B.
e.g. [OpenGVLab/InternVL3-1B-hf](https://huggingface.co/OpenGVLab/InternVL3-1B-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/jamba/configuration_jamba.py b/src/transformers/models/jamba/configuration_jamba.py
index d239476adeb..d9b22056f59 100644
--- a/src/transformers/models/jamba/configuration_jamba.py
+++ b/src/transformers/models/jamba/configuration_jamba.py
@@ -16,14 +16,14 @@
import math
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class JambaConfig(PretrainedConfig):
+class JambaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`JambaModel`]. It is used to instantiate a
Jamba model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -31,8 +31,8 @@ class JambaConfig(PretrainedConfig):
[ai21labs/Jamba-v0.1](https://huggingface.co/ai21labs/Jamba-v0.1)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/janus/configuration_janus.py b/src/transformers/models/janus/configuration_janus.py
index a0e758fd9ed..4f4f29e2174 100644
--- a/src/transformers/models/janus/configuration_janus.py
+++ b/src/transformers/models/janus/configuration_janus.py
@@ -19,7 +19,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -27,13 +27,13 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class JanusVisionConfig(PretrainedConfig):
+class JanusVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`JanusVisionModel`]. It is used to instantiate a
`JanusVisionModel` according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
Dimensionality of the encoder layers and the pooler layer.
@@ -122,12 +122,12 @@ class JanusVisionConfig(PretrainedConfig):
self.num_image_tokens = num_image_tokens
-class JanusVQVAEConfig(PretrainedConfig):
+class JanusVQVAEConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`JanusVQVAEModel`]. It is used to instantiate a
`JanusVQVAEModel` according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Instantiating a
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Instantiating a
configuration with the defaults will yield a similar configuration to the VQModel of the
[deepseek-community/Janus-Pro-1B](https://huggingface.co/deepseek-community/Janus-Pro-1B).
@@ -209,7 +209,7 @@ class JanusVQVAEConfig(PretrainedConfig):
self.image_token_embed_dim = image_token_embed_dim
-class JanusConfig(PretrainedConfig):
+class JanusConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`JanusModel`]. It is used to instantiate an
Janus model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -218,8 +218,8 @@ class JanusConfig(PretrainedConfig):
e.g. [deepseek-community/Janus-Pro-1B](https://huggingface.co/deepseek-community/Janus-Pro-1B) or
[deepseek-community/Janus-Pro-7B](https://huggingface.co/deepseek-community/Janus-Pro-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `LlamaConfig`):
@@ -277,7 +277,7 @@ class JanusConfig(PretrainedConfig):
elif text_config is None:
logger.info("`text_config` is None. Initializing with default values")
self.text_config = CONFIG_MAPPING["llama"]()
- elif isinstance(text_config, PretrainedConfig):
+ elif isinstance(text_config, PreTrainedConfig):
self.text_config = text_config
else:
raise ValueError(
diff --git a/src/transformers/models/janus/modular_janus.py b/src/transformers/models/janus/modular_janus.py
index 332dc689dc6..a2f2541d84f 100644
--- a/src/transformers/models/janus/modular_janus.py
+++ b/src/transformers/models/janus/modular_janus.py
@@ -28,7 +28,7 @@ from transformers.models.blip.image_processing_blip import BlipImageProcessor
from ...activations import ACT2FN
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import ClassifierFreeGuidanceLogitsProcessor, GenerationMixin, GenerationMode, LogitsProcessorList
from ...generation.utils import GenerateDecoderOnlyOutput
from ...image_processing_utils import BatchFeature, get_size_dict
@@ -86,8 +86,8 @@ class JanusVisionConfig(SiglipVisionConfig):
This is the configuration class to store the configuration of a [`JanusVisionModel`]. It is used to instantiate a
`JanusVisionModel` according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
Dimensionality of the encoder layers and the pooler layer.
@@ -182,8 +182,8 @@ class JanusVQVAEConfig(ChameleonVQVAEConfig):
r"""
This is the configuration class to store the configuration of a [`JanusVQVAEModel`]. It is used to instantiate a
`JanusVQVAEModel` according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information. Instantiating a
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information. Instantiating a
configuration with the defaults will yield a similar configuration to the VQModel of the
[deepseek-community/Janus-Pro-1B](https://huggingface.co/deepseek-community/Janus-Pro-1B).
@@ -268,7 +268,7 @@ class JanusVQVAEConfig(ChameleonVQVAEConfig):
del self.attn_type
-class JanusConfig(PretrainedConfig):
+class JanusConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`JanusModel`]. It is used to instantiate an
Janus model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -277,8 +277,8 @@ class JanusConfig(PretrainedConfig):
e.g. [deepseek-community/Janus-Pro-1B](https://huggingface.co/deepseek-community/Janus-Pro-1B) or
[deepseek-community/Janus-Pro-7B](https://huggingface.co/deepseek-community/Janus-Pro-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `LlamaConfig`):
@@ -336,7 +336,7 @@ class JanusConfig(PretrainedConfig):
elif text_config is None:
logger.info("`text_config` is None. Initializing with default values")
self.text_config = CONFIG_MAPPING["llama"]()
- elif isinstance(text_config, PretrainedConfig):
+ elif isinstance(text_config, PreTrainedConfig):
self.text_config = text_config
else:
raise ValueError(
diff --git a/src/transformers/models/jetmoe/configuration_jetmoe.py b/src/transformers/models/jetmoe/configuration_jetmoe.py
index 118e734143f..bc466a8f44a 100644
--- a/src/transformers/models/jetmoe/configuration_jetmoe.py
+++ b/src/transformers/models/jetmoe/configuration_jetmoe.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""JetMoe model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class JetMoeConfig(PretrainedConfig):
+class JetMoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`JetMoeModel`]. It is used to instantiate a
JetMoe model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -29,8 +29,8 @@ class JetMoeConfig(PretrainedConfig):
[jetmoe/jetmoe-8b](https://huggingface.co/jetmoe/jetmoe-8b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/kosmos2/configuration_kosmos2.py b/src/transformers/models/kosmos2/configuration_kosmos2.py
index 56b26eb1717..1ad8b133f02 100644
--- a/src/transformers/models/kosmos2/configuration_kosmos2.py
+++ b/src/transformers/models/kosmos2/configuration_kosmos2.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""KOSMOS-2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Kosmos2TextConfig(PretrainedConfig):
+class Kosmos2TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Kosmos2TextModel`]. It is used to instantiate a
KOSMOS-2 text decoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the text decoder of the KOSMOS-2
[microsoft/kosmos-2-patch14-224](https://huggingface.co/microsoft/kosmos-2-patch14-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 65037):
@@ -129,15 +129,15 @@ class Kosmos2TextConfig(PretrainedConfig):
self.use_cache = use_cache
-class Kosmos2VisionConfig(PretrainedConfig):
+class Kosmos2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Kosmos2VisionModel`]. It is used to instantiate a
KOSMOS-2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the KOSMOS-2
[microsoft/kosmos-2-patch14-224](https://huggingface.co/microsoft/kosmos-2-patch14-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
@@ -203,7 +203,7 @@ class Kosmos2VisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class Kosmos2Config(PretrainedConfig):
+class Kosmos2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Kosmos2Model`]. It is used to instantiate a
KOSMOS-2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
diff --git a/src/transformers/models/kosmos2_5/configuration_kosmos2_5.py b/src/transformers/models/kosmos2_5/configuration_kosmos2_5.py
index 9fc3bd58695..d3044eb4cb2 100644
--- a/src/transformers/models/kosmos2_5/configuration_kosmos2_5.py
+++ b/src/transformers/models/kosmos2_5/configuration_kosmos2_5.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""KOSMOS-2.5 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Kosmos2_5TextConfig(PretrainedConfig):
+class Kosmos2_5TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Kosmos2_5TextModel`]. It is used to instantiate a
KOSMOS-2.5 text decoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the text decoder of the KOSMOS-2.5
[microsoft/kosmos-2.5](https://huggingface.co/microsoft/kosmos-2.5) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 108481):
@@ -123,15 +123,15 @@ class Kosmos2_5TextConfig(PretrainedConfig):
self.use_cache = use_cache
-class Kosmos2_5VisionConfig(PretrainedConfig):
+class Kosmos2_5VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Kosmos2_5VisionModel`]. It is used to
instantiate a KOSMOS-2.5 vision encoder according to the specified arguments, defining the model architecture.
Instantiating a configuration defaults will yield a similar configuration to that of the vision encoder of the KOSMOS-2.5
[microsoft/kosmos-2.5](https://huggingface.co/microsoft/kosmos-2.5) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1536):
@@ -209,7 +209,7 @@ class Kosmos2_5VisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Kosmos2_5Config(PretrainedConfig):
+class Kosmos2_5Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Kosmos2_5Model`]. It is used to instantiate a
KOSMOS-2.5 model according to the specified arguments, defining the model architecture. Instantiating a configuration
diff --git a/src/transformers/models/kyutai_speech_to_text/configuration_kyutai_speech_to_text.py b/src/transformers/models/kyutai_speech_to_text/configuration_kyutai_speech_to_text.py
index 8693fd66679..940986c407d 100644
--- a/src/transformers/models/kyutai_speech_to_text/configuration_kyutai_speech_to_text.py
+++ b/src/transformers/models/kyutai_speech_to_text/configuration_kyutai_speech_to_text.py
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.s
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
@@ -21,7 +21,7 @@ from ..auto.configuration_auto import AutoConfig
logger = logging.get_logger(__name__)
-class KyutaiSpeechToTextConfig(PretrainedConfig):
+class KyutaiSpeechToTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`KyutaiSpeechToTextForConditionalGeneration`].
It is used to instantiate a Kyutai Speech-to-Text model according to the specified arguments, defining the model
@@ -30,8 +30,8 @@ class KyutaiSpeechToTextConfig(PretrainedConfig):
e.g. [kyutai/stt-2.6b-en-trfs](https://huggingface.co/kyutai/stt-2.6b-en-trfs)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
codebook_vocab_size (`int`, *optional*, defaults to 2049):
@@ -87,13 +87,13 @@ class KyutaiSpeechToTextConfig(PretrainedConfig):
Padding token id.
bos_token_id (`int`, *optional*, defaults to 48000):
Beginning of stream token id for text tokens.
- codec_config (`PretrainedConfig`, *optional*):
+ codec_config (`PreTrainedConfig`, *optional*):
Configuration for the codec.
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **audio_encoder_config** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **audio_encoder_config** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the audio encoder config.
- - **depth__config** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **depth__config** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the depth decoder config.
@@ -151,7 +151,7 @@ class KyutaiSpeechToTextConfig(PretrainedConfig):
logger.info("codec_config is None, using default audio encoder config.")
elif isinstance(codec_config, dict):
self.codec_config = AutoConfig.for_model(**codec_config)
- elif isinstance(codec_config, PretrainedConfig):
+ elif isinstance(codec_config, PreTrainedConfig):
self.codec_config = codec_config
self.num_codebooks = num_codebooks
diff --git a/src/transformers/models/layoutlm/configuration_layoutlm.py b/src/transformers/models/layoutlm/configuration_layoutlm.py
index f777cd86240..2a3c84901a5 100644
--- a/src/transformers/models/layoutlm/configuration_layoutlm.py
+++ b/src/transformers/models/layoutlm/configuration_layoutlm.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import Any, Optional
-from ... import PretrainedConfig, PreTrainedTokenizer
+from ... import PreTrainedConfig, PreTrainedTokenizer
from ...onnx import OnnxConfig, PatchingSpec
from ...utils import is_torch_available, logging
@@ -26,7 +26,7 @@ from ...utils import is_torch_available, logging
logger = logging.get_logger(__name__)
-class LayoutLMConfig(PretrainedConfig):
+class LayoutLMConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LayoutLMModel`]. It is used to instantiate a
LayoutLM model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -130,7 +130,7 @@ class LayoutLMConfig(PretrainedConfig):
class LayoutLMOnnxConfig(OnnxConfig):
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
task: str = "default",
patching_specs: Optional[list[PatchingSpec]] = None,
):
diff --git a/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py b/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py
index b729ddbb1d4..b204f769ec0 100644
--- a/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py
+++ b/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""LayoutLMv2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import is_detectron2_available, logging
@@ -26,15 +26,15 @@ if is_detectron2_available():
import detectron2
-class LayoutLMv2Config(PretrainedConfig):
+class LayoutLMv2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LayoutLMv2Model`]. It is used to instantiate an
LayoutLMv2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the LayoutLMv2
[microsoft/layoutlmv2-base-uncased](https://huggingface.co/microsoft/layoutlmv2-base-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
diff --git a/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py b/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py
index b7876074383..cbef304b8ff 100644
--- a/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py
+++ b/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py
@@ -20,7 +20,7 @@ from typing import TYPE_CHECKING, Any
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import logging
@@ -33,15 +33,15 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class LayoutLMv3Config(PretrainedConfig):
+class LayoutLMv3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LayoutLMv3Model`]. It is used to instantiate an
LayoutLMv3 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the LayoutLMv3
[microsoft/layoutlmv3-base](https://huggingface.co/microsoft/layoutlmv3-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50265):
diff --git a/src/transformers/models/led/configuration_led.py b/src/transformers/models/led/configuration_led.py
index 57809df4aa8..7873eaf8855 100644
--- a/src/transformers/models/led/configuration_led.py
+++ b/src/transformers/models/led/configuration_led.py
@@ -16,22 +16,22 @@
from typing import Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class LEDConfig(PretrainedConfig):
+class LEDConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LEDModel`]. It is used to instantiate an LED
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LED
[allenai/led-base-16384](https://huggingface.co/allenai/led-base-16384) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/levit/configuration_levit.py b/src/transformers/models/levit/configuration_levit.py
index b0d63ed8e37..e52f74ddd62 100644
--- a/src/transformers/models/levit/configuration_levit.py
+++ b/src/transformers/models/levit/configuration_levit.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class LevitConfig(PretrainedConfig):
+class LevitConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LevitModel`]. It is used to instantiate a LeViT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LeViT
[facebook/levit-128S](https://huggingface.co/facebook/levit-128S) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/lfm2/configuration_lfm2.py b/src/transformers/models/lfm2/configuration_lfm2.py
index ce331a311a7..3b75a640fc4 100644
--- a/src/transformers/models/lfm2/configuration_lfm2.py
+++ b/src/transformers/models/lfm2/configuration_lfm2.py
@@ -13,18 +13,18 @@
# limitations under the License.
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class Lfm2Config(PretrainedConfig):
+class Lfm2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Lfm2Model`]. It is used to instantiate a LFM2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LFM2-1.2B model.
e.g. [LiquidAI/LFM2-1.2B](https://huggingface.co/LiquidAI/LFM2-1.2B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/lfm2_vl/configuration_lfm2_vl.py b/src/transformers/models/lfm2_vl/configuration_lfm2_vl.py
index 1378fbe6dc8..22679854a7a 100755
--- a/src/transformers/models/lfm2_vl/configuration_lfm2_vl.py
+++ b/src/transformers/models/lfm2_vl/configuration_lfm2_vl.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""PyTorch LFM2-VL model."""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -22,7 +22,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class Lfm2VlConfig(PretrainedConfig):
+class Lfm2VlConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Lfm2VlForConditionalGeneration`]. It is used to instantiate an
Lfm2Vl model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -30,8 +30,8 @@ class Lfm2VlConfig(PretrainedConfig):
e.g. [LiquidAI/LFM2-VL-1.6B](https://huggingface.co/LiquidAI/LFM2-VL-1.6B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`AutoConfig | dict`, *optional*, defaults to `Siglip2ImageConfig`):
diff --git a/src/transformers/models/lightglue/configuration_lightglue.py b/src/transformers/models/lightglue/configuration_lightglue.py
index 90e8d41b451..f91b88f6bd7 100644
--- a/src/transformers/models/lightglue/configuration_lightglue.py
+++ b/src/transformers/models/lightglue/configuration_lightglue.py
@@ -19,20 +19,20 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
from ..superpoint import SuperPointConfig
-class LightGlueConfig(PretrainedConfig):
+class LightGlueConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LightGlueForKeypointMatching`]. It is used to
instantiate a LightGlue model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the LightGlue
[ETH-CVG/lightglue_superpoint](https://huggingface.co/ETH-CVG/lightglue_superpoint) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
keypoint_detector_config (`Union[AutoConfig, dict]`, *optional*, defaults to `SuperPointConfig`):
diff --git a/src/transformers/models/lightglue/modular_lightglue.py b/src/transformers/models/lightglue/modular_lightglue.py
index 29441344c9c..4018622a689 100644
--- a/src/transformers/models/lightglue/modular_lightglue.py
+++ b/src/transformers/models/lightglue/modular_lightglue.py
@@ -20,7 +20,7 @@ import torch
from torch import nn
from torch.nn.utils.rnn import pad_sequence
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...image_utils import ImageInput, is_vision_available, to_numpy_array
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
@@ -43,15 +43,15 @@ if is_vision_available():
logger = logging.get_logger(__name__)
-class LightGlueConfig(PretrainedConfig):
+class LightGlueConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LightGlueForKeypointMatching`]. It is used to
instantiate a LightGlue model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the LightGlue
[ETH-CVG/lightglue_superpoint](https://huggingface.co/ETH-CVG/lightglue_superpoint) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
keypoint_detector_config (`Union[AutoConfig, dict]`, *optional*, defaults to `SuperPointConfig`):
diff --git a/src/transformers/models/lilt/configuration_lilt.py b/src/transformers/models/lilt/configuration_lilt.py
index 940fad4aa81..c8e48271912 100644
--- a/src/transformers/models/lilt/configuration_lilt.py
+++ b/src/transformers/models/lilt/configuration_lilt.py
@@ -14,21 +14,21 @@
# limitations under the License.
"""LiLT configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class LiltConfig(PretrainedConfig):
+class LiltConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LiltModel`]. It is used to instantiate a LiLT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LiLT
[SCUT-DLVCLab/lilt-roberta-en-base](https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
diff --git a/src/transformers/models/llama/configuration_llama.py b/src/transformers/models/llama/configuration_llama.py
index 0065cf56b3b..5501785d46d 100644
--- a/src/transformers/models/llama/configuration_llama.py
+++ b/src/transformers/models/llama/configuration_llama.py
@@ -19,19 +19,19 @@
# limitations under the License.
"""LLaMA model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class LlamaConfig(PretrainedConfig):
+class LlamaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LlamaModel`]. It is used to instantiate an LLaMA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LLaMA-7B.
e.g. [meta-llama/Llama-2-7b-hf](https://huggingface.co/meta-llama/Llama-2-7b-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/llama4/configuration_llama4.py b/src/transformers/models/llama4/configuration_llama4.py
index 932f4975dba..214a90a1bc5 100644
--- a/src/transformers/models/llama4/configuration_llama4.py
+++ b/src/transformers/models/llama4/configuration_llama4.py
@@ -16,14 +16,14 @@
import warnings
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...utils import logging
logger = logging.get_logger(__name__)
-class Llama4VisionConfig(PretrainedConfig):
+class Llama4VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Llama4VisionModel`]. It is used to instantiate a
Llama4 vision model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -31,8 +31,8 @@ class Llama4VisionConfig(PretrainedConfig):
e.g. [meta-llama/Llama-4-Scout-17B-16E](https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -141,7 +141,7 @@ class Llama4VisionConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Llama4TextConfig(PretrainedConfig):
+class Llama4TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Llama4TextModel`]. It is used to instantiate a
Llama4 text model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -149,8 +149,8 @@ class Llama4TextConfig(PretrainedConfig):
e.g. [meta-llama/Llama-4-Scout-17B-16E](https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 202048):
@@ -394,7 +394,7 @@ class Llama4TextConfig(PretrainedConfig):
layer_type_validation(self.layer_types, self.num_hidden_layers)
-class Llama4Config(PretrainedConfig):
+class Llama4Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Llama4Model`]. It is used to instantiate an
Llama4 model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -402,8 +402,8 @@ class Llama4Config(PretrainedConfig):
e.g. [meta-llama/Llama-4-Scout-17B-16E](https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/llava/configuration_llava.py b/src/transformers/models/llava/configuration_llava.py
index 9ae710c0119..40157ab63b9 100644
--- a/src/transformers/models/llava/configuration_llava.py
+++ b/src/transformers/models/llava/configuration_llava.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""Llava model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,7 +21,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class LlavaConfig(PretrainedConfig):
+class LlavaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LlavaForConditionalGeneration`]. It is used to instantiate an
Llava model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -29,8 +29,8 @@ class LlavaConfig(PretrainedConfig):
e.g. [llava-hf/llava-9b](https://huggingface.co/llava-hf/llava-9b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `CLIPVisionConfig`):
diff --git a/src/transformers/models/llava_next/configuration_llava_next.py b/src/transformers/models/llava_next/configuration_llava_next.py
index 17ea71b1aa6..a319ae7b130 100644
--- a/src/transformers/models/llava_next/configuration_llava_next.py
+++ b/src/transformers/models/llava_next/configuration_llava_next.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""Llava-NeXT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,15 +21,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class LlavaNextConfig(PretrainedConfig):
+class LlavaNextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LlavaNextForConditionalGeneration`]. It is used to instantiate an
Llava-NeXT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [llava-hf/llava-v1.6-mistral-7b-hf](https://huggingface.co/llava-hf/llava-v1.6-mistral-7b-hf)
model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `CLIPVisionConfig`):
diff --git a/src/transformers/models/llava_next_video/configuration_llava_next_video.py b/src/transformers/models/llava_next_video/configuration_llava_next_video.py
index 1eb1078b6ac..7b82b5ac5b8 100644
--- a/src/transformers/models/llava_next_video/configuration_llava_next_video.py
+++ b/src/transformers/models/llava_next_video/configuration_llava_next_video.py
@@ -19,18 +19,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class LlavaNextVideoConfig(PretrainedConfig):
+class LlavaNextVideoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LlavaNextVideoForConditionalGeneration`]. It is used to instantiate an
Llava-NeXT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [llava-hf/LLaVA-NeXT-Video-7B-hf](https://huggingface.co/llava-hf/LLaVA-NeXT-Video-7B-hf)
model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `CLIPVisionConfig`):
diff --git a/src/transformers/models/llava_next_video/modular_llava_next_video.py b/src/transformers/models/llava_next_video/modular_llava_next_video.py
index 7eda08ffa0b..2ba202f668e 100644
--- a/src/transformers/models/llava_next_video/modular_llava_next_video.py
+++ b/src/transformers/models/llava_next_video/modular_llava_next_video.py
@@ -30,7 +30,7 @@ from transformers.models.llava_next.modeling_llava_next import (
)
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...processing_utils import Unpack
from ...utils import logging
@@ -40,14 +40,14 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class LlavaNextVideoConfig(PretrainedConfig):
+class LlavaNextVideoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LlavaNextVideoForConditionalGeneration`]. It is used to instantiate an
Llava-NeXT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [llava-hf/LLaVA-NeXT-Video-7B-hf](https://huggingface.co/llava-hf/LLaVA-NeXT-Video-7B-hf)
model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `CLIPVisionConfig`):
diff --git a/src/transformers/models/llava_onevision/configuration_llava_onevision.py b/src/transformers/models/llava_onevision/configuration_llava_onevision.py
index 21ead3df170..9fd1e850f0e 100644
--- a/src/transformers/models/llava_onevision/configuration_llava_onevision.py
+++ b/src/transformers/models/llava_onevision/configuration_llava_onevision.py
@@ -14,7 +14,7 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import (
logging,
)
@@ -24,15 +24,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class LlavaOnevisionConfig(PretrainedConfig):
+class LlavaOnevisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LlavaOnevisionForConditionalGeneration`]. It is used to instantiate an
Llava-NeXT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [llava-hf/llava-onevision-qwen2-7b-ov-hf](https://huggingface.co/llava-hf/llava-onevision-qwen2-7b-ov-hf)
model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `SiglipVisionConfig`):
diff --git a/src/transformers/models/longcat_flash/configuration_longcat_flash.py b/src/transformers/models/longcat_flash/configuration_longcat_flash.py
index 4c5930db8f3..e9703a6b55c 100644
--- a/src/transformers/models/longcat_flash/configuration_longcat_flash.py
+++ b/src/transformers/models/longcat_flash/configuration_longcat_flash.py
@@ -15,18 +15,18 @@
"""LongCat Flash model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class LongcatFlashConfig(PretrainedConfig):
+class LongcatFlashConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LongcatFlashModel`]. It is used to instantiate
a LongCat Flash model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the LongCat Flash architecture.
e.g. [meituan-longcat/LongCat-Flash-Chat](https://huggingface.co/meituan-longcat/LongCat-Flash-Chat)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/longformer/configuration_longformer.py b/src/transformers/models/longformer/configuration_longformer.py
index 111ede4d0dd..204e78a6b2a 100644
--- a/src/transformers/models/longformer/configuration_longformer.py
+++ b/src/transformers/models/longformer/configuration_longformer.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, Optional, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -31,7 +31,7 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class LongformerConfig(PretrainedConfig):
+class LongformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LongformerModel`] or a [`TFLongformerModel`]. It
is used to instantiate a Longformer model according to the specified arguments, defining the model architecture.
@@ -42,8 +42,8 @@ class LongformerConfig(PretrainedConfig):
[allenai/longformer-base-4096](https://huggingface.co/allenai/longformer-base-4096) architecture with a sequence
length 4,096.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
@@ -141,7 +141,7 @@ class LongformerConfig(PretrainedConfig):
class LongformerOnnxConfig(OnnxConfig):
def __init__(
- self, config: "PretrainedConfig", task: str = "default", patching_specs: "Optional[list[PatchingSpec]]" = None
+ self, config: "PreTrainedConfig", task: str = "default", patching_specs: "Optional[list[PatchingSpec]]" = None
):
super().__init__(config, task, patching_specs)
config.onnx_export = True
diff --git a/src/transformers/models/longt5/configuration_longt5.py b/src/transformers/models/longt5/configuration_longt5.py
index b4833f4394e..4889eff6467 100644
--- a/src/transformers/models/longt5/configuration_longt5.py
+++ b/src/transformers/models/longt5/configuration_longt5.py
@@ -16,7 +16,7 @@
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxSeq2SeqConfigWithPast
from ...utils import logging
@@ -24,15 +24,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class LongT5Config(PretrainedConfig):
+class LongT5Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LongT5Model`]. It is
used to instantiate a LongT5 model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the LongT5
[google/long-t5-local-base](https://huggingface.co/google/long-t5-local-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 32128):
diff --git a/src/transformers/models/luke/configuration_luke.py b/src/transformers/models/luke/configuration_luke.py
index fbac7c36d76..0a0d3061235 100644
--- a/src/transformers/models/luke/configuration_luke.py
+++ b/src/transformers/models/luke/configuration_luke.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""LUKE configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class LukeConfig(PretrainedConfig):
+class LukeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LukeModel`]. It is used to instantiate a LUKE
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LUKE
[studio-ousia/luke-base](https://huggingface.co/studio-ousia/luke-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/lxmert/configuration_lxmert.py b/src/transformers/models/lxmert/configuration_lxmert.py
index cba273e0f19..101a0b4965e 100644
--- a/src/transformers/models/lxmert/configuration_lxmert.py
+++ b/src/transformers/models/lxmert/configuration_lxmert.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""LXMERT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class LxmertConfig(PretrainedConfig):
+class LxmertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`LxmertModel`] or a [`TFLxmertModel`]. It is used
to instantiate a LXMERT model according to the specified arguments, defining the model architecture. Instantiating
a configuration with the defaults will yield a similar configuration to that of the Lxmert
[unc-nlp/lxmert-base-uncased](https://huggingface.co/unc-nlp/lxmert-base-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/m2m_100/configuration_m2m_100.py b/src/transformers/models/m2m_100/configuration_m2m_100.py
index ff4f6f0d1af..426413a0f1e 100644
--- a/src/transformers/models/m2m_100/configuration_m2m_100.py
+++ b/src/transformers/models/m2m_100/configuration_m2m_100.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig, OnnxSeq2SeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import is_torch_available, logging
@@ -28,15 +28,15 @@ from ...utils import is_torch_available, logging
logger = logging.get_logger(__name__)
-class M2M100Config(PretrainedConfig):
+class M2M100Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`M2M100Model`]. It is used to instantiate an
M2M100 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the M2M100
[facebook/m2m100_418M](https://huggingface.co/facebook/m2m100_418M) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/mamba/configuration_mamba.py b/src/transformers/models/mamba/configuration_mamba.py
index 4f6c17af01f..918edc412d1 100644
--- a/src/transformers/models/mamba/configuration_mamba.py
+++ b/src/transformers/models/mamba/configuration_mamba.py
@@ -16,22 +16,22 @@
import math
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MambaConfig(PretrainedConfig):
+class MambaConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`MambaModel`]. It is used to instantiate a MAMBA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the MAMBA
[state-spaces/mamba-2.8b](https://huggingface.co/state-spaces/mamba-2.8b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/mamba/modeling_mamba.py b/src/transformers/models/mamba/modeling_mamba.py
index ba1c1f44d3f..6e1d2482897 100644
--- a/src/transformers/models/mamba/modeling_mamba.py
+++ b/src/transformers/models/mamba/modeling_mamba.py
@@ -23,7 +23,7 @@ from torch import nn
from torch.nn import CrossEntropyLoss
from ...activations import ACT2FN
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...modeling_layers import GradientCheckpointingLayer
from ...modeling_utils import PreTrainedModel
@@ -81,7 +81,7 @@ class MambaCache:
Cache for mamba model which does not have attention mechanism and key value states.
Arguments:
- config (`PretrainedConfig):
+ config (`PreTrainedConfig):
The configuration file defining the shape-related attributes required to initialize the static cache.
max_batch_size (`int`):
The maximum batch size with which the model will be used. Note that a new instance must be instantiated if
@@ -115,7 +115,7 @@ class MambaCache:
# TODO (joao): add layer_device_map arg and update code in `generate` accordingly
def __init__(
self,
- config: PretrainedConfig,
+ config: PreTrainedConfig,
max_batch_size: int,
dtype: torch.dtype = torch.float16,
device: Union[torch.device, str, None] = None,
diff --git a/src/transformers/models/mamba2/configuration_mamba2.py b/src/transformers/models/mamba2/configuration_mamba2.py
index 3b1b1177c0a..1b84c28879a 100644
--- a/src/transformers/models/mamba2/configuration_mamba2.py
+++ b/src/transformers/models/mamba2/configuration_mamba2.py
@@ -16,22 +16,22 @@
import math
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Mamba2Config(PretrainedConfig):
+class Mamba2Config(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`Mamba2Model`]. It is used to instantiate a MAMBA2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the MAMBA2
[state-spaces/mamba2-2.8b](https://huggingface.co/state-spaces/mamba2-2.8b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/marian/configuration_marian.py b/src/transformers/models/marian/configuration_marian.py
index fd68286b9be..678572d162b 100644
--- a/src/transformers/models/marian/configuration_marian.py
+++ b/src/transformers/models/marian/configuration_marian.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeq2SeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import is_torch_available, logging
@@ -28,15 +28,15 @@ from ...utils import is_torch_available, logging
logger = logging.get_logger(__name__)
-class MarianConfig(PretrainedConfig):
+class MarianConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MarianModel`]. It is used to instantiate an
Marian model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Marian
[Helsinki-NLP/opus-mt-en-de](https://huggingface.co/Helsinki-NLP/opus-mt-en-de) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/markuplm/configuration_markuplm.py b/src/transformers/models/markuplm/configuration_markuplm.py
index 34c2083df85..1f1b62949fa 100644
--- a/src/transformers/models/markuplm/configuration_markuplm.py
+++ b/src/transformers/models/markuplm/configuration_markuplm.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""MarkupLM model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MarkupLMConfig(PretrainedConfig):
+class MarkupLMConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MarkupLMModel`]. It is used to instantiate a
MarkupLM model according to the specified arguments, defining the model architecture. Instantiating a configuration
diff --git a/src/transformers/models/mask2former/configuration_mask2former.py b/src/transformers/models/mask2former/configuration_mask2former.py
index 9ae93892aeb..d6f735ce80c 100644
--- a/src/transformers/models/mask2former/configuration_mask2former.py
+++ b/src/transformers/models/mask2former/configuration_mask2former.py
@@ -16,7 +16,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -25,7 +25,7 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class Mask2FormerConfig(PretrainedConfig):
+class Mask2FormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Mask2FormerModel`]. It is used to instantiate a
Mask2Former model according to the specified arguments, defining the model architecture. Instantiating a
@@ -33,13 +33,13 @@ class Mask2FormerConfig(PretrainedConfig):
[facebook/mask2former-swin-small-coco-instance](https://huggingface.co/facebook/mask2former-swin-small-coco-instance)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Currently, Mask2Former only supports the [Swin Transformer](swin) as backbone.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `SwinConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `SwinConfig()`):
The configuration of the backbone model. If unset, the configuration corresponding to
`swin-base-patch4-window12-384` will be used.
backbone (`str`, *optional*):
@@ -245,11 +245,11 @@ class Mask2FormerConfig(PretrainedConfig):
)
@classmethod
- def from_backbone_config(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_config(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`Mask2FormerConfig`] (or a derived class) from a pre-trained backbone model configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
diff --git a/src/transformers/models/maskformer/configuration_maskformer.py b/src/transformers/models/maskformer/configuration_maskformer.py
index d988acb45e9..49d5f19ba7a 100644
--- a/src/transformers/models/maskformer/configuration_maskformer.py
+++ b/src/transformers/models/maskformer/configuration_maskformer.py
@@ -16,7 +16,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -27,7 +27,7 @@ from ..swin import SwinConfig
logger = logging.get_logger(__name__)
-class MaskFormerConfig(PretrainedConfig):
+class MaskFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MaskFormerModel`]. It is used to instantiate a
MaskFormer model according to the specified arguments, defining the model architecture. Instantiating a
@@ -35,8 +35,8 @@ class MaskFormerConfig(PretrainedConfig):
[facebook/maskformer-swin-base-ade](https://huggingface.co/facebook/maskformer-swin-base-ade) architecture trained
on [ADE20k-150](https://huggingface.co/datasets/scene_parse_150).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Currently, MaskFormer only supports the [Swin Transformer](swin) as backbone.
@@ -211,15 +211,15 @@ class MaskFormerConfig(PretrainedConfig):
@classmethod
def from_backbone_and_decoder_configs(
- cls, backbone_config: PretrainedConfig, decoder_config: PretrainedConfig, **kwargs
+ cls, backbone_config: PreTrainedConfig, decoder_config: PreTrainedConfig, **kwargs
):
"""Instantiate a [`MaskFormerConfig`] (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
- decoder_config ([`PretrainedConfig`]):
+ decoder_config ([`PreTrainedConfig`]):
The transformer decoder configuration to use.
Returns:
diff --git a/src/transformers/models/maskformer/configuration_maskformer_swin.py b/src/transformers/models/maskformer/configuration_maskformer_swin.py
index 84157117bbf..8116b784489 100644
--- a/src/transformers/models/maskformer/configuration_maskformer_swin.py
+++ b/src/transformers/models/maskformer/configuration_maskformer_swin.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""MaskFormer Swin Transformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,7 +22,7 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class MaskFormerSwinConfig(BackboneConfigMixin, PretrainedConfig):
+class MaskFormerSwinConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MaskFormerSwinModel`]. It is used to instantiate
a Donut model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -30,8 +30,8 @@ class MaskFormerSwinConfig(BackboneConfigMixin, PretrainedConfig):
[microsoft/swin-tiny-patch4-window7-224](https://huggingface.co/microsoft/swin-tiny-patch4-window7-224)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/mbart/configuration_mbart.py b/src/transformers/models/mbart/configuration_mbart.py
index ba0dd16553c..3a88d90a2da 100644
--- a/src/transformers/models/mbart/configuration_mbart.py
+++ b/src/transformers/models/mbart/configuration_mbart.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from typing import Any
from ... import PreTrainedTokenizer
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeq2SeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import is_torch_available, logging
@@ -28,15 +28,15 @@ from ...utils import is_torch_available, logging
logger = logging.get_logger(__name__)
-class MBartConfig(PretrainedConfig):
+class MBartConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MBartModel`]. It is used to instantiate an MBART
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the MBART
[facebook/mbart-large-cc25](https://huggingface.co/facebook/mbart-large-cc25) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/megatron_bert/configuration_megatron_bert.py b/src/transformers/models/megatron_bert/configuration_megatron_bert.py
index 1505388e292..c84d5406b07 100644
--- a/src/transformers/models/megatron_bert/configuration_megatron_bert.py
+++ b/src/transformers/models/megatron_bert/configuration_megatron_bert.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""MEGATRON_BERT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MegatronBertConfig(PretrainedConfig):
+class MegatronBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MegatronBertModel`]. It is used to instantiate a
MEGATRON_BERT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MEGATRON_BERT
[nvidia/megatron-bert-uncased-345m](https://huggingface.co/nvidia/megatron-bert-uncased-345m) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/metaclip_2/configuration_metaclip_2.py b/src/transformers/models/metaclip_2/configuration_metaclip_2.py
index 4ad1bcde0da..ecd2d245df6 100644
--- a/src/transformers/models/metaclip_2/configuration_metaclip_2.py
+++ b/src/transformers/models/metaclip_2/configuration_metaclip_2.py
@@ -5,22 +5,22 @@
# modular_metaclip_2.py file directly. One of our CI enforces this.
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MetaClip2TextConfig(PretrainedConfig):
+class MetaClip2TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MetaClip2TextModel`]. It is used to instantiate
a MetaClip2 text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MetaClip2
[facebook/metaclip-2-worldwide-huge-quickgelu](https://huggingface.co/facebook/metaclip-2-worldwide-huge-quickgelu) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 49408):
@@ -113,15 +113,15 @@ class MetaClip2TextConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class MetaClip2VisionConfig(PretrainedConfig):
+class MetaClip2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MetaClip2VisionModel`]. It is used to instantiate a MetaClip2
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the MetaClip2
[facebook/metaclip-2-worldwide-huge-quickgelu](https://huggingface.co/facebook/metaclip-2-worldwide-huge-quickgelu) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -205,15 +205,15 @@ class MetaClip2VisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class MetaClip2Config(PretrainedConfig):
+class MetaClip2Config(PreTrainedConfig):
r"""
[`MetaClip2Config`] is the configuration class to store the configuration of a [`MetaClip2Model`]. It is used to
instantiate a MetaClip2 model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the MetaClip2
[facebook/metaclip-2-worldwide-huge-quickgelu](https://huggingface.co/facebook/metaclip-2-worldwide-huge-quickgelu) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/metaclip_2/modular_metaclip_2.py b/src/transformers/models/metaclip_2/modular_metaclip_2.py
index 4d5a536ab93..bf1f553c648 100644
--- a/src/transformers/models/metaclip_2/modular_metaclip_2.py
+++ b/src/transformers/models/metaclip_2/modular_metaclip_2.py
@@ -39,8 +39,8 @@ class MetaClip2TextConfig(CLIPTextConfig):
configuration with the defaults will yield a similar configuration to that of the MetaClip2
[facebook/metaclip-2-worldwide-huge-quickgelu](https://huggingface.co/facebook/metaclip-2-worldwide-huge-quickgelu) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 49408):
@@ -103,8 +103,8 @@ class MetaClip2VisionConfig(CLIPVisionConfig):
with the defaults will yield a similar configuration to that of the vision encoder of the MetaClip2
[facebook/metaclip-2-worldwide-huge-quickgelu](https://huggingface.co/facebook/metaclip-2-worldwide-huge-quickgelu) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -161,8 +161,8 @@ class MetaClip2Config(CLIPConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the MetaClip2
[facebook/metaclip-2-worldwide-huge-quickgelu](https://huggingface.co/facebook/metaclip-2-worldwide-huge-quickgelu) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/mgp_str/configuration_mgp_str.py b/src/transformers/models/mgp_str/configuration_mgp_str.py
index 1f6b355c771..a85ca281768 100644
--- a/src/transformers/models/mgp_str/configuration_mgp_str.py
+++ b/src/transformers/models/mgp_str/configuration_mgp_str.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""MGP-STR model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MgpstrConfig(PretrainedConfig):
+class MgpstrConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`MgpstrModel`]. It is used to instantiate an
MGP-STR model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the MGP-STR
[alibaba-damo/mgp-str-base](https://huggingface.co/alibaba-damo/mgp-str-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`list[int]`, *optional*, defaults to `[32, 128]`):
diff --git a/src/transformers/models/mimi/configuration_mimi.py b/src/transformers/models/mimi/configuration_mimi.py
index c53ce475f9e..482aaa854d0 100644
--- a/src/transformers/models/mimi/configuration_mimi.py
+++ b/src/transformers/models/mimi/configuration_mimi.py
@@ -18,22 +18,22 @@ import math
import numpy as np
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MimiConfig(PretrainedConfig):
+class MimiConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`MimiModel`]. It is used to instantiate a
Mimi model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[kyutai/mimi](https://huggingface.co/kyutai/mimi) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
sampling_rate (`int`, *optional*, defaults to 24000):
diff --git a/src/transformers/models/minimax/configuration_minimax.py b/src/transformers/models/minimax/configuration_minimax.py
index ec703cfb92d..5eb3045a452 100644
--- a/src/transformers/models/minimax/configuration_minimax.py
+++ b/src/transformers/models/minimax/configuration_minimax.py
@@ -19,10 +19,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
-class MiniMaxConfig(PretrainedConfig):
+class MiniMaxConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MiniMaxModel`]. It is used to instantiate an
MiniMax model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -30,8 +30,8 @@ class MiniMaxConfig(PretrainedConfig):
[MiniMaxAI/MiniMax-Text-01-hf](https://huggingface.co/MiniMaxAI/MiniMax-Text-01-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/minimax/modular_minimax.py b/src/transformers/models/minimax/modular_minimax.py
index 3ba68fcf234..d07c3f87383 100644
--- a/src/transformers/models/minimax/modular_minimax.py
+++ b/src/transformers/models/minimax/modular_minimax.py
@@ -58,8 +58,8 @@ class MiniMaxConfig(MixtralConfig):
[MiniMaxAI/MiniMax-Text-01-hf](https://huggingface.co/MiniMaxAI/MiniMax-Text-01-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/ministral/configuration_ministral.py b/src/transformers/models/ministral/configuration_ministral.py
index e6e20b4c6fd..0133b129d9b 100644
--- a/src/transformers/models/ministral/configuration_ministral.py
+++ b/src/transformers/models/ministral/configuration_ministral.py
@@ -4,10 +4,10 @@
# the file from the modular. If any change should be done, please apply the change to the
# modular_ministral.py file directly. One of our CI enforces this.
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class MinistralConfig(PretrainedConfig):
+class MinistralConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MinistralModel`]. It is used to instantiate an
Ministral model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -16,8 +16,8 @@ class MinistralConfig(PretrainedConfig):
[mistralai/Ministral-8B-Instruct-2410](https://huggingface.co/mistralai/Ministral-8B-Instruct-2410)
[mistralai/Ministral-8B-Instruct-2410](https://huggingface.co/mistralai/Ministral-8B-Instruct-2410)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/ministral/modular_ministral.py b/src/transformers/models/ministral/modular_ministral.py
index f0b0d52d695..8dd114246b4 100644
--- a/src/transformers/models/ministral/modular_ministral.py
+++ b/src/transformers/models/ministral/modular_ministral.py
@@ -4,7 +4,7 @@ import torch
from torch import nn
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...masking_utils import create_causal_mask, create_sliding_window_causal_mask
from ...modeling_outputs import BaseModelOutputWithPast
from ...processing_utils import Unpack
@@ -26,7 +26,7 @@ from ..qwen2.modeling_qwen2 import (
)
-class MinistralConfig(MistralConfig, PretrainedConfig):
+class MinistralConfig(MistralConfig, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MinistralModel`]. It is used to instantiate an
Ministral model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -35,8 +35,8 @@ class MinistralConfig(MistralConfig, PretrainedConfig):
[mistralai/Ministral-8B-Instruct-2410](https://huggingface.co/mistralai/Ministral-8B-Instruct-2410)
[mistralai/Ministral-8B-Instruct-2410](https://huggingface.co/mistralai/Ministral-8B-Instruct-2410)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -128,7 +128,7 @@ class MinistralConfig(MistralConfig, PretrainedConfig):
layer_types=None,
**kwargs,
):
- PretrainedConfig.__init__(
+ PreTrainedConfig.__init__(
self,
pad_token_id=pad_token_id,
bos_token_id=bos_token_id,
diff --git a/src/transformers/models/mistral/configuration_mistral.py b/src/transformers/models/mistral/configuration_mistral.py
index e9f66b1a2fb..f0902731534 100644
--- a/src/transformers/models/mistral/configuration_mistral.py
+++ b/src/transformers/models/mistral/configuration_mistral.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""Mistral model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MistralConfig(PretrainedConfig):
+class MistralConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MistralModel`]. It is used to instantiate an
Mistral model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -30,8 +30,8 @@ class MistralConfig(PretrainedConfig):
[mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
[mistralai/Mistral-7B-Instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/mistral3/configuration_mistral3.py b/src/transformers/models/mistral3/configuration_mistral3.py
index 90ae36abcec..59851c13598 100644
--- a/src/transformers/models/mistral3/configuration_mistral3.py
+++ b/src/transformers/models/mistral3/configuration_mistral3.py
@@ -14,19 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class Mistral3Config(PretrainedConfig):
+class Mistral3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Mistral3ForConditionalGeneration`]. It is used to instantiate an
Mistral3 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
[mistralai/Mistral-Small-3.1-24B-Instruct-2503](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Instruct-2503)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `PixtralVisionConfig`):
diff --git a/src/transformers/models/mixtral/configuration_mixtral.py b/src/transformers/models/mixtral/configuration_mixtral.py
index b83da64552c..06cc29fd92a 100644
--- a/src/transformers/models/mixtral/configuration_mixtral.py
+++ b/src/transformers/models/mixtral/configuration_mixtral.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""Mixtral model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MixtralConfig(PretrainedConfig):
+class MixtralConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MixtralModel`]. It is used to instantiate an
Mixtral model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -30,8 +30,8 @@ class MixtralConfig(PretrainedConfig):
[mixtralai/Mixtral-8x7B](https://huggingface.co/mixtralai/Mixtral-8x7B)
[mixtralai/Mixtral-7B-Instruct-v0.1](https://huggingface.co/mixtralai/Mixtral-7B-Instruct-v0.1)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/mlcd/configuration_mlcd.py b/src/transformers/models/mlcd/configuration_mlcd.py
index f28a5f1a7ca..d4f79140c80 100644
--- a/src/transformers/models/mlcd/configuration_mlcd.py
+++ b/src/transformers/models/mlcd/configuration_mlcd.py
@@ -19,18 +19,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class MLCDVisionConfig(PretrainedConfig):
+class MLCDVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MLCDVisionModel`]. It is used to instantiate a MLCD
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the MLCD
[DeepGlint-AI/mlcd-vit-bigG-patch14-336](https://huggingface.co/DeepGlint-AI/mlcd-vit-bigG-patch14-336) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1664):
diff --git a/src/transformers/models/mlcd/modular_mlcd.py b/src/transformers/models/mlcd/modular_mlcd.py
index fcc18ab2b1c..782c0f69762 100644
--- a/src/transformers/models/mlcd/modular_mlcd.py
+++ b/src/transformers/models/mlcd/modular_mlcd.py
@@ -17,7 +17,7 @@ from typing import Callable, Optional, Union
import torch
import torch.nn as nn
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
@@ -39,15 +39,15 @@ from ..qwen2_vl.modeling_qwen2_vl import VisionRotaryEmbedding, apply_rotary_pos
logger = logging.get_logger(__name__)
-class MLCDVisionConfig(PretrainedConfig):
+class MLCDVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MLCDVisionModel`]. It is used to instantiate a MLCD
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the MLCD
[DeepGlint-AI/mlcd-vit-bigG-patch14-336](https://huggingface.co/DeepGlint-AI/mlcd-vit-bigG-patch14-336) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1664):
diff --git a/src/transformers/models/mllama/configuration_mllama.py b/src/transformers/models/mllama/configuration_mllama.py
index 6d0518ab9b8..498cfa930ec 100644
--- a/src/transformers/models/mllama/configuration_mllama.py
+++ b/src/transformers/models/mllama/configuration_mllama.py
@@ -15,7 +15,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -23,7 +23,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class MllamaVisionConfig(PretrainedConfig):
+class MllamaVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MllamaVisionModel`]. It is used to instantiate an
Mllama vision model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -31,8 +31,8 @@ class MllamaVisionConfig(PretrainedConfig):
e.g. [meta-llama/Llama-3.2-11B-Vision](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1280):
@@ -138,7 +138,7 @@ class MllamaVisionConfig(PretrainedConfig):
return len(self.supported_aspect_ratios)
-class MllamaTextConfig(PretrainedConfig):
+class MllamaTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MllamaTextModel`]. It is used to instantiate an
Mllama text model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -146,8 +146,8 @@ class MllamaTextConfig(PretrainedConfig):
e.g. [meta-llama/Llama-3.2-11B-Vision](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 128256):
@@ -296,7 +296,7 @@ class MllamaTextConfig(PretrainedConfig):
)
-class MllamaConfig(PretrainedConfig):
+class MllamaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MllamaForConditionalGeneration`]. It is used to instantiate an
Mllama model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -304,8 +304,8 @@ class MllamaConfig(PretrainedConfig):
e.g. [meta-llama/Llama-3.2-11B-Vision](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `MllamaVisionConfig`):
diff --git a/src/transformers/models/mm_grounding_dino/configuration_mm_grounding_dino.py b/src/transformers/models/mm_grounding_dino/configuration_mm_grounding_dino.py
index e49ccde7e2d..5401ee9d59d 100644
--- a/src/transformers/models/mm_grounding_dino/configuration_mm_grounding_dino.py
+++ b/src/transformers/models/mm_grounding_dino/configuration_mm_grounding_dino.py
@@ -19,7 +19,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -28,18 +28,18 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class MMGroundingDinoConfig(PretrainedConfig):
+class MMGroundingDinoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MMGroundingDinoModel`]. It is used to instantiate a
MM Grounding DINO model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MM Grounding DINO tiny architecture
[openmmlab-community/mm_grounding_dino_tiny_o365v1_goldg_v3det](https://huggingface.co/openmmlab-community/mm_grounding_dino_tiny_o365v1_goldg_v3det).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
@@ -293,9 +293,9 @@ class MMGroundingDinoConfig(PretrainedConfig):
sub_configs = {}
backbone_config = getattr(self, "backbone_config", None)
text_config = getattr(self, "text_config", None)
- if isinstance(backbone_config, PretrainedConfig):
+ if isinstance(backbone_config, PreTrainedConfig):
sub_configs["backbone_config"] = type(backbone_config)
- if isinstance(text_config, PretrainedConfig):
+ if isinstance(text_config, PreTrainedConfig):
sub_configs["text_config"] = type(self.text_config)
return sub_configs
diff --git a/src/transformers/models/mm_grounding_dino/modular_mm_grounding_dino.py b/src/transformers/models/mm_grounding_dino/modular_mm_grounding_dino.py
index a05045a68cb..15d2484cc9b 100644
--- a/src/transformers/models/mm_grounding_dino/modular_mm_grounding_dino.py
+++ b/src/transformers/models/mm_grounding_dino/modular_mm_grounding_dino.py
@@ -17,7 +17,7 @@ import math
import torch
from torch import nn
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -40,18 +40,18 @@ from ..grounding_dino.modeling_grounding_dino import (
logger = logging.get_logger(__name__)
-class MMGroundingDinoConfig(GroundingDinoConfig, PretrainedConfig):
+class MMGroundingDinoConfig(GroundingDinoConfig, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MMGroundingDinoModel`]. It is used to instantiate a
MM Grounding DINO model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MM Grounding DINO tiny architecture
[openmmlab-community/mm_grounding_dino_tiny_o365v1_goldg_v3det](https://huggingface.co/openmmlab-community/mm_grounding_dino_tiny_o365v1_goldg_v3det).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
@@ -205,7 +205,7 @@ class MMGroundingDinoConfig(GroundingDinoConfig, PretrainedConfig):
layer_norm_eps=1e-5,
**kwargs,
):
- PretrainedConfig.__init__(is_encoder_decoder=is_encoder_decoder, **kwargs)
+ PreTrainedConfig.__init__(is_encoder_decoder=is_encoder_decoder, **kwargs)
if backbone_config is None and backbone is None:
logger.info("`backbone_config` is `None`. Initializing the config with the default `Swin` backbone.")
backbone_config = CONFIG_MAPPING["swin"](
diff --git a/src/transformers/models/mobilebert/configuration_mobilebert.py b/src/transformers/models/mobilebert/configuration_mobilebert.py
index 3b37289e070..c394305c3de 100644
--- a/src/transformers/models/mobilebert/configuration_mobilebert.py
+++ b/src/transformers/models/mobilebert/configuration_mobilebert.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class MobileBertConfig(PretrainedConfig):
+class MobileBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MobileBertModel`] or a [`TFMobileBertModel`]. It
is used to instantiate a MobileBERT model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the MobileBERT
[google/mobilebert-uncased](https://huggingface.co/google/mobilebert-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py b/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py
index c18d72d5500..99dd381290b 100644
--- a/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py
+++ b/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class MobileNetV1Config(PretrainedConfig):
+class MobileNetV1Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MobileNetV1Model`]. It is used to instantiate a
MobileNetV1 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MobileNetV1
[google/mobilenet_v1_1.0_224](https://huggingface.co/google/mobilenet_v1_1.0_224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py b/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py
index b344593bffd..3de6c856b0c 100644
--- a/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py
+++ b/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class MobileNetV2Config(PretrainedConfig):
+class MobileNetV2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MobileNetV2Model`]. It is used to instantiate a
MobileNetV2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MobileNetV2
[google/mobilenet_v2_1.0_224](https://huggingface.co/google/mobilenet_v2_1.0_224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/mobilevit/configuration_mobilevit.py b/src/transformers/models/mobilevit/configuration_mobilevit.py
index 1bb22e1590b..7705c3b2c98 100644
--- a/src/transformers/models/mobilevit/configuration_mobilevit.py
+++ b/src/transformers/models/mobilevit/configuration_mobilevit.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class MobileViTConfig(PretrainedConfig):
+class MobileViTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MobileViTModel`]. It is used to instantiate a
MobileViT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MobileViT
[apple/mobilevit-small](https://huggingface.co/apple/mobilevit-small) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py b/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py
index dc9db247602..c22080bed69 100644
--- a/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py
+++ b/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class MobileViTV2Config(PretrainedConfig):
+class MobileViTV2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MobileViTV2Model`]. It is used to instantiate a
MobileViTV2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MobileViTV2
[apple/mobilevitv2-1.0](https://huggingface.co/apple/mobilevitv2-1.0) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/modernbert/configuration_modernbert.py b/src/transformers/models/modernbert/configuration_modernbert.py
index 3b0da20ad20..deddab1d7f5 100644
--- a/src/transformers/models/modernbert/configuration_modernbert.py
+++ b/src/transformers/models/modernbert/configuration_modernbert.py
@@ -21,18 +21,18 @@
from typing import Literal
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class ModernBertConfig(PretrainedConfig):
+class ModernBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ModernBertModel`]. It is used to instantiate an ModernBert
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ModernBERT-base.
e.g. [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50368):
diff --git a/src/transformers/models/modernbert/modular_modernbert.py b/src/transformers/models/modernbert/modular_modernbert.py
index 5ac298f0959..03be2ed4c9e 100644
--- a/src/transformers/models/modernbert/modular_modernbert.py
+++ b/src/transformers/models/modernbert/modular_modernbert.py
@@ -24,7 +24,7 @@ from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
from ...activations import ACT2FN
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_attn_mask_utils import _prepare_4d_attention_mask
from ...modeling_layers import GradientCheckpointingLayer
from ...modeling_outputs import (
@@ -52,15 +52,15 @@ else:
logger = logging.get_logger(__name__)
-class ModernBertConfig(PretrainedConfig):
+class ModernBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ModernBertModel`]. It is used to instantiate an ModernBert
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ModernBERT-base.
e.g. [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50368):
diff --git a/src/transformers/models/modernbert_decoder/configuration_modernbert_decoder.py b/src/transformers/models/modernbert_decoder/configuration_modernbert_decoder.py
index 6a065a53dfc..864ae980817 100644
--- a/src/transformers/models/modernbert_decoder/configuration_modernbert_decoder.py
+++ b/src/transformers/models/modernbert_decoder/configuration_modernbert_decoder.py
@@ -19,18 +19,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class ModernBertDecoderConfig(PretrainedConfig):
+class ModernBertDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ModernBertDecoderModel`]. It is used to instantiate a ModernBert
decoder model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ModernBERT-base decoder.
e.g. [blab-jhu/test-32m-dec](https://huggingface.co/blab-jhu/test-32m-dec)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50368):
diff --git a/src/transformers/models/modernbert_decoder/modular_modernbert_decoder.py b/src/transformers/models/modernbert_decoder/modular_modernbert_decoder.py
index 0abe98b5a8f..1c5ed9948bf 100644
--- a/src/transformers/models/modernbert_decoder/modular_modernbert_decoder.py
+++ b/src/transformers/models/modernbert_decoder/modular_modernbert_decoder.py
@@ -22,7 +22,7 @@ from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...masking_utils import create_causal_mask, create_sliding_window_causal_mask
from ...modeling_layers import GradientCheckpointingLayer
@@ -45,15 +45,15 @@ from ..modernbert.modeling_modernbert import (
logger = logging.get_logger(__name__)
-class ModernBertDecoderConfig(PretrainedConfig):
+class ModernBertDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ModernBertDecoderModel`]. It is used to instantiate a ModernBert
decoder model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ModernBERT-base decoder.
e.g. [blab-jhu/test-32m-dec](https://huggingface.co/blab-jhu/test-32m-dec)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50368):
diff --git a/src/transformers/models/moonshine/configuration_moonshine.py b/src/transformers/models/moonshine/configuration_moonshine.py
index 270a2e3e484..2d6b026cf8a 100644
--- a/src/transformers/models/moonshine/configuration_moonshine.py
+++ b/src/transformers/models/moonshine/configuration_moonshine.py
@@ -18,19 +18,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class MoonshineConfig(PretrainedConfig):
+class MoonshineConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MoonshineModel`]. It is used to instantiate a Moonshine
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Moonshine
[UsefulSensors/moonshine-tiny](https://huggingface.co/UsefulSensors/moonshine-tiny).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32768):
diff --git a/src/transformers/models/moonshine/modular_moonshine.py b/src/transformers/models/moonshine/modular_moonshine.py
index 12b2ee647bb..cc5b414850c 100644
--- a/src/transformers/models/moonshine/modular_moonshine.py
+++ b/src/transformers/models/moonshine/modular_moonshine.py
@@ -21,7 +21,7 @@ from transformers.utils.generic import OutputRecorder, check_model_inputs
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...masking_utils import create_causal_mask
from ...modeling_attn_mask_utils import _prepare_4d_attention_mask, _prepare_4d_attention_mask_for_sdpa
@@ -47,15 +47,15 @@ from ..whisper.modeling_whisper import WhisperModel, shift_tokens_right
logger = logging.get_logger(__name__)
-class MoonshineConfig(PretrainedConfig):
+class MoonshineConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MoonshineModel`]. It is used to instantiate a Moonshine
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Moonshine
[UsefulSensors/moonshine-tiny](https://huggingface.co/UsefulSensors/moonshine-tiny).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32768):
diff --git a/src/transformers/models/moshi/configuration_moshi.py b/src/transformers/models/moshi/configuration_moshi.py
index ca2837017b8..d5beb71400d 100644
--- a/src/transformers/models/moshi/configuration_moshi.py
+++ b/src/transformers/models/moshi/configuration_moshi.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Moshi model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
@@ -22,13 +22,13 @@ from ..auto.configuration_auto import AutoConfig
logger = logging.get_logger(__name__)
-class MoshiDepthConfig(PretrainedConfig):
+class MoshiDepthConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MoshiDepthDecoder`]. It is used to instantiate a
Moshi depth decoder model according to the specified arguments, defining the Moshi depth decoder config.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
@@ -78,7 +78,7 @@ class MoshiDepthConfig(PretrainedConfig):
Whether to tie weight embeddings
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **audio_encoder_config** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **audio_encoder_config** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the audio encoder config.
Example:
@@ -146,15 +146,15 @@ class MoshiDepthConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class MoshiConfig(PretrainedConfig):
+class MoshiConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MoshiModel`]. It is used to instantiate a
Moshi model according to the specified arguments, defining the audio encoder, Moshi depth decoder and Moshi decoder
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the Moshiko model,
e.g. [kmhf/hf-moshiko](https://huggingface.co/kmhf/hf-moshiko)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
@@ -204,9 +204,9 @@ class MoshiConfig(PretrainedConfig):
Whether to tie weight embeddings
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **audio_encoder_config** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **audio_encoder_config** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the audio encoder config.
- - **depth__config** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **depth__config** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the depth decoder config.
@@ -314,7 +314,7 @@ class MoshiConfig(PretrainedConfig):
@classmethod
def from_audio_encoder_config(
cls,
- audio_encoder_config: PretrainedConfig,
+ audio_encoder_config: PreTrainedConfig,
**kwargs,
):
r"""
diff --git a/src/transformers/models/mpnet/configuration_mpnet.py b/src/transformers/models/mpnet/configuration_mpnet.py
index e80d6a0c303..27540903ad1 100644
--- a/src/transformers/models/mpnet/configuration_mpnet.py
+++ b/src/transformers/models/mpnet/configuration_mpnet.py
@@ -15,22 +15,22 @@
# limitations under the License.
"""MPNet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MPNetConfig(PretrainedConfig):
+class MPNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MPNetModel`] or a [`TFMPNetModel`]. It is used to
instantiate a MPNet model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MPNet
[microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30527):
diff --git a/src/transformers/models/mpt/configuration_mpt.py b/src/transformers/models/mpt/configuration_mpt.py
index f3468ca8fac..b39886c9b2e 100644
--- a/src/transformers/models/mpt/configuration_mpt.py
+++ b/src/transformers/models/mpt/configuration_mpt.py
@@ -16,14 +16,14 @@
from typing import Optional, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MptAttentionConfig(PretrainedConfig):
+class MptAttentionConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`MptAttention`] class. It is used to instantiate
attention layers according to the specified arguments, defining the layers architecture. Instantiating a
@@ -31,8 +31,8 @@ class MptAttentionConfig(PretrainedConfig):
[mosaicml/mpt-7b](https://huggingface.co/mosaicml/mpt-7b) architecture. Most of the arguments are kept for backward
compatibility with previous MPT models that are hosted on the Hub (previously with `trust_remote_code=True`).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
attn_type (`str`, *optional*, defaults to `"multihead_attention"`):
@@ -96,15 +96,15 @@ class MptAttentionConfig(PretrainedConfig):
)
-class MptConfig(PretrainedConfig):
+class MptConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`MptModel`]. It is used to instantiate a Mpt model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to the Mpt-7b architecture
[mosaicml/mpt-7b](https://huggingface.co/mosaicml/mpt-7b).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/mra/configuration_mra.py b/src/transformers/models/mra/configuration_mra.py
index 16b064c98f7..670377765ef 100644
--- a/src/transformers/models/mra/configuration_mra.py
+++ b/src/transformers/models/mra/configuration_mra.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""MRA model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MraConfig(PretrainedConfig):
+class MraConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MraModel`]. It is used to instantiate an MRA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Mra
[uw-madison/mra-base-512-4](https://huggingface.co/uw-madison/mra-base-512-4) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/mt5/configuration_mt5.py b/src/transformers/models/mt5/configuration_mt5.py
index bad66e63b12..57c2a4429b8 100644
--- a/src/transformers/models/mt5/configuration_mt5.py
+++ b/src/transformers/models/mt5/configuration_mt5.py
@@ -16,7 +16,7 @@
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxSeq2SeqConfigWithPast
from ...utils import logging
@@ -24,15 +24,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class MT5Config(PretrainedConfig):
+class MT5Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MT5Model`] or a [`TFMT5Model`]. It is used to
instantiate a mT5 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the mT5
[google/mt5-small](https://huggingface.co/google/mt5-small) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 250112):
diff --git a/src/transformers/models/musicgen/configuration_musicgen.py b/src/transformers/models/musicgen/configuration_musicgen.py
index 878cc122f17..f6223287a45 100644
--- a/src/transformers/models/musicgen/configuration_musicgen.py
+++ b/src/transformers/models/musicgen/configuration_musicgen.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""MusicGen model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
@@ -22,15 +22,15 @@ from ..auto.configuration_auto import AutoConfig
logger = logging.get_logger(__name__)
-class MusicgenDecoderConfig(PretrainedConfig):
+class MusicgenDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`MusicgenDecoder`]. It is used to instantiate a
MusicGen decoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the MusicGen
[facebook/musicgen-small](https://huggingface.co/facebook/musicgen-small) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -132,24 +132,24 @@ class MusicgenDecoderConfig(PretrainedConfig):
)
-class MusicgenConfig(PretrainedConfig):
+class MusicgenConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MusicgenModel`]. It is used to instantiate a
MusicGen model according to the specified arguments, defining the text encoder, audio encoder and MusicGen decoder
configs.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **text_encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **text_encoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the text encoder config.
- - **audio_encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **audio_encoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the audio encoder config.
- - **decoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **decoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the decoder config.
Example:
@@ -219,8 +219,8 @@ class MusicgenConfig(PretrainedConfig):
@classmethod
def from_sub_models_config(
cls,
- text_encoder_config: PretrainedConfig,
- audio_encoder_config: PretrainedConfig,
+ text_encoder_config: PreTrainedConfig,
+ audio_encoder_config: PreTrainedConfig,
decoder_config: MusicgenDecoderConfig,
**kwargs,
):
diff --git a/src/transformers/models/musicgen_melody/configuration_musicgen_melody.py b/src/transformers/models/musicgen_melody/configuration_musicgen_melody.py
index c4285151c4d..59190444990 100644
--- a/src/transformers/models/musicgen_melody/configuration_musicgen_melody.py
+++ b/src/transformers/models/musicgen_melody/configuration_musicgen_melody.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Musicgen Melody model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
@@ -22,15 +22,15 @@ from ..auto.configuration_auto import AutoConfig
logger = logging.get_logger(__name__)
-class MusicgenMelodyDecoderConfig(PretrainedConfig):
+class MusicgenMelodyDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`MusicgenMelodyDecoder`]. It is used to instantiate a
Musicgen Melody decoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Musicgen Melody
[facebook/musicgen-melody](https://huggingface.co/facebook/musicgen-melody) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -134,15 +134,15 @@ class MusicgenMelodyDecoderConfig(PretrainedConfig):
)
-class MusicgenMelodyConfig(PretrainedConfig):
+class MusicgenMelodyConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MusicgenMelodyModel`]. It is used to instantiate a
Musicgen Melody model according to the specified arguments, defining the text encoder, audio encoder and Musicgen Melody decoder
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the Musicgen Melody
[facebook/musicgen-melody](https://huggingface.co/facebook/musicgen-melody) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_chroma (`int`, *optional*, defaults to 12): Number of chroma bins to use.
@@ -151,11 +151,11 @@ class MusicgenMelodyConfig(PretrainedConfig):
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **text_encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **text_encoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the text encoder config.
- - **audio_encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that
+ - **audio_encoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that
defines the audio encoder config.
- - **decoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **decoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the decoder config.
Example:
@@ -232,8 +232,8 @@ class MusicgenMelodyConfig(PretrainedConfig):
@classmethod
def from_sub_models_config(
cls,
- text_encoder_config: PretrainedConfig,
- audio_encoder_config: PretrainedConfig,
+ text_encoder_config: PreTrainedConfig,
+ audio_encoder_config: PreTrainedConfig,
decoder_config: MusicgenMelodyDecoderConfig,
**kwargs,
):
diff --git a/src/transformers/models/mvp/configuration_mvp.py b/src/transformers/models/mvp/configuration_mvp.py
index c216e53ed81..cf2571f2b36 100644
--- a/src/transformers/models/mvp/configuration_mvp.py
+++ b/src/transformers/models/mvp/configuration_mvp.py
@@ -16,22 +16,22 @@
import warnings
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class MvpConfig(PretrainedConfig):
+class MvpConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MvpModel`]. It is used to instantiate a MVP model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the MVP [RUCAIBox/mvp](https://huggingface.co/RUCAIBox/mvp)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/nemotron/configuration_nemotron.py b/src/transformers/models/nemotron/configuration_nemotron.py
index 0a15bb96b06..a728ead38b7 100644
--- a/src/transformers/models/nemotron/configuration_nemotron.py
+++ b/src/transformers/models/nemotron/configuration_nemotron.py
@@ -15,7 +15,7 @@
# limitations under the License.
"""Nemotron model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -23,14 +23,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class NemotronConfig(PretrainedConfig):
+class NemotronConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`NemotronModel`]. It is used to instantiate an Nemotron
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Nemotron-8B.
e.g. [nvidia/nemotron-3-8b-base-4k-hf](https://huggingface.co/nvidia/nemotron-3-8b-base-4k-hf).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/nllb_moe/configuration_nllb_moe.py b/src/transformers/models/nllb_moe/configuration_nllb_moe.py
index 61cb2197c84..2eb14b8c430 100644
--- a/src/transformers/models/nllb_moe/configuration_nllb_moe.py
+++ b/src/transformers/models/nllb_moe/configuration_nllb_moe.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""NLLB-MoE model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class NllbMoeConfig(PretrainedConfig):
+class NllbMoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`NllbMoeModel`]. It is used to instantiate an
NLLB-MoE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the NLLB-MoE
[facebook/nllb-moe-54b](https://huggingface.co/facebook/nllb-moe-54b) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/nystromformer/configuration_nystromformer.py b/src/transformers/models/nystromformer/configuration_nystromformer.py
index 96a48b99fda..7f8bde75b2a 100644
--- a/src/transformers/models/nystromformer/configuration_nystromformer.py
+++ b/src/transformers/models/nystromformer/configuration_nystromformer.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Nystromformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class NystromformerConfig(PretrainedConfig):
+class NystromformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`NystromformerModel`]. It is used to instantiate
an Nystromformer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Nystromformer
[uw-madison/nystromformer-512](https://huggingface.co/uw-madison/nystromformer-512) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30000):
diff --git a/src/transformers/models/olmo/configuration_olmo.py b/src/transformers/models/olmo/configuration_olmo.py
index a1bf0971b55..817e6d38df1 100644
--- a/src/transformers/models/olmo/configuration_olmo.py
+++ b/src/transformers/models/olmo/configuration_olmo.py
@@ -19,21 +19,21 @@
# limitations under the License.
"""OLMo model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class OlmoConfig(PretrainedConfig):
+class OlmoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`OlmoModel`]. It is used to instantiate an OLMo
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/OLMo-7B-hf](https://huggingface.co/allenai/OLMo-7B-hf).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/olmo2/configuration_olmo2.py b/src/transformers/models/olmo2/configuration_olmo2.py
index c7a0dabaf4e..8d0722f44b5 100644
--- a/src/transformers/models/olmo2/configuration_olmo2.py
+++ b/src/transformers/models/olmo2/configuration_olmo2.py
@@ -5,17 +5,17 @@
# modular_olmo2.py file directly. One of our CI enforces this.
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class Olmo2Config(PretrainedConfig):
+class Olmo2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Olmo2Model`]. It is used to instantiate an OLMo2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/Olmo2-7B-1124-hf](https://huggingface.co/allenai/Olmo2-7B-1124-hf).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/olmo2/modular_olmo2.py b/src/transformers/models/olmo2/modular_olmo2.py
index 84aa2509007..a0a31b6db89 100644
--- a/src/transformers/models/olmo2/modular_olmo2.py
+++ b/src/transformers/models/olmo2/modular_olmo2.py
@@ -31,8 +31,8 @@ class Olmo2Config(OlmoConfig):
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/Olmo2-7B-1124-hf](https://huggingface.co/allenai/Olmo2-7B-1124-hf).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/olmo3/configuration_olmo3.py b/src/transformers/models/olmo3/configuration_olmo3.py
index a6ea71f3a97..dc3dfb394e2 100644
--- a/src/transformers/models/olmo3/configuration_olmo3.py
+++ b/src/transformers/models/olmo3/configuration_olmo3.py
@@ -19,18 +19,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
-class Olmo3Config(PretrainedConfig):
+class Olmo3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Olmo3Model`]. It is used to instantiate an OLMo3
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/OLMo-3-0725-1B](https://huggingface.co/allenai/OLMo-3-0725-1B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/olmo3/modular_olmo3.py b/src/transformers/models/olmo3/modular_olmo3.py
index 963b18ea0af..366f33eb748 100644
--- a/src/transformers/models/olmo3/modular_olmo3.py
+++ b/src/transformers/models/olmo3/modular_olmo3.py
@@ -47,8 +47,8 @@ class Olmo3Config(Olmo2Config):
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/OLMo-3-0725-1B](https://huggingface.co/allenai/OLMo-3-0725-1B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/olmoe/configuration_olmoe.py b/src/transformers/models/olmoe/configuration_olmoe.py
index 864d06b64d7..99606d480f7 100644
--- a/src/transformers/models/olmoe/configuration_olmoe.py
+++ b/src/transformers/models/olmoe/configuration_olmoe.py
@@ -11,18 +11,18 @@
# limitations under the License.
"""OLMoE model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class OlmoeConfig(PretrainedConfig):
+class OlmoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`OlmoeModel`]. It is used to instantiate an OLMoE
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the [allenai/OLMoE-1B-7B-0924](https://huggingface.co/allenai/OLMoE-1B-7B-0924).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/omdet_turbo/configuration_omdet_turbo.py b/src/transformers/models/omdet_turbo/configuration_omdet_turbo.py
index e11cc563db1..3c46c95cf1f 100644
--- a/src/transformers/models/omdet_turbo/configuration_omdet_turbo.py
+++ b/src/transformers/models/omdet_turbo/configuration_omdet_turbo.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""OmDet-Turbo model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -23,20 +23,20 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class OmDetTurboConfig(PretrainedConfig):
+class OmDetTurboConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`OmDetTurboForObjectDetection`].
It is used to instantiate a OmDet-Turbo model according to the specified arguments, defining the model architecture
Instantiating a configuration with the defaults will yield a similar configuration to that of the OmDet-Turbo
[omlab/omdet-turbo-swin-tiny-hf](https://huggingface.co/omlab/omdet-turbo-swin-tiny-hf) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- text_config (`PretrainedConfig`, *optional*):
+ text_config (`PreTrainedConfig`, *optional*):
The configuration of the text backbone.
- backbone_config (`PretrainedConfig`, *optional*):
+ backbone_config (`PreTrainedConfig`, *optional*):
The configuration of the vision backbone.
use_timm_backbone (`bool`, *optional*, defaults to `True`):
Whether to use the timm for the vision backbone.
@@ -294,9 +294,9 @@ class OmDetTurboConfig(PretrainedConfig):
sub_configs = {}
backbone_config = getattr(self, "backbone_config", None)
text_config = getattr(self, "text_config", None)
- if isinstance(backbone_config, PretrainedConfig):
+ if isinstance(backbone_config, PreTrainedConfig):
sub_configs["backbone_config"] = type(backbone_config)
- if isinstance(text_config, PretrainedConfig):
+ if isinstance(text_config, PreTrainedConfig):
sub_configs["text_config"] = type(text_config)
return sub_configs
diff --git a/src/transformers/models/oneformer/configuration_oneformer.py b/src/transformers/models/oneformer/configuration_oneformer.py
index 1b9229f040d..b94ec0b615a 100644
--- a/src/transformers/models/oneformer/configuration_oneformer.py
+++ b/src/transformers/models/oneformer/configuration_oneformer.py
@@ -16,7 +16,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -25,7 +25,7 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class OneFormerConfig(PretrainedConfig):
+class OneFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`OneFormerModel`]. It is used to instantiate a
OneFormer model according to the specified arguments, defining the model architecture. Instantiating a
@@ -33,11 +33,11 @@ class OneFormerConfig(PretrainedConfig):
[shi-labs/oneformer_ade20k_swin_tiny](https://huggingface.co/shi-labs/oneformer_ade20k_swin_tiny) architecture
trained on [ADE20k-150](https://huggingface.co/datasets/scene_parse_150).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig`, *optional*, defaults to `SwinConfig`):
+ backbone_config (`PreTrainedConfig`, *optional*, defaults to `SwinConfig`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
diff --git a/src/transformers/models/openai/configuration_openai.py b/src/transformers/models/openai/configuration_openai.py
index b4f2fae9d30..39d5c6d3850 100644
--- a/src/transformers/models/openai/configuration_openai.py
+++ b/src/transformers/models/openai/configuration_openai.py
@@ -15,22 +15,22 @@
# limitations under the License.
"""OpenAI GPT configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class OpenAIGPTConfig(PretrainedConfig):
+class OpenAIGPTConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`OpenAIGPTModel`] or a [`TFOpenAIGPTModel`]. It is
used to instantiate a GPT model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the GPT
[openai-community/openai-gpt](https://huggingface.co/openai-community/openai-gpt) architecture from OpenAI.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 40478):
diff --git a/src/transformers/models/opt/configuration_opt.py b/src/transformers/models/opt/configuration_opt.py
index 58c2569d4eb..cd5983f7d42 100644
--- a/src/transformers/models/opt/configuration_opt.py
+++ b/src/transformers/models/opt/configuration_opt.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""OPT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class OPTConfig(PretrainedConfig):
+class OPTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`OPTModel`]. It is used to instantiate a OPT model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the OPT
[facebook/opt-350m](https://huggingface.co/facebook/opt-350m) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/ovis2/configuration_ovis2.py b/src/transformers/models/ovis2/configuration_ovis2.py
index cd2a1c0af4d..26b0a8d2a09 100644
--- a/src/transformers/models/ovis2/configuration_ovis2.py
+++ b/src/transformers/models/ovis2/configuration_ovis2.py
@@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..qwen2.configuration_qwen2 import Qwen2Config
-class Ovis2VisionConfig(PretrainedConfig):
+class Ovis2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Ovis2VisionModel`]. It is used to instantiate a
Ovis2VisionModel model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -106,14 +106,14 @@ class Ovis2VisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Ovis2Config(PretrainedConfig):
+class Ovis2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Ovis2ForConditionalGeneration`]. It is used to instantiate a
Ovis2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of Ovis2.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
e.g. [thisisiron/Ovis2-1B-hf](https://huggingface.co/thisisiron/Ovis2-1B-hf)
diff --git a/src/transformers/models/owlv2/configuration_owlv2.py b/src/transformers/models/owlv2/configuration_owlv2.py
index 310a46508b8..9126429dfe3 100644
--- a/src/transformers/models/owlv2/configuration_owlv2.py
+++ b/src/transformers/models/owlv2/configuration_owlv2.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""OWLv2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
@@ -22,15 +22,15 @@ logger = logging.get_logger(__name__)
# Copied from transformers.models.owlvit.configuration_owlvit.OwlViTTextConfig with OwlViT->Owlv2, owlvit-base-patch32->owlv2-base-patch16, owlvit->owlv2, OWL-ViT->OWLv2
-class Owlv2TextConfig(PretrainedConfig):
+class Owlv2TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`Owlv2TextModel`]. It is used to instantiate an
Owlv2 text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Owlv2
[google/owlv2-base-patch16](https://huggingface.co/google/owlv2-base-patch16) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -119,15 +119,15 @@ class Owlv2TextConfig(PretrainedConfig):
# Copied from transformers.models.owlvit.configuration_owlvit.OwlViTVisionConfig with OwlViT->Owlv2, owlvit-base-patch32->owlv2-base-patch16, owlvit->owlv2, OWL-ViT->OWLv2, 32->16
-class Owlv2VisionConfig(PretrainedConfig):
+class Owlv2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`Owlv2VisionModel`]. It is used to instantiate
an OWLv2 image encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the OWLv2
[google/owlv2-base-patch16](https://huggingface.co/google/owlv2-base-patch16) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -208,15 +208,15 @@ class Owlv2VisionConfig(PretrainedConfig):
# Copied from transformers.models.owlvit.configuration_owlvit.OwlViTConfig with OwlViT->Owlv2, owlvit-base-patch32->owlv2-base-patch16, owlvit->owlv2, OWL-ViT->OWLv2
-class Owlv2Config(PretrainedConfig):
+class Owlv2Config(PreTrainedConfig):
r"""
[`Owlv2Config`] is the configuration class to store the configuration of an [`Owlv2Model`]. It is used to
instantiate an OWLv2 model according to the specified arguments, defining the text model and vision model
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the OWLv2
[google/owlv2-base-patch16](https://huggingface.co/google/owlv2-base-patch16) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/owlvit/configuration_owlvit.py b/src/transformers/models/owlvit/configuration_owlvit.py
index 4f615dece67..95f31363488 100644
--- a/src/transformers/models/owlvit/configuration_owlvit.py
+++ b/src/transformers/models/owlvit/configuration_owlvit.py
@@ -22,7 +22,7 @@ from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from ...processing_utils import ProcessorMixin
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -30,15 +30,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class OwlViTTextConfig(PretrainedConfig):
+class OwlViTTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`OwlViTTextModel`]. It is used to instantiate an
OwlViT text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the OwlViT
[google/owlvit-base-patch32](https://huggingface.co/google/owlvit-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -126,15 +126,15 @@ class OwlViTTextConfig(PretrainedConfig):
self.initializer_factor = initializer_factor
-class OwlViTVisionConfig(PretrainedConfig):
+class OwlViTVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`OwlViTVisionModel`]. It is used to instantiate
an OWL-ViT image encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the OWL-ViT
[google/owlvit-base-patch32](https://huggingface.co/google/owlvit-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -214,15 +214,15 @@ class OwlViTVisionConfig(PretrainedConfig):
self.initializer_factor = initializer_factor
-class OwlViTConfig(PretrainedConfig):
+class OwlViTConfig(PreTrainedConfig):
r"""
[`OwlViTConfig`] is the configuration class to store the configuration of an [`OwlViTModel`]. It is used to
instantiate an OWL-ViT model according to the specified arguments, defining the text model and vision model
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the OWL-ViT
[google/owlvit-base-patch32](https://huggingface.co/google/owlvit-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/paligemma/configuration_paligemma.py b/src/transformers/models/paligemma/configuration_paligemma.py
index 941543c2c9d..e8e5ed5e7a8 100644
--- a/src/transformers/models/paligemma/configuration_paligemma.py
+++ b/src/transformers/models/paligemma/configuration_paligemma.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""PaliGemmamodel configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,7 +21,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class PaliGemmaConfig(PretrainedConfig):
+class PaliGemmaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PaliGemmaForConditionalGeneration`]. It is used to instantiate an
PaliGemmamodel according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -29,8 +29,8 @@ class PaliGemmaConfig(PretrainedConfig):
e.g. [paligemma-hf/paligemma-2b](https://huggingface.co/paligemma-hf/paligemma-2b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`PaliGemmaVisionConfig`, *optional*):
diff --git a/src/transformers/models/paligemma/modeling_paligemma.py b/src/transformers/models/paligemma/modeling_paligemma.py
index 7e5d9f8332e..2ffd2c1490c 100644
--- a/src/transformers/models/paligemma/modeling_paligemma.py
+++ b/src/transformers/models/paligemma/modeling_paligemma.py
@@ -21,7 +21,7 @@ import torch
from torch import nn
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...masking_utils import create_masks_for_generate
from ...modeling_flash_attention_utils import FlashAttentionKwargs
@@ -132,7 +132,7 @@ def token_type_ids_mask_function(
def create_causal_mask_mapping(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
@@ -605,7 +605,7 @@ class PaliGemmaForConditionalGeneration(PaliGemmaPreTrainedModel, GenerationMixi
@staticmethod
def create_masks_for_generate(
- config: PretrainedConfig,
+ config: PreTrainedConfig,
input_embeds: torch.Tensor,
attention_mask: Optional[torch.Tensor],
cache_position: torch.Tensor,
diff --git a/src/transformers/models/parakeet/configuration_parakeet.py b/src/transformers/models/parakeet/configuration_parakeet.py
index 3612da58006..1e3d97b4182 100644
--- a/src/transformers/models/parakeet/configuration_parakeet.py
+++ b/src/transformers/models/parakeet/configuration_parakeet.py
@@ -16,20 +16,20 @@
from typing import Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ParakeetEncoderConfig(PretrainedConfig):
+class ParakeetEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ParakeetEncoder`]. It is used to instantiate a
`ParakeetEncoder` model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
@@ -150,13 +150,13 @@ class ParakeetEncoderConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class ParakeetCTCConfig(PretrainedConfig):
+class ParakeetCTCConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ParakeetForCTC`]. It is used to instantiate a
Parakeet CTC model according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 1025):
diff --git a/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py b/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py
index 9725bd75463..71c6204f48b 100644
--- a/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py
+++ b/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py
@@ -16,22 +16,22 @@
from typing import Optional, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class PatchTSMixerConfig(PretrainedConfig):
+class PatchTSMixerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PatchTSMixerModel`]. It is used to instantiate a
PatchTSMixer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the PatchTSMixer
[ibm/patchtsmixer-etth1-pretrain](https://huggingface.co/ibm/patchtsmixer-etth1-pretrain) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
context_length (`int`, *optional*, defaults to 32):
diff --git a/src/transformers/models/patchtst/configuration_patchtst.py b/src/transformers/models/patchtst/configuration_patchtst.py
index 17cabe491c0..3bf76369e3c 100644
--- a/src/transformers/models/patchtst/configuration_patchtst.py
+++ b/src/transformers/models/patchtst/configuration_patchtst.py
@@ -16,21 +16,21 @@
from typing import Optional, Union
-from transformers.configuration_utils import PretrainedConfig
+from transformers.configuration_utils import PreTrainedConfig
from transformers.utils import logging
logger = logging.get_logger(__name__)
-class PatchTSTConfig(PretrainedConfig):
+class PatchTSTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`PatchTSTModel`]. It is used to instantiate an
PatchTST model according to the specified arguments, defining the model architecture.
[ibm/patchtst](https://huggingface.co/ibm/patchtst) architecture.
- Configuration objects inherit from [`PretrainedConfig`] can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_input_channels (`int`, *optional*, defaults to 1):
diff --git a/src/transformers/models/pegasus/configuration_pegasus.py b/src/transformers/models/pegasus/configuration_pegasus.py
index 3c27f7d44d9..b078bab0bf8 100644
--- a/src/transformers/models/pegasus/configuration_pegasus.py
+++ b/src/transformers/models/pegasus/configuration_pegasus.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""PEGASUS model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class PegasusConfig(PretrainedConfig):
+class PegasusConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PegasusModel`]. It is used to instantiate an
PEGASUS model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the PEGASUS
[google/pegasus-large](https://huggingface.co/google/pegasus-large) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/pegasus_x/configuration_pegasus_x.py b/src/transformers/models/pegasus_x/configuration_pegasus_x.py
index 626389c448b..43d17481062 100644
--- a/src/transformers/models/pegasus_x/configuration_pegasus_x.py
+++ b/src/transformers/models/pegasus_x/configuration_pegasus_x.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""PEGASUS-X model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class PegasusXConfig(PretrainedConfig):
+class PegasusXConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PegasusXModel`]. It is used to instantiate a
PEGASUS-X model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the PEGASUS-X
[google/pegasus-x-large](https://huggingface.co/google/pegasus-x-large) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/perceiver/configuration_perceiver.py b/src/transformers/models/perceiver/configuration_perceiver.py
index d983779c6ad..d8575f21819 100644
--- a/src/transformers/models/perceiver/configuration_perceiver.py
+++ b/src/transformers/models/perceiver/configuration_perceiver.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import Any, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...feature_extraction_utils import FeatureExtractionMixin
from ...onnx import OnnxConfig
from ...onnx.utils import compute_effective_axis_dimension
@@ -29,15 +29,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class PerceiverConfig(PretrainedConfig):
+class PerceiverConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PerceiverModel`]. It is used to instantiate an
Perceiver model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Perceiver
[deepmind/language-perceiver](https://huggingface.co/deepmind/language-perceiver) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_latents (`int`, *optional*, defaults to 256):
diff --git a/src/transformers/models/perception_lm/configuration_perception_lm.py b/src/transformers/models/perception_lm/configuration_perception_lm.py
index 08c084065ff..8983855c64a 100644
--- a/src/transformers/models/perception_lm/configuration_perception_lm.py
+++ b/src/transformers/models/perception_lm/configuration_perception_lm.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""PerceptionLM model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
from ..timm_wrapper.configuration_timm_wrapper import TimmWrapperConfig
@@ -22,7 +22,7 @@ from ..timm_wrapper.configuration_timm_wrapper import TimmWrapperConfig
logger = logging.get_logger(__name__)
-class PerceptionLMConfig(PretrainedConfig):
+class PerceptionLMConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PerceptionLMForConditionalGeneration`]. It is used to instantiate an
PerceptionLM model according to the specified arguments, defining the model architecture.
@@ -32,13 +32,13 @@ class PerceptionLMConfig(PretrainedConfig):
- [facebook/Perception-LM-3B](https://huggingface.co/facebook/Perception-LM-3B).
- [facebook/Perception-LM-8B](https://huggingface.co/facebook/Perception-LM-8B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`Union[TimmWrapperConfig, dict]`, *optional*, defaults to `TimmWrapperConfig()`):
The config object or dictionary of the vision backbone.
- text_config (`Union[PretrainedConfig, dict]`, *optional*, defaults to `LlamaConfig()`):
+ text_config (`Union[PreTrainedConfig, dict]`, *optional*, defaults to `LlamaConfig()`):
The config object or dictionary of the text backbone.
vision_use_cls_token (`bool`, *optional*, defaults to `True`):
Whether CLS token is used in the vision backbone. If used, we remove CLS token embedding from vision output.
diff --git a/src/transformers/models/persimmon/configuration_persimmon.py b/src/transformers/models/persimmon/configuration_persimmon.py
index 3773ad4174d..5e80cd704ff 100644
--- a/src/transformers/models/persimmon/configuration_persimmon.py
+++ b/src/transformers/models/persimmon/configuration_persimmon.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Persimmon model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class PersimmonConfig(PretrainedConfig):
+class PersimmonConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PersimmonModel`]. It is used to instantiate an
Persimmon model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[adept/persimmon-8b-base](https://huggingface.co/adept/persimmon-8b-base).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/phi/configuration_phi.py b/src/transformers/models/phi/configuration_phi.py
index 0a3e6a6787e..8457dd2709e 100644
--- a/src/transformers/models/phi/configuration_phi.py
+++ b/src/transformers/models/phi/configuration_phi.py
@@ -15,7 +15,7 @@
"""Phi model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -23,15 +23,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class PhiConfig(PretrainedConfig):
+class PhiConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PhiModel`]. It is used to instantiate an Phi
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Phi
[microsoft/phi-1](https://huggingface.co/microsoft/phi-1).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 51200):
diff --git a/src/transformers/models/phi3/configuration_phi3.py b/src/transformers/models/phi3/configuration_phi3.py
index 33cee6b37ba..30429a673f4 100644
--- a/src/transformers/models/phi3/configuration_phi3.py
+++ b/src/transformers/models/phi3/configuration_phi3.py
@@ -15,22 +15,22 @@
"""Phi-3 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Phi3Config(PretrainedConfig):
+class Phi3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Phi3Model`]. It is used to instantiate a Phi-3
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the
[microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32064):
diff --git a/src/transformers/models/phi4_multimodal/configuration_phi4_multimodal.py b/src/transformers/models/phi4_multimodal/configuration_phi4_multimodal.py
index e5e5ca91bfc..3c4efd4b5a3 100644
--- a/src/transformers/models/phi4_multimodal/configuration_phi4_multimodal.py
+++ b/src/transformers/models/phi4_multimodal/configuration_phi4_multimodal.py
@@ -20,18 +20,18 @@
import math
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class Phi4MultimodalVisionConfig(PretrainedConfig):
+class Phi4MultimodalVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Phi4MultimodalVisionModel`]. It is used to instantiate a
Phi4Multimodal vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of
[microsoft/Phi-4-multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1152):
@@ -108,15 +108,15 @@ class Phi4MultimodalVisionConfig(PretrainedConfig):
self.feature_layer = feature_layer
-class Phi4MultimodalAudioConfig(PretrainedConfig):
+class Phi4MultimodalAudioConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Phi4MultimodalAudioModel`]. It is used to instantiate a
Phi4Multimodal audio encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the audio encoder of
[microsoft/Phi-4-multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
@@ -241,15 +241,15 @@ class Phi4MultimodalAudioConfig(PretrainedConfig):
self.nemo_final_size = length
-class Phi4MultimodalConfig(PretrainedConfig):
+class Phi4MultimodalConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Phi4MultimodalModel`]. It is used to instantiate a
Phi4Multimodal model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[microsoft/Phi-4-multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 200064):
diff --git a/src/transformers/models/phi4_multimodal/modular_phi4_multimodal.py b/src/transformers/models/phi4_multimodal/modular_phi4_multimodal.py
index bea02eef03c..dd9ec1e3995 100644
--- a/src/transformers/models/phi4_multimodal/modular_phi4_multimodal.py
+++ b/src/transformers/models/phi4_multimodal/modular_phi4_multimodal.py
@@ -22,7 +22,7 @@ from torch import nn
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...masking_utils import create_causal_mask, create_sliding_window_causal_mask
from ...modeling_attn_mask_utils import _prepare_4d_attention_mask
from ...modeling_outputs import (
@@ -67,8 +67,8 @@ class Phi4MultimodalVisionConfig(SiglipVisionConfig):
configuration with the defaults will yield a similar configuration to that of the vision encoder of
[microsoft/Phi-4-multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1152):
@@ -145,15 +145,15 @@ class Phi4MultimodalVisionConfig(SiglipVisionConfig):
self.feature_layer = feature_layer
-class Phi4MultimodalAudioConfig(PretrainedConfig):
+class Phi4MultimodalAudioConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Phi4MultimodalAudioModel`]. It is used to instantiate a
Phi4Multimodal audio encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the audio encoder of
[microsoft/Phi-4-multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
@@ -285,8 +285,8 @@ class Phi4MultimodalConfig(Phi3Config):
with the defaults will yield a similar configuration to that of the
[microsoft/Phi-4-multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 200064):
diff --git a/src/transformers/models/phimoe/configuration_phimoe.py b/src/transformers/models/phimoe/configuration_phimoe.py
index 80fefd3dc91..189be828906 100644
--- a/src/transformers/models/phimoe/configuration_phimoe.py
+++ b/src/transformers/models/phimoe/configuration_phimoe.py
@@ -15,7 +15,7 @@
"""PyTorch Phi-MoE model."""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -23,14 +23,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class PhimoeConfig(PretrainedConfig):
+class PhimoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PhimoeModel`]. It is used to instantiate a Phi-moe
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the
[microsoft/Phi-3.5-MoE-instruct](https://huggingface.co/microsoft/Phi-3.5-MoE-instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32064):
Vocabulary size of the Phimoe model. Defines the number of different tokens that can be represented by the
diff --git a/src/transformers/models/pix2struct/configuration_pix2struct.py b/src/transformers/models/pix2struct/configuration_pix2struct.py
index 89109350d95..8caf5f00667 100644
--- a/src/transformers/models/pix2struct/configuration_pix2struct.py
+++ b/src/transformers/models/pix2struct/configuration_pix2struct.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Pix2Struct model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Pix2StructTextConfig(PretrainedConfig):
+class Pix2StructTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Pix2StructTextModel`]. It is used to instantiate
a Pix2Struct text model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Pix2Struct text decoder used by
the [google/pix2struct-base](https://huggingface.co/google/pix2struct-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 50244):
@@ -145,15 +145,15 @@ class Pix2StructTextConfig(PretrainedConfig):
)
-class Pix2StructVisionConfig(PretrainedConfig):
+class Pix2StructVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Pix2StructVisionModel`]. It is used to
instantiate a Pix2Struct vision model according to the specified arguments, defining the model architecture.
Instantiating a configuration defaults will yield a similar configuration to that of the Pix2Struct-base
[google/pix2struct-base](https://huggingface.co/google/pix2struct-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -244,7 +244,7 @@ class Pix2StructVisionConfig(PretrainedConfig):
self.d_kv = d_kv
-class Pix2StructConfig(PretrainedConfig):
+class Pix2StructConfig(PreTrainedConfig):
r"""
[`Pix2StructConfig`] is the configuration class to store the configuration of a
[`Pix2StructForConditionalGeneration`]. It is used to instantiate a Pix2Struct model according to the specified
@@ -252,8 +252,8 @@ class Pix2StructConfig(PretrainedConfig):
yield a similar configuration to that of the Pix2Struct-base
[google/pix2struct-base](https://huggingface.co/google/pix2struct-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/pixtral/configuration_pixtral.py b/src/transformers/models/pixtral/configuration_pixtral.py
index d4710e00e42..719aace6d54 100644
--- a/src/transformers/models/pixtral/configuration_pixtral.py
+++ b/src/transformers/models/pixtral/configuration_pixtral.py
@@ -13,14 +13,14 @@
# limitations under the License.
"""Pixtral model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class PixtralVisionConfig(PretrainedConfig):
+class PixtralVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PixtralVisionModel`]. It is used to instantiate an
Pixtral vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -28,8 +28,8 @@ class PixtralVisionConfig(PretrainedConfig):
e.g. [pixtral-hf/pixtral-9b](https://huggingface.co/pixtral-hf/pixtral-9b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
diff --git a/src/transformers/models/plbart/configuration_plbart.py b/src/transformers/models/plbart/configuration_plbart.py
index a4aaa3ff370..48dfa2e53ca 100644
--- a/src/transformers/models/plbart/configuration_plbart.py
+++ b/src/transformers/models/plbart/configuration_plbart.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfigWithPast
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class PLBartConfig(PretrainedConfig):
+class PLBartConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PLBartModel`]. It is used to instantiate an
PLBART model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the PLBART
[uclanlp/plbart-base](https://huggingface.co/uclanlp/plbart-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/poolformer/configuration_poolformer.py b/src/transformers/models/poolformer/configuration_poolformer.py
index eaaa89f6704..1798086fdc9 100644
--- a/src/transformers/models/poolformer/configuration_poolformer.py
+++ b/src/transformers/models/poolformer/configuration_poolformer.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class PoolFormerConfig(PretrainedConfig):
+class PoolFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of [`PoolFormerModel`]. It is used to instantiate a
PoolFormer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the PoolFormer
[sail/poolformer_s12](https://huggingface.co/sail/poolformer_s12) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/pop2piano/configuration_pop2piano.py b/src/transformers/models/pop2piano/configuration_pop2piano.py
index 6bc90961154..135b4185d16 100644
--- a/src/transformers/models/pop2piano/configuration_pop2piano.py
+++ b/src/transformers/models/pop2piano/configuration_pop2piano.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Pop2Piano model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Pop2PianoConfig(PretrainedConfig):
+class Pop2PianoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Pop2PianoForConditionalGeneration`]. It is used
to instantiate a Pop2PianoForConditionalGeneration model according to the specified arguments, defining the model
architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the
Pop2Piano [sweetcocoa/pop2piano](https://huggingface.co/sweetcocoa/pop2piano) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 2400):
diff --git a/src/transformers/models/prompt_depth_anything/configuration_prompt_depth_anything.py b/src/transformers/models/prompt_depth_anything/configuration_prompt_depth_anything.py
index a45ae66cf3b..5c38572e089 100644
--- a/src/transformers/models/prompt_depth_anything/configuration_prompt_depth_anything.py
+++ b/src/transformers/models/prompt_depth_anything/configuration_prompt_depth_anything.py
@@ -19,7 +19,7 @@
import copy
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto.configuration_auto import CONFIG_MAPPING
@@ -28,18 +28,18 @@ from ..auto.configuration_auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class PromptDepthAnythingConfig(PretrainedConfig):
+class PromptDepthAnythingConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PromptDepthAnythingModel`]. It is used to instantiate a PromptDepthAnything
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the PromptDepthAnything
[LiheYoung/depth-anything-small-hf](https://huggingface.co/LiheYoung/depth-anything-small-hf) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*):
+ backbone_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*):
The configuration of the backbone model. Only used in case `is_hybrid` is `True` or in case you want to
leverage the [`AutoBackbone`] API.
backbone (`str`, *optional*):
@@ -164,7 +164,7 @@ class PromptDepthAnythingConfig(PretrainedConfig):
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`]. Returns:
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`]. Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
"""
output = copy.deepcopy(self.__dict__)
diff --git a/src/transformers/models/prophetnet/configuration_prophetnet.py b/src/transformers/models/prophetnet/configuration_prophetnet.py
index a6da708da4c..e237ec07818 100644
--- a/src/transformers/models/prophetnet/configuration_prophetnet.py
+++ b/src/transformers/models/prophetnet/configuration_prophetnet.py
@@ -16,22 +16,22 @@
from typing import Callable, Optional, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ProphetNetConfig(PretrainedConfig):
+class ProphetNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ProphetNetModel`]. It is used to instantiate a
ProphetNet model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the ProphetNet
[microsoft/prophetnet-large-uncased](https://huggingface.co/microsoft/prophetnet-large-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
activation_dropout (`float`, *optional*, defaults to 0.1):
diff --git a/src/transformers/models/pvt/configuration_pvt.py b/src/transformers/models/pvt/configuration_pvt.py
index 208295db71f..b34c94fb23c 100644
--- a/src/transformers/models/pvt/configuration_pvt.py
+++ b/src/transformers/models/pvt/configuration_pvt.py
@@ -22,7 +22,7 @@ from typing import Callable
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -30,15 +30,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class PvtConfig(PretrainedConfig):
+class PvtConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PvtModel`]. It is used to instantiate an Pvt
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Pvt
[Xrenya/pvt-tiny-224](https://huggingface.co/Xrenya/pvt-tiny-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/pvt_v2/configuration_pvt_v2.py b/src/transformers/models/pvt_v2/configuration_pvt_v2.py
index 167c5674ac2..0d0d8cebc5c 100644
--- a/src/transformers/models/pvt_v2/configuration_pvt_v2.py
+++ b/src/transformers/models/pvt_v2/configuration_pvt_v2.py
@@ -18,7 +18,7 @@
from typing import Callable, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -26,15 +26,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class PvtV2Config(BackboneConfigMixin, PretrainedConfig):
+class PvtV2Config(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`PvtV2Model`]. It is used to instantiate a Pvt V2
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Pvt V2 B0
[OpenGVLab/pvt_v2_b0](https://huggingface.co/OpenGVLab/pvt_v2_b0) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`Union[int, tuple[int, int]]`, *optional*, defaults to 224):
diff --git a/src/transformers/models/qwen2/configuration_qwen2.py b/src/transformers/models/qwen2/configuration_qwen2.py
index 4d75e25092f..5fa2d8126be 100644
--- a/src/transformers/models/qwen2/configuration_qwen2.py
+++ b/src/transformers/models/qwen2/configuration_qwen2.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Qwen2 model configuration"""
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen2Config(PretrainedConfig):
+class Qwen2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2Model`]. It is used to instantiate a
Qwen2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-7B-beta [Qwen/Qwen2-7B-beta](https://huggingface.co/Qwen/Qwen2-7B-beta).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen2_5_omni/configuration_qwen2_5_omni.py b/src/transformers/models/qwen2_5_omni/configuration_qwen2_5_omni.py
index 7bd36b7a3c0..3cf0ee47d2c 100644
--- a/src/transformers/models/qwen2_5_omni/configuration_qwen2_5_omni.py
+++ b/src/transformers/models/qwen2_5_omni/configuration_qwen2_5_omni.py
@@ -19,7 +19,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -27,7 +27,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen2_5OmniVisionEncoderConfig(PretrainedConfig):
+class Qwen2_5OmniVisionEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniThinkerVision`]. It is used to instantiate a
Qwen2.5-VL vision encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -36,8 +36,8 @@ class Qwen2_5OmniVisionEncoderConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
depth (`int`, *optional*, defaults to 32):
@@ -111,7 +111,7 @@ class Qwen2_5OmniVisionEncoderConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Qwen2_5OmniAudioEncoderConfig(PretrainedConfig):
+class Qwen2_5OmniAudioEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniAudioEncoder`]. It is used to instantiate a
Qwen2.5-Omni-Thinker audio encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -120,8 +120,8 @@ class Qwen2_5OmniAudioEncoderConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_mel_bins (`int`, *optional*, defaults to 128):
@@ -209,7 +209,7 @@ class Qwen2_5OmniAudioEncoderConfig(PretrainedConfig):
self.output_dim = output_dim
-class Qwen2_5OmniTextConfig(PretrainedConfig):
+class Qwen2_5OmniTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniThinkerForConditionalGeneration`]. It is used to instantiate an
Qwen2.5-Omni-Thinker model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -217,8 +217,8 @@ class Qwen2_5OmniTextConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 152064):
@@ -410,7 +410,7 @@ class Qwen2_5OmniTextConfig(PretrainedConfig):
layer_type_validation(self.layer_types, self.num_hidden_layers)
-class Qwen2_5OmniThinkerConfig(PretrainedConfig):
+class Qwen2_5OmniThinkerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniThinkerForConditionalGeneration`]. It is used to instantiate an
Qwen2.5-Omni-Thinker model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -418,8 +418,8 @@ class Qwen2_5OmniThinkerConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_config (`dict`, *optional*):
@@ -530,7 +530,7 @@ class Qwen2_5OmniThinkerConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniTalkerConfig(PretrainedConfig):
+class Qwen2_5OmniTalkerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniTalkerForConditionalGeneration`]. It is used to instantiate an
Qwen2.5-Omni-Talker model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -538,8 +538,8 @@ class Qwen2_5OmniTalkerConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_token_index (`int`, *optional*, defaults to 151646):
@@ -792,7 +792,7 @@ class Qwen2_5OmniTalkerConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Qwen2_5OmniDiTConfig(PretrainedConfig):
+class Qwen2_5OmniDiTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of the Qwen2_5OmniToken2WavDiT used in the Qwen2.5-Omni-Token2Wav model.
It defines the architecture of the DiT model, which is used for generating mel-spectrograms from tokens.
@@ -892,7 +892,7 @@ class Qwen2_5OmniDiTConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniBigVGANConfig(PretrainedConfig):
+class Qwen2_5OmniBigVGANConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of the Qwen2_5OmniToken2WavBigVGAN module used in the Qwen2.5-Omni-Token2Wav model.
It defines the architecture of the BigVGAN model, which is used for converting mel-spectrograms to waveforms.
@@ -933,13 +933,13 @@ class Qwen2_5OmniBigVGANConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniToken2WavConfig(PretrainedConfig):
+class Qwen2_5OmniToken2WavConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniToken2WavModel`].
It is used to instantiate the Qwen2.5-Omni-Token2Wav model which combines a Diffusion Transformer (DiT) for mel-spectrogram generation with a BigVGAN model for waveform synthesis. The configuration contains sub-configurations for both components.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
dit_config ([`DiT_Args`], *optional*):
@@ -992,7 +992,7 @@ class Qwen2_5OmniToken2WavConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniConfig(PretrainedConfig):
+class Qwen2_5OmniConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniForConditionalGeneration`]. It is used to instantiate a Qwen2.5Omni
model according to the specified sub-models configurations, defining the model architecture.
@@ -1000,8 +1000,8 @@ class Qwen2_5OmniConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the
[Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
thinker_config (`dict`, *optional*): Configuration of the underlying thinker sub-model.
diff --git a/src/transformers/models/qwen2_5_omni/modular_qwen2_5_omni.py b/src/transformers/models/qwen2_5_omni/modular_qwen2_5_omni.py
index ee73836f8ab..6620765bc83 100644
--- a/src/transformers/models/qwen2_5_omni/modular_qwen2_5_omni.py
+++ b/src/transformers/models/qwen2_5_omni/modular_qwen2_5_omni.py
@@ -41,7 +41,7 @@ from transformers.models.qwen2_audio.modeling_qwen2_audio import Qwen2AudioEncod
from transformers.models.qwen2_vl.modeling_qwen2_vl import Qwen2VLRotaryEmbedding
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...generation import GenerationMixin
from ...modeling_outputs import BaseModelOutput, ModelOutput
from ...modeling_rope_utils import rope_config_validation
@@ -68,8 +68,8 @@ class Qwen2_5OmniVisionEncoderConfig(Qwen2_5_VLVisionConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
depth (`int`, *optional*, defaults to 32):
@@ -153,8 +153,8 @@ class Qwen2_5OmniAudioEncoderConfig(Qwen2AudioEncoderConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_mel_bins (`int`, *optional*, defaults to 128):
@@ -243,7 +243,7 @@ class Qwen2_5OmniAudioEncoderConfig(Qwen2AudioEncoderConfig):
del self.encoder_layerdrop
-class Qwen2_5OmniTextConfig(PretrainedConfig):
+class Qwen2_5OmniTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniThinkerForConditionalGeneration`]. It is used to instantiate an
Qwen2.5-Omni-Thinker model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -251,8 +251,8 @@ class Qwen2_5OmniTextConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 152064):
@@ -444,7 +444,7 @@ class Qwen2_5OmniTextConfig(PretrainedConfig):
layer_type_validation(self.layer_types, self.num_hidden_layers)
-class Qwen2_5OmniThinkerConfig(PretrainedConfig):
+class Qwen2_5OmniThinkerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniThinkerForConditionalGeneration`]. It is used to instantiate an
Qwen2.5-Omni-Thinker model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -452,8 +452,8 @@ class Qwen2_5OmniThinkerConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_config (`dict`, *optional*):
@@ -564,7 +564,7 @@ class Qwen2_5OmniThinkerConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniTalkerConfig(PretrainedConfig):
+class Qwen2_5OmniTalkerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniTalkerForConditionalGeneration`]. It is used to instantiate an
Qwen2.5-Omni-Talker model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -572,8 +572,8 @@ class Qwen2_5OmniTalkerConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_token_index (`int`, *optional*, defaults to 151646):
@@ -826,7 +826,7 @@ class Qwen2_5OmniTalkerConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Qwen2_5OmniDiTConfig(PretrainedConfig):
+class Qwen2_5OmniDiTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of the Qwen2_5OmniToken2WavDiT used in the Qwen2.5-Omni-Token2Wav model.
It defines the architecture of the DiT model, which is used for generating mel-spectrograms from tokens.
@@ -926,7 +926,7 @@ class Qwen2_5OmniDiTConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniBigVGANConfig(PretrainedConfig):
+class Qwen2_5OmniBigVGANConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of the Qwen2_5OmniToken2WavBigVGAN module used in the Qwen2.5-Omni-Token2Wav model.
It defines the architecture of the BigVGAN model, which is used for converting mel-spectrograms to waveforms.
@@ -967,13 +967,13 @@ class Qwen2_5OmniBigVGANConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniToken2WavConfig(PretrainedConfig):
+class Qwen2_5OmniToken2WavConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniToken2WavModel`].
It is used to instantiate the Qwen2.5-Omni-Token2Wav model which combines a Diffusion Transformer (DiT) for mel-spectrogram generation with a BigVGAN model for waveform synthesis. The configuration contains sub-configurations for both components.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
dit_config ([`DiT_Args`], *optional*):
@@ -1026,7 +1026,7 @@ class Qwen2_5OmniToken2WavConfig(PretrainedConfig):
super().__init__(**kwargs)
-class Qwen2_5OmniConfig(PretrainedConfig):
+class Qwen2_5OmniConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`Qwen2_5OmniForConditionalGeneration`]. It is used to instantiate a Qwen2.5Omni
model according to the specified sub-models configurations, defining the model architecture.
@@ -1034,8 +1034,8 @@ class Qwen2_5OmniConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the
[Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
thinker_config (`dict`, *optional*): Configuration of the underlying thinker sub-model.
diff --git a/src/transformers/models/qwen2_5_vl/configuration_qwen2_5_vl.py b/src/transformers/models/qwen2_5_vl/configuration_qwen2_5_vl.py
index fcd17cb5811..06b1c6965a7 100644
--- a/src/transformers/models/qwen2_5_vl/configuration_qwen2_5_vl.py
+++ b/src/transformers/models/qwen2_5_vl/configuration_qwen2_5_vl.py
@@ -23,11 +23,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
-class Qwen2_5_VLVisionConfig(PretrainedConfig):
+class Qwen2_5_VLVisionConfig(PreTrainedConfig):
model_type = "qwen2_5_vl"
base_config_key = "vision_config"
@@ -67,15 +67,15 @@ class Qwen2_5_VLVisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Qwen2_5_VLTextConfig(PretrainedConfig):
+class Qwen2_5_VLTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5_VLTextModel`]. It is used to instantiate a
Qwen2-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-VL-7B-Instruct [Qwen/Qwen2-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 152064):
@@ -261,15 +261,15 @@ class Qwen2_5_VLTextConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Qwen2_5_VLConfig(PretrainedConfig):
+class Qwen2_5_VLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2_5_VLModel`]. It is used to instantiate a
Qwen2-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-VL-7B-Instruct [Qwen/Qwen2-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen2_5_vl/modular_qwen2_5_vl.py b/src/transformers/models/qwen2_5_vl/modular_qwen2_5_vl.py
index 9434e7a787e..68e18704667 100644
--- a/src/transformers/models/qwen2_5_vl/modular_qwen2_5_vl.py
+++ b/src/transformers/models/qwen2_5_vl/modular_qwen2_5_vl.py
@@ -44,7 +44,7 @@ from transformers.models.qwen2_vl.processing_qwen2_vl import Qwen2VLProcessor
from ...activations import ACT2FN
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...feature_extraction_utils import BatchFeature
from ...image_utils import ImageInput
from ...modeling_flash_attention_utils import is_flash_attn_available
@@ -62,7 +62,7 @@ if is_flash_attn_available():
logger = logging.get_logger(__name__)
-class Qwen2_5_VLVisionConfig(PretrainedConfig):
+class Qwen2_5_VLVisionConfig(PreTrainedConfig):
model_type = "qwen2_5_vl"
base_config_key = "vision_config"
diff --git a/src/transformers/models/qwen2_audio/configuration_qwen2_audio.py b/src/transformers/models/qwen2_audio/configuration_qwen2_audio.py
index 88e930a94fd..c8704f6a1d8 100644
--- a/src/transformers/models/qwen2_audio/configuration_qwen2_audio.py
+++ b/src/transformers/models/qwen2_audio/configuration_qwen2_audio.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""Qwen2Audio model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,7 +21,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class Qwen2AudioEncoderConfig(PretrainedConfig):
+class Qwen2AudioEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2AudioEncoder`]. It is used to instantiate a
Qwen2-Audio audio encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -30,8 +30,8 @@ class Qwen2AudioEncoderConfig(PretrainedConfig):
e.g. [Qwen/Qwen2-Audio-7B](https://huggingface.co/Qwen/Qwen2-Audio-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_mel_bins (`int`, *optional*, defaults to 128):
@@ -116,7 +116,7 @@ class Qwen2AudioEncoderConfig(PretrainedConfig):
self.max_source_positions = max_source_positions
-class Qwen2AudioConfig(PretrainedConfig):
+class Qwen2AudioConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2AudioForConditionalGeneration`]. It is used to instantiate an
Qwen2-Audio model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -124,8 +124,8 @@ class Qwen2AudioConfig(PretrainedConfig):
e.g. [Qwen/Qwen2-Audio-7B](https://huggingface.co/Qwen/Qwen2-Audio-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_config (`Union[AutoConfig, dict]`, *optional*, defaults to `CLIPVisionConfig`):
diff --git a/src/transformers/models/qwen2_moe/configuration_qwen2_moe.py b/src/transformers/models/qwen2_moe/configuration_qwen2_moe.py
index fb4405bca22..a5a951d2f89 100644
--- a/src/transformers/models/qwen2_moe/configuration_qwen2_moe.py
+++ b/src/transformers/models/qwen2_moe/configuration_qwen2_moe.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Qwen2MoE model configuration"""
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,14 +22,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen2MoeConfig(PretrainedConfig):
+class Qwen2MoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2MoeModel`]. It is used to instantiate a
Qwen2MoE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of [Qwen/Qwen1.5-MoE-A2.7B](https://huggingface.co/Qwen/Qwen1.5-MoE-A2.7B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen2_vl/configuration_qwen2_vl.py b/src/transformers/models/qwen2_vl/configuration_qwen2_vl.py
index 774e35d30bb..12c0ce8509c 100644
--- a/src/transformers/models/qwen2_vl/configuration_qwen2_vl.py
+++ b/src/transformers/models/qwen2_vl/configuration_qwen2_vl.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Qwen2VL model configuration"""
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,7 +22,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen2VLVisionConfig(PretrainedConfig):
+class Qwen2VLVisionConfig(PreTrainedConfig):
model_type = "qwen2_vl"
base_config_key = "vision_config"
@@ -56,15 +56,15 @@ class Qwen2VLVisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Qwen2VLTextConfig(PretrainedConfig):
+class Qwen2VLTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2VLTextModel`]. It is used to instantiate a
Qwen2-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-VL-7B-Instruct [Qwen/Qwen2-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 152064):
@@ -250,15 +250,15 @@ class Qwen2VLTextConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Qwen2VLConfig(PretrainedConfig):
+class Qwen2VLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen2VLModel`]. It is used to instantiate a
Qwen2-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-VL-7B-Instruct [Qwen/Qwen2-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen3/configuration_qwen3.py b/src/transformers/models/qwen3/configuration_qwen3.py
index 0b642913dce..ed21fbe767a 100644
--- a/src/transformers/models/qwen3/configuration_qwen3.py
+++ b/src/transformers/models/qwen3/configuration_qwen3.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Qwen3 model configuration"""
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen3Config(PretrainedConfig):
+class Qwen3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3Model`]. It is used to instantiate a
Qwen3 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-8B [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen3_moe/configuration_qwen3_moe.py b/src/transformers/models/qwen3_moe/configuration_qwen3_moe.py
index a23d19c1154..5f25cc232fe 100644
--- a/src/transformers/models/qwen3_moe/configuration_qwen3_moe.py
+++ b/src/transformers/models/qwen3_moe/configuration_qwen3_moe.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Qwen3MoE model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,14 +22,14 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen3MoeConfig(PretrainedConfig):
+class Qwen3MoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3MoeModel`]. It is used to instantiate a
Qwen3MoE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of [Qwen/Qwen3-15B-A2B](https://huggingface.co/Qwen/Qwen3-15B-A2B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen3_next/configuration_qwen3_next.py b/src/transformers/models/qwen3_next/configuration_qwen3_next.py
index 148166cbd16..564f3938ac2 100644
--- a/src/transformers/models/qwen3_next/configuration_qwen3_next.py
+++ b/src/transformers/models/qwen3_next/configuration_qwen3_next.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Qwen3-Next model configuration"""
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen3NextConfig(PretrainedConfig):
+class Qwen3NextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3NextModel`]. It is used to instantiate a
Qwen3-Next model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of
Qwen3-Next-80B-A3B-Instruct [Qwen/Qwen3-Next-80B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Next-80B-A3B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen3_omni_moe/configuration_qwen3_omni_moe.py b/src/transformers/models/qwen3_omni_moe/configuration_qwen3_omni_moe.py
index b530630813d..7acafe963be 100644
--- a/src/transformers/models/qwen3_omni_moe/configuration_qwen3_omni_moe.py
+++ b/src/transformers/models/qwen3_omni_moe/configuration_qwen3_omni_moe.py
@@ -19,7 +19,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -27,7 +27,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Qwen3OmniMoeAudioEncoderConfig(PretrainedConfig):
+class Qwen3OmniMoeAudioEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeAudioEncoder`]. It is used to instantiate a
Qwen2.5-Omni-Thinker audio encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -36,8 +36,8 @@ class Qwen3OmniMoeAudioEncoderConfig(PretrainedConfig):
e.g. [Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_mel_bins (`int`, *optional*, defaults to 128):
@@ -131,7 +131,7 @@ class Qwen3OmniMoeAudioEncoderConfig(PretrainedConfig):
self.downsample_hidden_size = downsample_hidden_size
-class Qwen3OmniMoeVisionEncoderConfig(PretrainedConfig):
+class Qwen3OmniMoeVisionEncoderConfig(PreTrainedConfig):
model_type = "qwen3_omni_moe_vision_encoder"
base_config_key = "vision_config"
@@ -169,14 +169,14 @@ class Qwen3OmniMoeVisionEncoderConfig(PretrainedConfig):
self.deepstack_visual_indexes = deepstack_visual_indexes
-class Qwen3OmniMoeTextConfig(PretrainedConfig):
+class Qwen3OmniMoeTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeTextModel`]. It is used to instantiate a
Qwen3OmniMoeText model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of [Qwen/Qwen3-15B-A2B](https://huggingface.co/Qwen/Qwen3-15B-A2B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -381,7 +381,7 @@ class Qwen3OmniMoeTextConfig(PretrainedConfig):
self.mlp_only_layers = [] if mlp_only_layers is None else mlp_only_layers
-class Qwen3OmniMoeThinkerConfig(PretrainedConfig):
+class Qwen3OmniMoeThinkerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeThinker`]. It is used to instantiate a
Qwen3-Omni-Thinker model according to the specified arguments, defining the model architecture. Instantiating a
@@ -390,8 +390,8 @@ class Qwen3OmniMoeThinkerConfig(PretrainedConfig):
e.g. [Qwen/Qwen3-Omni-7B](https://huggingface.co/Qwen/Qwen3-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_config (`dict`, *optional*):
@@ -481,15 +481,15 @@ class Qwen3OmniMoeThinkerConfig(PretrainedConfig):
self.video_token_id = video_token_id
-class Qwen3OmniMoeTalkerCodePredictorConfig(PretrainedConfig):
+class Qwen3OmniMoeTalkerCodePredictorConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeTalkerCodePredictorModel`]. It is used to instantiate a
Qwen3OmniMoeTalkerCodePredictor model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3OmniMoeTalkerCodePredictor-8B [Qwen/Qwen3OmniMoeTalkerCodePredictor-8B](https://huggingface.co/Qwen/Qwen3OmniMoeTalkerCodePredictor-8B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -679,14 +679,14 @@ class Qwen3OmniMoeTalkerCodePredictorConfig(PretrainedConfig):
self.num_code_groups = num_code_groups
-class Qwen3OmniMoeTalkerTextConfig(PretrainedConfig):
+class Qwen3OmniMoeTalkerTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeTalkerTextModel`]. It is used to instantiate a
Qwen3OmniMoeTalkerText model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of [Qwen/Qwen3-15B-A2B](https://huggingface.co/Qwen/Qwen3-15B-A2B).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -891,7 +891,7 @@ class Qwen3OmniMoeTalkerTextConfig(PretrainedConfig):
self.mlp_only_layers = [] if mlp_only_layers is None else mlp_only_layers
-class Qwen3OmniMoeTalkerConfig(PretrainedConfig):
+class Qwen3OmniMoeTalkerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeTalker`]. It is used to instantiate a
Qwen3-Omni multi-modal talker model capable of handling text, audio, and vision modalities in a unified architecture.
@@ -901,8 +901,8 @@ class Qwen3OmniMoeTalkerConfig(PretrainedConfig):
e.g. [Qwen/Qwen3-Omni-7B](https://huggingface.co/Qwen/Qwen3-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
code_predictor_config (`dict`, *optional*):
@@ -1027,7 +1027,7 @@ class Qwen3OmniMoeTalkerConfig(PretrainedConfig):
self.speaker_id = speaker_id
-class Qwen3OmniMoeCode2WavConfig(PretrainedConfig):
+class Qwen3OmniMoeCode2WavConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeCode2WavConfig`]. It is used to instantiate a
Qwen3-Omni code-to-waveform decoder, responsible for converting discrete audio codes into high-fidelity waveforms.
@@ -1036,8 +1036,8 @@ class Qwen3OmniMoeCode2WavConfig(PretrainedConfig):
e.g. [Qwen/Qwen3-Omni-7B](https://huggingface.co/Qwen/Qwen3-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
codebook_size (`int`, *optional*, defaults to 2048):
@@ -1142,7 +1142,7 @@ class Qwen3OmniMoeCode2WavConfig(PretrainedConfig):
return ["sliding_attention"] * self.num_hidden_layers
-class Qwen3OmniMoeConfig(PretrainedConfig):
+class Qwen3OmniMoeConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeForConditionalGeneration`]. It is used to instantiate a Qwen3Omni
model according to the specified sub-models configurations, defining the model architecture.
@@ -1150,8 +1150,8 @@ class Qwen3OmniMoeConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the
[Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
thinker_config (`dict`, *optional*): Configuration of the underlying thinker sub-model.
@@ -1229,7 +1229,7 @@ class Qwen3OmniMoeConfig(PretrainedConfig):
self.user_token_id = user_token_id
self.assistant_token_id = assistant_token_id
- def get_text_config(self, decoder=False) -> "PretrainedConfig":
+ def get_text_config(self, decoder=False) -> "PreTrainedConfig":
"""
Returns the config that is meant to be used with text IO. On most models, it is the original config instance
itself. On specific composite models, it is under a set of valid names.
diff --git a/src/transformers/models/qwen3_omni_moe/modular_qwen3_omni_moe.py b/src/transformers/models/qwen3_omni_moe/modular_qwen3_omni_moe.py
index a7c147b42fb..11108cbc54f 100644
--- a/src/transformers/models/qwen3_omni_moe/modular_qwen3_omni_moe.py
+++ b/src/transformers/models/qwen3_omni_moe/modular_qwen3_omni_moe.py
@@ -28,7 +28,7 @@ from torch.nn import functional as F
from ...activations import ACT2FN
from ...audio_utils import AudioInput
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...feature_extraction_utils import BatchFeature
from ...generation import GenerationMixin
from ...image_utils import ImageInput
@@ -225,8 +225,8 @@ class Qwen3OmniMoeThinkerConfig(Qwen2_5OmniThinkerConfig):
e.g. [Qwen/Qwen3-Omni-7B](https://huggingface.co/Qwen/Qwen3-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_config (`dict`, *optional*):
@@ -426,7 +426,7 @@ class Qwen3OmniMoeTalkerTextConfig(Qwen3MoeConfig):
self.sliding_window = sliding_window
-class Qwen3OmniMoeTalkerConfig(PretrainedConfig):
+class Qwen3OmniMoeTalkerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeTalker`]. It is used to instantiate a
Qwen3-Omni multi-modal talker model capable of handling text, audio, and vision modalities in a unified architecture.
@@ -436,8 +436,8 @@ class Qwen3OmniMoeTalkerConfig(PretrainedConfig):
e.g. [Qwen/Qwen3-Omni-7B](https://huggingface.co/Qwen/Qwen3-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
code_predictor_config (`dict`, *optional*):
@@ -562,7 +562,7 @@ class Qwen3OmniMoeTalkerConfig(PretrainedConfig):
self.speaker_id = speaker_id
-class Qwen3OmniMoeCode2WavConfig(PretrainedConfig):
+class Qwen3OmniMoeCode2WavConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeCode2WavConfig`]. It is used to instantiate a
Qwen3-Omni code-to-waveform decoder, responsible for converting discrete audio codes into high-fidelity waveforms.
@@ -571,8 +571,8 @@ class Qwen3OmniMoeCode2WavConfig(PretrainedConfig):
e.g. [Qwen/Qwen3-Omni-7B](https://huggingface.co/Qwen/Qwen3-Omni-7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
codebook_size (`int`, *optional*, defaults to 2048):
@@ -677,7 +677,7 @@ class Qwen3OmniMoeCode2WavConfig(PretrainedConfig):
return ["sliding_attention"] * self.num_hidden_layers
-class Qwen3OmniMoeConfig(PretrainedConfig):
+class Qwen3OmniMoeConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`Qwen3OmniMoeForConditionalGeneration`]. It is used to instantiate a Qwen3Omni
model according to the specified sub-models configurations, defining the model architecture.
@@ -685,8 +685,8 @@ class Qwen3OmniMoeConfig(PretrainedConfig):
Instantiating a configuration with the defaults will yield a similar configuration to that of the
[Qwen/Qwen2.5-Omni-7B](https://huggingface.co/Qwen/Qwen2.5-Omni-7B) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
thinker_config (`dict`, *optional*): Configuration of the underlying thinker sub-model.
@@ -764,7 +764,7 @@ class Qwen3OmniMoeConfig(PretrainedConfig):
self.user_token_id = user_token_id
self.assistant_token_id = assistant_token_id
- def get_text_config(self, decoder=False) -> "PretrainedConfig":
+ def get_text_config(self, decoder=False) -> "PreTrainedConfig":
"""
Returns the config that is meant to be used with text IO. On most models, it is the original config instance
itself. On specific composite models, it is under a set of valid names.
diff --git a/src/transformers/models/qwen3_vl/configuration_qwen3_vl.py b/src/transformers/models/qwen3_vl/configuration_qwen3_vl.py
index 132ffa8be15..2d1f6a6d4bd 100644
--- a/src/transformers/models/qwen3_vl/configuration_qwen3_vl.py
+++ b/src/transformers/models/qwen3_vl/configuration_qwen3_vl.py
@@ -18,11 +18,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class Qwen3VLVisionConfig(PretrainedConfig):
+class Qwen3VLVisionConfig(PreTrainedConfig):
model_type = "qwen3_vl"
base_config_key = "vision_config"
@@ -60,15 +60,15 @@ class Qwen3VLVisionConfig(PretrainedConfig):
self.deepstack_visual_indexes = deepstack_visual_indexes
-class Qwen3VLTextConfig(PretrainedConfig):
+class Qwen3VLTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3VLTextModel`]. It is used to instantiate a
Qwen3-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-VL-4B-Instruct [Qwen/Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151936):
@@ -212,15 +212,15 @@ class Qwen3VLTextConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Qwen3VLConfig(PretrainedConfig):
+class Qwen3VLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3VLModel`]. It is used to instantiate a
Qwen3-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-VL-4B-Instruct [Qwen/Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen3_vl/modular_qwen3_vl.py b/src/transformers/models/qwen3_vl/modular_qwen3_vl.py
index ff5346fb94b..ffac84f90c8 100644
--- a/src/transformers/models/qwen3_vl/modular_qwen3_vl.py
+++ b/src/transformers/models/qwen3_vl/modular_qwen3_vl.py
@@ -23,7 +23,7 @@ import torch.nn.functional as F
from ...activations import ACT2FN
from ...cache_utils import Cache, DynamicCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...feature_extraction_utils import BatchFeature
from ...image_utils import ImageInput
from ...masking_utils import create_causal_mask
@@ -63,7 +63,7 @@ from ..qwen3.modeling_qwen3 import (
logger = logging.get_logger(__name__)
-class Qwen3VLVisionConfig(PretrainedConfig):
+class Qwen3VLVisionConfig(PreTrainedConfig):
model_type = "qwen3_vl"
base_config_key = "vision_config"
@@ -101,15 +101,15 @@ class Qwen3VLVisionConfig(PretrainedConfig):
self.deepstack_visual_indexes = deepstack_visual_indexes
-class Qwen3VLTextConfig(PretrainedConfig):
+class Qwen3VLTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3VLTextModel`]. It is used to instantiate a
Qwen3-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-VL-4B-Instruct [Qwen/Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151936):
@@ -253,15 +253,15 @@ class Qwen3VLTextConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Qwen3VLConfig(PretrainedConfig):
+class Qwen3VLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3VLModel`]. It is used to instantiate a
Qwen3-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-VL-4B-Instruct [Qwen/Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen3_vl_moe/configuration_qwen3_vl_moe.py b/src/transformers/models/qwen3_vl_moe/configuration_qwen3_vl_moe.py
index 25358aa79bf..b05bb7d8a01 100644
--- a/src/transformers/models/qwen3_vl_moe/configuration_qwen3_vl_moe.py
+++ b/src/transformers/models/qwen3_vl_moe/configuration_qwen3_vl_moe.py
@@ -18,19 +18,19 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
-class Qwen3VLMoeTextConfig(PretrainedConfig):
+class Qwen3VLMoeTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3VLMoeTextModel`]. It is used to instantiate a
Qwen3-VL-MOE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-VL-30B-A3B-Instruct [Qwen/Qwen3-VL-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-30B-A3B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151936):
@@ -222,7 +222,7 @@ class Qwen3VLMoeTextConfig(PretrainedConfig):
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
-class Qwen3VLMoeVisionConfig(PretrainedConfig):
+class Qwen3VLMoeVisionConfig(PreTrainedConfig):
model_type = "qwen3_vl_moe"
base_config_key = "vision_config"
@@ -260,15 +260,15 @@ class Qwen3VLMoeVisionConfig(PretrainedConfig):
self.deepstack_visual_indexes = deepstack_visual_indexes
-class Qwen3VLMoeConfig(PretrainedConfig):
+class Qwen3VLMoeConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3VLMoeModel`]. It is used to instantiate a
Qwen3-VL-MOE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-VL-30B-A3B-Instruct [Qwen/Qwen3-VL-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-30B-A3B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/qwen3_vl_moe/modular_qwen3_vl_moe.py b/src/transformers/models/qwen3_vl_moe/modular_qwen3_vl_moe.py
index 30dda5f9949..57d6d46539f 100644
--- a/src/transformers/models/qwen3_vl_moe/modular_qwen3_vl_moe.py
+++ b/src/transformers/models/qwen3_vl_moe/modular_qwen3_vl_moe.py
@@ -21,7 +21,7 @@ import torch.nn as nn
from ...activations import ACT2FN
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...modeling_utils import PreTrainedModel
from ...processing_utils import Unpack
@@ -46,15 +46,15 @@ from ..qwen3_vl.modeling_qwen3_vl import (
logger = logging.get_logger(__name__)
-class Qwen3VLMoeTextConfig(PretrainedConfig):
+class Qwen3VLMoeTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Qwen3VLMoeTextModel`]. It is used to instantiate a
Qwen3-VL-MOE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen3-VL-30B-A3B-Instruct [Qwen/Qwen3-VL-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-30B-A3B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 151936):
@@ -257,8 +257,8 @@ class Qwen3VLMoeConfig(Qwen3VLConfig):
with the defaults will yield a similar configuration to that of
Qwen3-VL-30B-A3B-Instruct [Qwen/Qwen3-VL-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-30B-A3B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/rag/configuration_rag.py b/src/transformers/models/rag/configuration_rag.py
index dca4eb04d3f..d9b1b4551d6 100644
--- a/src/transformers/models/rag/configuration_rag.py
+++ b/src/transformers/models/rag/configuration_rag.py
@@ -14,13 +14,13 @@
# limitations under the License.
"""RAG model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import add_start_docstrings
RAG_CONFIG_DOC = r"""
- [`RagConfig`] stores the configuration of a *RagModel*. Configuration objects inherit from [`PretrainedConfig`] and
- can be used to control the model outputs. Read the documentation from [`PretrainedConfig`] for more information.
+ [`RagConfig`] stores the configuration of a *RagModel*. Configuration objects inherit from [`PreTrainedConfig`] and
+ can be used to control the model outputs. Read the documentation from [`PreTrainedConfig`] for more information.
Args:
title_sep (`str`, *optional*, defaults to `" / "`):
@@ -77,7 +77,7 @@ RAG_CONFIG_DOC = r"""
@add_start_docstrings(RAG_CONFIG_DOC)
-class RagConfig(PretrainedConfig):
+class RagConfig(PreTrainedConfig):
model_type = "rag"
has_no_defaults_at_init = True
@@ -171,8 +171,8 @@ class RagConfig(PretrainedConfig):
@classmethod
def from_question_encoder_generator_configs(
- cls, question_encoder_config: PretrainedConfig, generator_config: PretrainedConfig, **kwargs
- ) -> PretrainedConfig:
+ cls, question_encoder_config: PreTrainedConfig, generator_config: PreTrainedConfig, **kwargs
+ ) -> PreTrainedConfig:
r"""
Instantiate a [`EncoderDecoderConfig`] (or a derived class) from a pre-trained encoder model configuration and
decoder model configuration.
diff --git a/src/transformers/models/rag/modeling_rag.py b/src/transformers/models/rag/modeling_rag.py
index 277fb2c04c6..59b7b17908f 100644
--- a/src/transformers/models/rag/modeling_rag.py
+++ b/src/transformers/models/rag/modeling_rag.py
@@ -22,7 +22,7 @@ import torch
from torch import nn
from ...cache_utils import Cache, EncoderDecoderCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationConfig, GenerationMixin, LogitsProcessorList, StoppingCriteriaList
from ...modeling_outputs import ModelOutput
from ...modeling_utils import PreTrainedModel
@@ -373,7 +373,7 @@ class RagPreTrainedModel(PreTrainedModel):
class RagModel(RagPreTrainedModel):
def __init__(
self,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
question_encoder: Optional[PreTrainedModel] = None,
generator: Optional[PreTrainedModel] = None,
retriever: Optional[RagRetriever] = None, # or maybe just use a `set_retriever(...)` method
@@ -661,7 +661,7 @@ class RagModel(RagPreTrainedModel):
class RagSequenceForGeneration(RagPreTrainedModel):
def __init__(
self,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
question_encoder: Optional[PreTrainedModel] = None,
generator: Optional[PreTrainedModel] = None,
retriever: Optional[RagRetriever] = None,
@@ -1096,7 +1096,7 @@ class RagSequenceForGeneration(RagPreTrainedModel):
class RagTokenForGeneration(RagPreTrainedModel, GenerationMixin):
def __init__(
self,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
question_encoder: Optional[PreTrainedModel] = None,
generator: Optional[PreTrainedModel] = None,
retriever: Optional[RagRetriever] = None,
diff --git a/src/transformers/models/recurrent_gemma/configuration_recurrent_gemma.py b/src/transformers/models/recurrent_gemma/configuration_recurrent_gemma.py
index ef2a0869912..77a7cae6aa4 100644
--- a/src/transformers/models/recurrent_gemma/configuration_recurrent_gemma.py
+++ b/src/transformers/models/recurrent_gemma/configuration_recurrent_gemma.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""RecurrentGemma model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class RecurrentGemmaConfig(PretrainedConfig):
+class RecurrentGemmaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RecurrentGemmaModel`]. It is used to instantiate a RecurrentGemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -29,8 +29,8 @@ class RecurrentGemmaConfig(PretrainedConfig):
e.g. [google/recurrentgemma-2b](https://huggingface.co/google/recurrentgemma-2b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/reformer/configuration_reformer.py b/src/transformers/models/reformer/configuration_reformer.py
index d9f7734b9f3..353ecac18c6 100755
--- a/src/transformers/models/reformer/configuration_reformer.py
+++ b/src/transformers/models/reformer/configuration_reformer.py
@@ -15,22 +15,22 @@
# limitations under the License.
"""Reformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ReformerConfig(PretrainedConfig):
+class ReformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ReformerModel`]. It is used to instantiate a
Reformer model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ReFormer
[google/reformer-crime-and-punishment](https://huggingface.co/google/reformer-crime-and-punishment) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
attention_head_size (`int`, *optional*, defaults to 64):
diff --git a/src/transformers/models/regnet/configuration_regnet.py b/src/transformers/models/regnet/configuration_regnet.py
index 4858bd1e461..bb4a3ae577e 100644
--- a/src/transformers/models/regnet/configuration_regnet.py
+++ b/src/transformers/models/regnet/configuration_regnet.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""RegNet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class RegNetConfig(PretrainedConfig):
+class RegNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RegNetModel`]. It is used to instantiate a RegNet
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the RegNet
[facebook/regnet-y-040](https://huggingface.co/facebook/regnet-y-040) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/rembert/configuration_rembert.py b/src/transformers/models/rembert/configuration_rembert.py
index 4b7456a20fd..0157201aa82 100644
--- a/src/transformers/models/rembert/configuration_rembert.py
+++ b/src/transformers/models/rembert/configuration_rembert.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class RemBertConfig(PretrainedConfig):
+class RemBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RemBertModel`]. It is used to instantiate an
RemBERT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the RemBERT
[google/rembert](https://huggingface.co/google/rembert) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/resnet/configuration_resnet.py b/src/transformers/models/resnet/configuration_resnet.py
index f4dcc6e0c6b..e2bdd7ee730 100644
--- a/src/transformers/models/resnet/configuration_resnet.py
+++ b/src/transformers/models/resnet/configuration_resnet.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -28,15 +28,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class ResNetConfig(BackboneConfigMixin, PretrainedConfig):
+class ResNetConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ResNetModel`]. It is used to instantiate an
ResNet model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ResNet
[microsoft/resnet-50](https://huggingface.co/microsoft/resnet-50) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/roberta/configuration_roberta.py b/src/transformers/models/roberta/configuration_roberta.py
index 04917804a22..0e50bb0e753 100644
--- a/src/transformers/models/roberta/configuration_roberta.py
+++ b/src/transformers/models/roberta/configuration_roberta.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -26,15 +26,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class RobertaConfig(PretrainedConfig):
+class RobertaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RobertaModel`] or a [`TFRobertaModel`]. It is
used to instantiate a RoBERTa model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the RoBERTa
[FacebookAI/roberta-base](https://huggingface.co/FacebookAI/roberta-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py b/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py
index 72bc808c450..a01be718d75 100644
--- a/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py
+++ b/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ logger = logging.get_logger(__name__)
# Copied from transformers.models.roberta.configuration_roberta.RobertaConfig with FacebookAI/roberta-base->andreasmadsen/efficient_mlm_m0.40,RoBERTa->RoBERTa-PreLayerNorm,Roberta->RobertaPreLayerNorm,roberta->roberta-prelayernorm
-class RobertaPreLayerNormConfig(PretrainedConfig):
+class RobertaPreLayerNormConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RobertaPreLayerNormModel`] or a [`TFRobertaPreLayerNormModel`]. It is
used to instantiate a RoBERTa-PreLayerNorm model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the RoBERTa-PreLayerNorm
[andreasmadsen/efficient_mlm_m0.40](https://huggingface.co/andreasmadsen/efficient_mlm_m0.40) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/roc_bert/configuration_roc_bert.py b/src/transformers/models/roc_bert/configuration_roc_bert.py
index 75f83e11a79..425f05921ec 100644
--- a/src/transformers/models/roc_bert/configuration_roc_bert.py
+++ b/src/transformers/models/roc_bert/configuration_roc_bert.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""RoCBert model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class RoCBertConfig(PretrainedConfig):
+class RoCBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RoCBertModel`]. It is used to instantiate a
RoCBert model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the RoCBert
[weiweishi/roc-bert-base-zh](https://huggingface.co/weiweishi/roc-bert-base-zh) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/roformer/configuration_roformer.py b/src/transformers/models/roformer/configuration_roformer.py
index 876b42a9225..e32323cf274 100644
--- a/src/transformers/models/roformer/configuration_roformer.py
+++ b/src/transformers/models/roformer/configuration_roformer.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class RoFormerConfig(PretrainedConfig):
+class RoFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RoFormerModel`]. It is used to instantiate an
RoFormer model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the RoFormer
[junnyu/roformer_chinese_base](https://huggingface.co/junnyu/roformer_chinese_base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/rt_detr/configuration_rt_detr.py b/src/transformers/models/rt_detr/configuration_rt_detr.py
index 994d4a6fd6f..007a2138497 100644
--- a/src/transformers/models/rt_detr/configuration_rt_detr.py
+++ b/src/transformers/models/rt_detr/configuration_rt_detr.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""RT-DETR model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -24,15 +24,15 @@ from .configuration_rt_detr_resnet import RTDetrResNetConfig
logger = logging.get_logger(__name__)
-class RTDetrConfig(PretrainedConfig):
+class RTDetrConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RTDetrModel`]. It is used to instantiate a
RT-DETR model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the RT-DETR
[PekingU/rtdetr_r50vd](https://huggingface.co/PekingU/rtdetr_r50vd) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
initializer_range (`float`, *optional*, defaults to 0.01):
@@ -352,12 +352,12 @@ class RTDetrConfig(PretrainedConfig):
)
@classmethod
- def from_backbone_configs(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_configs(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`RTDetrConfig`] (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
diff --git a/src/transformers/models/rt_detr/configuration_rt_detr_resnet.py b/src/transformers/models/rt_detr/configuration_rt_detr_resnet.py
index 73b9517ab14..4de88917cac 100644
--- a/src/transformers/models/rt_detr/configuration_rt_detr_resnet.py
+++ b/src/transformers/models/rt_detr/configuration_rt_detr_resnet.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""RT-DETR ResNet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class RTDetrResNetConfig(BackboneConfigMixin, PretrainedConfig):
+class RTDetrResNetConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RTDetrResnetBackbone`]. It is used to instantiate an
ResNet model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the ResNet
[microsoft/resnet-50](https://huggingface.co/microsoft/resnet-50) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/rt_detr_v2/configuration_rt_detr_v2.py b/src/transformers/models/rt_detr_v2/configuration_rt_detr_v2.py
index 6f4a53483b1..25a41100574 100644
--- a/src/transformers/models/rt_detr_v2/configuration_rt_detr_v2.py
+++ b/src/transformers/models/rt_detr_v2/configuration_rt_detr_v2.py
@@ -19,7 +19,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -28,7 +28,7 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class RTDetrV2Config(PretrainedConfig):
+class RTDetrV2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RTDetrV2Model`]. It is used to instantiate a
RT-DETR model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -36,8 +36,8 @@ class RTDetrV2Config(PretrainedConfig):
e.g. [PekingU/rtdetr_r18vd](https://huggingface.co/PekingU/rtdetr_r18vd)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
initializer_range (`float`, *optional*, defaults to 0.01):
@@ -367,12 +367,12 @@ class RTDetrV2Config(PretrainedConfig):
)
@classmethod
- def from_backbone_configs(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_configs(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`RTDetrV2Config`] (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
diff --git a/src/transformers/models/rt_detr_v2/modular_rt_detr_v2.py b/src/transformers/models/rt_detr_v2/modular_rt_detr_v2.py
index af28015d146..447320e38a5 100644
--- a/src/transformers/models/rt_detr_v2/modular_rt_detr_v2.py
+++ b/src/transformers/models/rt_detr_v2/modular_rt_detr_v2.py
@@ -20,7 +20,7 @@ import torch
import torch.nn.functional as F
from torch import Tensor, nn
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import is_torchdynamo_compiling, logging
from ...utils.backbone_utils import (
verify_backbone_config_arguments,
@@ -39,7 +39,7 @@ from ..rt_detr.modeling_rt_detr import (
logger = logging.get_logger(__name__)
-class RTDetrV2Config(PretrainedConfig):
+class RTDetrV2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`RTDetrV2Model`]. It is used to instantiate a
RT-DETR model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -47,8 +47,8 @@ class RTDetrV2Config(PretrainedConfig):
e.g. [PekingU/rtdetr_r18vd](https://huggingface.co/PekingU/rtdetr_r18vd)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
initializer_range (`float`, *optional*, defaults to 0.01):
@@ -378,12 +378,12 @@ class RTDetrV2Config(PretrainedConfig):
)
@classmethod
- def from_backbone_configs(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_configs(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`RTDetrV2Config`] (or a derived class) from a pre-trained backbone model configuration and DETR model
configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
diff --git a/src/transformers/models/rwkv/configuration_rwkv.py b/src/transformers/models/rwkv/configuration_rwkv.py
index be90607c55f..986e1e9d41f 100644
--- a/src/transformers/models/rwkv/configuration_rwkv.py
+++ b/src/transformers/models/rwkv/configuration_rwkv.py
@@ -15,22 +15,22 @@
# limitations under the License.
"""RWKV configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class RwkvConfig(PretrainedConfig):
+class RwkvConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`RwkvModel`]. It is used to instantiate a RWKV
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the RWVK-4
[RWKV/rwkv-4-169m-pile](https://huggingface.co/RWKV/rwkv-4-169m-pile) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/sam/configuration_sam.py b/src/transformers/models/sam/configuration_sam.py
index 11a3e421d42..4d4a4761ad1 100644
--- a/src/transformers/models/sam/configuration_sam.py
+++ b/src/transformers/models/sam/configuration_sam.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""SAM model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SamPromptEncoderConfig(PretrainedConfig):
+class SamPromptEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SamPromptEncoder`]. The [`SamPromptEncoder`]
module is used to encode the input 2D points and bounding boxes. Instantiating a configuration defaults will yield
a similar configuration to that of the SAM-vit-h
[facebook/sam-vit-huge](https://huggingface.co/facebook/sam-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -70,15 +70,15 @@ class SamPromptEncoderConfig(PretrainedConfig):
self.layer_norm_eps = layer_norm_eps
-class SamMaskDecoderConfig(PretrainedConfig):
+class SamMaskDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SamMaskDecoder`]. It is used to instantiate a SAM
mask decoder to the specified arguments, defining the model architecture. Instantiating a configuration defaults
will yield a similar configuration to that of the SAM-vit-h
[facebook/sam-vit-huge](https://huggingface.co/facebook/sam-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -133,15 +133,15 @@ class SamMaskDecoderConfig(PretrainedConfig):
self.layer_norm_eps = layer_norm_eps
-class SamVisionConfig(PretrainedConfig):
+class SamVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SamVisionModel`]. It is used to instantiate a SAM
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
defaults will yield a similar configuration to that of the SAM ViT-h
[facebook/sam-vit-huge](https://huggingface.co/facebook/sam-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -251,15 +251,15 @@ class SamVisionConfig(PretrainedConfig):
self.mlp_dim = int(hidden_size * mlp_ratio) if mlp_dim is None else mlp_dim
-class SamConfig(PretrainedConfig):
+class SamConfig(PreTrainedConfig):
r"""
[`SamConfig`] is the configuration class to store the configuration of a [`SamModel`]. It is used to instantiate a
SAM model according to the specified arguments, defining the vision model, prompt-encoder model and mask decoder
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the
SAM-ViT-H [facebook/sam-vit-huge](https://huggingface.co/facebook/sam-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `SamVisionConfig`], *optional*):
diff --git a/src/transformers/models/sam2/configuration_sam2.py b/src/transformers/models/sam2/configuration_sam2.py
index e14583181d3..8734e22a9ea 100644
--- a/src/transformers/models/sam2/configuration_sam2.py
+++ b/src/transformers/models/sam2/configuration_sam2.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""SAM2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -22,15 +22,15 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class Sam2HieraDetConfig(PretrainedConfig):
+class Sam2HieraDetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Sam2HieraDetModel`]. It is used to instantiate
a HieraDet model as defined in the original sam2 repo according to the specified arguments, defining the model architecture.
Instantiating a configuration defaults will yield a similar configuration to that of SAM 2.1 Hiera-tiny
[facebook/sam2.1-hiera-tiny](https://huggingface.co/facebook/sam2.1-hiera-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 96):
@@ -141,18 +141,18 @@ class Sam2HieraDetConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Sam2VisionConfig(PretrainedConfig):
+class Sam2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Sam2VisionModel`]. It is used to instantiate a SAM
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
defaults will yield a similar configuration to that of SAM 2.1 Hiera-tiny
[facebook/sam2.1-hiera-tiny](https://huggingface.co/facebook/sam2.1-hiera-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`Union[dict, "PretrainedConfig"]`, *optional*):
+ backbone_config (`Union[dict, "PreTrainedConfig"]`, *optional*):
Configuration for the vision backbone. This is used to instantiate the backbone using
`AutoModel.from_config`.
backbone_channel_list (`List[int]`, *optional*, defaults to `[768, 384, 192, 96]`):
@@ -235,13 +235,13 @@ class Sam2VisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class Sam2PromptEncoderConfig(PretrainedConfig):
+class Sam2PromptEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Sam2PromptEncoder`]. The [`Sam2PromptEncoder`]
module is used to encode the input 2D points and bounding boxes.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -287,13 +287,13 @@ class Sam2PromptEncoderConfig(PretrainedConfig):
self.scale = scale
-class Sam2MaskDecoderConfig(PretrainedConfig):
+class Sam2MaskDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Sam2MaskDecoder`]. It is used to instantiate a SAM2
memory encoder according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -360,15 +360,15 @@ class Sam2MaskDecoderConfig(PretrainedConfig):
self.attention_downsample_rate = attention_downsample_rate
-class Sam2Config(PretrainedConfig):
+class Sam2Config(PreTrainedConfig):
r"""
[`Sam2Config`] is the configuration class to store the configuration of a [`Sam2Model`]. It is used to instantiate a
SAM2 model according to the specified arguments, defining the memory attention, memory encoder, and image encoder
configs. Instantiating a configuration defaults will yield a similar configuration to that of the SAM 2.1 Hiera-tiny
[facebook/sam2.1-hiera-tiny](https://huggingface.co/facebook/sam2.1-hiera-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `Sam2VisionConfig`], *optional*):
diff --git a/src/transformers/models/sam2_video/configuration_sam2_video.py b/src/transformers/models/sam2_video/configuration_sam2_video.py
index 2712165b44c..da96c3f0653 100644
--- a/src/transformers/models/sam2_video/configuration_sam2_video.py
+++ b/src/transformers/models/sam2_video/configuration_sam2_video.py
@@ -18,17 +18,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class Sam2VideoPromptEncoderConfig(PretrainedConfig):
+class Sam2VideoPromptEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Sam2VideoPromptEncoder`]. The [`Sam2VideoPromptEncoder`]
module is used to encode the input 2D points and bounding boxes.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -74,13 +74,13 @@ class Sam2VideoPromptEncoderConfig(PretrainedConfig):
self.scale = scale
-class Sam2VideoMaskDecoderConfig(PretrainedConfig):
+class Sam2VideoMaskDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Sam2VideoMaskDecoder`]. It is used to instantiate a SAM2_VIDEO
memory encoder according to the specified arguments, defining the model architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -147,15 +147,15 @@ class Sam2VideoMaskDecoderConfig(PretrainedConfig):
self.attention_downsample_rate = attention_downsample_rate
-class Sam2VideoConfig(PretrainedConfig):
+class Sam2VideoConfig(PreTrainedConfig):
r"""
[`Sam2Config`] is the configuration class to store the configuration of a [`Sam2Model`]. It is used to instantiate a
SAM2 model according to the specified arguments, defining the memory attention, memory encoder, and image encoder
configs. Instantiating a configuration defaults will yield a similar configuration to that of the SAM 2.1 Hiera-tiny
[facebook/sam2.1-hiera-tiny](https://huggingface.co/facebook/sam2.1-hiera-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `Sam2VisionConfig`], *optional*):
diff --git a/src/transformers/models/sam2_video/modular_sam2_video.py b/src/transformers/models/sam2_video/modular_sam2_video.py
index b95a9f77825..091844f0aa1 100644
--- a/src/transformers/models/sam2_video/modular_sam2_video.py
+++ b/src/transformers/models/sam2_video/modular_sam2_video.py
@@ -28,7 +28,7 @@ from torch import Tensor
from tqdm import tqdm
from ...activations import ACT2FN
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_layers import GradientCheckpointingLayer
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
@@ -68,15 +68,15 @@ class Sam2VideoMaskDecoderConfig(Sam2MaskDecoderConfig):
pass
-class Sam2VideoConfig(PretrainedConfig):
+class Sam2VideoConfig(PreTrainedConfig):
r"""
[`Sam2Config`] is the configuration class to store the configuration of a [`Sam2Model`]. It is used to instantiate a
SAM2 model according to the specified arguments, defining the memory attention, memory encoder, and image encoder
configs. Instantiating a configuration defaults will yield a similar configuration to that of the SAM 2.1 Hiera-tiny
[facebook/sam2.1-hiera-tiny](https://huggingface.co/facebook/sam2.1-hiera-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `Sam2VisionConfig`], *optional*):
diff --git a/src/transformers/models/sam_hq/configuration_sam_hq.py b/src/transformers/models/sam_hq/configuration_sam_hq.py
index 7987510b88e..68e2fc8d9b9 100644
--- a/src/transformers/models/sam_hq/configuration_sam_hq.py
+++ b/src/transformers/models/sam_hq/configuration_sam_hq.py
@@ -20,18 +20,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class SamHQPromptEncoderConfig(PretrainedConfig):
+class SamHQPromptEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SamHQPromptEncoderModel`].The [`SamHQPromptEncoderModel`]
module is used to encode the input 2D points and bounding boxes. Instantiating a configuration defaults will yield a
similar configuration to that of the SAM_HQ model. The configuration is used to store the configuration of the model.
[Uminosachi/sam-hq](https://huggingface.co/Uminosachi/sam-hq) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model's output.Read the documentation from
- [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model's output.Read the documentation from
+ [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -72,15 +72,15 @@ class SamHQPromptEncoderConfig(PretrainedConfig):
self.layer_norm_eps = layer_norm_eps
-class SamHQVisionConfig(PretrainedConfig):
+class SamHQVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SamHQVisionModel`]. It is used to instantiate a SAM_HQ
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
defaults will yield a similar configuration to that of the SAM_HQ ViT-h
[facebook/sam_hq-vit-huge](https://huggingface.co/facebook/sam_hq-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -190,15 +190,15 @@ class SamHQVisionConfig(PretrainedConfig):
self.mlp_dim = int(hidden_size * mlp_ratio) if mlp_dim is None else mlp_dim
-class SamHQMaskDecoderConfig(PretrainedConfig):
+class SamHQMaskDecoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SamHQMaskDecoder`]. It is used to instantiate a SAM_HQ
mask decoder to the specified arguments, defining the model architecture. Instantiating a configuration defaults
will yield a similar configuration to that of the SAM_HQ-vit-h
[facebook/sam_hq-vit-huge](https://huggingface.co/facebook/sam_hq-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -256,15 +256,15 @@ class SamHQMaskDecoderConfig(PretrainedConfig):
self.vit_dim = vit_dim
-class SamHQConfig(PretrainedConfig):
+class SamHQConfig(PreTrainedConfig):
r"""
[`SamHQConfig`] is the configuration class to store the configuration of a [`SamHQModel`]. It is used to instantiate a
SAM-HQ model according to the specified arguments, defining the vision model, prompt-encoder model and mask decoder
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the
SAM-HQ-ViT-H [sushmanth/sam_hq_vit_h](https://huggingface.co/sushmanth/sam_hq_vit_h) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `SamHQVisionConfig`], *optional*):
diff --git a/src/transformers/models/sam_hq/modular_sam_hq.py b/src/transformers/models/sam_hq/modular_sam_hq.py
index 2ea75966472..da5189b6db7 100644
--- a/src/transformers/models/sam_hq/modular_sam_hq.py
+++ b/src/transformers/models/sam_hq/modular_sam_hq.py
@@ -50,8 +50,8 @@ class SamHQPromptEncoderConfig(SamPromptEncoderConfig):
similar configuration to that of the SAM_HQ model. The configuration is used to store the configuration of the model.
[Uminosachi/sam-hq](https://huggingface.co/Uminosachi/sam-hq) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model's output.Read the documentation from
- [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model's output.Read the documentation from
+ [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -82,8 +82,8 @@ class SamHQMaskDecoderConfig(SamMaskDecoderConfig):
will yield a similar configuration to that of the SAM_HQ-vit-h
[facebook/sam_hq-vit-huge](https://huggingface.co/facebook/sam_hq-vit-huge) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 256):
@@ -126,8 +126,8 @@ class SamHQConfig(SamConfig):
configs. Instantiating a configuration with the defaults will yield a similar configuration to that of the
SAM-HQ-ViT-H [sushmanth/sam_hq_vit_h](https://huggingface.co/sushmanth/sam_hq_vit_h) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (Union[`dict`, `SamHQVisionConfig`], *optional*):
diff --git a/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py b/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py
index fe4f911957f..c434de09e79 100644
--- a/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py
+++ b/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""SeamlessM4T model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SeamlessM4TConfig(PretrainedConfig):
+class SeamlessM4TConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`~SeamlessM4TModel`]. It is used to instantiate an
SeamlessM4T model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SeamlessM4T
["facebook/hf-seamless-m4t-medium"](https://huggingface.co/"facebook/hf-seamless-m4t-medium") architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py b/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py
index 7ac6c4024a5..8ab2060b860 100644
--- a/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py
+++ b/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""SeamlessM4Tv2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SeamlessM4Tv2Config(PretrainedConfig):
+class SeamlessM4Tv2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`~SeamlessM4Tv2Model`]. It is used to instantiate
an SeamlessM4Tv2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SeamlessM4Tv2
[""](https://huggingface.co/"") architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/seed_oss/configuration_seed_oss.py b/src/transformers/models/seed_oss/configuration_seed_oss.py
index 66c32a2fe98..d4ac2937881 100644
--- a/src/transformers/models/seed_oss/configuration_seed_oss.py
+++ b/src/transformers/models/seed_oss/configuration_seed_oss.py
@@ -13,19 +13,19 @@
# limitations under the License.
"""SeedOss model configuration"""
-from transformers.configuration_utils import PretrainedConfig
+from transformers.configuration_utils import PreTrainedConfig
from transformers.modeling_rope_utils import rope_config_validation
-class SeedOssConfig(PretrainedConfig):
+class SeedOssConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SeedOssModel`]. It is used to instantiate an SeedOss
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the SeedOss-36B.
e.g. [ByteDance-Seed/SeedOss-36B](https://huggingface.co/ByteDance-Seed/SeedOss-36B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/segformer/configuration_segformer.py b/src/transformers/models/segformer/configuration_segformer.py
index f42e6539985..00ee5c3812f 100644
--- a/src/transformers/models/segformer/configuration_segformer.py
+++ b/src/transformers/models/segformer/configuration_segformer.py
@@ -20,7 +20,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -28,7 +28,7 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class SegformerConfig(PretrainedConfig):
+class SegformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SegformerModel`]. It is used to instantiate an
SegFormer model according to the specified arguments, defining the model architecture. Instantiating a
@@ -36,8 +36,8 @@ class SegformerConfig(PretrainedConfig):
[nvidia/segformer-b0-finetuned-ade-512-512](https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/seggpt/configuration_seggpt.py b/src/transformers/models/seggpt/configuration_seggpt.py
index dc149adfa03..d35929e33b8 100644
--- a/src/transformers/models/seggpt/configuration_seggpt.py
+++ b/src/transformers/models/seggpt/configuration_seggpt.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""SegGpt model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SegGptConfig(PretrainedConfig):
+class SegGptConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SegGptModel`]. It is used to instantiate a SegGPT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the SegGPT
[BAAI/seggpt-vit-large](https://huggingface.co/BAAI/seggpt-vit-large) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1024):
diff --git a/src/transformers/models/sew/configuration_sew.py b/src/transformers/models/sew/configuration_sew.py
index f6cf7b85a15..a49395d923b 100644
--- a/src/transformers/models/sew/configuration_sew.py
+++ b/src/transformers/models/sew/configuration_sew.py
@@ -17,22 +17,22 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SEWConfig(PretrainedConfig):
+class SEWConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SEWModel`]. It is used to instantiate a SEW model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the SEW
[asapp/sew-tiny-100k](https://huggingface.co/asapp/sew-tiny-100k) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/sew_d/configuration_sew_d.py b/src/transformers/models/sew_d/configuration_sew_d.py
index 2809fa0fb6b..ac2b5574b1e 100644
--- a/src/transformers/models/sew_d/configuration_sew_d.py
+++ b/src/transformers/models/sew_d/configuration_sew_d.py
@@ -17,22 +17,22 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SEWDConfig(PretrainedConfig):
+class SEWDConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SEWDModel`]. It is used to instantiate a SEW-D
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the SEW-D
[asapp/sew-d-tiny-100k](https://huggingface.co/asapp/sew-d-tiny-100k) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/shieldgemma2/configuration_shieldgemma2.py b/src/transformers/models/shieldgemma2/configuration_shieldgemma2.py
index 63d7f49bf33..70de2c905b2 100644
--- a/src/transformers/models/shieldgemma2/configuration_shieldgemma2.py
+++ b/src/transformers/models/shieldgemma2/configuration_shieldgemma2.py
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -22,7 +22,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class ShieldGemma2Config(PretrainedConfig):
+class ShieldGemma2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ShieldGemma2ForImageClassification`]. It is used to instantiate an
ShieldGemma2ForImageClassification according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -30,8 +30,8 @@ class ShieldGemma2Config(PretrainedConfig):
e.g. [google/gemma-3-4b](https://huggingface.co/google/gemma-3-4b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`Union[ShieldGemma2TextConfig, dict]`, *optional*):
diff --git a/src/transformers/models/siglip/configuration_siglip.py b/src/transformers/models/siglip/configuration_siglip.py
index 0c182014fa2..64637cd26bc 100644
--- a/src/transformers/models/siglip/configuration_siglip.py
+++ b/src/transformers/models/siglip/configuration_siglip.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Siglip model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SiglipTextConfig(PretrainedConfig):
+class SiglipTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SiglipTextModel`]. It is used to instantiate a
Siglip text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the text encoder of the Siglip
[google/siglip-base-patch16-224](https://huggingface.co/google/siglip-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
@@ -113,15 +113,15 @@ class SiglipTextConfig(PretrainedConfig):
self.projection_size = projection_size if projection_size is not None else hidden_size
-class SiglipVisionConfig(PretrainedConfig):
+class SiglipVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SiglipVisionModel`]. It is used to instantiate a
Siglip vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the Siglip
[google/siglip-base-patch16-224](https://huggingface.co/google/siglip-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -192,15 +192,15 @@ class SiglipVisionConfig(PretrainedConfig):
self.hidden_act = hidden_act
-class SiglipConfig(PretrainedConfig):
+class SiglipConfig(PreTrainedConfig):
r"""
[`SiglipConfig`] is the configuration class to store the configuration of a [`SiglipModel`]. It is used to
instantiate a Siglip model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Siglip
[google/siglip-base-patch16-224](https://huggingface.co/google/siglip-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/siglip2/configuration_siglip2.py b/src/transformers/models/siglip2/configuration_siglip2.py
index 67ef9df8f4f..d1980d8c337 100644
--- a/src/transformers/models/siglip2/configuration_siglip2.py
+++ b/src/transformers/models/siglip2/configuration_siglip2.py
@@ -19,22 +19,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Siglip2TextConfig(PretrainedConfig):
+class Siglip2TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Siglip2TextModel`]. It is used to instantiate a
Siglip2 text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the text encoder of the Siglip2
[google/siglip2-base-patch16-224](https://huggingface.co/google/siglip2-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
@@ -118,15 +118,15 @@ class Siglip2TextConfig(PretrainedConfig):
self.projection_size = projection_size if projection_size is not None else hidden_size
-class Siglip2VisionConfig(PretrainedConfig):
+class Siglip2VisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Siglip2VisionModel`]. It is used to instantiate a
Siglip2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the Siglip2
[google/siglip2-base-patch16-naflex](https://huggingface.co/google/siglip2-base-patch16-naflex) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
@@ -200,15 +200,15 @@ class Siglip2VisionConfig(PretrainedConfig):
self.num_patches = num_patches
-class Siglip2Config(PretrainedConfig):
+class Siglip2Config(PreTrainedConfig):
r"""
[`Siglip2Config`] is the configuration class to store the configuration of a [`Siglip2Model`]. It is used to
instantiate a Siglip2 model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Siglip2
[google/siglip2-base-patch16-224](https://huggingface.co/google/siglip2-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/siglip2/modular_siglip2.py b/src/transformers/models/siglip2/modular_siglip2.py
index 260a82e5143..6432e4327ab 100644
--- a/src/transformers/models/siglip2/modular_siglip2.py
+++ b/src/transformers/models/siglip2/modular_siglip2.py
@@ -50,8 +50,8 @@ class Siglip2VisionConfig(SiglipVisionConfig):
configuration with the defaults will yield a similar configuration to that of the vision encoder of the Siglip2
[google/siglip2-base-patch16-naflex](https://huggingface.co/google/siglip2-base-patch16-naflex) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
diff --git a/src/transformers/models/smollm3/configuration_smollm3.py b/src/transformers/models/smollm3/configuration_smollm3.py
index 325703f782c..1f4c665460f 100644
--- a/src/transformers/models/smollm3/configuration_smollm3.py
+++ b/src/transformers/models/smollm3/configuration_smollm3.py
@@ -19,19 +19,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_rope_utils import rope_config_validation
-class SmolLM3Config(PretrainedConfig):
+class SmolLM3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SmolLM3Model`]. It is used to instantiate a
SmolLM3 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the SmolLM3 3B.
e.g. [HuggingFaceTB/SmolLM3-3B](https://huggingface.co/HuggingFaceTB/SmolLM3-3B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 128256):
diff --git a/src/transformers/models/smollm3/modular_smollm3.py b/src/transformers/models/smollm3/modular_smollm3.py
index cd82fccbd7c..1b59658dd36 100644
--- a/src/transformers/models/smollm3/modular_smollm3.py
+++ b/src/transformers/models/smollm3/modular_smollm3.py
@@ -18,7 +18,7 @@ from typing import Callable, Optional
import torch
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_rope_utils import rope_config_validation
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS
@@ -42,15 +42,15 @@ from ..qwen2.modeling_qwen2 import Qwen2Model
logger = logging.get_logger(__name__)
-class SmolLM3Config(PretrainedConfig):
+class SmolLM3Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SmolLM3Model`]. It is used to instantiate a
SmolLM3 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the SmolLM3 3B.
e.g. [HuggingFaceTB/SmolLM3-3B](https://huggingface.co/HuggingFaceTB/SmolLM3-3B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 128256):
diff --git a/src/transformers/models/smolvlm/configuration_smolvlm.py b/src/transformers/models/smolvlm/configuration_smolvlm.py
index 2dca4721c02..755222d3e58 100644
--- a/src/transformers/models/smolvlm/configuration_smolvlm.py
+++ b/src/transformers/models/smolvlm/configuration_smolvlm.py
@@ -19,7 +19,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -27,7 +27,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class SmolVLMVisionConfig(PretrainedConfig):
+class SmolVLMVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SmolVLMVisionModel`]. It is used to instantiate a
SmolVLM vision encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -35,8 +35,8 @@ class SmolVLMVisionConfig(PretrainedConfig):
[google/siglip-so400m-patch14-384](https://huggingface.co/google/siglip-so400m-patch14-384) used in SmolVLM
[HuggingFaceTB/SmolVLM2-2.2B-Instruct](https://huggingface.co/HuggingFaceTB/SmolVLM2-2.2B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1152):
@@ -112,15 +112,15 @@ class SmolVLMVisionConfig(PretrainedConfig):
self.initializer_range = initializer_range
-class SmolVLMConfig(PretrainedConfig):
+class SmolVLMConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SmolVLMModel`]. It is used to instantiate a
SmolVLM model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the model of the SmolVLM
[HuggingFaceTB/SmolVLM2-2.2B-Instruct](https://huggingface.co/HuggingFaceTB/SmolVLM2-2.2B-Instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_cache (`bool`, *optional*, defaults to `True`):
@@ -132,7 +132,7 @@ class SmolVLMConfig(PretrainedConfig):
Whether or not to tie the word embeddings with the token embeddings.
vision_config (`IdeficsVisionConfig` or `dict`, *optional*, defaults to `IdeficsVisionConfig`):
Custom vision config or dict for the vision tower
- text_config (`PretrainedConfig` or `dict`, *optional*, defaults to `LlamaConfig`):
+ text_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `LlamaConfig`):
Custom text config or dict for the text model
scale_factor (`int`, *optional*, defaults to 2):
The scale factor for the image encoder.
diff --git a/src/transformers/models/smolvlm/modular_smolvlm.py b/src/transformers/models/smolvlm/modular_smolvlm.py
index ffc7f06c97c..b29c0aa6f34 100644
--- a/src/transformers/models/smolvlm/modular_smolvlm.py
+++ b/src/transformers/models/smolvlm/modular_smolvlm.py
@@ -46,8 +46,8 @@ class SmolVLMVisionConfig(Idefics3VisionConfig):
[google/siglip-so400m-patch14-384](https://huggingface.co/google/siglip-so400m-patch14-384) used in SmolVLM
[HuggingFaceTB/SmolVLM2-2.2B-Instruct](https://huggingface.co/HuggingFaceTB/SmolVLM2-2.2B-Instruct).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 1152):
@@ -109,8 +109,8 @@ class SmolVLMConfig(Idefics3Config):
configuration with the defaults will yield a similar configuration to that of the model of the SmolVLM
[HuggingFaceTB/SmolVLM2-2.2B-Instruct](https://huggingface.co/HuggingFaceTB/SmolVLM2-2.2B-Instruct) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_cache (`bool`, *optional*, defaults to `True`):
@@ -122,7 +122,7 @@ class SmolVLMConfig(Idefics3Config):
Whether or not to tie the word embeddings with the token embeddings.
vision_config (`IdeficsVisionConfig` or `dict`, *optional*, defaults to `IdeficsVisionConfig`):
Custom vision config or dict for the vision tower
- text_config (`PretrainedConfig` or `dict`, *optional*, defaults to `LlamaConfig`):
+ text_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `LlamaConfig`):
Custom text config or dict for the text model
scale_factor (`int`, *optional*, defaults to 2):
The scale factor for the image encoder.
diff --git a/src/transformers/models/speech_encoder_decoder/configuration_speech_encoder_decoder.py b/src/transformers/models/speech_encoder_decoder/configuration_speech_encoder_decoder.py
index 63e161fcbe7..c97a40499c2 100644
--- a/src/transformers/models/speech_encoder_decoder/configuration_speech_encoder_decoder.py
+++ b/src/transformers/models/speech_encoder_decoder/configuration_speech_encoder_decoder.py
@@ -15,7 +15,7 @@
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
@@ -23,22 +23,22 @@ from ..auto.configuration_auto import AutoConfig
logger = logging.get_logger(__name__)
-class SpeechEncoderDecoderConfig(PretrainedConfig):
+class SpeechEncoderDecoderConfig(PreTrainedConfig):
r"""
[`SpeechEncoderDecoderConfig`] is the configuration class to store the configuration of a
[`SpeechEncoderDecoderModel`]. It is used to instantiate an Encoder Decoder model according to the specified
arguments, defining the encoder and decoder configs.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **encoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the encoder config.
- - **decoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **decoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the decoder config.
Examples:
@@ -93,8 +93,8 @@ class SpeechEncoderDecoderConfig(PretrainedConfig):
@classmethod
def from_encoder_decoder_configs(
- cls, encoder_config: PretrainedConfig, decoder_config: PretrainedConfig, **kwargs
- ) -> PretrainedConfig:
+ cls, encoder_config: PreTrainedConfig, decoder_config: PreTrainedConfig, **kwargs
+ ) -> PreTrainedConfig:
r"""
Instantiate a [`SpeechEncoderDecoderConfig`] (or a derived class) from a pre-trained encoder model
configuration and decoder model configuration.
diff --git a/src/transformers/models/speech_encoder_decoder/modeling_speech_encoder_decoder.py b/src/transformers/models/speech_encoder_decoder/modeling_speech_encoder_decoder.py
index a5a6bc2fbf0..2fb5160ed90 100644
--- a/src/transformers/models/speech_encoder_decoder/modeling_speech_encoder_decoder.py
+++ b/src/transformers/models/speech_encoder_decoder/modeling_speech_encoder_decoder.py
@@ -21,7 +21,7 @@ from torch import nn
from torch.nn import CrossEntropyLoss
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...modeling_outputs import BaseModelOutput, Seq2SeqLMOutput
from ...modeling_utils import PreTrainedModel
@@ -72,7 +72,7 @@ class SpeechEncoderDecoderModel(PreTrainedModel, GenerationMixin):
def __init__(
self,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
encoder: Optional[PreTrainedModel] = None,
decoder: Optional[PreTrainedModel] = None,
):
diff --git a/src/transformers/models/speech_to_text/configuration_speech_to_text.py b/src/transformers/models/speech_to_text/configuration_speech_to_text.py
index a08d4fddfd4..78c75c144f8 100644
--- a/src/transformers/models/speech_to_text/configuration_speech_to_text.py
+++ b/src/transformers/models/speech_to_text/configuration_speech_to_text.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Speech2Text model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Speech2TextConfig(PretrainedConfig):
+class Speech2TextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Speech2TextModel`]. It is used to instantiate a
Speech2Text model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Speech2Text
[facebook/s2t-small-librispeech-asr](https://huggingface.co/facebook/s2t-small-librispeech-asr) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/speecht5/configuration_speecht5.py b/src/transformers/models/speecht5/configuration_speecht5.py
index b73471a29dc..af78e420606 100644
--- a/src/transformers/models/speecht5/configuration_speecht5.py
+++ b/src/transformers/models/speecht5/configuration_speecht5.py
@@ -17,22 +17,22 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SpeechT5Config(PretrainedConfig):
+class SpeechT5Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SpeechT5Model`]. It is used to instantiate a
SpeechT5 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the SpeechT5
[microsoft/speecht5_asr](https://huggingface.co/microsoft/speecht5_asr) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 81):
@@ -337,15 +337,15 @@ class SpeechT5Config(PretrainedConfig):
return functools.reduce(operator.mul, self.conv_stride, 1)
-class SpeechT5HifiGanConfig(PretrainedConfig):
+class SpeechT5HifiGanConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SpeechT5HifiGanModel`]. It is used to instantiate
a SpeechT5 HiFi-GAN vocoder model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the SpeechT5
[microsoft/speecht5_hifigan](https://huggingface.co/microsoft/speecht5_hifigan) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
model_in_dim (`int`, *optional*, defaults to 80):
diff --git a/src/transformers/models/splinter/configuration_splinter.py b/src/transformers/models/splinter/configuration_splinter.py
index 533b067ed34..e19bbed3c24 100644
--- a/src/transformers/models/splinter/configuration_splinter.py
+++ b/src/transformers/models/splinter/configuration_splinter.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Splinter model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SplinterConfig(PretrainedConfig):
+class SplinterConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SplinterModel`]. It is used to instantiate an
Splinter model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Splinter
[tau/splinter-base](https://huggingface.co/tau/splinter-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/squeezebert/configuration_squeezebert.py b/src/transformers/models/squeezebert/configuration_squeezebert.py
index 4b3c080a3d6..18d66b70b92 100644
--- a/src/transformers/models/squeezebert/configuration_squeezebert.py
+++ b/src/transformers/models/squeezebert/configuration_squeezebert.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class SqueezeBertConfig(PretrainedConfig):
+class SqueezeBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SqueezeBertModel`]. It is used to instantiate a
SqueezeBERT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SqueezeBERT
[squeezebert/squeezebert-uncased](https://huggingface.co/squeezebert/squeezebert-uncased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/stablelm/configuration_stablelm.py b/src/transformers/models/stablelm/configuration_stablelm.py
index b919470c7f3..37725fefda7 100644
--- a/src/transformers/models/stablelm/configuration_stablelm.py
+++ b/src/transformers/models/stablelm/configuration_stablelm.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""StableLM model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class StableLmConfig(PretrainedConfig):
+class StableLmConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`~StableLmModel`].
It is used to instantiate an StableLM model according to the specified arguments, defining the model
architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of
the StableLM [stabilityai/stablelm-3b-4e1t](https://huggingface.co/stabilityai/stablelm-3b-4e1t) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used
- to control the model outputs. Read the documentation from [`PretrainedConfig`]
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used
+ to control the model outputs. Read the documentation from [`PreTrainedConfig`]
for more information.
diff --git a/src/transformers/models/starcoder2/configuration_starcoder2.py b/src/transformers/models/starcoder2/configuration_starcoder2.py
index a700b4f4254..8e1872cfba6 100644
--- a/src/transformers/models/starcoder2/configuration_starcoder2.py
+++ b/src/transformers/models/starcoder2/configuration_starcoder2.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Starcoder2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...modeling_rope_utils import rope_config_validation
from ...utils import logging
@@ -22,15 +22,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class Starcoder2Config(PretrainedConfig):
+class Starcoder2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Starcoder2Model`]. It is used to instantiate a
Starcoder2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the [bigcode/starcoder2-7b](https://huggingface.co/bigcode/starcoder2-7b) model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/superglue/configuration_superglue.py b/src/transformers/models/superglue/configuration_superglue.py
index 74bd991f95e..c8a13d10e7b 100644
--- a/src/transformers/models/superglue/configuration_superglue.py
+++ b/src/transformers/models/superglue/configuration_superglue.py
@@ -13,7 +13,7 @@
# limitations under the License.
from typing import TYPE_CHECKING, Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING
@@ -24,15 +24,15 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class SuperGlueConfig(PretrainedConfig):
+class SuperGlueConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SuperGlueModel`]. It is used to instantiate a
SuperGlue model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SuperGlue
[magic-leap-community/superglue_indoor](https://huggingface.co/magic-leap-community/superglue_indoor) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
keypoint_detector_config (`Union[AutoConfig, dict]`, *optional*, defaults to `SuperPointConfig`):
diff --git a/src/transformers/models/superpoint/configuration_superpoint.py b/src/transformers/models/superpoint/configuration_superpoint.py
index 1e427196072..932fd4abc34 100644
--- a/src/transformers/models/superpoint/configuration_superpoint.py
+++ b/src/transformers/models/superpoint/configuration_superpoint.py
@@ -12,22 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SuperPointConfig(PretrainedConfig):
+class SuperPointConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SuperPointForKeypointDetection`]. It is used to instantiate a
SuperPoint model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SuperPoint
[magic-leap-community/superpoint](https://huggingface.co/magic-leap-community/superpoint) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
encoder_hidden_sizes (`List`, *optional*, defaults to `[64, 64, 128, 128]`):
diff --git a/src/transformers/models/swiftformer/configuration_swiftformer.py b/src/transformers/models/swiftformer/configuration_swiftformer.py
index c0b4428a432..58e00508489 100644
--- a/src/transformers/models/swiftformer/configuration_swiftformer.py
+++ b/src/transformers/models/swiftformer/configuration_swiftformer.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class SwiftFormerConfig(PretrainedConfig):
+class SwiftFormerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SwiftFormerModel`]. It is used to instantiate an
SwiftFormer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SwiftFormer
[MBZUAI/swiftformer-xs](https://huggingface.co/MBZUAI/swiftformer-xs) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/swin/configuration_swin.py b/src/transformers/models/swin/configuration_swin.py
index 41462d51edb..8797f3b6f7b 100644
--- a/src/transformers/models/swin/configuration_swin.py
+++ b/src/transformers/models/swin/configuration_swin.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -28,7 +28,7 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class SwinConfig(BackboneConfigMixin, PretrainedConfig):
+class SwinConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SwinModel`]. It is used to instantiate a Swin
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -36,8 +36,8 @@ class SwinConfig(BackboneConfigMixin, PretrainedConfig):
[microsoft/swin-tiny-patch4-window7-224](https://huggingface.co/microsoft/swin-tiny-patch4-window7-224)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/swin2sr/configuration_swin2sr.py b/src/transformers/models/swin2sr/configuration_swin2sr.py
index a507d9d6251..712d2f48ce0 100644
--- a/src/transformers/models/swin2sr/configuration_swin2sr.py
+++ b/src/transformers/models/swin2sr/configuration_swin2sr.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Swin2SR Transformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Swin2SRConfig(PretrainedConfig):
+class Swin2SRConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Swin2SRModel`]. It is used to instantiate a Swin
Transformer v2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Swin Transformer v2
[caidas/swin2sr-classicalsr-x2-64](https://huggingface.co/caidas/swin2sr-classicalsr-x2-64) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 64):
diff --git a/src/transformers/models/swinv2/configuration_swinv2.py b/src/transformers/models/swinv2/configuration_swinv2.py
index 8fe49325908..ae78766f8ee 100644
--- a/src/transformers/models/swinv2/configuration_swinv2.py
+++ b/src/transformers/models/swinv2/configuration_swinv2.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""Swinv2 Transformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,7 +22,7 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class Swinv2Config(BackboneConfigMixin, PretrainedConfig):
+class Swinv2Config(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Swinv2Model`]. It is used to instantiate a Swin
Transformer v2 model according to the specified arguments, defining the model architecture. Instantiating a
@@ -30,8 +30,8 @@ class Swinv2Config(BackboneConfigMixin, PretrainedConfig):
[microsoft/swinv2-tiny-patch4-window8-256](https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/switch_transformers/configuration_switch_transformers.py b/src/transformers/models/switch_transformers/configuration_switch_transformers.py
index 1b8d42e1d60..5ff15f9323c 100644
--- a/src/transformers/models/switch_transformers/configuration_switch_transformers.py
+++ b/src/transformers/models/switch_transformers/configuration_switch_transformers.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""Switch Transformers model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class SwitchTransformersConfig(PretrainedConfig):
+class SwitchTransformersConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`SwitchTransformersModel`]. It is used to
instantiate a SwitchTransformers model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the
SwitchTransformers [google/switch-base-8](https://huggingface.co/google/switch-base-8) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 32128):
diff --git a/src/transformers/models/t5/configuration_t5.py b/src/transformers/models/t5/configuration_t5.py
index 21d25520087..a0fb4d3915e 100644
--- a/src/transformers/models/t5/configuration_t5.py
+++ b/src/transformers/models/t5/configuration_t5.py
@@ -16,7 +16,7 @@
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxSeq2SeqConfigWithPast
from ...utils import logging
@@ -24,15 +24,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class T5Config(PretrainedConfig):
+class T5Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`T5Model`] or a [`TFT5Model`]. It is used to
instantiate a T5 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the T5
[google-t5/t5-small](https://huggingface.co/google-t5/t5-small) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 32128):
diff --git a/src/transformers/models/t5gemma/configuration_t5gemma.py b/src/transformers/models/t5gemma/configuration_t5gemma.py
index d998ae18b6e..494e8b757a8 100644
--- a/src/transformers/models/t5gemma/configuration_t5gemma.py
+++ b/src/transformers/models/t5gemma/configuration_t5gemma.py
@@ -21,17 +21,17 @@
# limitations under the License.
from typing import Any, Optional, Union
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
-class T5GemmaModuleConfig(PretrainedConfig):
+class T5GemmaModuleConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`T5GemmaModuleModel`]. It is used to instantiate an T5GemmaModule
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the T5GemmaModule-7B.
e.g. [google/t5_gemma_module-7b](https://huggingface.co/google/t5_gemma_module-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
@@ -182,7 +182,7 @@ class T5GemmaModuleConfig(PretrainedConfig):
layer_type_validation(self.layer_types, self.num_hidden_layers)
-class T5GemmaConfig(PretrainedConfig):
+class T5GemmaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`T5GemmaModel`]. It is used to instantiate an T5Gemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -193,8 +193,8 @@ class T5GemmaConfig(PretrainedConfig):
>>> t5gemma_config = T5GemmaConfig.from_pretrained("google/t5gemma-2b-2b-prefixlm-it")
>>> model = T5GemmaModel(t5gemma_config)
```
- Configuration objects inherit from [PretrainedConfig] and can be used to control the model outputs. Read the
- documentation from [PretrainedConfig] for more information.
+ Configuration objects inherit from [PreTrainedConfig] and can be used to control the model outputs. Read the
+ documentation from [PreTrainedConfig] for more information.
Args:
encoder (`Union[T5GemmaModuleConfig, dict]`, optional, *optional*):
Configuration for the encoder.
@@ -213,7 +213,7 @@ class T5GemmaConfig(PretrainedConfig):
vocab_size (`int`, *optional*, defaults to 256000):
Vocabulary size of the T5Gemma model (the same as Gemma 2).
kwargs (additional keyword arguments, optional, *optional*):
- Will be passed to the PretrainedConfig base class.
+ Will be passed to the PreTrainedConfig base class.
"""
model_type = "t5gemma"
diff --git a/src/transformers/models/t5gemma/modular_t5gemma.py b/src/transformers/models/t5gemma/modular_t5gemma.py
index 9ed3abf3400..75ee3c22ce6 100644
--- a/src/transformers/models/t5gemma/modular_t5gemma.py
+++ b/src/transformers/models/t5gemma/modular_t5gemma.py
@@ -19,7 +19,7 @@ import torch
import torch.nn as nn
from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...modeling_flash_attention_utils import FlashAttentionKwargs
from ...modeling_layers import GradientCheckpointingLayer
@@ -66,8 +66,8 @@ class T5GemmaModuleConfig(Gemma2Config):
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the T5GemmaModule-7B.
e.g. [google/t5_gemma_module-7b](https://huggingface.co/google/t5_gemma_module-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
@@ -197,7 +197,7 @@ class T5GemmaModuleConfig(Gemma2Config):
del self.use_bidirectional_attention
-class T5GemmaConfig(PretrainedConfig):
+class T5GemmaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`T5GemmaModel`]. It is used to instantiate an T5Gemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -208,8 +208,8 @@ class T5GemmaConfig(PretrainedConfig):
>>> t5gemma_config = T5GemmaConfig.from_pretrained("google/t5gemma-2b-2b-prefixlm-it")
>>> model = T5GemmaModel(t5gemma_config)
```
- Configuration objects inherit from [PretrainedConfig] and can be used to control the model outputs. Read the
- documentation from [PretrainedConfig] for more information.
+ Configuration objects inherit from [PreTrainedConfig] and can be used to control the model outputs. Read the
+ documentation from [PreTrainedConfig] for more information.
Args:
encoder (`Union[T5GemmaModuleConfig, dict]`, optional, *optional*):
Configuration for the encoder.
@@ -228,7 +228,7 @@ class T5GemmaConfig(PretrainedConfig):
vocab_size (`int`, *optional*, defaults to 256000):
Vocabulary size of the T5Gemma model (the same as Gemma 2).
kwargs (additional keyword arguments, optional, *optional*):
- Will be passed to the PretrainedConfig base class.
+ Will be passed to the PreTrainedConfig base class.
"""
model_type = "t5gemma"
diff --git a/src/transformers/models/table_transformer/configuration_table_transformer.py b/src/transformers/models/table_transformer/configuration_table_transformer.py
index 32eed6ce0df..28cb7bbcf7c 100644
--- a/src/transformers/models/table_transformer/configuration_table_transformer.py
+++ b/src/transformers/models/table_transformer/configuration_table_transformer.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
@@ -29,21 +29,21 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class TableTransformerConfig(PretrainedConfig):
+class TableTransformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TableTransformerModel`]. It is used to
instantiate a Table Transformer model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Table Transformer
[microsoft/table-transformer-detection](https://huggingface.co/microsoft/table-transformer-detection) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
use_timm_backbone (`bool`, *optional*, defaults to `True`):
Whether or not to use the `timm` library for the backbone. If set to `False`, will use the [`AutoBackbone`]
API.
- backbone_config (`PretrainedConfig` or `dict`, *optional*):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*):
The configuration of the backbone model. Only used in case `use_timm_backbone` is set to `False` in which
case it will default to `ResNetConfig()`.
num_channels (`int`, *optional*, defaults to 3):
diff --git a/src/transformers/models/tapas/configuration_tapas.py b/src/transformers/models/tapas/configuration_tapas.py
index a40d4ba6393..7eb22301bda 100644
--- a/src/transformers/models/tapas/configuration_tapas.py
+++ b/src/transformers/models/tapas/configuration_tapas.py
@@ -22,10 +22,10 @@ Hyperparameters are taken from run_task_main.py and hparam_utils.py of the origi
"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class TapasConfig(PretrainedConfig):
+class TapasConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TapasModel`]. It is used to instantiate a TAPAS
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
@@ -33,7 +33,7 @@ class TapasConfig(PretrainedConfig):
[google/tapas-base-finetuned-sqa](https://huggingface.co/google/tapas-base-finetuned-sqa) architecture.
Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ documentation from [`PreTrainedConfig`] for more information.
Hyperparameters additional to BERT are taken from run_task_main.py and hparam_utils.py of the original
implementation. Original implementation available at https://github.com/google-research/tapas/tree/master.
diff --git a/src/transformers/models/textnet/configuration_textnet.py b/src/transformers/models/textnet/configuration_textnet.py
index 90f73f54164..6ab630cf0f7 100644
--- a/src/transformers/models/textnet/configuration_textnet.py
+++ b/src/transformers/models/textnet/configuration_textnet.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""TextNet model configuration"""
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
from transformers.utils import logging
from transformers.utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,13 +22,13 @@ from transformers.utils.backbone_utils import BackboneConfigMixin, get_aligned_o
logger = logging.get_logger(__name__)
-class TextNetConfig(BackboneConfigMixin, PretrainedConfig):
+class TextNetConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TextNextModel`]. It is used to instantiate a
TextNext model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[czczup/textnet-base](https://huggingface.co/czczup/textnet-base). Configuration objects inherit from
- [`PretrainedConfig`] and can be used to control the model outputs.Read the documentation from [`PretrainedConfig`]
+ [`PreTrainedConfig`] and can be used to control the model outputs.Read the documentation from [`PreTrainedConfig`]
for more information.
Args:
diff --git a/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py b/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py
index a42e95ccc5d..c2571d6685d 100644
--- a/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py
+++ b/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py
@@ -16,14 +16,14 @@
from typing import Optional, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class TimeSeriesTransformerConfig(PretrainedConfig):
+class TimeSeriesTransformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TimeSeriesTransformerModel`]. It is used to
instantiate a Time Series Transformer model according to the specified arguments, defining the model architecture.
@@ -32,8 +32,8 @@ class TimeSeriesTransformerConfig(PretrainedConfig):
[huggingface/time-series-transformer-tourism-monthly](https://huggingface.co/huggingface/time-series-transformer-tourism-monthly)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
prediction_length (`int`):
diff --git a/src/transformers/models/timesfm/configuration_timesfm.py b/src/transformers/models/timesfm/configuration_timesfm.py
index 04566ab34ab..3c073fdff06 100644
--- a/src/transformers/models/timesfm/configuration_timesfm.py
+++ b/src/transformers/models/timesfm/configuration_timesfm.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""TimesFM model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class TimesFmConfig(PretrainedConfig):
+class TimesFmConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TimesFmModelForPrediction`] or a [`TFTimesFmModel`]. It is used to
instantiate a TimesFM model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the TimesFM
[google/timesfm-2.0-500m-pytorch](https://huggingface.co/google/timesfm-2.0-500m-pytorch) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
patch_length (`int`, *optional*, defaults to 32):
diff --git a/src/transformers/models/timesformer/configuration_timesformer.py b/src/transformers/models/timesformer/configuration_timesformer.py
index edb69af230f..9d2d60e9650 100644
--- a/src/transformers/models/timesformer/configuration_timesformer.py
+++ b/src/transformers/models/timesformer/configuration_timesformer.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""TimeSformer model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class TimesformerConfig(PretrainedConfig):
+class TimesformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TimesformerModel`]. It is used to instantiate a
TimeSformer model according to the specified arguments, defining the model architecture. Instantiating a
@@ -29,8 +29,8 @@ class TimesformerConfig(PretrainedConfig):
[facebook/timesformer-base-finetuned-k600](https://huggingface.co/facebook/timesformer-base-finetuned-k600)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/timm_backbone/configuration_timm_backbone.py b/src/transformers/models/timm_backbone/configuration_timm_backbone.py
index 7f8c1c22e9f..d4a90b616da 100644
--- a/src/transformers/models/timm_backbone/configuration_timm_backbone.py
+++ b/src/transformers/models/timm_backbone/configuration_timm_backbone.py
@@ -15,21 +15,21 @@
"""Configuration for Backbone models"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class TimmBackboneConfig(PretrainedConfig):
+class TimmBackboneConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration for a timm backbone [`TimmBackbone`].
It is used to instantiate a timm backbone model according to the specified arguments, defining the model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
backbone (`str`, *optional*):
diff --git a/src/transformers/models/timm_wrapper/configuration_timm_wrapper.py b/src/transformers/models/timm_wrapper/configuration_timm_wrapper.py
index 34e640ade8b..b426d6d5171 100644
--- a/src/transformers/models/timm_wrapper/configuration_timm_wrapper.py
+++ b/src/transformers/models/timm_wrapper/configuration_timm_wrapper.py
@@ -17,7 +17,7 @@
from typing import Any, Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import is_timm_available, logging, requires_backends
@@ -28,14 +28,14 @@ if is_timm_available():
logger = logging.get_logger(__name__)
-class TimmWrapperConfig(PretrainedConfig):
+class TimmWrapperConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration for a timm backbone [`TimmWrapper`].
It is used to instantiate a timm model according to the specified arguments, defining the model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Config loads imagenet label descriptions and stores them in `id2label` attribute, `label2id` attribute for default
imagenet models is set to `None` due to occlusions in the label descriptions.
diff --git a/src/transformers/models/trocr/configuration_trocr.py b/src/transformers/models/trocr/configuration_trocr.py
index c7d1e316b10..47bd161c958 100644
--- a/src/transformers/models/trocr/configuration_trocr.py
+++ b/src/transformers/models/trocr/configuration_trocr.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""TrOCR model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class TrOCRConfig(PretrainedConfig):
+class TrOCRConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TrOCRForCausalLM`]. It is used to instantiate an
TrOCR model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the TrOCR
[microsoft/trocr-base-handwritten](https://huggingface.co/microsoft/trocr-base-handwritten) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/tvp/configuration_tvp.py b/src/transformers/models/tvp/configuration_tvp.py
index be7c785084d..eb719e042f3 100644
--- a/src/transformers/models/tvp/configuration_tvp.py
+++ b/src/transformers/models/tvp/configuration_tvp.py
@@ -16,7 +16,7 @@
import copy
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto import CONFIG_MAPPING
@@ -25,19 +25,19 @@ from ..auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class TvpConfig(PretrainedConfig):
+class TvpConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`TvpModel`]. It is used to instantiate an Tvp
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Tvp
[Intel/tvp-base](https://huggingface.co/Intel/tvp-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
@@ -181,11 +181,11 @@ class TvpConfig(PretrainedConfig):
)
@classmethod
- def from_backbone_config(cls, backbone_config: PretrainedConfig, **kwargs):
+ def from_backbone_config(cls, backbone_config: PreTrainedConfig, **kwargs):
"""Instantiate a [`TvpConfig`] (or a derived class) from a pre-trained backbone model configuration.
Args:
- backbone_config ([`PretrainedConfig`]):
+ backbone_config ([`PreTrainedConfig`]):
The backbone configuration.
Returns:
[`TvpConfig`]: An instance of a configuration object
@@ -194,7 +194,7 @@ class TvpConfig(PretrainedConfig):
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`].
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`].
Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
diff --git a/src/transformers/models/udop/configuration_udop.py b/src/transformers/models/udop/configuration_udop.py
index d55717af2b8..8f8e6f0e2be 100644
--- a/src/transformers/models/udop/configuration_udop.py
+++ b/src/transformers/models/udop/configuration_udop.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""UDOP model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class UdopConfig(PretrainedConfig):
+class UdopConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`UdopForConditionalGeneration`]. It is used to
instantiate a UDOP model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the UDOP
[microsoft/udop-large](https://huggingface.co/microsoft/udop-large) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 33201):
diff --git a/src/transformers/models/umt5/configuration_umt5.py b/src/transformers/models/umt5/configuration_umt5.py
index c23f171e4d6..415f188968c 100644
--- a/src/transformers/models/umt5/configuration_umt5.py
+++ b/src/transformers/models/umt5/configuration_umt5.py
@@ -16,7 +16,7 @@
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxSeq2SeqConfigWithPast
from ...utils import logging
@@ -24,15 +24,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class UMT5Config(PretrainedConfig):
+class UMT5Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`UMT5Model`]. It is used to instantiate a UMT5
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the UMT5
[google/umt5-small](https://huggingface.co/google/umt5-small) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Arguments:
vocab_size (`int`, *optional*, defaults to 250112):
diff --git a/src/transformers/models/unispeech/configuration_unispeech.py b/src/transformers/models/unispeech/configuration_unispeech.py
index a71ba7f1b7d..f9c7823680b 100644
--- a/src/transformers/models/unispeech/configuration_unispeech.py
+++ b/src/transformers/models/unispeech/configuration_unispeech.py
@@ -17,22 +17,22 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class UniSpeechConfig(PretrainedConfig):
+class UniSpeechConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`UniSpeechModel`]. It is used to instantiate an
UniSpeech model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the UniSpeech
[microsoft/unispeech-large-1500h-cv](https://huggingface.co/microsoft/unispeech-large-1500h-cv) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py b/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py
index 2bebff802e8..a6f81cd9a55 100644
--- a/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py
+++ b/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py
@@ -17,14 +17,14 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class UniSpeechSatConfig(PretrainedConfig):
+class UniSpeechSatConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`UniSpeechSatModel`]. It is used to instantiate an
UniSpeechSat model according to the specified arguments, defining the model architecture. Instantiating a
@@ -32,8 +32,8 @@ class UniSpeechSatConfig(PretrainedConfig):
[microsoft/unispeech-sat-base-100h-libri-ft](https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/univnet/configuration_univnet.py b/src/transformers/models/univnet/configuration_univnet.py
index 4c1bad6da25..fb53f06d484 100644
--- a/src/transformers/models/univnet/configuration_univnet.py
+++ b/src/transformers/models/univnet/configuration_univnet.py
@@ -13,14 +13,14 @@
# limitations under the License.
"""UnivNetModel model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class UnivNetConfig(PretrainedConfig):
+class UnivNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`UnivNetModel`]. It is used to instantiate a
UnivNet vocoder model according to the specified arguments, defining the model architecture. Instantiating a
@@ -28,8 +28,8 @@ class UnivNetConfig(PretrainedConfig):
[dg845/univnet-dev](https://huggingface.co/dg845/univnet-dev) architecture, which corresponds to the 'c32'
architecture in [maum-ai/univnet](https://github.com/maum-ai/univnet/blob/master/config/default_c32.yaml).
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
model_in_channels (`int`, *optional*, defaults to 64):
diff --git a/src/transformers/models/upernet/configuration_upernet.py b/src/transformers/models/upernet/configuration_upernet.py
index d116b22fcfb..ee43928d7ee 100644
--- a/src/transformers/models/upernet/configuration_upernet.py
+++ b/src/transformers/models/upernet/configuration_upernet.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""UperNet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto.configuration_auto import CONFIG_MAPPING
@@ -23,18 +23,18 @@ from ..auto.configuration_auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class UperNetConfig(PretrainedConfig):
+class UperNetConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`UperNetForSemanticSegmentation`]. It is used to
instantiate an UperNet model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the UperNet
[openmmlab/upernet-convnext-tiny](https://huggingface.co/openmmlab/upernet-convnext-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `ResNetConfig()`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
diff --git a/src/transformers/models/vaultgemma/configuration_vaultgemma.py b/src/transformers/models/vaultgemma/configuration_vaultgemma.py
index 488ce47e896..9536eb029e8 100644
--- a/src/transformers/models/vaultgemma/configuration_vaultgemma.py
+++ b/src/transformers/models/vaultgemma/configuration_vaultgemma.py
@@ -19,17 +19,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig, layer_type_validation
+from ...configuration_utils import PreTrainedConfig, layer_type_validation
-class VaultGemmaConfig(PretrainedConfig):
+class VaultGemmaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VaultGemmaModel`]. It is used to instantiate an VaultGemma
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the VaultGemma-7B.
e.g. [google/vaultgemma-7b](https://huggingface.co/google/vaultgemma-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
diff --git a/src/transformers/models/vaultgemma/modular_vaultgemma.py b/src/transformers/models/vaultgemma/modular_vaultgemma.py
index 5eb641a5556..0a653117905 100644
--- a/src/transformers/models/vaultgemma/modular_vaultgemma.py
+++ b/src/transformers/models/vaultgemma/modular_vaultgemma.py
@@ -28,8 +28,8 @@ class VaultGemmaConfig(Gemma2Config):
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the VaultGemma-7B.
e.g. [google/vaultgemma-7b](https://huggingface.co/google/vaultgemma-7b)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 256000):
diff --git a/src/transformers/models/video_llava/configuration_video_llava.py b/src/transformers/models/video_llava/configuration_video_llava.py
index 561d2e3a925..7342615bd57 100644
--- a/src/transformers/models/video_llava/configuration_video_llava.py
+++ b/src/transformers/models/video_llava/configuration_video_llava.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""VideoLlava model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,7 +21,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class VideoLlavaConfig(PretrainedConfig):
+class VideoLlavaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VideoLlavaForConditionalGeneration`]. It is used to instantiate an
VideoLlava model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -29,8 +29,8 @@ class VideoLlavaConfig(PretrainedConfig):
e.g. [LanguageBind/Video-LLaVA-7B-hf](https://huggingface.co/LanguageBind/Video-LLaVA-7B-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`VideoLlavaVisionConfig`, *optional*):
diff --git a/src/transformers/models/videomae/configuration_videomae.py b/src/transformers/models/videomae/configuration_videomae.py
index 3940b6f0100..0dcab54ccb4 100644
--- a/src/transformers/models/videomae/configuration_videomae.py
+++ b/src/transformers/models/videomae/configuration_videomae.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""VideoMAE model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class VideoMAEConfig(PretrainedConfig):
+class VideoMAEConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VideoMAEModel`]. It is used to instantiate a
VideoMAE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VideoMAE
[MCG-NJU/videomae-base](https://huggingface.co/MCG-NJU/videomae-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/vilt/configuration_vilt.py b/src/transformers/models/vilt/configuration_vilt.py
index baa30704f78..e5b6fb3aa46 100644
--- a/src/transformers/models/vilt/configuration_vilt.py
+++ b/src/transformers/models/vilt/configuration_vilt.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""VilT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ViltConfig(PretrainedConfig):
+class ViltConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ViLTModel`]. It is used to instantiate an ViLT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ViLT
[dandelin/vilt-b32-mlm](https://huggingface.co/dandelin/vilt-b32-mlm) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30522):
diff --git a/src/transformers/models/vipllava/configuration_vipllava.py b/src/transformers/models/vipllava/configuration_vipllava.py
index cdeb7823ad4..cf62762a332 100644
--- a/src/transformers/models/vipllava/configuration_vipllava.py
+++ b/src/transformers/models/vipllava/configuration_vipllava.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""VipLlava model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING, AutoConfig
@@ -21,7 +21,7 @@ from ..auto import CONFIG_MAPPING, AutoConfig
logger = logging.get_logger(__name__)
-class VipLlavaConfig(PretrainedConfig):
+class VipLlavaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VipLlavaForConditionalGeneration`]. It is used to instantiate an
VipLlava model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -29,8 +29,8 @@ class VipLlavaConfig(PretrainedConfig):
e.g. [ybelkada/vip-llava-7b-hf](https://huggingface.co/ybelkada/vip-llava-7b-hf)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vision_config (`VipLlavaVisionConfig`, *optional*):
diff --git a/src/transformers/models/vision_encoder_decoder/configuration_vision_encoder_decoder.py b/src/transformers/models/vision_encoder_decoder/configuration_vision_encoder_decoder.py
index a069a888f02..03c8807f0ec 100644
--- a/src/transformers/models/vision_encoder_decoder/configuration_vision_encoder_decoder.py
+++ b/src/transformers/models/vision_encoder_decoder/configuration_vision_encoder_decoder.py
@@ -20,7 +20,7 @@ from typing import TYPE_CHECKING, Any
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
@@ -32,22 +32,22 @@ if TYPE_CHECKING:
logger = logging.get_logger(__name__)
-class VisionEncoderDecoderConfig(PretrainedConfig):
+class VisionEncoderDecoderConfig(PreTrainedConfig):
r"""
[`VisionEncoderDecoderConfig`] is the configuration class to store the configuration of a
[`VisionEncoderDecoderModel`]. It is used to instantiate a Vision-Encoder-Text-Decoder model according to the
specified arguments, defining the encoder and decoder configs.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
kwargs (*optional*):
Dictionary of keyword arguments. Notably:
- - **encoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **encoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the encoder config.
- - **decoder** ([`PretrainedConfig`], *optional*) -- An instance of a configuration object that defines
+ - **decoder** ([`PreTrainedConfig`], *optional*) -- An instance of a configuration object that defines
the decoder config.
Examples:
@@ -102,8 +102,8 @@ class VisionEncoderDecoderConfig(PretrainedConfig):
@classmethod
def from_encoder_decoder_configs(
- cls, encoder_config: PretrainedConfig, decoder_config: PretrainedConfig, **kwargs
- ) -> PretrainedConfig:
+ cls, encoder_config: PreTrainedConfig, decoder_config: PreTrainedConfig, **kwargs
+ ) -> PreTrainedConfig:
r"""
Instantiate a [`VisionEncoderDecoderConfig`] (or a derived class) from a pre-trained encoder model
configuration and decoder model configuration.
@@ -180,12 +180,12 @@ class VisionEncoderDecoderOnnxConfig(OnnxConfig):
def inputs(self) -> None:
pass
- def get_encoder_config(self, encoder_config: PretrainedConfig) -> OnnxConfig:
+ def get_encoder_config(self, encoder_config: PreTrainedConfig) -> OnnxConfig:
r"""
Returns ONNX encoder config for `VisionEncoderDecoder` model.
Args:
- encoder_config (`PretrainedConfig`):
+ encoder_config (`PreTrainedConfig`):
The encoder model's configuration to use when exporting to ONNX.
Returns:
@@ -194,15 +194,15 @@ class VisionEncoderDecoderOnnxConfig(OnnxConfig):
return VisionEncoderDecoderEncoderOnnxConfig(encoder_config)
def get_decoder_config(
- self, encoder_config: PretrainedConfig, decoder_config: PretrainedConfig, feature: str = "default"
+ self, encoder_config: PreTrainedConfig, decoder_config: PreTrainedConfig, feature: str = "default"
) -> OnnxConfig:
r"""
Returns ONNX decoder config for `VisionEncoderDecoder` model.
Args:
- encoder_config (`PretrainedConfig`):
+ encoder_config (`PreTrainedConfig`):
The encoder model's configuration to use when exporting to ONNX.
- decoder_config (`PretrainedConfig`):
+ decoder_config (`PreTrainedConfig`):
The decoder model's configuration to use when exporting to ONNX
feature (`str`, *optional*):
The type of feature to export the model with.
diff --git a/src/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py b/src/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py
index 09eeba11add..62e44a365f8 100644
--- a/src/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py
+++ b/src/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py
@@ -20,7 +20,7 @@ import torch
from torch import nn
from ...cache_utils import Cache
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...generation import GenerationMixin
from ...modeling_outputs import BaseModelOutput, Seq2SeqLMOutput
from ...modeling_utils import PreTrainedModel
@@ -71,7 +71,7 @@ class VisionEncoderDecoderModel(PreTrainedModel, GenerationMixin):
def __init__(
self,
- config: Optional[PretrainedConfig] = None,
+ config: Optional[PreTrainedConfig] = None,
encoder: Optional[PreTrainedModel] = None,
decoder: Optional[PreTrainedModel] = None,
):
diff --git a/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py b/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py
index 3f544e9eaf0..508baf9a2c8 100644
--- a/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py
+++ b/src/transformers/models/vision_text_dual_encoder/configuration_vision_text_dual_encoder.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""VisionTextDualEncoder model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
from ..chinese_clip.configuration_chinese_clip import ChineseCLIPVisionConfig
@@ -31,14 +31,14 @@ VISION_MODEL_CONFIGS = {
}
-class VisionTextDualEncoderConfig(PretrainedConfig):
+class VisionTextDualEncoderConfig(PreTrainedConfig):
r"""
[`VisionTextDualEncoderConfig`] is the configuration class to store the configuration of a
[`VisionTextDualEncoderModel`]. It is used to instantiate [`VisionTextDualEncoderModel`] model according to the
specified arguments, defining the text model and vision model configs.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
projection_dim (`int`, *optional*, defaults to 512):
@@ -107,7 +107,7 @@ class VisionTextDualEncoderConfig(PretrainedConfig):
self.logit_scale_init_value = logit_scale_init_value
@classmethod
- def from_vision_text_configs(cls, vision_config: PretrainedConfig, text_config: PretrainedConfig, **kwargs):
+ def from_vision_text_configs(cls, vision_config: PreTrainedConfig, text_config: PreTrainedConfig, **kwargs):
r"""
Instantiate a [`VisionTextDualEncoderConfig`] (or a derived class) from text model configuration and vision
model configuration.
diff --git a/src/transformers/models/visual_bert/configuration_visual_bert.py b/src/transformers/models/visual_bert/configuration_visual_bert.py
index a866227d347..c0950570480 100644
--- a/src/transformers/models/visual_bert/configuration_visual_bert.py
+++ b/src/transformers/models/visual_bert/configuration_visual_bert.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""VisualBERT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class VisualBertConfig(PretrainedConfig):
+class VisualBertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VisualBertModel`]. It is used to instantiate an
VisualBERT model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the VisualBERT
[uclanlp/visualbert-vqa-coco-pre](https://huggingface.co/uclanlp/visualbert-vqa-coco-pre) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/vit/configuration_vit.py b/src/transformers/models/vit/configuration_vit.py
index 7d69cdf5194..797f6a7cfb5 100644
--- a/src/transformers/models/vit/configuration_vit.py
+++ b/src/transformers/models/vit/configuration_vit.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class ViTConfig(PretrainedConfig):
+class ViTConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ViTModel`]. It is used to instantiate an ViT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ViT
[google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/vit_mae/configuration_vit_mae.py b/src/transformers/models/vit_mae/configuration_vit_mae.py
index 2c5ec360059..d3bfd7f25b9 100644
--- a/src/transformers/models/vit_mae/configuration_vit_mae.py
+++ b/src/transformers/models/vit_mae/configuration_vit_mae.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""ViT MAE model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ViTMAEConfig(PretrainedConfig):
+class ViTMAEConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ViTMAEModel`]. It is used to instantiate an ViT
MAE model according to the specified arguments, defining the model architecture. Instantiating a configuration with
the defaults will yield a similar configuration to that of the ViT
[facebook/vit-mae-base](https://huggingface.co/facebook/vit-mae-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/vit_msn/configuration_vit_msn.py b/src/transformers/models/vit_msn/configuration_vit_msn.py
index cd47df3e993..55e4b69dc8b 100644
--- a/src/transformers/models/vit_msn/configuration_vit_msn.py
+++ b/src/transformers/models/vit_msn/configuration_vit_msn.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""ViT MSN model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ViTMSNConfig(PretrainedConfig):
+class ViTMSNConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ViTMSNModel`]. It is used to instantiate an ViT
MSN model according to the specified arguments, defining the model architecture. Instantiating a configuration with
the defaults will yield a similar configuration to that of the ViT
[facebook/vit_msn_base](https://huggingface.co/facebook/vit_msn_base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/vitdet/configuration_vitdet.py b/src/transformers/models/vitdet/configuration_vitdet.py
index 7cc7f6b875c..b9331c7b7de 100644
--- a/src/transformers/models/vitdet/configuration_vitdet.py
+++ b/src/transformers/models/vitdet/configuration_vitdet.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""VitDet model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class VitDetConfig(BackboneConfigMixin, PretrainedConfig):
+class VitDetConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VitDetModel`]. It is used to instantiate an
VitDet model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VitDet
[google/vitdet-base-patch16-224](https://huggingface.co/google/vitdet-base-patch16-224) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
diff --git a/src/transformers/models/vitmatte/configuration_vitmatte.py b/src/transformers/models/vitmatte/configuration_vitmatte.py
index 85b0b0f58d8..922c5136f6a 100644
--- a/src/transformers/models/vitmatte/configuration_vitmatte.py
+++ b/src/transformers/models/vitmatte/configuration_vitmatte.py
@@ -17,7 +17,7 @@
import copy
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto.configuration_auto import CONFIG_MAPPING
@@ -26,18 +26,18 @@ from ..auto.configuration_auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class VitMatteConfig(PretrainedConfig):
+class VitMatteConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of [`VitMatteForImageMatting`]. It is used to
instantiate a ViTMatte model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the ViTMatte
[hustvl/vitmatte-small-composition-1k](https://huggingface.co/hustvl/vitmatte-small-composition-1k) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `VitDetConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `VitDetConfig()`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
@@ -81,7 +81,7 @@ class VitMatteConfig(PretrainedConfig):
def __init__(
self,
- backbone_config: Optional[PretrainedConfig] = None,
+ backbone_config: Optional[PreTrainedConfig] = None,
backbone=None,
use_pretrained_backbone=False,
use_timm_backbone=False,
@@ -132,7 +132,7 @@ class VitMatteConfig(PretrainedConfig):
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`]. Returns:
+ Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`]. Returns:
`dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
"""
output = copy.deepcopy(self.__dict__)
diff --git a/src/transformers/models/vitpose/configuration_vitpose.py b/src/transformers/models/vitpose/configuration_vitpose.py
index 777e3d3c60c..de8c073f125 100644
--- a/src/transformers/models/vitpose/configuration_vitpose.py
+++ b/src/transformers/models/vitpose/configuration_vitpose.py
@@ -16,7 +16,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import verify_backbone_config_arguments
from ..auto.configuration_auto import CONFIG_MAPPING
@@ -25,18 +25,18 @@ from ..auto.configuration_auto import CONFIG_MAPPING
logger = logging.get_logger(__name__)
-class VitPoseConfig(PretrainedConfig):
+class VitPoseConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VitPoseForPoseEstimation`]. It is used to instantiate a
VitPose model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VitPose
[usyd-community/vitpose-base-simple](https://huggingface.co/usyd-community/vitpose-base-simple) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`PretrainedConfig` or `dict`, *optional*, defaults to `VitPoseBackboneConfig()`):
+ backbone_config (`PreTrainedConfig` or `dict`, *optional*, defaults to `VitPoseBackboneConfig()`):
The configuration of the backbone model. Currently, only `backbone_config` with `vitpose_backbone` as `model_type` is supported.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
@@ -77,7 +77,7 @@ class VitPoseConfig(PretrainedConfig):
def __init__(
self,
- backbone_config: Optional[PretrainedConfig] = None,
+ backbone_config: Optional[PreTrainedConfig] = None,
backbone: Optional[str] = None,
use_pretrained_backbone: bool = False,
use_timm_backbone: bool = False,
diff --git a/src/transformers/models/vitpose_backbone/configuration_vitpose_backbone.py b/src/transformers/models/vitpose_backbone/configuration_vitpose_backbone.py
index b3edc62f485..9f062034452 100644
--- a/src/transformers/models/vitpose_backbone/configuration_vitpose_backbone.py
+++ b/src/transformers/models/vitpose_backbone/configuration_vitpose_backbone.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""VitPose backbone configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices
@@ -22,15 +22,15 @@ from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_feat
logger = logging.get_logger(__name__)
-class VitPoseBackboneConfig(BackboneConfigMixin, PretrainedConfig):
+class VitPoseBackboneConfig(BackboneConfigMixin, PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VitPoseBackbone`]. It is used to instantiate a
VitPose model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VitPose
[usyd-community/vitpose-base-simple](https://huggingface.co/usyd-community/vitpose-base-simple) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to `[256, 192]`):
diff --git a/src/transformers/models/vits/configuration_vits.py b/src/transformers/models/vits/configuration_vits.py
index 96407d1ac0d..be98b48da06 100644
--- a/src/transformers/models/vits/configuration_vits.py
+++ b/src/transformers/models/vits/configuration_vits.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""VITS model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class VitsConfig(PretrainedConfig):
+class VitsConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VitsModel`]. It is used to instantiate a VITS
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the VITS
[facebook/mms-tts-eng](https://huggingface.co/facebook/mms-tts-eng) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 38):
diff --git a/src/transformers/models/vivit/configuration_vivit.py b/src/transformers/models/vivit/configuration_vivit.py
index 02c776b3500..88bdee687a6 100644
--- a/src/transformers/models/vivit/configuration_vivit.py
+++ b/src/transformers/models/vivit/configuration_vivit.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""ViViT model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class VivitConfig(PretrainedConfig):
+class VivitConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VivitModel`]. It is used to instantiate a ViViT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ViViT
[google/vivit-b-16x2-kinetics400](https://huggingface.co/google/vivit-b-16x2-kinetics400) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
image_size (`int`, *optional*, defaults to 224):
diff --git a/src/transformers/models/vjepa2/configuration_vjepa2.py b/src/transformers/models/vjepa2/configuration_vjepa2.py
index 1fd19c4d078..cc0b90927d1 100644
--- a/src/transformers/models/vjepa2/configuration_vjepa2.py
+++ b/src/transformers/models/vjepa2/configuration_vjepa2.py
@@ -14,18 +14,18 @@
# limitations under the License.
"""VJEPA 2 model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class VJEPA2Config(PretrainedConfig):
+class VJEPA2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VJEPA2Model`]. It is used to instantiate an
VJEPA2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the VJEPA2
[facebook/vjepa2-vitl-fpc64-256](https://huggingface.co/facebook/vjepa2-vitl-fpc64-256) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
patch_size (`int`, *optional*, defaults to 16):
diff --git a/src/transformers/models/voxtral/configuration_voxtral.py b/src/transformers/models/voxtral/configuration_voxtral.py
index 8cdd499cdea..e799c763101 100644
--- a/src/transformers/models/voxtral/configuration_voxtral.py
+++ b/src/transformers/models/voxtral/configuration_voxtral.py
@@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
-class VoxtralEncoderConfig(PretrainedConfig):
+class VoxtralEncoderConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VoxtralEncoder`]. It is used to instantiate a
Voxtral audio encoder according to the specified arguments, defining the model architecture. Instantiating a
@@ -26,8 +26,8 @@ class VoxtralEncoderConfig(PretrainedConfig):
e.g. [mistralai/Voxtral-Mini-3B-2507](https://huggingface.co/mistralai/Voxtral-Mini-3B-2507)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 51866):
@@ -116,7 +116,7 @@ class VoxtralEncoderConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class VoxtralConfig(PretrainedConfig):
+class VoxtralConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`VoxtralForConditionalGeneration`]. It is used to instantiate an
Voxtral model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -124,8 +124,8 @@ class VoxtralConfig(PretrainedConfig):
e.g. [mistralai/Voxtral-Mini-3B-2507](https://huggingface.co/mistralai/Voxtral-Mini-3B-2507)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
audio_config (`Union[AutoConfig, dict]`, *optional*):
diff --git a/src/transformers/models/wav2vec2/configuration_wav2vec2.py b/src/transformers/models/wav2vec2/configuration_wav2vec2.py
index e6fffc0ffa4..3d9e789b24f 100644
--- a/src/transformers/models/wav2vec2/configuration_wav2vec2.py
+++ b/src/transformers/models/wav2vec2/configuration_wav2vec2.py
@@ -17,22 +17,22 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Wav2Vec2Config(PretrainedConfig):
+class Wav2Vec2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Wav2Vec2Model`]. It is used to instantiate an
Wav2Vec2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Wav2Vec2
[facebook/wav2vec2-base-960h](https://huggingface.co/facebook/wav2vec2-base-960h) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py b/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py
index 2462976cfbb..65037a46c02 100644
--- a/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py
+++ b/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py
@@ -14,14 +14,14 @@
# limitations under the License.
"""Wav2Vec2Bert model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Wav2Vec2BertConfig(PretrainedConfig):
+class Wav2Vec2BertConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Wav2Vec2BertModel`]. It is used to
instantiate an Wav2Vec2Bert model according to the specified arguments, defining the model architecture.
@@ -29,8 +29,8 @@ class Wav2Vec2BertConfig(PretrainedConfig):
[facebook/wav2vec2-bert-rel-pos-large](https://huggingface.co/facebook/wav2vec2-bert-rel-pos-large)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py b/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py
index 493e96f4403..80c69eb2559 100644
--- a/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py
+++ b/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py
@@ -17,14 +17,14 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class Wav2Vec2ConformerConfig(PretrainedConfig):
+class Wav2Vec2ConformerConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Wav2Vec2ConformerModel`]. It is used to
instantiate an Wav2Vec2Conformer model according to the specified arguments, defining the model architecture.
@@ -32,8 +32,8 @@ class Wav2Vec2ConformerConfig(PretrainedConfig):
[facebook/wav2vec2-conformer-rel-pos-large](https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large)
architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/wavlm/configuration_wavlm.py b/src/transformers/models/wavlm/configuration_wavlm.py
index a137792e2a8..d449c1cc982 100644
--- a/src/transformers/models/wavlm/configuration_wavlm.py
+++ b/src/transformers/models/wavlm/configuration_wavlm.py
@@ -17,22 +17,22 @@
import functools
import operator
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class WavLMConfig(PretrainedConfig):
+class WavLMConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`WavLMModel`]. It is used to instantiate an WavLM
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the WavLM
[microsoft/wavlm-base](https://huggingface.co/microsoft/wavlm-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/whisper/configuration_whisper.py b/src/transformers/models/whisper/configuration_whisper.py
index 1950e03f54e..1af902320af 100644
--- a/src/transformers/models/whisper/configuration_whisper.py
+++ b/src/transformers/models/whisper/configuration_whisper.py
@@ -18,7 +18,7 @@ from collections import OrderedDict
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, Union
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig, OnnxSeq2SeqConfigWithPast
from ...utils import logging
@@ -56,15 +56,15 @@ NON_SPEECH_TOKENS_MULTI = [
# fmt: on
-class WhisperConfig(PretrainedConfig):
+class WhisperConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`WhisperModel`]. It is used to instantiate a
Whisper model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Whisper
[openai/whisper-tiny](https://huggingface.co/openai/whisper-tiny) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/x_clip/configuration_x_clip.py b/src/transformers/models/x_clip/configuration_x_clip.py
index 3fa6bb1544a..a41a8d18380 100644
--- a/src/transformers/models/x_clip/configuration_x_clip.py
+++ b/src/transformers/models/x_clip/configuration_x_clip.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""X-CLIP model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class XCLIPTextConfig(PretrainedConfig):
+class XCLIPTextConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`XCLIPModel`]. It is used to instantiate an X-CLIP
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the X-CLIP
[microsoft/xclip-base-patch32](https://huggingface.co/microsoft/xclip-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -111,15 +111,15 @@ class XCLIPTextConfig(PretrainedConfig):
self.attention_dropout = attention_dropout
-class XCLIPVisionConfig(PretrainedConfig):
+class XCLIPVisionConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`XCLIPModel`]. It is used to instantiate an X-CLIP
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the X-CLIP
[microsoft/xclip-base-patch32](https://huggingface.co/microsoft/xclip-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
@@ -221,15 +221,15 @@ class XCLIPVisionConfig(PretrainedConfig):
self.drop_path_rate = drop_path_rate
-class XCLIPConfig(PretrainedConfig):
+class XCLIPConfig(PreTrainedConfig):
r"""
[`XCLIPConfig`] is the configuration class to store the configuration of a [`XCLIPModel`]. It is used to
instantiate X-CLIP model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the X-CLIP
[microsoft/xclip-base-patch32](https://huggingface.co/microsoft/xclip-base-patch32) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
text_config (`dict`, *optional*):
diff --git a/src/transformers/models/xcodec/configuration_xcodec.py b/src/transformers/models/xcodec/configuration_xcodec.py
index 959838cc1d5..7b9dcf8b488 100644
--- a/src/transformers/models/xcodec/configuration_xcodec.py
+++ b/src/transformers/models/xcodec/configuration_xcodec.py
@@ -21,22 +21,22 @@ import numpy as np
from transformers import AutoConfig, DacConfig, HubertConfig, WavLMConfig
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class XcodecConfig(PretrainedConfig):
+class XcodecConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of an [`XcodecModel`]. It is used to instantiate a
Xcodec model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
[Manel/X-Codec](https://huggingface.co/Manel/X-Codec) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
target_bandwidths (`List[float]`, *optional*, defaults to `[0.5, 1, 1.5, 2, 4]`):
diff --git a/src/transformers/models/xglm/configuration_xglm.py b/src/transformers/models/xglm/configuration_xglm.py
index eae648c4726..4716231f97c 100644
--- a/src/transformers/models/xglm/configuration_xglm.py
+++ b/src/transformers/models/xglm/configuration_xglm.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""XGLM model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class XGLMConfig(PretrainedConfig):
+class XGLMConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`XGLMModel`]. It is used to instantiate an XGLM
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the XGLM
[facebook/xglm-564M](https://huggingface.co/facebook/xglm-564M) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/xlm/configuration_xlm.py b/src/transformers/models/xlm/configuration_xlm.py
index d4c85bf5827..657584288ac 100644
--- a/src/transformers/models/xlm/configuration_xlm.py
+++ b/src/transformers/models/xlm/configuration_xlm.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class XLMConfig(PretrainedConfig):
+class XLMConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`XLMModel`] or a [`TFXLMModel`]. It is used to
instantiate a XLM model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[FacebookAI/xlm-mlm-en-2048](https://huggingface.co/FacebookAI/xlm-mlm-en-2048) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 30145):
diff --git a/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py b/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py
index 97d6245cb1d..786d484edc3 100644
--- a/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py
+++ b/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -26,15 +26,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class XLMRobertaConfig(PretrainedConfig):
+class XLMRobertaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`XLMRobertaModel`] or a [`TFXLMRobertaModel`]. It
is used to instantiate a XLM-RoBERTa model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the XLMRoBERTa
[FacebookAI/xlm-roberta-base](https://huggingface.co/FacebookAI/xlm-roberta-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py b/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py
index 4111a61d4e2..35558e5b60b 100644
--- a/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py
+++ b/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py
@@ -17,7 +17,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -25,15 +25,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class XLMRobertaXLConfig(PretrainedConfig):
+class XLMRobertaXLConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`XLMRobertaXLModel`] or a [`TFXLMRobertaXLModel`].
It is used to instantiate a XLM_ROBERTA_XL model according to the specified arguments, defining the model
architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the
XLM_ROBERTA_XL [facebook/xlm-roberta-xl](https://huggingface.co/facebook/xlm-roberta-xl) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/xlnet/configuration_xlnet.py b/src/transformers/models/xlnet/configuration_xlnet.py
index d32f05c875b..b6395c35b75 100644
--- a/src/transformers/models/xlnet/configuration_xlnet.py
+++ b/src/transformers/models/xlnet/configuration_xlnet.py
@@ -17,22 +17,22 @@
import warnings
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class XLNetConfig(PretrainedConfig):
+class XLNetConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`XLNetModel`] or a [`TFXLNetModel`]. It is used to
instantiate a XLNet model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[xlnet/xlnet-large-cased](https://huggingface.co/xlnet/xlnet-large-cased) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
diff --git a/src/transformers/models/xlstm/configuration_xlstm.py b/src/transformers/models/xlstm/configuration_xlstm.py
index 22a9a13fe3e..101f24ec407 100644
--- a/src/transformers/models/xlstm/configuration_xlstm.py
+++ b/src/transformers/models/xlstm/configuration_xlstm.py
@@ -17,7 +17,7 @@
from typing import Optional
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import is_xlstm_available, logging
@@ -57,14 +57,14 @@ else:
logger = logging.get_logger(__name__)
-class xLSTMConfig(PretrainedConfig):
+class xLSTMConfig(PreTrainedConfig):
"""
This is the configuration class to store the configuration of a [`xLSTM`]. It is used to instantiate a xLSTM
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the xLSTM-7b [NX-AI/xLSTM-7b](https://huggingface.co/NX-AI/xLSTM-7b) model.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/xlstm/modeling_xlstm.py b/src/transformers/models/xlstm/modeling_xlstm.py
index 467dff5f313..6c9b9638d80 100644
--- a/src/transformers/models/xlstm/modeling_xlstm.py
+++ b/src/transformers/models/xlstm/modeling_xlstm.py
@@ -1293,7 +1293,7 @@ class xLSTMCache:
Cache for xLSTM model which does not have attention mechanism and key value states.
Arguments:
- config (`PretrainedConfig):
+ config (`PreTrainedConfig):
The configuration file defining the shape-related attributes required to initialize the static cache.
max_batch_size (`int`):
The batch size with which the model will be used.
diff --git a/src/transformers/models/xmod/configuration_xmod.py b/src/transformers/models/xmod/configuration_xmod.py
index 41bad38a45d..cd5358750f4 100644
--- a/src/transformers/models/xmod/configuration_xmod.py
+++ b/src/transformers/models/xmod/configuration_xmod.py
@@ -18,7 +18,7 @@
from collections import OrderedDict
from collections.abc import Mapping
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -26,15 +26,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class XmodConfig(PretrainedConfig):
+class XmodConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`XmodModel`]. It is used to instantiate an X-MOD
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the
[facebook/xmod-base](https://huggingface.co/facebook/xmod-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/yolos/configuration_yolos.py b/src/transformers/models/yolos/configuration_yolos.py
index 3d2fdb2ba34..b19bf4962a0 100644
--- a/src/transformers/models/yolos/configuration_yolos.py
+++ b/src/transformers/models/yolos/configuration_yolos.py
@@ -19,7 +19,7 @@ from collections.abc import Mapping
from packaging import version
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
@@ -27,15 +27,15 @@ from ...utils import logging
logger = logging.get_logger(__name__)
-class YolosConfig(PretrainedConfig):
+class YolosConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`YolosModel`]. It is used to instantiate a YOLOS
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the YOLOS
[hustvl/yolos-base](https://huggingface.co/hustvl/yolos-base) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
hidden_size (`int`, *optional*, defaults to 768):
diff --git a/src/transformers/models/yoso/configuration_yoso.py b/src/transformers/models/yoso/configuration_yoso.py
index 9a7fb1218e4..d7fa03780d0 100644
--- a/src/transformers/models/yoso/configuration_yoso.py
+++ b/src/transformers/models/yoso/configuration_yoso.py
@@ -14,22 +14,22 @@
# limitations under the License.
"""YOSO model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class YosoConfig(PretrainedConfig):
+class YosoConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`YosoModel`]. It is used to instantiate an YOSO
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the YOSO
[uw-madison/yoso-4096](https://huggingface.co/uw-madison/yoso-4096) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/zamba/configuration_zamba.py b/src/transformers/models/zamba/configuration_zamba.py
index 3de9a19d1bd..37ea17e9bb2 100644
--- a/src/transformers/models/zamba/configuration_zamba.py
+++ b/src/transformers/models/zamba/configuration_zamba.py
@@ -16,14 +16,14 @@
import math
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
-class ZambaConfig(PretrainedConfig):
+class ZambaConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ZambaModel`]. It is used to instantiate a
Zamba model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -31,8 +31,8 @@ class ZambaConfig(PretrainedConfig):
[Zyphra/Zamba-7B-v1](https://huggingface.co/Zyphra/Zamba-7B-v1)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
diff --git a/src/transformers/models/zamba2/configuration_zamba2.py b/src/transformers/models/zamba2/configuration_zamba2.py
index 2789e508f6f..9023c9137da 100644
--- a/src/transformers/models/zamba2/configuration_zamba2.py
+++ b/src/transformers/models/zamba2/configuration_zamba2.py
@@ -20,10 +20,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
-class Zamba2Config(PretrainedConfig):
+class Zamba2Config(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`Zamba2Model`]. It is used to instantiate a
Zamba2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
@@ -31,8 +31,8 @@ class Zamba2Config(PretrainedConfig):
[Zyphra/Zamba2-2.7B](https://huggingface.co/Zyphra/Zamba2-2.7B)
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
Vocabulary size of the Zamba2 model. Defines the number of different tokens that can be represented by the
diff --git a/src/transformers/models/zoedepth/configuration_zoedepth.py b/src/transformers/models/zoedepth/configuration_zoedepth.py
index ac89f815f82..bdcfcdde3da 100644
--- a/src/transformers/models/zoedepth/configuration_zoedepth.py
+++ b/src/transformers/models/zoedepth/configuration_zoedepth.py
@@ -14,7 +14,7 @@
# limitations under the License.
"""ZoeDepth model configuration"""
-from ...configuration_utils import PretrainedConfig
+from ...configuration_utils import PreTrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING
@@ -26,18 +26,18 @@ ZOEDEPTH_PRETRAINED_CONFIG_ARCHIVE_MAP = {
}
-class ZoeDepthConfig(PretrainedConfig):
+class ZoeDepthConfig(PreTrainedConfig):
r"""
This is the configuration class to store the configuration of a [`ZoeDepthForDepthEstimation`]. It is used to instantiate an ZoeDepth
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the ZoeDepth
[Intel/zoedepth-nyu](https://huggingface.co/Intel/zoedepth-nyu) architecture.
- Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
- documentation from [`PretrainedConfig`] for more information.
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
+ documentation from [`PreTrainedConfig`] for more information.
Args:
- backbone_config (`Union[dict[str, Any], PretrainedConfig]`, *optional*, defaults to `BeitConfig()`):
+ backbone_config (`Union[dict[str, Any], PreTrainedConfig]`, *optional*, defaults to `BeitConfig()`):
The configuration of the backbone model.
backbone (`str`, *optional*):
Name of backbone to use when `backbone_config` is `None`. If `use_pretrained_backbone` is `True`, this
diff --git a/src/transformers/onnx/config.py b/src/transformers/onnx/config.py
index b3edad05327..4b7dc77c5d9 100644
--- a/src/transformers/onnx/config.py
+++ b/src/transformers/onnx/config.py
@@ -27,7 +27,7 @@ from .utils import ParameterFormat, compute_effective_axis_dimension, compute_se
if TYPE_CHECKING:
- from ..configuration_utils import PretrainedConfig
+ from ..configuration_utils import PreTrainedConfig
from ..feature_extraction_utils import FeatureExtractionMixin
from ..image_processing_utils import ImageProcessingMixin
from ..tokenization_utils_base import PreTrainedTokenizerBase
@@ -110,7 +110,7 @@ class OnnxConfig(ABC):
}
def __init__(
- self, config: "PretrainedConfig", task: str = "default", patching_specs: Optional[list[PatchingSpec]] = None
+ self, config: "PreTrainedConfig", task: str = "default", patching_specs: Optional[list[PatchingSpec]] = None
):
self._config = config
@@ -128,7 +128,7 @@ class OnnxConfig(ABC):
self._patching_specs.append(final_spec)
@classmethod
- def from_model_config(cls, config: "PretrainedConfig", task: str = "default") -> "OnnxConfig":
+ def from_model_config(cls, config: "PreTrainedConfig", task: str = "default") -> "OnnxConfig":
"""
Instantiate a OnnxConfig for a specific model
@@ -443,7 +443,7 @@ class OnnxConfig(ABC):
class OnnxConfigWithPast(OnnxConfig, ABC):
def __init__(
self,
- config: "PretrainedConfig",
+ config: "PreTrainedConfig",
task: str = "default",
patching_specs: Optional[list[PatchingSpec]] = None,
use_past: bool = False,
@@ -452,7 +452,7 @@ class OnnxConfigWithPast(OnnxConfig, ABC):
self.use_past = use_past
@classmethod
- def with_past(cls, config: "PretrainedConfig", task: str = "default") -> "OnnxConfigWithPast":
+ def with_past(cls, config: "PreTrainedConfig", task: str = "default") -> "OnnxConfigWithPast":
"""
Instantiate a OnnxConfig with `use_past` attribute set to True
diff --git a/src/transformers/pipelines/__init__.py b/src/transformers/pipelines/__init__.py
index a2ab8d1726c..7cd93b49ad7 100755
--- a/src/transformers/pipelines/__init__.py
+++ b/src/transformers/pipelines/__init__.py
@@ -20,7 +20,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
from huggingface_hub import model_info
-from ..configuration_utils import PretrainedConfig
+from ..configuration_utils import PreTrainedConfig
from ..dynamic_module_utils import get_class_from_dynamic_module
from ..feature_extraction_utils import PreTrainedFeatureExtractor
from ..image_processing_utils import BaseImageProcessor
@@ -442,67 +442,67 @@ from typing import Literal, overload
@overload
-def pipeline(task: Literal[None], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> Pipeline: ...
+def pipeline(task: Literal[None], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> Pipeline: ...
@overload
-def pipeline(task: Literal["audio-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> AudioClassificationPipeline: ...
+def pipeline(task: Literal["audio-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> AudioClassificationPipeline: ...
@overload
-def pipeline(task: Literal["automatic-speech-recognition"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> AutomaticSpeechRecognitionPipeline: ...
+def pipeline(task: Literal["automatic-speech-recognition"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> AutomaticSpeechRecognitionPipeline: ...
@overload
-def pipeline(task: Literal["depth-estimation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> DepthEstimationPipeline: ...
+def pipeline(task: Literal["depth-estimation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> DepthEstimationPipeline: ...
@overload
-def pipeline(task: Literal["document-question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> DocumentQuestionAnsweringPipeline: ...
+def pipeline(task: Literal["document-question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> DocumentQuestionAnsweringPipeline: ...
@overload
-def pipeline(task: Literal["feature-extraction"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> FeatureExtractionPipeline: ...
+def pipeline(task: Literal["feature-extraction"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> FeatureExtractionPipeline: ...
@overload
-def pipeline(task: Literal["fill-mask"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> FillMaskPipeline: ...
+def pipeline(task: Literal["fill-mask"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> FillMaskPipeline: ...
@overload
-def pipeline(task: Literal["image-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageClassificationPipeline: ...
+def pipeline(task: Literal["image-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageClassificationPipeline: ...
@overload
-def pipeline(task: Literal["image-feature-extraction"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageFeatureExtractionPipeline: ...
+def pipeline(task: Literal["image-feature-extraction"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageFeatureExtractionPipeline: ...
@overload
-def pipeline(task: Literal["image-segmentation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageSegmentationPipeline: ...
+def pipeline(task: Literal["image-segmentation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageSegmentationPipeline: ...
@overload
-def pipeline(task: Literal["image-text-to-text"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageTextToTextPipeline: ...
+def pipeline(task: Literal["image-text-to-text"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageTextToTextPipeline: ...
@overload
-def pipeline(task: Literal["image-to-image"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageToImagePipeline: ...
+def pipeline(task: Literal["image-to-image"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageToImagePipeline: ...
@overload
-def pipeline(task: Literal["image-to-text"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageToTextPipeline: ...
+def pipeline(task: Literal["image-to-text"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ImageToTextPipeline: ...
@overload
-def pipeline(task: Literal["keypoint-matching"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> KeypointMatchingPipeline: ...
+def pipeline(task: Literal["keypoint-matching"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> KeypointMatchingPipeline: ...
@overload
-def pipeline(task: Literal["mask-generation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> MaskGenerationPipeline: ...
+def pipeline(task: Literal["mask-generation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> MaskGenerationPipeline: ...
@overload
-def pipeline(task: Literal["object-detection"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ObjectDetectionPipeline: ...
+def pipeline(task: Literal["object-detection"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ObjectDetectionPipeline: ...
@overload
-def pipeline(task: Literal["question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> QuestionAnsweringPipeline: ...
+def pipeline(task: Literal["question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> QuestionAnsweringPipeline: ...
@overload
-def pipeline(task: Literal["summarization"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> SummarizationPipeline: ...
+def pipeline(task: Literal["summarization"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> SummarizationPipeline: ...
@overload
-def pipeline(task: Literal["table-question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TableQuestionAnsweringPipeline: ...
+def pipeline(task: Literal["table-question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TableQuestionAnsweringPipeline: ...
@overload
-def pipeline(task: Literal["text-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TextClassificationPipeline: ...
+def pipeline(task: Literal["text-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TextClassificationPipeline: ...
@overload
-def pipeline(task: Literal["text-generation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TextGenerationPipeline: ...
+def pipeline(task: Literal["text-generation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TextGenerationPipeline: ...
@overload
-def pipeline(task: Literal["text-to-audio"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TextToAudioPipeline: ...
+def pipeline(task: Literal["text-to-audio"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TextToAudioPipeline: ...
@overload
-def pipeline(task: Literal["text2text-generation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> Text2TextGenerationPipeline: ...
+def pipeline(task: Literal["text2text-generation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> Text2TextGenerationPipeline: ...
@overload
-def pipeline(task: Literal["token-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TokenClassificationPipeline: ...
+def pipeline(task: Literal["token-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TokenClassificationPipeline: ...
@overload
-def pipeline(task: Literal["translation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TranslationPipeline: ...
+def pipeline(task: Literal["translation"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> TranslationPipeline: ...
@overload
-def pipeline(task: Literal["video-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> VideoClassificationPipeline: ...
+def pipeline(task: Literal["video-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> VideoClassificationPipeline: ...
@overload
-def pipeline(task: Literal["visual-question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> VisualQuestionAnsweringPipeline: ...
+def pipeline(task: Literal["visual-question-answering"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> VisualQuestionAnsweringPipeline: ...
@overload
-def pipeline(task: Literal["zero-shot-audio-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotAudioClassificationPipeline: ...
+def pipeline(task: Literal["zero-shot-audio-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotAudioClassificationPipeline: ...
@overload
-def pipeline(task: Literal["zero-shot-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotClassificationPipeline: ...
+def pipeline(task: Literal["zero-shot-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotClassificationPipeline: ...
@overload
-def pipeline(task: Literal["zero-shot-image-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotImageClassificationPipeline: ...
+def pipeline(task: Literal["zero-shot-image-classification"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotImageClassificationPipeline: ...
@overload
-def pipeline(task: Literal["zero-shot-object-detection"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PretrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotObjectDetectionPipeline: ...
+def pipeline(task: Literal["zero-shot-object-detection"], model: Optional[Union[str, "PreTrainedModel"]] = None, config: Optional[Union[str, PreTrainedConfig]] = None, tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None, feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None, image_processor: Optional[Union[str, BaseImageProcessor]] = None, processor: Optional[Union[str, ProcessorMixin]] = None, revision: Optional[str] = None, use_fast: bool = True, token: Optional[Union[str, bool]] = None, device: Optional[Union[int, str, "torch.device"]] = None, device_map: Optional[Union[str, dict[str, Union[int, str]]]] = None, dtype: Optional[Union[str, "torch.dtype"]] = "auto", trust_remote_code: Optional[bool] = None, model_kwargs: Optional[dict[str, Any]] = None, pipeline_class: Optional[Any] = None, **kwargs: Any) -> ZeroShotObjectDetectionPipeline: ...
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# The part of the file above was automatically generated from the code.
@@ -514,7 +514,7 @@ def pipeline(task: Literal["zero-shot-object-detection"], model: Optional[Union[
def pipeline(
task: Optional[str] = None,
model: Optional[Union[str, "PreTrainedModel"]] = None,
- config: Optional[Union[str, PretrainedConfig]] = None,
+ config: Optional[Union[str, PreTrainedConfig]] = None,
tokenizer: Optional[Union[str, PreTrainedTokenizer, "PreTrainedTokenizerFast"]] = None,
feature_extractor: Optional[Union[str, PreTrainedFeatureExtractor]] = None,
image_processor: Optional[Union[str, BaseImageProcessor]] = None,
@@ -589,9 +589,9 @@ def pipeline(
actual instance of a pretrained model inheriting from [`PreTrainedModel`].
If not provided, the default for the `task` will be loaded.
- config (`str` or [`PretrainedConfig`], *optional*):
+ config (`str` or [`PreTrainedConfig`], *optional*):
The configuration that will be used by the pipeline to instantiate the model. This can be a model
- identifier or an actual pretrained model configuration inheriting from [`PretrainedConfig`].
+ identifier or an actual pretrained model configuration inheriting from [`PreTrainedConfig`].
If not provided, the default configuration file for the requested model will be used. That means that if
`model` is given, its default configuration will be used. However, if `model` is not supplied, this
@@ -746,7 +746,7 @@ def pipeline(
elif config is None and isinstance(model, str):
pretrained_model_name_or_path = model
- if not isinstance(config, PretrainedConfig) and pretrained_model_name_or_path is not None:
+ if not isinstance(config, PreTrainedConfig) and pretrained_model_name_or_path is not None:
# We make a call to the config file first (which may be absent) to get the commit hash as soon as possible
resolved_config_file = cached_file(
pretrained_model_name_or_path,
diff --git a/src/transformers/pipelines/zero_shot_classification.py b/src/transformers/pipelines/zero_shot_classification.py
index 917f4d753f8..4dc21733425 100644
--- a/src/transformers/pipelines/zero_shot_classification.py
+++ b/src/transformers/pipelines/zero_shot_classification.py
@@ -52,7 +52,7 @@ class ZeroShotClassificationPipeline(ChunkPipeline):
Any combination of sequences and labels can be passed and each combination will be posed as a premise/hypothesis
pair and passed to the pretrained model. Then, the logit for *entailment* is taken as the logit for the candidate
label being valid. Any NLI model can be used, but the id of the *entailment* label must be included in the model
- config's :attr:*~transformers.PretrainedConfig.label2id*.
+ config's :attr:*~transformers.PreTrainedConfig.label2id*.
Example:
diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py
index 6eca89c5cb8..ba182dbc56a 100755
--- a/src/transformers/trainer.py
+++ b/src/transformers/trainer.py
@@ -56,7 +56,7 @@ from torch import nn
from torch.utils.data import DataLoader, Dataset, IterableDataset, RandomSampler, SequentialSampler
from . import __version__
-from .configuration_utils import PretrainedConfig
+from .configuration_utils import PreTrainedConfig
from .data.data_collator import DataCollator, DataCollatorWithPadding, default_data_collator
from .debug_utils import DebugOption, DebugUnderflowOverflow
from .feature_extraction_sequence_utils import SequenceFeatureExtractor
@@ -2812,7 +2812,7 @@ class Trainer:
logger.info(f"Loading model from {resume_from_checkpoint}.")
if os.path.isfile(config_file):
- config = PretrainedConfig.from_json_file(config_file)
+ config = PreTrainedConfig.from_json_file(config_file)
checkpoint_version = config.transformers_version
if checkpoint_version is not None and checkpoint_version != __version__:
logger.warning(
diff --git a/src/transformers/utils/backbone_utils.py b/src/transformers/utils/backbone_utils.py
index d2f6277282d..ab8b436fe40 100644
--- a/src/transformers/utils/backbone_utils.py
+++ b/src/transformers/utils/backbone_utils.py
@@ -21,7 +21,7 @@ from typing import TYPE_CHECKING, Optional, Union
if TYPE_CHECKING:
- from ..configuration_utils import PretrainedConfig
+ from ..configuration_utils import PreTrainedConfig
class BackboneType(enum.Enum):
@@ -252,7 +252,7 @@ class BackboneMixin:
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default `to_dict()` from `PretrainedConfig` to
+ Serializes this instance to a Python dictionary. Override the default `to_dict()` from `PreTrainedConfig` to
include the `out_features` and `out_indices` attributes.
"""
output = super().to_dict()
@@ -294,7 +294,7 @@ class BackboneConfigMixin:
def to_dict(self):
"""
- Serializes this instance to a Python dictionary. Override the default `to_dict()` from `PretrainedConfig` to
+ Serializes this instance to a Python dictionary. Override the default `to_dict()` from `PreTrainedConfig` to
include the `out_features` and `out_indices` attributes.
"""
output = super().to_dict()
@@ -363,7 +363,7 @@ def verify_backbone_config_arguments(
use_timm_backbone: bool,
use_pretrained_backbone: bool,
backbone: Optional[str],
- backbone_config: Optional[Union[dict, "PretrainedConfig"]],
+ backbone_config: Optional[Union[dict, "PreTrainedConfig"]],
backbone_kwargs: Optional[dict],
):
"""
diff --git a/src/transformers/utils/fx.py b/src/transformers/utils/fx.py
index 7dac97831b3..73647ba6840 100755
--- a/src/transformers/utils/fx.py
+++ b/src/transformers/utils/fx.py
@@ -35,7 +35,7 @@ from torch.fx.proxy import ParameterProxy
from .. import logging
from ..cache_utils import Cache, DynamicCache, StaticCache
-from ..modeling_utils import PretrainedConfig, PreTrainedModel
+from ..modeling_utils import PreTrainedConfig, PreTrainedModel
from ..models.auto import get_values
from ..models.auto.modeling_auto import (
MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES,
@@ -75,7 +75,7 @@ _IS_IN_DEBUG_MODE = os.environ.get("FX_DEBUG_MODE", "").upper() in ENV_VARS_TRUE
def _generate_supported_model_class_names(
- model_name: type[PretrainedConfig],
+ model_name: type[PreTrainedConfig],
supported_tasks: Optional[Union[str, list[str]]] = None,
) -> list[str]:
task_mapping = {
diff --git a/src/transformers/utils/quantization_config.py b/src/transformers/utils/quantization_config.py
index 82357e6f0fe..1e31ab0d747 100644
--- a/src/transformers/utils/quantization_config.py
+++ b/src/transformers/utils/quantization_config.py
@@ -172,7 +172,7 @@ class QuantizationConfigMixin:
Args:
use_diff (`bool`, *optional*, defaults to `True`):
- If set to `True`, only the difference between the config instance and the default `PretrainedConfig()`
+ If set to `True`, only the difference between the config instance and the default `PreTrainedConfig()`
is serialized to JSON string.
Returns:
diff --git a/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py b/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py
index 8ada67913b0..6a4941e47e5 100755
--- a/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py
+++ b/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py
@@ -534,7 +534,7 @@ from transformers import (
{{cookiecutter.model_class}},
AutoTokenizer,
DataCollatorWithPadding,
- PretrainedConfig,
+ PreTrainedConfig,
SchedulerType,
default_data_collator,
get_scheduler,
diff --git a/templates/adding_a_new_model/ADD_NEW_MODEL_PROPOSAL_TEMPLATE.md b/templates/adding_a_new_model/ADD_NEW_MODEL_PROPOSAL_TEMPLATE.md
index dc7143465d4..eb110421530 100644
--- a/templates/adding_a_new_model/ADD_NEW_MODEL_PROPOSAL_TEMPLATE.md
+++ b/templates/adding_a_new_model/ADD_NEW_MODEL_PROPOSAL_TEMPLATE.md
@@ -85,7 +85,7 @@ design.
To successfully add a model, it is important to understand the
interaction between your model and its config,
-`PreTrainedModel`, and `PretrainedConfig`. For
+`PreTrainedModel`, and `PreTrainedConfig`. For
exemplary purposes, we will call the PyTorch model to be added to 🤗 Transformers
`BrandNewBert`.
@@ -128,12 +128,12 @@ model.config # model has access to its config
Similar to the model, the configuration inherits basic serialization and
deserialization functionalities from
-`PretrainedConfig`. Note
+`PreTrainedConfig`. Note
that the configuration and the model are always serialized into two
different formats - the model to a `pytorch_model.bin` file
and the configuration to a `config.json` file. Calling
`PreTrainedModel.save_pretrained` will automatically call
-`PretrainedConfig.save_pretrained`, so that both model and configuration are saved.
+`PreTrainedConfig.save_pretrained`, so that both model and configuration are saved.
### Overview of tokenizers
diff --git a/templates/adding_a_new_model/open_model_proposals/ADD_BIG_BIRD.md b/templates/adding_a_new_model/open_model_proposals/ADD_BIG_BIRD.md
index 02c9fa32a23..476c4fe3edf 100644
--- a/templates/adding_a_new_model/open_model_proposals/ADD_BIG_BIRD.md
+++ b/templates/adding_a_new_model/open_model_proposals/ADD_BIG_BIRD.md
@@ -67,7 +67,7 @@ design.
To successfully add a model, it is important to understand the
interaction between your model and its config,
-`PreTrainedModel`, and `PretrainedConfig`. For
+`PreTrainedModel`, and `PreTrainedConfig`. For
exemplary purposes, we will call the PyTorch model to be added to 🤗 Transformers
`BrandNewBert`.
@@ -110,12 +110,12 @@ model.config # model has access to its config
Similar to the model, the configuration inherits basic serialization and
deserialization functionalities from
-`PretrainedConfig`. Note
+`PreTrainedConfig`. Note
that the configuration and the model are always serialized into two
different formats - the model to a `pytorch_model.bin` file
and the configuration to a `config.json` file. Calling
`PreTrainedModel.save_pretrained` will automatically call
-`PretrainedConfig.save_pretrained`, so that both model and configuration are saved.
+`PreTrainedConfig.save_pretrained`, so that both model and configuration are saved.
### Overview of tokenizers
diff --git a/tests/causal_lm_tester.py b/tests/causal_lm_tester.py
index a6f98c2aca3..577359e22ca 100644
--- a/tests/causal_lm_tester.py
+++ b/tests/causal_lm_tester.py
@@ -18,7 +18,7 @@ from inspect import signature
import pytest
from parameterized import parameterized
-from transformers import AutoModelForCausalLM, PretrainedConfig, set_seed
+from transformers import AutoModelForCausalLM, PreTrainedConfig, set_seed
from transformers.models.auto.auto_factory import getattribute_from_module
from transformers.testing_utils import (
_COMMON_MODEL_NAMES_MAP,
@@ -87,7 +87,7 @@ class CausalLMModelTester:
pass
else:
if tester_attribute_name == "config_class":
- if "PretrainedConfig" not in str(getattr(cls, tester_attribute_name).__mro__):
+ if "PreTrainedConfig" not in str(getattr(cls, tester_attribute_name).__mro__):
raise ValueError(
f"You have inherited from `CausalLMModelTester` but did not set the "
f"`{tester_attribute_name}` attribute to a valid config class. (It's set to "
@@ -572,7 +572,7 @@ class CausalLMModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterM
_ = model(**inputs_dict, return_dict=False)
-def _config_supports_rope_scaling(config: PretrainedConfig) -> bool:
+def _config_supports_rope_scaling(config: PreTrainedConfig) -> bool:
"""Returns whether a certain model config supports RoPE scaling parameterization."""
# Has rope_scaling -> model was designed with rope scaling in mind
# Has rope_theta (and no rope_scaling) -> probably an older model, but should support rope scaling as well
diff --git a/tests/models/auto/test_tokenization_auto.py b/tests/models/auto/test_tokenization_auto.py
index 67396312941..3e92073efd2 100644
--- a/tests/models/auto/test_tokenization_auto.py
+++ b/tests/models/auto/test_tokenization_auto.py
@@ -463,9 +463,9 @@ class NopTokenizer(transformers.PreTrainedTokenizer):
"""
nop_config_code = """
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
-class NopConfig(PretrainedConfig):
+class NopConfig(PreTrainedConfig):
model_type = "test_unregistered_dynamic"
def __init__(self, **kwargs):
diff --git a/tests/models/dia/test_modeling_dia.py b/tests/models/dia/test_modeling_dia.py
index 83eaf0e336f..8c2baf3d174 100644
--- a/tests/models/dia/test_modeling_dia.py
+++ b/tests/models/dia/test_modeling_dia.py
@@ -48,7 +48,7 @@ if is_torch_available():
DiaForConditionalGeneration,
DiaModel,
DiaProcessor,
- PretrainedConfig,
+ PreTrainedConfig,
PreTrainedModel,
)
from transformers.cache_utils import (
@@ -438,7 +438,7 @@ class DiaModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin,
else:
model_sdpa = model_class.from_pretrained(tmpdirname, attn_implementation="sdpa")
for key in model_sdpa.config:
- if isinstance(getattr(model_sdpa.config, key), PretrainedConfig):
+ if isinstance(getattr(model_sdpa.config, key), PreTrainedConfig):
sub_config = getattr(model_sdpa.config, key)
self.assertTrue(sub_config._attn_implementation == "sdpa")
diff --git a/tests/models/moshi/test_modeling_moshi.py b/tests/models/moshi/test_modeling_moshi.py
index 06f81f3ef79..fda066c00dc 100644
--- a/tests/models/moshi/test_modeling_moshi.py
+++ b/tests/models/moshi/test_modeling_moshi.py
@@ -25,7 +25,7 @@ from parameterized import parameterized
from transformers import (
MoshiConfig,
- PretrainedConfig,
+ PreTrainedConfig,
)
from transformers.integrations.deepspeed import (
is_deepspeed_available,
@@ -71,7 +71,7 @@ def _config_zero_init(config):
for key in configs_no_init.__dict__:
if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
setattr(configs_no_init, key, 1e-10)
- if isinstance(getattr(configs_no_init, key, None), PretrainedConfig):
+ if isinstance(getattr(configs_no_init, key, None), PreTrainedConfig):
no_init_subconfig = _config_zero_init(getattr(configs_no_init, key))
setattr(configs_no_init, key, no_init_subconfig)
return configs_no_init
diff --git a/tests/models/musicgen/test_modeling_musicgen.py b/tests/models/musicgen/test_modeling_musicgen.py
index e5f41ca358d..6902c7b65cb 100644
--- a/tests/models/musicgen/test_modeling_musicgen.py
+++ b/tests/models/musicgen/test_modeling_musicgen.py
@@ -29,7 +29,7 @@ from transformers import (
MusicgenConfig,
MusicgenDecoderConfig,
MusicgenProcessor,
- PretrainedConfig,
+ PreTrainedConfig,
T5Config,
)
from transformers.testing_utils import (
@@ -67,7 +67,7 @@ def _config_zero_init(config):
for key in configs_no_init.__dict__:
if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
setattr(configs_no_init, key, 1e-10)
- if isinstance(getattr(configs_no_init, key, None), PretrainedConfig):
+ if isinstance(getattr(configs_no_init, key, None), PreTrainedConfig):
no_init_subconfig = _config_zero_init(getattr(configs_no_init, key))
setattr(configs_no_init, key, no_init_subconfig)
return configs_no_init
diff --git a/tests/models/musicgen_melody/test_modeling_musicgen_melody.py b/tests/models/musicgen_melody/test_modeling_musicgen_melody.py
index 6f5f8728dba..d0335e93415 100644
--- a/tests/models/musicgen_melody/test_modeling_musicgen_melody.py
+++ b/tests/models/musicgen_melody/test_modeling_musicgen_melody.py
@@ -28,7 +28,7 @@ from transformers import (
EncodecConfig,
MusicgenMelodyConfig,
MusicgenMelodyDecoderConfig,
- PretrainedConfig,
+ PreTrainedConfig,
T5Config,
)
from transformers.testing_utils import (
@@ -72,7 +72,7 @@ def _config_zero_init(config):
for key in configs_no_init.__dict__:
if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
setattr(configs_no_init, key, 1e-10)
- if isinstance(getattr(configs_no_init, key, None), PretrainedConfig):
+ if isinstance(getattr(configs_no_init, key, None), PreTrainedConfig):
no_init_subconfig = _config_zero_init(getattr(configs_no_init, key))
setattr(configs_no_init, key, no_init_subconfig)
return configs_no_init
diff --git a/tests/models/timm_backbone/test_modeling_timm_backbone.py b/tests/models/timm_backbone/test_modeling_timm_backbone.py
index aafcb141db7..b3b77b8a9df 100644
--- a/tests/models/timm_backbone/test_modeling_timm_backbone.py
+++ b/tests/models/timm_backbone/test_modeling_timm_backbone.py
@@ -90,7 +90,7 @@ class TimmBackboneModelTest(ModelTesterMixin, BackboneTesterMixin, PipelineTeste
has_attentions = False
def setUp(self):
- # self.config_class = PretrainedConfig
+ # self.config_class = PreTrainedConfig
self.config_class = TimmBackboneConfig
self.model_tester = TimmBackboneModelTester(self)
self.config_tester = ConfigTester(
diff --git a/tests/models/vits/test_modeling_vits.py b/tests/models/vits/test_modeling_vits.py
index f45382e7ce9..22837ef175e 100644
--- a/tests/models/vits/test_modeling_vits.py
+++ b/tests/models/vits/test_modeling_vits.py
@@ -20,7 +20,7 @@ import unittest
import numpy as np
-from transformers import PretrainedConfig, VitsConfig
+from transformers import PreTrainedConfig, VitsConfig
from transformers.testing_utils import (
Expectations,
is_flaky,
@@ -58,7 +58,7 @@ def _config_zero_init(config):
for key in configs_no_init.__dict__:
if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
setattr(configs_no_init, key, 1e-10)
- if isinstance(getattr(configs_no_init, key, None), PretrainedConfig):
+ if isinstance(getattr(configs_no_init, key, None), PreTrainedConfig):
no_init_subconfig = _config_zero_init(getattr(configs_no_init, key))
setattr(configs_no_init, key, no_init_subconfig)
return configs_no_init
diff --git a/tests/repo_utils/test_tests_fetcher.py b/tests/repo_utils/test_tests_fetcher.py
index 0a7917e6033..4fcb86127b4 100644
--- a/tests/repo_utils/test_tests_fetcher.py
+++ b/tests/repo_utils/test_tests_fetcher.py
@@ -130,7 +130,7 @@ def create_tmp_repo(tmp_dir, models=None):
with open(model_dir / "__init__.py", "w") as f:
f.write(f"from .configuration_{model} import {cls}Config\nfrom .modeling_{model} import {cls}Model\n")
with open(model_dir / f"configuration_{model}.py", "w") as f:
- f.write("from ...configuration_utils import PretrainedConfig\ncode")
+ f.write("from ...configuration_utils import PreTrainedConfig\ncode")
with open(model_dir / f"modeling_{model}.py", "w") as f:
modeling_code = BERT_MODEL_FILE.replace("bert", model).replace("Bert", cls)
f.write(modeling_code)
@@ -638,7 +638,7 @@ src/transformers/configuration_utils.py
with open(model_dir / "__init__.py", "w") as f:
f.write("from .configuration_t5 import T5Config\nfrom .modeling_t5 import T5Model\n")
with open(model_dir / "configuration_t5.py", "w") as f:
- f.write("from ...configuration_utils import PretrainedConfig\ncode")
+ f.write("from ...configuration_utils import PreTrainedConfig\ncode")
with open(model_dir / "modeling_t5.py", "w") as f:
modeling_code = BERT_MODEL_FILE.replace("bert", "t5").replace("Bert", "T5")
f.write(modeling_code)
diff --git a/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py b/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py
index 525b63f1bc8..a5e81a93c83 100644
--- a/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py
+++ b/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py
@@ -33,7 +33,7 @@ from transformers import (
DataCollatorWithPadding,
EvalPrediction,
HfArgumentParser,
- PretrainedConfig,
+ PreTrainedConfig,
default_data_collator,
set_seed,
)
@@ -353,7 +353,7 @@ def main():
# Some models have set the order of the labels to use, so let's make sure we do use it.
label_to_id = None
if (
- model.config.label2id != PretrainedConfig(num_labels=num_labels).label2id
+ model.config.label2id != PreTrainedConfig(num_labels=num_labels).label2id
and data_args.task_name is not None
and not is_regression
):
diff --git a/tests/test_modeling_common.py b/tests/test_modeling_common.py
index 0896c189932..e247d1ccc8f 100755
--- a/tests/test_modeling_common.py
+++ b/tests/test_modeling_common.py
@@ -34,7 +34,7 @@ from pytest import mark
from transformers import (
AutoModel,
AutoModelForSequenceClassification,
- PretrainedConfig,
+ PreTrainedConfig,
PreTrainedModel,
is_torch_available,
logging,
@@ -509,7 +509,7 @@ def _config_zero_init(config):
for key in configs_no_init.__dict__:
if "_range" in key or "_std" in key or "initializer_factor" in key or "layer_scale" in key:
setattr(configs_no_init, key, 1e-10)
- if isinstance(getattr(configs_no_init, key, None), PretrainedConfig):
+ if isinstance(getattr(configs_no_init, key, None), PreTrainedConfig):
no_init_subconfig = _config_zero_init(getattr(configs_no_init, key))
setattr(configs_no_init, key, no_init_subconfig)
return configs_no_init
@@ -3679,7 +3679,7 @@ class ModelTesterMixin:
tmpdirname, dtype=dtype, attn_implementation=attn_implementation
)
for key in model_fa.config:
- if isinstance(getattr(model_fa.config, key), PretrainedConfig):
+ if isinstance(getattr(model_fa.config, key), PreTrainedConfig):
sub_config = getattr(model_fa.config, key)
self.assertTrue(sub_config._attn_implementation == attn_implementation)
@@ -3967,7 +3967,7 @@ class ModelTesterMixin:
Test if model can be exported with torch.export.export()
Args:
- config (PretrainedConfig):
+ config (PreTrainedConfig):
Config to use for the model, if None, use default config from model_tester
inputs_dict (dict):
Inputs to use for the model, if None, use default inputs from model_tester
@@ -4246,14 +4246,14 @@ class ModelTesterMixin:
def test_config_attn_implementation_setter(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
- def check_attn_implementation_setter(config: PretrainedConfig, attn_implementation: str):
+ def check_attn_implementation_setter(config: PreTrainedConfig, attn_implementation: str):
if not config._attn_implementation == attn_implementation:
raise ValueError(
f"Unexpected attn_implementation for config {config.__class__.__name__}: "
f"{config._attn_implementation} != {attn_implementation}"
)
for attribute_value in config.__dict__.values():
- if isinstance(attribute_value, PretrainedConfig):
+ if isinstance(attribute_value, PreTrainedConfig):
check_attn_implementation_setter(attribute_value, attn_implementation)
config._attn_implementation = "eager"
diff --git a/tests/test_tokenization_common.py b/tests/test_tokenization_common.py
index 0be43774a85..fe8f3c2dccc 100644
--- a/tests/test_tokenization_common.py
+++ b/tests/test_tokenization_common.py
@@ -65,7 +65,7 @@ if is_torch_available():
if TYPE_CHECKING:
- from transformers import PretrainedConfig, PreTrainedModel
+ from transformers import PreTrainedConfig, PreTrainedModel
def use_cache_if_possible(func):
@@ -120,11 +120,11 @@ def filter_roberta_detectors(_, pretrained_name: str):
def merge_model_tokenizer_mappings(
- model_mapping: dict["PretrainedConfig", "PreTrainedModel"],
- tokenizer_mapping: dict["PretrainedConfig", tuple["PreTrainedTokenizer", "PreTrainedTokenizerFast"]],
+ model_mapping: dict["PreTrainedConfig", "PreTrainedModel"],
+ tokenizer_mapping: dict["PreTrainedConfig", tuple["PreTrainedTokenizer", "PreTrainedTokenizerFast"]],
) -> dict[
Union["PreTrainedTokenizer", "PreTrainedTokenizerFast"],
- tuple["PretrainedConfig", "PreTrainedModel"],
+ tuple["PreTrainedConfig", "PreTrainedModel"],
]:
configurations = list(model_mapping.keys())
model_tokenizer_mapping = OrderedDict([])
diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py
index 266a874b64b..4f66cdf8c0d 100644
--- a/tests/trainer/test_trainer.py
+++ b/tests/trainer/test_trainer.py
@@ -43,7 +43,7 @@ from transformers import (
AutoTokenizer,
DataCollatorForLanguageModeling,
IntervalStrategy,
- PretrainedConfig,
+ PreTrainedConfig,
TrainerCallback,
TrainingArguments,
default_data_collator,
@@ -351,7 +351,7 @@ class AlmostAccuracyBatched:
return result
-class RegressionModelConfig(PretrainedConfig):
+class RegressionModelConfig(PreTrainedConfig):
def __init__(self, a=0, b=0, double_output=False, random_torch=True, **kwargs):
super().__init__(**kwargs)
self.a = a
diff --git a/tests/utils/test_configuration_utils.py b/tests/utils/test_configuration_utils.py
index 069ca6729bb..304697f2e0b 100644
--- a/tests/utils/test_configuration_utils.py
+++ b/tests/utils/test_configuration_utils.py
@@ -24,7 +24,7 @@ from pathlib import Path
import httpx
from transformers import AutoConfig, BertConfig, Florence2Config, GPT2Config
-from transformers.configuration_utils import PretrainedConfig
+from transformers.configuration_utils import PreTrainedConfig
from transformers.testing_utils import TOKEN, TemporaryHubRepo, is_staging_test, require_torch
@@ -179,7 +179,7 @@ class ConfigTestUtils(unittest.TestCase):
self.assertEqual(summary_type, c.summary_type, "mismatch for key: summary_type")
def test_config_common_kwargs_is_complete(self):
- base_config = PretrainedConfig()
+ base_config = PreTrainedConfig()
missing_keys = [key for key in base_config.__dict__ if key not in config_common_kwargs]
# If this part of the test fails, you have arguments to add in config_common_kwargs above.
self.assertListEqual(
@@ -297,7 +297,7 @@ class ConfigTestUtils(unittest.TestCase):
# Loading config should not raise a FutureWarning. It was the case before.
with warnings.catch_warnings():
warnings.simplefilter("error")
- PretrainedConfig.from_pretrained("bert-base-uncased")
+ PreTrainedConfig.from_pretrained("bert-base-uncased")
def test_get_text_config(self):
"""Tests the `get_text_config` method."""
@@ -335,24 +335,24 @@ class ConfigTestUtils(unittest.TestCase):
def test_bc_torch_dtype(self):
import torch
- config = PretrainedConfig(dtype="bfloat16")
+ config = PreTrainedConfig(dtype="bfloat16")
self.assertEqual(config.dtype, torch.bfloat16)
- config = PretrainedConfig(torch_dtype="bfloat16")
+ config = PreTrainedConfig(torch_dtype="bfloat16")
self.assertEqual(config.dtype, torch.bfloat16)
# Check that if we pass both, `dtype` is used
- config = PretrainedConfig(dtype="bfloat16", torch_dtype="float32")
+ config = PreTrainedConfig(dtype="bfloat16", torch_dtype="float32")
self.assertEqual(config.dtype, torch.bfloat16)
with tempfile.TemporaryDirectory() as tmpdirname:
config.save_pretrained(tmpdirname)
- config = PretrainedConfig.from_pretrained(tmpdirname)
+ config = PreTrainedConfig.from_pretrained(tmpdirname)
self.assertEqual(config.dtype, torch.bfloat16)
- config = PretrainedConfig.from_pretrained(tmpdirname, dtype="float32")
+ config = PreTrainedConfig.from_pretrained(tmpdirname, dtype="float32")
self.assertEqual(config.dtype, "float32")
- config = PretrainedConfig.from_pretrained(tmpdirname, torch_dtype="float32")
+ config = PreTrainedConfig.from_pretrained(tmpdirname, torch_dtype="float32")
self.assertEqual(config.dtype, "float32")
diff --git a/tests/utils/test_generic.py b/tests/utils/test_generic.py
index f09d8653adf..1c2dd48582b 100644
--- a/tests/utils/test_generic.py
+++ b/tests/utils/test_generic.py
@@ -18,7 +18,7 @@ import warnings
import numpy as np
import pytest
-from transformers.configuration_utils import PretrainedConfig
+from transformers.configuration_utils import PreTrainedConfig
from transformers.modeling_outputs import BaseModelOutput, CausalLMOutputWithPast
from transformers.testing_utils import require_torch
from transformers.utils import (
@@ -250,7 +250,7 @@ class CanReturnTupleDecoratorTester(unittest.TestCase):
"""Test that the can_return_tuple decorator works with eager mode."""
# test nothing is set
- config = PretrainedConfig()
+ config = PreTrainedConfig()
model = self._get_model(config)
inputs = torch.tensor(10)
output = model(inputs)
@@ -261,7 +261,7 @@ class CanReturnTupleDecoratorTester(unittest.TestCase):
# test all explicit cases
for config_return_dict in [True, False, None]:
for return_dict in [True, False, None]:
- config = PretrainedConfig(return_dict=config_return_dict)
+ config = PreTrainedConfig(return_dict=config_return_dict)
model = self._get_model(config)
output = model(torch.tensor(10), return_dict=return_dict)
@@ -278,7 +278,7 @@ class CanReturnTupleDecoratorTester(unittest.TestCase):
@pytest.mark.torch_compile_test
def test_decorator_compiled(self):
"""Test that the can_return_tuple decorator works with compiled mode."""
- config = PretrainedConfig()
+ config = PreTrainedConfig()
# Output object
model = self._get_model(config)
@@ -295,13 +295,13 @@ class CanReturnTupleDecoratorTester(unittest.TestCase):
@pytest.mark.torch_export_test
def test_decorator_torch_export(self):
"""Test that the can_return_tuple decorator works with torch.export."""
- config = PretrainedConfig()
+ config = PreTrainedConfig()
model = self._get_model(config)
torch.export.export(model, args=(torch.tensor(10),))
def test_decorator_torchscript(self):
"""Test that the can_return_tuple decorator works with torch.jit.trace."""
- config = PretrainedConfig(return_dict=False)
+ config = PreTrainedConfig(return_dict=False)
model = self._get_model(config)
inputs = torch.tensor(10)
traced_module = torch.jit.trace(model, inputs)
@@ -311,7 +311,7 @@ class CanReturnTupleDecoratorTester(unittest.TestCase):
def test_attribute_cleanup(self):
"""Test that the `_is_top_level_module` attribute is removed after the forward call."""
- config = PretrainedConfig(return_dict=False)
+ config = PreTrainedConfig(return_dict=False)
inputs = torch.tensor(10)
# working case
diff --git a/tests/utils/test_modeling_utils.py b/tests/utils/test_modeling_utils.py
index ca55e59549b..9d72018aeeb 100644
--- a/tests/utils/test_modeling_utils.py
+++ b/tests/utils/test_modeling_utils.py
@@ -51,7 +51,7 @@ from transformers import (
OPTConfig,
OPTForCausalLM,
OwlViTForObjectDetection,
- PretrainedConfig,
+ PreTrainedConfig,
T5Config,
T5ForConditionalGeneration,
is_torch_available,
@@ -128,7 +128,7 @@ if is_torch_available():
# Fake pretrained models for tests
class BaseModel(PreTrainedModel):
base_model_prefix = "base"
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
def __init__(self, config):
super().__init__(config)
@@ -140,7 +140,7 @@ if is_torch_available():
class BaseModelWithUnexpectedKeys(PreTrainedModel):
base_model_prefix = "base"
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
_keys_to_ignore_on_load_unexpected = [r"^mtp.*"]
def __init__(self, config):
@@ -153,7 +153,7 @@ if is_torch_available():
class BaseModelWithMissingKeys(PreTrainedModel):
base_model_prefix = "base"
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
_keys_to_ignore_on_load_missing = [r"^linear"]
def __init__(self, config):
@@ -165,7 +165,7 @@ if is_torch_available():
return self.linear_2(self.linear(x))
class BaseModelWithTiedWeights(PreTrainedModel):
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
def __init__(self, config):
super().__init__(config)
@@ -180,7 +180,7 @@ if is_torch_available():
class ModelWithHead(PreTrainedModel):
base_model_prefix = "base"
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
def _init_weights(self, module):
pass
@@ -197,7 +197,7 @@ if is_torch_available():
class ModelWithDirectParam(PreTrainedModel):
base_model_prefix = "base"
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
def _init_weights(self, module):
pass
@@ -213,7 +213,7 @@ if is_torch_available():
class ModelWithDirectParamSubmodule(PreTrainedModel):
base_model_prefix = "base"
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
def _init_weights(self, module):
pass
@@ -229,7 +229,7 @@ if is_torch_available():
class ModelWithHeadAndTiedWeights(PreTrainedModel):
base_model_prefix = "base"
- config_class = PretrainedConfig
+ config_class = PreTrainedConfig
def _init_weights(self, module):
pass
@@ -429,7 +429,7 @@ class ModelUtilsTest(TestCasePlus):
model_name = "google-bert/bert-base-uncased"
config = BertConfig.from_pretrained(model_name)
self.assertIsNotNone(config)
- self.assertIsInstance(config, PretrainedConfig)
+ self.assertIsInstance(config, PreTrainedConfig)
model = BertModel.from_pretrained(model_name)
model, loading_info = BertModel.from_pretrained(model_name, output_loading_info=True)
@@ -1242,7 +1242,7 @@ class ModelUtilsTest(TestCasePlus):
from accelerate import dispatch_model
device_map = {"submodule": "cpu", "linear": f"{torch_device}:0"}
- model = ModelWithDirectParamSubmodule(PretrainedConfig())
+ model = ModelWithDirectParamSubmodule(PreTrainedConfig())
dispatch_model(model, device_map)
with tempfile.TemporaryDirectory() as tmp_dir:
@@ -1255,7 +1255,7 @@ class ModelUtilsTest(TestCasePlus):
from accelerate import dispatch_model
device_map = {"base": f"{torch_device}:0", "linear": "cpu", "linear2": "cpu"}
- model = ModelWithHead(PretrainedConfig())
+ model = ModelWithHead(PreTrainedConfig())
dispatch_model(model, device_map)
transform_a = torch.nn.Linear(1, 1, bias=False)
@@ -1375,7 +1375,7 @@ class ModelUtilsTest(TestCasePlus):
torch.testing.assert_close(p1, p2)
def test_base_model_to_head_model_load(self):
- base_model = BaseModel(PretrainedConfig())
+ base_model = BaseModel(PreTrainedConfig())
with tempfile.TemporaryDirectory() as tmp_dir:
base_model.save_pretrained(tmp_dir, safe_serialization=False)
@@ -1398,7 +1398,7 @@ class ModelUtilsTest(TestCasePlus):
def test_tied_weights_reload(self):
# Base
- model = BaseModelWithTiedWeights(PretrainedConfig())
+ model = BaseModelWithTiedWeights(PreTrainedConfig())
with tempfile.TemporaryDirectory() as tmp_dir:
model.save_pretrained(tmp_dir)
@@ -1421,7 +1421,7 @@ class ModelUtilsTest(TestCasePlus):
self.assertListEqual(load_info["missing_keys"], ["decoder.bias"])
def test_unexpected_keys_warnings(self):
- model = ModelWithHead(PretrainedConfig())
+ model = ModelWithHead(PreTrainedConfig())
logger = logging.get_logger("transformers.modeling_utils")
with tempfile.TemporaryDirectory() as tmp_dir:
model.save_pretrained(tmp_dir)
@@ -1453,7 +1453,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
with LoggingLevel(logging.WARNING):
with CaptureLogger(logger) as cl:
- config_no_pad_token = PretrainedConfig()
+ config_no_pad_token = PreTrainedConfig()
config_no_pad_token.pad_token_id = None
model = ModelWithHead(config_no_pad_token)
input_ids = torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 0, 0]])
@@ -1464,7 +1464,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
with LoggingLevel(logging.WARNING):
with CaptureLogger(logger) as cl:
- config = PretrainedConfig()
+ config = PreTrainedConfig()
config.pad_token_id = 0
model = ModelWithHead(config)
input_ids = torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 0, 0]])
@@ -1476,7 +1476,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
with LoggingLevel(logging.WARNING):
with CaptureLogger(logger) as cl:
- config = PretrainedConfig()
+ config = PreTrainedConfig()
config.pad_token_id = 0
model = ModelWithHead(config)
input_ids = torch.tensor([[1, 345, 232, 328, 740, 140, 1695, 69, 6078, 2341, 25]])
@@ -1487,7 +1487,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
with LoggingLevel(logging.WARNING):
with CaptureLogger(logger) as cl:
- config = PretrainedConfig()
+ config = PreTrainedConfig()
config.pad_token_id = 0
model = ModelWithHead(config)
input_ids = torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 432, 5232]])
@@ -1498,7 +1498,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
with LoggingLevel(logging.WARNING):
with CaptureLogger(logger) as cl:
- config = PretrainedConfig()
+ config = PreTrainedConfig()
config.pad_token_id = 0
model = ModelWithHead(config)
input_ids = torch.tensor([[432, 345, 232, 328, 740, 140, 1695, 69, 6078, 0, 0]])
@@ -1509,7 +1509,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
with LoggingLevel(logging.WARNING):
with CaptureLogger(logger) as cl:
- config = PretrainedConfig()
+ config = PreTrainedConfig()
config.pad_token_id = 0
model = ModelWithHead(config)
input_ids = torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 0, 0]])
@@ -1521,7 +1521,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
with LoggingLevel(logging.WARNING):
with CaptureLogger(logger) as cl:
- config = PretrainedConfig()
+ config = PreTrainedConfig()
config.pad_token_id = 0
config.bos_token_id = config.pad_token_id
model = ModelWithHead(config)
@@ -1533,7 +1533,7 @@ class ModelUtilsTest(TestCasePlus):
logger.warning_once.cache_clear()
from torch._dynamo import config, testing
- config = PretrainedConfig()
+ config = PreTrainedConfig()
config.pad_token_id = 0
model = ModelWithHead(config)
input_ids = torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 432, 5232]])
@@ -1645,7 +1645,7 @@ class ModelUtilsTest(TestCasePlus):
def test_warning_for_beta_gamma_parameters(self):
logger = logging.get_logger("transformers.modeling_utils")
- config = PretrainedConfig()
+ config = PreTrainedConfig()
warning_msg_gamma = "`LayerNorm.gamma` -> `LayerNorm.weight`"
warning_msg_beta = "`LayerNorm.beta` -> `LayerNorm.bias`"
model = TestModelGammaBeta(config)
@@ -2014,13 +2014,13 @@ class ModelUtilsTest(TestCasePlus):
def test_config_class_attribute(self):
# custom configs
- class MyConfigA(PretrainedConfig):
+ class MyConfigA(PreTrainedConfig):
pass
- class MyConfigB(PretrainedConfig):
+ class MyConfigB(PreTrainedConfig):
pass
- class MyConfigC(PretrainedConfig):
+ class MyConfigC(PreTrainedConfig):
pass
# custom models
@@ -2048,7 +2048,7 @@ class ModelUtilsTest(TestCasePlus):
missing from the checkpoint, it will still be moved to cpu and initialized"""
temp = tempfile.TemporaryDirectory()
# Create dummy model
- model = BaseModelWithMissingKeys(PretrainedConfig())
+ model = BaseModelWithMissingKeys(PreTrainedConfig())
# Save the config
model.config.save_pretrained(temp.name)
@@ -2073,7 +2073,7 @@ class ModelUtilsTest(TestCasePlus):
temp = tempfile.TemporaryDirectory()
# Create dummy model
- model = BaseModelWithUnexpectedKeys(PretrainedConfig())
+ model = BaseModelWithUnexpectedKeys(PreTrainedConfig())
# Save the config
model.config.save_pretrained(temp.name)
@@ -2096,7 +2096,7 @@ class ModelUtilsTest(TestCasePlus):
temp = tempfile.TemporaryDirectory()
# Create dummy model
- model = BaseModelWithUnexpectedKeys(PretrainedConfig())
+ model = BaseModelWithUnexpectedKeys(PreTrainedConfig())
# Save the config
model.config.save_pretrained(temp.name)
@@ -2949,7 +2949,7 @@ class TestSaveAndLoadModelWithExtraState(TestCasePlus):
"""
def test_save_and_load_model_with_tensor_extra_state(self):
- class MyConfig(PretrainedConfig):
+ class MyConfig(PreTrainedConfig):
def __init__(self, **kwargs):
super().__init__(**kwargs)
@@ -2986,7 +2986,7 @@ class TestSaveAndLoadModelWithExtraState(TestCasePlus):
@mark.xfail(reason="save and from_pretrained currently only supports tensor extra_state")
def test_save_and_load_model_with_dict_extra_state(self):
- class MyConfig(PretrainedConfig):
+ class MyConfig(PreTrainedConfig):
def __init__(self, **kwargs):
super().__init__(**kwargs)
diff --git a/utils/check_config_attributes.py b/utils/check_config_attributes.py
index 7b7c3bd4502..9e857f250cb 100644
--- a/utils/check_config_attributes.py
+++ b/utils/check_config_attributes.py
@@ -17,7 +17,7 @@ import inspect
import os
import re
-from transformers.configuration_utils import PretrainedConfig
+from transformers.configuration_utils import PreTrainedConfig
from transformers.utils import direct_transformers_import
@@ -434,7 +434,7 @@ def check_attribute_being_used(config_class, attributes, default_value, source_s
if not attribute_used:
case_allowed = False
for attribute in attributes:
- # Allow if the default value in the configuration class is different from the one in `PretrainedConfig`
+ # Allow if the default value in the configuration class is different from the one in `PreTrainedConfig`
if attribute == "is_encoder_decoder" and default_value is True:
case_allowed = True
elif attribute == "tie_word_embeddings" and default_value is False:
@@ -512,7 +512,7 @@ def check_config_attributes():
for name, cls in inspect.getmembers(
inspect.getmodule(_config_class),
lambda x: inspect.isclass(x)
- and issubclass(x, PretrainedConfig)
+ and issubclass(x, PreTrainedConfig)
and inspect.getmodule(x) == inspect.getmodule(_config_class),
)
]
diff --git a/utils/check_repo.py b/utils/check_repo.py
index 7d658a219f1..17f18659bd0 100644
--- a/utils/check_repo.py
+++ b/utils/check_repo.py
@@ -941,6 +941,7 @@ def find_all_documented_objects() -> list[str]:
# One good reason for not being documented is to be deprecated. Put in this list deprecated objects.
DEPRECATED_OBJECTS = [
+ "PretrainedConfig", # deprecated in favor of PreTrainedConfig
"AutoModelWithLMHead",
"BartPretrainedModel",
"DataCollator",
diff --git a/utils/create_dummy_models.py b/utils/create_dummy_models.py
index 4cdb30ff2b4..d05ea780017 100644
--- a/utils/create_dummy_models.py
+++ b/utils/create_dummy_models.py
@@ -1047,8 +1047,8 @@ def build(config_class, models_to_create, output_dir):
"""Create all models for a certain model type.
Args:
- config_class (`PretrainedConfig`):
- A subclass of `PretrainedConfig` that is used to determine `models_to_create`.
+ config_class (`PreTrainedConfig`):
+ A subclass of `PreTrainedConfig` that is used to determine `models_to_create`.
models_to_create (`dict`):
A dictionary containing the processor/model classes that we want to create the instances. These models are
of the same model type which is associated to `config_class`.
diff --git a/utils/modular_model_converter.py b/utils/modular_model_converter.py
index 18c3a729368..d32e1d2dbe7 100644
--- a/utils/modular_model_converter.py
+++ b/utils/modular_model_converter.py
@@ -1504,10 +1504,10 @@ def check_dependencies_and_create_import_node(
```
from ..llama.modeling_llama import LlamaModel
- class NewNameTextConfig(PretrainedConfig):
+ class NewNameTextConfig(PreTrainedConfig):
...
- class NewNameConfig(PretrainedConfig):
+ class NewNameConfig(PreTrainedConfig):
...
class NewNameModel(LlamaModel):
diff --git a/utils/test_module/custom_configuration.py b/utils/test_module/custom_configuration.py
index 4bb0fe6a15d..5efc4b94364 100644
--- a/utils/test_module/custom_configuration.py
+++ b/utils/test_module/custom_configuration.py
@@ -1,7 +1,7 @@
-from transformers import PretrainedConfig
+from transformers import PreTrainedConfig
-class CustomConfig(PretrainedConfig):
+class CustomConfig(PreTrainedConfig):
model_type = "custom"
def __init__(self, attribute=1, **kwargs):