Skip to content

Commit

Permalink
[Doc] Fix docbuilder - make BackboneMixin and `BackboneConfigMixi…
Browse files Browse the repository at this point in the history
…n` importable from `utils`. (#29002)

* Trigger doc build

* Test removing references

* Importable from utils

* Trigger another run on a new commit for testing
  • Loading branch information
amyeroberts authored and Ita Zaporozhets committed May 14, 2024
1 parent bcc2ae9 commit 265123d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/en/main_classes/backbones.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ rendered properly in your Markdown viewer.

A backbone is a model used for feature extraction for higher level computer vision tasks such as object detection and image classification. Transformers provides an [`AutoBackbone`] class for initializing a Transformers backbone from pretrained model weights, and two utility classes:

* [`~utils.backbone_utils.BackboneMixin`] enables initializing a backbone from Transformers or [timm](https://hf.co/docs/timm/index) and includes functions for returning the output features and indices.
* [`~utils.backbone_utils.BackboneConfigMixin`] sets the output features and indices of the backbone configuration.
* [`~utils.BackboneMixin`] enables initializing a backbone from Transformers or [timm](https://hf.co/docs/timm/index) and includes functions for returning the output features and indices.
* [`~utils.BackboneConfigMixin`] sets the output features and indices of the backbone configuration.

[timm](https://hf.co/docs/timm/index) models are loaded with the [`TimmBackbone`] and [`TimmBackboneConfig`] classes.

Expand All @@ -45,11 +45,11 @@ Backbones are supported for the following models:

## BackboneMixin

[[autodoc]] utils.backbone_utils.BackboneMixin
[[autodoc]] utils.BackboneMixin

## BackboneConfigMixin

[[autodoc]] utils.backbone_utils.BackboneConfigMixin
[[autodoc]] utils.BackboneConfigMixin

## TimmBackbone

Expand Down
1 change: 1 addition & 0 deletions src/transformers/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from packaging import version

from .. import __version__
from .backbone_utils import BackboneConfigMixin, BackboneMixin
from .constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD
from .doc import (
add_code_sample_docstrings,
Expand Down

0 comments on commit 265123d

Please sign in to comment.