From 36ca58bf4f44d0aeca38726269175732bfb701af Mon Sep 17 00:00:00 2001 From: NielsRogge <48327001+NielsRogge@users.noreply.github.com> Date: Mon, 5 May 2025 14:05:46 +0200 Subject: [PATCH] [D-FINE] Update names (#37957) * Update names * Fix modular --------- Co-authored-by: qubvel --- src/transformers/models/d_fine/configuration_d_fine.py | 2 +- src/transformers/models/d_fine/modeling_d_fine.py | 4 ++-- src/transformers/models/d_fine/modular_d_fine.py | 6 +++--- tests/models/d_fine/test_modeling_d_fine.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/transformers/models/d_fine/configuration_d_fine.py b/src/transformers/models/d_fine/configuration_d_fine.py index 7acd58c96a..8ca98e348b 100644 --- a/src/transformers/models/d_fine/configuration_d_fine.py +++ b/src/transformers/models/d_fine/configuration_d_fine.py @@ -33,7 +33,7 @@ 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_x_coco"](https://huggingface.co/ustc-community/dfine_x_coco"). + 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. diff --git a/src/transformers/models/d_fine/modeling_d_fine.py b/src/transformers/models/d_fine/modeling_d_fine.py index bd981b17c6..78b49cf2be 100644 --- a/src/transformers/models/d_fine/modeling_d_fine.py +++ b/src/transformers/models/d_fine/modeling_d_fine.py @@ -1790,8 +1790,8 @@ class DFineForObjectDetection(DFinePreTrainedModel): >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg" >>> image = load_image(url) - >>> image_processor = AutoImageProcessor.from_pretrained("ustc-community/dfine_x_coco") - >>> model = DFineForObjectDetection.from_pretrained("ustc-community/dfine_x_coco") + >>> image_processor = AutoImageProcessor.from_pretrained("ustc-community/dfine-xlarge-coco") + >>> model = DFineForObjectDetection.from_pretrained("ustc-community/dfine-xlarge-coco") >>> # prepare image for the model >>> inputs = image_processor(images=image, return_tensors="pt") diff --git a/src/transformers/models/d_fine/modular_d_fine.py b/src/transformers/models/d_fine/modular_d_fine.py index f4fd0992e4..9e8970ddc7 100644 --- a/src/transformers/models/d_fine/modular_d_fine.py +++ b/src/transformers/models/d_fine/modular_d_fine.py @@ -52,7 +52,7 @@ 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_x_coco"](https://huggingface.co/ustc-community/dfine_x_coco"). + 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. @@ -922,8 +922,8 @@ class DFineForObjectDetection(RTDetrForObjectDetection, DFinePreTrainedModel): >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg" >>> image = load_image(url) - >>> image_processor = AutoImageProcessor.from_pretrained("ustc-community/dfine_x_coco") - >>> model = DFineForObjectDetection.from_pretrained("ustc-community/dfine_x_coco") + >>> image_processor = AutoImageProcessor.from_pretrained("ustc-community/dfine-xlarge-coco") + >>> model = DFineForObjectDetection.from_pretrained("ustc-community/dfine-xlarge-coco") >>> # prepare image for the model >>> inputs = image_processor(images=image, return_tensors="pt") diff --git a/tests/models/d_fine/test_modeling_d_fine.py b/tests/models/d_fine/test_modeling_d_fine.py index 433db70df2..cbbe821c79 100644 --- a/tests/models/d_fine/test_modeling_d_fine.py +++ b/tests/models/d_fine/test_modeling_d_fine.py @@ -46,7 +46,7 @@ from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_ from ...test_pipeline_mixin import PipelineTesterMixin -CHECKPOINT = "ustc-community/dfine_s_coco" +CHECKPOINT = "ustc-community/dfine-small-coco" class DFineModelTester: