transformers/tests/models
NielsRogge 836921fdeb
Add UDOP (#22940)
* First draft

* More improvements

* More improvements

* More fixes

* Fix copies

* More improvements

* More fixes

* More improvements

* Convert checkpoint

* More improvements, set up tests

* Fix more tests

* Add UdopModel

* More improvements

* Fix equivalence test

* More fixes

* Redesign model

* Extend conversion script

* Use real inputs for conversion script

* Add image processor

* Improve conversion script

* Add UdopTokenizer

* Add fast tokenizer

* Add converter

* Update README's

* Add processor

* Add fully fledged tokenizer

* Add fast tokenizer

* Use processor in conversion script

* Add tokenizer tests

* Fix one more test

* Fix more tests

* Fix tokenizer tests

* Enable fast tokenizer tests

* Fix more tests

* Fix additional_special_tokens of fast tokenizer

* Fix tokenizer tests

* Fix more tests

* Fix equivalence test

* Rename image to pixel_values

* Rename seg_data to bbox

* More renamings

* Remove vis_special_token

* More improvements

* Add docs

* Fix copied from

* Update slow tokenizer

* Update fast tokenizer design

* Make text input optional

* Add first draft of processor tests

* Fix more processor tests

* Fix decoder_start_token_id

* Fix test_initialization

* Add integration test

* More improvements

* Improve processor, add test

* Add more copied from

* Add more copied from

* Add more copied from

* Add more copied from

* Remove print statement

* Update README and auto mapping

* Delete files

* Delete another file

* Remove code

* Fix test

* Fix docs

* Remove asserts

* Add doc tests

* Include UDOP in exotic model tests

* Add expected tesseract decodings

* Add sentencepiece

* Use same design as T5

* Add UdopEncoderModel

* Add UdopEncoderModel to tests

* More fixes

* Fix fast tokenizer

* Fix one more test

* Remove parallelisable attribute

* Fix copies

* Remove legacy file

* Copy from T5Tokenizer

* Fix rebase

* More fixes, copy from T5

* More fixes

* Fix init

* Use ArthurZ/udop for tests

* Make all model tests pass

* Remove UdopForConditionalGeneration from auto mapping

* Fix more tests

* fixups

* more fixups

* fix the tokenizers

* remove un-necessary changes

* nits

* nits

* replace truncate_sequences_boxes with truncate_sequences for fix-copies

* nit current path

* add a test for input ids

* ids that we should get taken from c9f7a32f57440d90ff79890270d376a1cc0acb68

* nits converting

* nits

* apply ruff

* nits

* nits

* style

* fix slow order of addition

* fix udop fast range as well

* fixup

* nits

* Add docstrings

* Fix gradient checkpointing

* Update code examples

* Skip tests

* Update integration test

* Address comment

* Make fixup

* Remove extra ids from tokenizer

* Skip test

* Apply suggestions from code review

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* Update year

* Address comment

* Address more comments

* Address comments

* Add copied from

* Update CI

* Rename script

* Update model id

* Add AddedToken, skip tests

* Update CI

* Fix doc tests

* Do not use Tesseract for the doc tests

* Remove kwargs

* Add original inputs

* Update casting

* Fix doc test

* Update question

* Update question

* Use LayoutLMv3ImageProcessor

* Update organization

* Improve docs

* Update forward signature

* Make images optional

* Remove deprecated device argument

* Add comment, add add_prefix_space

* More improvements

* Remove kwargs

---------

Co-authored-by: ArthurZucker <arthur.zucker@gmail.com>
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
2024-03-04 18:49:02 +01:00
..
albert Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
align
altclip [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
audio_spectrogram_transformer
auto Allow remote code repo names to contain "." (#29175) 2024-02-23 12:46:31 +00:00
autoformer
bark F.scaled_dot_product_attention support (#26572) 2023-12-09 05:38:14 +09:00
bart Replace build() with build_in_name_scope() for some TF tests (#28046) 2023-12-14 17:42:25 +00:00
barthez [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
bartpho
beit Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
bert Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
bert_generation Revert low cpu mem tie weights (#29135) 2024-02-20 12:06:46 +00:00
bert_japanese Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
bertweet
big_bird [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
bigbird_pegasus
biogpt
bit Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
blenderbot
blenderbot_small
blip Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
blip_2
bloom [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
bridgetower
bros
byt5 [Docs] Fix spelling and grammar mistakes (#28825) 2024-02-02 08:45:00 +01:00
camembert Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
canine [Docs] Fix spelling and grammar mistakes (#28825) 2024-02-02 08:45:00 +01:00
chinese_clip [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
clap
clip Add SiglipForImageClassification and CLIPForImageClassification (#28952) 2024-02-14 08:41:31 +01:00
clipseg Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
clvp CLVP Fixes (#27547) 2023-11-28 17:40:01 +01:00
code_llama [Docs] Fix spelling and grammar mistakes (#28825) 2024-02-02 08:45:00 +01:00
codegen
conditional_detr [YOLOS] Fix - return padded annotations (#29300) 2024-03-01 09:42:13 +00:00
convbert Add tf_keras imports to prepare for Keras 3 (#28588) 2024-01-30 17:26:36 +00:00
convnext Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
convnextv2 Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
cpm
cpmant
ctrl Add tf_keras imports to prepare for Keras 3 (#28588) 2024-01-30 17:26:36 +00:00
cvt Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
data2vec Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
deberta
deberta_v2 [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
decision_transformer
deformable_detr DeformableDETR support bfloat16 (#29232) 2024-03-04 14:18:09 +00:00
deit Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
depth_anything Add Depth Anything (#28654) 2024-01-25 09:34:50 +01:00
deta [YOLOS] Fix - return padded annotations (#29300) 2024-03-01 09:42:13 +00:00
detr [YOLOS] Fix - return padded annotations (#29300) 2024-03-01 09:42:13 +00:00
dinat Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
dinov2 Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
distilbert F.scaled_dot_product_attention support (#26572) 2023-12-09 05:38:14 +09:00
dit
donut Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
dpr Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
dpt Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
efficientformer Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
efficientnet Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
electra
encodec
encoder_decoder Generate: missing generation config eos token setting in encoder-decoder tests (#29146) 2024-02-20 16:17:51 +00:00
ernie
ernie_m [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
esm FIX [quantization / ESM] Fix ESM 8bit / 4bit with bitsandbytes (#29329) 2024-03-01 03:01:53 +01:00
falcon F.scaled_dot_product_attention support (#26572) 2023-12-09 05:38:14 +09:00
fastspeech2_conformer Hotfix - make torchaudio get the correct version in torch_and_flax_job (#28899) 2024-02-06 21:00:42 +01:00
flaubert
flava Fix pos_mask application and update tests accordingly (#27892) 2024-01-05 12:36:10 +01:00
fnet [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
focalnet Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
fsmt Revert low cpu mem tie weights (#29135) 2024-02-20 12:06:46 +00:00
funnel
fuyu Update tiny model summary file (#27388) 2023-11-23 21:00:39 +01:00
gemma Fix llama + gemma accelete tests (#29380) 2024-03-01 10:32:36 -05:00
git
glpn Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
gpt2 Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
gpt_bigcode
gpt_neo Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
gpt_neox [GPTNeoX] Fix BC issue with 4.36 (#28602) 2024-01-21 17:01:19 +00:00
gpt_neox_japanese [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
gpt_sw3 Remove token_type_ids from model_input_names (like #24788) (#28325) 2024-01-03 19:26:07 +01:00
gptj Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
gptsan_japanese [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
graphormer
groupvit Add tf_keras imports to prepare for Keras 3 (#28588) 2024-01-30 17:26:36 +00:00
herbert
hubert
ibert
idefics F.scaled_dot_product_attention support (#26572) 2023-12-09 05:38:14 +09:00
imagegpt Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
informer
instructblip [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
jukebox
kosmos2 Make image processors more general (#27690) 2023-12-05 10:45:39 +01:00
layoutlm
layoutlmv2 [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
layoutlmv3 [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
layoutxlm [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
led
levit Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
lilt
llama Fix llama + gemma accelete tests (#29380) 2024-03-01 10:32:36 -05:00
llava Fix _merge_input_ids_with_image_features for llava model (#28333) 2024-01-10 08:33:33 +01:00
longformer Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
longt5 Byebye torch 1.10 (#28207) 2024-01-11 16:18:27 +01:00
luke
lxmert [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
m2m_100 [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
marian Revert low cpu mem tie weights (#29135) 2024-02-20 12:06:46 +00:00
markuplm Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
mask2former Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
maskformer Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
mbart
mbart50 [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
mega fix / skip (for now) some tests before switch to torch 2.2 (#28838) 2024-02-02 14:11:50 +01:00
megatron_bert
megatron_gpt2
mgp_str Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
mistral Flax mistral (#26943) 2024-01-31 14:19:02 +01:00
mixtral Exclude the load balancing loss of padding tokens in Mixtral-8x7B (#28517) 2024-01-24 10:12:14 +01:00
mluke
mobilebert Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
mobilenet_v1 Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
mobilenet_v2 Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
mobilevit Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
mobilevitv2 Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
mpnet Fix TF loading PT safetensors when weights are tied (#27490) 2023-12-07 14:28:53 +00:00
mpt Fix building alibi tensor when num_heads is not a power of 2 (#28380) 2024-01-08 10:39:40 +01:00
mra
mt5 Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
musicgen Revert low cpu mem tie weights (#29135) 2024-02-20 12:06:46 +00:00
mvp [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
nat Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
nezha
nllb [NllbTokenizer] refactor with added tokens decoder (#27717) 2024-02-13 03:49:20 +01:00
nllb_moe fix assisted decoding assistant model inputs (#27503) 2023-11-27 14:23:54 +00:00
nougat
nystromformer
oneformer Fix OneFormer post_process_instance_segmentation for panoptic tasks (#29304) 2024-03-04 11:04:49 +00:00
openai Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
opt Proper build() methods for TF (#27794) 2023-12-14 15:17:30 +00:00
owlv2 Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
owlvit Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
patchtsmixer PatchtTST and PatchTSMixer fixes (#28083) 2024-01-29 10:09:26 +00:00
patchtst PatchtTST and PatchTSMixer fixes (#28083) 2024-01-29 10:09:26 +00:00
pegasus [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
pegasus_x
perceiver Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
persimmon Fix device of masks in tests (#27887) 2023-12-07 21:34:43 +09:00
phi [Phi] Extend implementation to use GQA/MQA. (#28163) 2024-01-11 15:58:02 +01:00
phobert
pix2struct Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
plbart
poolformer Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
pop2piano Byebye torch 1.10 (#28207) 2024-01-11 16:18:27 +01:00
prophetnet
pvt Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
qdqbert Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
qwen2 [Docs] Fix spelling and grammar mistakes (#28825) 2024-02-02 08:45:00 +01:00
rag Even more TF test fixes (#28146) 2023-12-21 15:14:46 +00:00
realm Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
reformer Revert low cpu mem tie weights (#29135) 2024-02-20 12:06:46 +00:00
regnet Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
rembert Added test cases for rembert refering to albert and reformer test_tok… (#27637) 2023-12-04 13:36:57 +01:00
resnet Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
roberta Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
roberta_prelayernorm Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
roc_bert
roformer [TokenizationRoformerFast] Fix the save and loading (#28527) 2024-01-16 16:37:15 +01:00
rwkv
sam Add tf_keras imports to prepare for Keras 3 (#28588) 2024-01-30 17:26:36 +00:00
seamless_m4t [Core tokenization] add_dummy_prefix_space option to help with latest issues (#28010) 2024-02-20 12:50:31 +01:00
seamless_m4t_v2 Fix languages covered by M4Tv2 (#28019) 2023-12-14 14:43:44 +00:00
segformer Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
seggpt Adding SegGPT (#27735) 2024-02-26 18:17:19 +00:00
sew
sew_d
siglip Add SiglipForImageClassification and CLIPForImageClassification (#28952) 2024-02-14 08:41:31 +01:00
speech_encoder_decoder Generate: missing generation config eos token setting in encoder-decoder tests (#29146) 2024-02-20 16:17:51 +00:00
speech_to_text [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
speech_to_text_2 Fix TF loading PT safetensors when weights are tied (#27490) 2023-12-07 14:28:53 +00:00
speecht5 [SpeechT5Tokenization] Add copied from and fix the convert_tokens_to_string to match the fast decoding scheme (#28522) 2024-01-16 16:50:02 +01:00
splinter
squeezebert
stablelm support SDPA Attention in stablelm (#29106) 2024-02-21 13:12:49 +01:00
starcoder2 FIX [CI / starcoder2] Change starcoder2 path to correct one for slow tests (#29359) 2024-02-29 03:52:13 +01:00
swiftformer Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
swin Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
swin2sr Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
swinv2 Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
switch_transformers Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
t5 [Core tokenization] add_dummy_prefix_space option to help with latest issues (#28010) 2024-02-20 12:50:31 +01:00
table_transformer Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
tapas [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
time_series_transformer
timesformer Update forward signature test for vision models (#27681) 2023-11-27 15:48:17 +01:00
timm_backbone
trocr
tvlt
tvp Enable instantiating model with pretrained backbone weights (#28214) 2024-01-23 11:01:50 +00:00
udop Add UDOP (#22940) 2024-03-04 18:49:02 +01:00
umt5 Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
unispeech
unispeech_sat Byebye torch 1.10 (#28207) 2024-01-11 16:18:27 +01:00
univnet Skip UnivNetModelTest::test_multi_gpu_data_parallel_forward (#27912) 2023-12-11 09:17:37 +01:00
upernet Enable instantiating model with pretrained backbone weights (#28214) 2024-01-23 11:01:50 +00:00
videomae Update forward signature test for vision models (#27681) 2023-11-27 15:48:17 +01:00
vilt Avoid using uncessary get_values(MODEL_MAPPING) (#29362) 2024-02-29 17:19:17 +08:00
vipllava Fix _merge_input_ids_with_image_features for llava model (#28333) 2024-01-10 08:33:33 +01:00
vision_encoder_decoder Generate: missing generation config eos token setting in encoder-decoder tests (#29146) 2024-02-20 16:17:51 +00:00
vision_text_dual_encoder [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
visual_bert
vit Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
vit_hybrid Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
vit_mae Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
vit_msn Image Feature Extraction pipeline (#28216) 2024-02-05 14:50:07 +00:00
vitdet mark test_initialization as flaky in 2 model tests (#27906) 2023-12-08 14:54:32 +01:00
vitmatte Enable instantiating model with pretrained backbone weights (#28214) 2024-01-23 11:01:50 +00:00
vits fix / skip (for now) some tests before switch to torch 2.2 (#28838) 2024-02-02 14:11:50 +01:00
vivit
wav2vec2 Byebye torch 1.10 (#28207) 2024-01-11 16:18:27 +01:00
wav2vec2_bert Add new meta w2v2-conformer BERT-like model (#28165) 2024-01-18 13:37:34 +00:00
wav2vec2_conformer
wav2vec2_phoneme
wav2vec2_with_lm
wavlm Byebye torch 1.10 (#28207) 2024-01-11 16:18:27 +01:00
whisper 🚨🚨[Whisper Tok] Update integration test (#29368) 2024-03-01 09:22:31 +00:00
x_clip
xglm Fix TF loading PT safetensors when weights are tied (#27490) 2023-12-07 14:28:53 +00:00
xlm Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
xlm_prophetnet [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
xlm_roberta Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
xlm_roberta_xl Revert low cpu mem tie weights (#29135) 2024-02-20 12:06:46 +00:00
xlnet Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
xmod Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
yolos [YOLOS] Fix - return padded annotations (#29300) 2024-03-01 09:42:13 +00:00
yoso
__init__.py