Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsRogge committed Nov 3, 2021
1 parent f081790 commit 56fe5c0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,9 +2382,9 @@
from .models.detr import DetrFeatureExtractor
from .models.layoutlmv2 import LayoutLMv2FeatureExtractor, LayoutLMv2Processor
from .models.layoutxlm import LayoutXLMProcessor
from .models.perceiver import PerceiverFeatureExtractor
from .models.segformer import SegformerFeatureExtractor
from .models.vit import ViTFeatureExtractor
from .models.perceiver import PerceiverFeatureExtractor
else:
from .utils.dummy_vision_objects import *

Expand Down
9 changes: 8 additions & 1 deletion src/transformers/models/auto/modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,14 @@
("deit", ("DeiTForImageClassification", "DeiTForImageClassificationWithTeacher")),
("beit", "BeitForImageClassification"),
("segformer", "SegformerForImageClassification"),
("perceiver", ("PerceiverForImageClassification", "PerceiverForImageClassificationFourier", "PerceiverForImageClassificationConvProcessing")),
(
"perceiver",
(
"PerceiverForImageClassification",
"PerceiverForImageClassificationFourier",
"PerceiverForImageClassificationConvProcessing",
),
),
]
)

Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/perceiver/modeling_perceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ class PreTrainedModel

@add_start_docstrings_to_model_forward(PERCEIVER_INPUTS_DOCSTRING.format("(batch_size, sequence_length)"))
@add_code_sample_docstrings(
tokenizer_class=_TOKENIZER_FOR_DOC,
processor_class=_TOKENIZER_FOR_DOC,
checkpoint=_CHECKPOINT_FOR_DOC,
output_type=PerceiverModelOutput,
config_class=_CONFIG_FOR_DOC,
Expand Down Expand Up @@ -908,7 +908,7 @@ def __init__(self, config):

@add_start_docstrings_to_model_forward(PERCEIVER_INPUTS_DOCSTRING.format("batch_size, sequence_length"))
@add_code_sample_docstrings(
tokenizer_class=_TOKENIZER_FOR_DOC,
processor_class=_TOKENIZER_FOR_DOC,
checkpoint=_CHECKPOINT_FOR_DOC,
output_type=PerceiverMaskedLMOutput,
config_class=_CONFIG_FOR_DOC,
Expand Down
3 changes: 1 addition & 2 deletions tests/test_modeling_perceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
import copy
import inspect
import os
import random
import tempfile
import unittest
from typing import Dict, List, Tuple

import numpy as np

from transformers import PerceiverConfig
from transformers.file_utils import is_torch_available, is_vision_available
from transformers.file_utils import WEIGHTS_NAME, is_torch_available, is_vision_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

Expand Down

0 comments on commit 56fe5c0

Please sign in to comment.