Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
fc77bd6
First draft
NielsRogge Aug 2, 2021
177ad35
Style and remove mlm
NielsRogge Sep 6, 2021
c9b0064
Make forward pass work
NielsRogge Sep 6, 2021
df5be95
More improvements
NielsRogge Sep 6, 2021
66a42ee
More improvements
NielsRogge Sep 7, 2021
4d25043
Fix bug
NielsRogge Sep 7, 2021
381e0d1
More improvements
NielsRogge Sep 7, 2021
77bf795
More improvements
NielsRogge Sep 7, 2021
697af73
Add PerceiverTokenizer first draft
NielsRogge Sep 8, 2021
b98b1df
Improve conversion script
NielsRogge Sep 8, 2021
fef9208
More improvements
NielsRogge Sep 8, 2021
2e6055a
Make conversion script work for the encoder
NielsRogge Sep 8, 2021
0a10005
Make conversion script work with local pickle files
NielsRogge Sep 8, 2021
3b7e9ec
Style & quality, fix-copies
NielsRogge Sep 8, 2021
25de5e0
Add dummy input to conversion script
NielsRogge Sep 8, 2021
b223379
Add absolute position embeddings to TextPreProcessor
NielsRogge Sep 8, 2021
6d37915
Make forward pass of encoder work
NielsRogge Sep 9, 2021
ebb49a1
More improvements
NielsRogge Sep 10, 2021
43417c2
Move text preprocessor to separate script
NielsRogge Sep 10, 2021
d429cfd
More improvements
NielsRogge Sep 10, 2021
4188df2
More improvements
NielsRogge Sep 10, 2021
b15241d
Add post processor
NielsRogge Sep 10, 2021
5179d57
Make MLM model work
NielsRogge Sep 10, 2021
87f24c8
Style
NielsRogge Sep 10, 2021
db9ff20
Add PerceiverForMaskedLM
NielsRogge Sep 10, 2021
ab0981b
Add PerceiverImagePreprocessor
NielsRogge Sep 13, 2021
0ccdea9
Make style
NielsRogge Sep 13, 2021
0685088
Make PerceiverForImageClassification work
NielsRogge Sep 13, 2021
089f9a0
More improvements
NielsRogge Sep 14, 2021
e32cde7
More improvements
NielsRogge Sep 14, 2021
a49bf66
Use tokenizer in conversion script
NielsRogge Sep 14, 2021
6ab614c
Use PerceiverForMaskedLM in conversion script
NielsRogge Sep 14, 2021
a5e83e7
Define custom PerceiverModelOutput
NielsRogge Sep 14, 2021
6a0b8ff
Improve PerceiverAttention to make it work for both MLM and image cla…
NielsRogge Sep 14, 2021
7557b09
More improvements
NielsRogge Sep 14, 2021
1852416
More improvements
NielsRogge Sep 15, 2021
113f0ef
More improvements to the conversion script
NielsRogge Sep 15, 2021
0d5666a
Make conversion script work for both MLM and image classification
NielsRogge Sep 15, 2021
ef9dcdf
Add PerceiverFeatureExtractor
NielsRogge Sep 15, 2021
70fabe1
More improvements
NielsRogge Sep 15, 2021
24014aa
Style and quality
NielsRogge Sep 15, 2021
50ea770
Add center cropping
NielsRogge Sep 15, 2021
9f8d2ad
Fix bug
NielsRogge Sep 15, 2021
758b912
Small fix
NielsRogge Sep 15, 2021
f04a1d3
Add print statement
NielsRogge Sep 15, 2021
59260bf
Fix bug in image preprocessor
NielsRogge Sep 15, 2021
f9c65e9
Fix bug with conversion script
NielsRogge Sep 15, 2021
7269ce0
Make output position embeddings an nn.Parameter layer instead of nn.E…
NielsRogge Sep 15, 2021
436e467
Comment out print statements
NielsRogge Sep 16, 2021
a0881ca
Add position encoding classes
NielsRogge Sep 16, 2021
b63ffb5
More improvements
NielsRogge Sep 16, 2021
3eb3c11
Use position_encoding_kwargs
NielsRogge Sep 17, 2021
505d6cd
Add PerceiverForImageClassificationFourier
NielsRogge Sep 17, 2021
4b08c19
Make style & quality
NielsRogge Sep 17, 2021
e89774e
Add PerceiverForImageClassificationConvProcessing
NielsRogge Sep 17, 2021
1867093
Style & quality
NielsRogge Sep 17, 2021
df1b14b
Add flow model
NielsRogge Sep 18, 2021
7399cc8
Move processors to modeling file
NielsRogge Sep 20, 2021
9f18885
Make position encodings modular
NielsRogge Sep 20, 2021
ddf0e01
Make basic decoder use modular position encodings
NielsRogge Sep 20, 2021
4012143
Add PerceiverForOpticalFlow to conversion script
NielsRogge Sep 20, 2021
64099ac
Add AudioPreprocessor
NielsRogge Sep 21, 2021
5663621
Make it possible for the basic decoder to use Fourier position embedd…
NielsRogge Sep 21, 2021
3a66549
Add PerceiverForMultimodalAutoencoding
NielsRogge Sep 21, 2021
0cf0c46
Improve model for optical flow
NielsRogge Sep 22, 2021
03bd7e1
Improve _build_network_inputs method
NielsRogge Sep 22, 2021
4489c1e
Add print statement
NielsRogge Sep 22, 2021
f98a69d
Fix device issue
NielsRogge Sep 22, 2021
b0fbc00
Fix device of Fourier embeddings
NielsRogge Sep 23, 2021
87457b8
Add print statements for debugging
NielsRogge Sep 23, 2021
99befc5
Add another print statement
NielsRogge Sep 23, 2021
ce41b86
Add another print statement
NielsRogge Sep 23, 2021
371fb00
Add another print statement
NielsRogge Sep 23, 2021
9cfb336
Add another print statement
NielsRogge Sep 23, 2021
1c2fb11
Improve PerceiverAudioPreprocessor
NielsRogge Sep 24, 2021
3be52ae
Improve conversion script for multimodal modal
NielsRogge Sep 24, 2021
47f23d9
More improvements
NielsRogge Sep 24, 2021
1cbb13b
More improvements
NielsRogge Sep 25, 2021
ffa25df
Improve multimodal model
NielsRogge Sep 27, 2021
4f0404b
Make forward pass multimodal model work
NielsRogge Sep 28, 2021
57da1cc
More improvements
NielsRogge Sep 29, 2021
a292f21
Improve tests
NielsRogge Oct 6, 2021
8aa3144
Fix some more tests
NielsRogge Oct 6, 2021
6ffdf39
Add output dataclasses
NielsRogge Oct 6, 2021
0c9b51b
Make more tests pass
NielsRogge Oct 7, 2021
2e1af16
Add print statements for debuggin
NielsRogge Oct 7, 2021
a77d9fd
Add tests for image classification
NielsRogge Oct 7, 2021
49ab608
Add PerceiverClassifierOutput
NielsRogge Oct 7, 2021
96fe9d0
More improvements
NielsRogge Oct 7, 2021
82f9f45
Make more tests pass for the optical flow model
NielsRogge Oct 7, 2021
9543cc4
Make style & quality
NielsRogge Oct 7, 2021
d6f928c
Small improvements
NielsRogge Oct 7, 2021
a690266
Don't support training for optical flow model for now
NielsRogge Oct 11, 2021
85079ec
Fix _prepare_for_class for tests
NielsRogge Oct 11, 2021
4f8cb33
Make more tests pass, add some docs
NielsRogge Oct 12, 2021
dd6c5ce
Add multimodal model to tests
NielsRogge Oct 12, 2021
87cd3a9
Added output_size calculation for preprocessors
esceptico Oct 12, 2021
1fbb1e9
Fix tensor shape in OneHotPreprocessor test
esceptico Oct 12, 2021
7e89ecd
Added num_query_channels property for decoders
esceptico Oct 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ Flax), PyTorch, and/or TensorFlow.
+-----------------------------+----------------+----------------+-----------------+--------------------+--------------+
| Pegasus | ✅ | ✅ | ✅ | ✅ | ✅ |
+-----------------------------+----------------+----------------+-----------------+--------------------+--------------+
| Perceiver | ✅ | ❌ | ✅ | ❌ | ❌ |
+-----------------------------+----------------+----------------+-----------------+--------------------+--------------+
| ProphetNet | ✅ | ❌ | ✅ | ❌ | ❌ |
+-----------------------------+----------------+----------------+-----------------+--------------------+--------------+
| RAG | ✅ | ❌ | ✅ | ✅ | ❌ |
Expand Down Expand Up @@ -606,6 +608,7 @@ Flax), PyTorch, and/or TensorFlow.
model_doc/gpt_neo
model_doc/hubert
model_doc/pegasus
model_doc/perceiver
model_doc/phobert
model_doc/prophetnet
model_doc/rag
Expand Down
78 changes: 78 additions & 0 deletions docs/source/model_doc/perceiver.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
..
Copyright 2021 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, 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.

Perceiver
-----------------------------------------------------------------------------------------------------------------------

Overview
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Perceiver IO model was proposed in `Perceiver IO: A General Architecture for Structured Inputs & Outputs
<https://arxiv.org/abs/2107.14795>`__ by Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch,
Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, Olivier Hénaff, Matthew M.
Botvinick, Andrew Zisserman, Oriol Vinyals, João Carreira.

Perceiver IO is a generalization of `Perceiver <https://arxiv.org/abs/2103.03206>`__ to handle arbitrary outputs in
addition to arbitrary inputs. The original Perceiver only produced a single classification label. In addition to
classification labels, Perceiver IO can produce (for example) language, optical flow, and multimodal videos with audio.
This is done using the same building blocks as the original Perceiver. The computational complexity of Perceiver IO is
linear in the input and output size and the bulk of the processing occurs in the latent space, allowing us to process
inputs and outputs that are much larger than can be handled by standard Transformers. This means, for example,
Perceiver IO can do BERT-style masked language modeling directly using bytes instead of tokenized inputs.

The abstract from the paper is the following:

*The recently-proposed Perceiver model obtains good results on several domains (images, audio, multimodal, point
clouds) while scaling linearly in compute and memory with the input size. While the Perceiver supports many kinds of
inputs, it can only produce very simple outputs such as class scores. Perceiver IO overcomes this limitation without
sacrificing the original's appealing properties by learning to flexibly query the model's latent space to produce
outputs of arbitrary size and semantics. Perceiver IO still decouples model depth from data size and still scales
linearly with data size, but now with respect to both input and output sizes. The full Perceiver IO model achieves
strong results on tasks with highly structured output spaces, such as natural language and visual understanding,
StarCraft II, and multi-task and multi-modal domains. As highlights, Perceiver IO matches a Transformer-based BERT
baseline on the GLUE language benchmark without the need for input tokenization and achieves state-of-the-art
performance on Sintel optical flow estimation.*

Tips:

<INSERT TIPS ABOUT MODEL HERE>

This model was contributed by `<nielsr> <https://huggingface.co/nielsr>`__. The original code can be found `here
<https://github.com/deepmind/deepmind-research/tree/master/perceiver>`__.

PerceiverConfig
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.PerceiverConfig
:members:


PerceiverTokenizer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.PerceiverTokenizer
:members: build_inputs_with_special_tokens, get_special_tokens_mask,
create_token_type_ids_from_sequences, save_vocabulary


PerceiverModel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.PerceiverModel
:members: forward


PerceiverForMaskedLM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.PerceiverForMaskedLM
:members: forward
46 changes: 46 additions & 0 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
"models.mt5": ["MT5Config"],
"models.openai": ["OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenAIGPTConfig", "OpenAIGPTTokenizer"],
"models.pegasus": ["PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusConfig", "PegasusTokenizer"],
"models.perceiver": ["PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PerceiverConfig", "PerceiverTokenizer"],
"models.phobert": ["PhobertTokenizer"],
"models.prophetnet": ["PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ProphetNetConfig", "ProphetNetTokenizer"],
"models.rag": ["RagConfig", "RagRetriever", "RagTokenizer"],
Expand Down Expand Up @@ -456,6 +457,7 @@
_import_structure["models.detr"].append("DetrFeatureExtractor")
_import_structure["models.layoutlmv2"].append("LayoutLMv2FeatureExtractor")
_import_structure["models.layoutlmv2"].append("LayoutLMv2Processor")
_import_structure["models.perceiver"].append("PerceiverFeatureExtractor")
_import_structure["models.vit"].append("ViTFeatureExtractor")
else:
from .utils import dummy_vision_objects
Expand Down Expand Up @@ -526,6 +528,7 @@
_import_structure["modeling_utils"] = ["Conv1D", "PreTrainedModel", "apply_chunking_to_forward", "prune_layer"]

# PyTorch models structure

_import_structure["models.albert"].extend(
[
"ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
Expand Down Expand Up @@ -1036,6 +1039,27 @@
_import_structure["models.pegasus"].extend(
["PegasusForCausalLM", "PegasusForConditionalGeneration", "PegasusModel", "PegasusPreTrainedModel"]
)
_import_structure["models.perceiver"].extend(
[
"PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST",
"PerceiverAudioPreprocessor",
"PerceiverBasicDecoder",
"PerceiverClassificationDecoder",
"PerceiverForImageClassification",
"PerceiverForImageClassificationConvProcessing",
"PerceiverForImageClassificationFourier",
"PerceiverForMaskedLM",
"PerceiverForMultimodalAutoencoding",
"PerceiverForOpticalFlow",
"PerceiverImagePreprocessor",
"PerceiverLayer",
"PerceiverModel",
"PerceiverOneHotPreprocessor",
"PerceiverPreTrainedModel",
"PerceiverTextPostprocessor",
"PerceiverTextPreprocessor",
]
)
_import_structure["models.prophetnet"].extend(
[
"PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST",
Expand Down Expand Up @@ -2066,6 +2090,7 @@
from .models.mt5 import MT5Config
from .models.openai import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig, OpenAIGPTTokenizer
from .models.pegasus import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig, PegasusTokenizer
from .models.perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverTokenizer
from .models.phobert import PhobertTokenizer
from .models.prophetnet import PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ProphetNetConfig, ProphetNetTokenizer
from .models.rag import RagConfig, RagRetriever, RagTokenizer
Expand Down Expand Up @@ -2252,6 +2277,7 @@
from .models.deit import DeiTFeatureExtractor
from .models.detr import DetrFeatureExtractor
from .models.layoutlmv2 import LayoutLMv2FeatureExtractor, LayoutLMv2Processor
from .models.perceiver import PerceiverFeatureExtractor
from .models.vit import ViTFeatureExtractor
else:
from .utils.dummy_vision_objects import *
Expand All @@ -2269,6 +2295,7 @@
from .utils.dummy_timm_objects import *

if is_torch_available():

# Benchmarks
from .benchmark.benchmark import PyTorchBenchmark
from .benchmark.benchmark_args import PyTorchBenchmarkArguments
Expand Down Expand Up @@ -2740,6 +2767,25 @@
PegasusModel,
PegasusPreTrainedModel,
)
from .models.perceiver import (
PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST,
PerceiverAudioPreprocessor,
PerceiverBasicDecoder,
PerceiverClassificationDecoder,
PerceiverForImageClassification,
PerceiverForImageClassificationConvProcessing,
PerceiverForImageClassificationFourier,
PerceiverForMaskedLM,
PerceiverForMultimodalAutoencoding,
PerceiverForOpticalFlow,
PerceiverImagePreprocessor,
PerceiverLayer,
PerceiverModel,
PerceiverOneHotPreprocessor,
PerceiverPreTrainedModel,
PerceiverTextPostprocessor,
PerceiverTextPreprocessor,
)
from .models.prophetnet import (
PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST,
ProphetNetDecoder,
Expand Down
1 change: 1 addition & 0 deletions src/transformers/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
mt5,
openai,
pegasus,
perceiver,
phobert,
prophetnet,
rag,
Expand Down
3 changes: 3 additions & 0 deletions src/transformers/models/auto/configuration_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
[
# Add configs here
("fnet", "FNetConfig"),
("perceiver", "PerceiverConfig"),
("gptj", "GPTJConfig"),
("layoutlmv2", "LayoutLMv2Config"),
("beit", "BeitConfig"),
Expand Down Expand Up @@ -102,6 +103,7 @@
# Add archive maps here
("fnet", "FNET_PRETRAINED_CONFIG_ARCHIVE_MAP"),
("pegasus", "PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP"),
("perceiver", "PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP"),
("gptj", "GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP"),
("layoutlmv2", "LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP"),
("beit", "BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP"),
Expand Down Expand Up @@ -167,6 +169,7 @@
[
# Add full (and cased) model names here
("fnet", "FNet"),
("perceiver", "Perceiver"),
("gptj", "GPT-J"),
("beit", "BeiT"),
("rembert", "RemBERT"),
Expand Down
10 changes: 10 additions & 0 deletions src/transformers/models/auto/modeling_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
[
# Base model mapping
("fnet", "FNetModel"),
("perceiver", "PerceiverModel"),
("gptj", "GPTJModel"),
("layoutlmv2", "LayoutLMv2Model"),
("beit", "BeitModel"),
Expand Down Expand Up @@ -225,6 +226,14 @@
("vit", "ViTForImageClassification"),
("deit", ("DeiTForImageClassification", "DeiTForImageClassificationWithTeacher")),
("beit", "BeitForImageClassification"),
(
"perceiver",
(
"PerceiverForImageClassification",
"PerceiverForImageClassificationFourier",
"PerceiverForImageClassificationConvProcessing",
),
),
]
)

Expand All @@ -238,6 +247,7 @@
MODEL_FOR_MASKED_LM_MAPPING_NAMES = OrderedDict(
[
# Model for Masked LM mapping
("perceiver", "PerceiverForMaskedLM"),
("fnet", "FNetForMaskedLM"),
("rembert", "RemBertForMaskedLM"),
("roformer", "RoFormerForMaskedLM"),
Expand Down
84 changes: 84 additions & 0 deletions src/transformers/models/perceiver/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.

# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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 typing import TYPE_CHECKING

from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available, is_vision_available


_import_structure = {
"configuration_perceiver": ["PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PerceiverConfig"],
"tokenization_perceiver": ["PerceiverTokenizer"],
}

if is_vision_available():
_import_structure["feature_extraction_perceiver"] = ["PerceiverFeatureExtractor"]

if is_torch_available():
_import_structure["modeling_perceiver"] = [
"PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST",
"PerceiverAudioPreprocessor",
"PerceiverBasicDecoder",
"PerceiverClassificationDecoder",
"PerceiverForImageClassification",
"PerceiverForImageClassificationConvProcessing",
"PerceiverForImageClassificationFourier",
"PerceiverForMaskedLM",
"PerceiverForMultimodalAutoencoding",
"PerceiverForOpticalFlow",
"PerceiverImagePreprocessor",
"PerceiverLayer",
"PerceiverModel",
"PerceiverOneHotPreprocessor",
"PerceiverPreTrainedModel",
"PerceiverTextPostprocessor",
"PerceiverTextPreprocessor",
]


if TYPE_CHECKING:
from .configuration_perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig
from .tokenization_perceiver import PerceiverTokenizer

if is_vision_available():
from .feature_extraction_perceiver import PerceiverFeatureExtractor

if is_torch_available():
from .modeling_perceiver import (
PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST,
PerceiverAudioPreprocessor,
PerceiverBasicDecoder,
PerceiverClassificationDecoder,
PerceiverForImageClassification,
PerceiverForImageClassificationConvProcessing,
PerceiverForImageClassificationFourier,
PerceiverForMaskedLM,
PerceiverForMultimodalAutoencoding,
PerceiverForOpticalFlow,
PerceiverImagePreprocessor,
PerceiverLayer,
PerceiverModel,
PerceiverOneHotPreprocessor,
PerceiverPreTrainedModel,
PerceiverTextPostprocessor,
PerceiverTextPreprocessor,
)

else:
import sys

sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
Loading