From 1c70522e01cdf5fcc6ebda6c372ee0198d557c53 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Wed, 6 Mar 2024 10:50:18 +0100 Subject: [PATCH 01/13] [test_all] Remove static pretrained maps from the library's internals --- .../bertabs/modeling_bertabs.py | 4 - src/transformers/__init__.py | 1245 +++-------------- .../commands/add_new_model_like.py | 52 +- .../convert_pytorch_checkpoint_to_tf2.py | 50 - src/transformers/models/albert/__init__.py | 8 +- .../models/albert/configuration_albert.py | 12 - .../models/albert/modeling_albert.py | 13 - .../models/albert/modeling_tf_albert.py | 12 - .../models/albert/tokenization_albert.py | 25 - .../models/albert/tokenization_albert_fast.py | 35 - src/transformers/models/align/__init__.py | 4 - .../models/align/configuration_align.py | 4 - .../models/align/modeling_align.py | 6 - src/transformers/models/altclip/__init__.py | 4 - .../models/altclip/configuration_altclip.py | 5 - .../models/altclip/modeling_altclip.py | 5 - .../audio_spectrogram_transformer/__init__.py | 8 +- ...iguration_audio_spectrogram_transformer.py | 6 - .../modeling_audio_spectrogram_transformer.py | 6 - src/transformers/models/auto/__init__.py | 4 +- .../models/auto/configuration_auto.py | 232 --- .../models/autoformer/__init__.py | 8 +- .../autoformer/configuration_autoformer.py | 4 - .../models/autoformer/modeling_autoformer.py | 6 - src/transformers/models/bark/__init__.py | 4 - .../models/bark/configuration_bark.py | 5 - src/transformers/models/bark/modeling_bark.py | 6 - src/transformers/models/bart/__init__.py | 6 +- .../models/bart/configuration_bart.py | 5 - src/transformers/models/bart/modeling_bart.py | 6 - .../models/bart/tokenization_bart.py | 29 - .../models/bart/tokenization_bart_fast.py | 37 - .../models/barthez/tokenization_barthez.py | 17 - .../barthez/tokenization_barthez_fast.py | 24 - .../models/bartpho/tokenization_bartpho.py | 13 - src/transformers/models/beit/__init__.py | 6 +- .../models/beit/configuration_beit.py | 7 - src/transformers/models/beit/modeling_beit.py | 5 - src/transformers/models/bert/__init__.py | 8 +- .../models/bert/configuration_bert.py | 44 - src/transformers/models/bert/modeling_bert.py | 27 - .../models/bert/modeling_tf_bert.py | 24 - .../models/bert/tokenization_bert.py | 88 -- .../models/bert/tokenization_bert_fast.py | 132 -- .../tokenization_bert_generation.py | 12 - .../tokenization_bert_japanese.py | 48 - .../models/bertweet/tokenization_bertweet.py | 15 - src/transformers/models/big_bird/__init__.py | 6 +- .../models/big_bird/configuration_big_bird.py | 7 - .../models/big_bird/modeling_big_bird.py | 6 - .../models/big_bird/tokenization_big_bird.py | 20 - .../big_bird/tokenization_big_bird_fast.py | 31 - .../models/bigbird_pegasus/__init__.py | 4 - .../configuration_bigbird_pegasus.py | 13 - .../modeling_bigbird_pegasus.py | 8 - src/transformers/models/biogpt/__init__.py | 6 +- .../models/biogpt/configuration_biogpt.py | 5 - .../models/biogpt/modeling_biogpt.py | 7 - .../models/biogpt/tokenization_biogpt.py | 13 - src/transformers/models/bit/__init__.py | 6 +- .../models/bit/configuration_bit.py | 4 - src/transformers/models/bit/modeling_bit.py | 5 - .../models/blenderbot/__init__.py | 4 - .../blenderbot/configuration_blenderbot.py | 5 - .../models/blenderbot/modeling_blenderbot.py | 6 - .../blenderbot/tokenization_blenderbot.py | 12 - .../tokenization_blenderbot_fast.py | 12 - .../models/blenderbot_small/__init__.py | 4 - .../configuration_blenderbot_small.py | 5 - .../modeling_blenderbot_small.py | 6 - .../tokenization_blenderbot_small.py | 18 - .../tokenization_blenderbot_small_fast.py | 20 - src/transformers/models/blip/__init__.py | 7 +- .../models/blip/configuration_blip.py | 19 - src/transformers/models/blip/modeling_blip.py | 12 - .../models/blip/modeling_tf_blip.py | 12 - src/transformers/models/blip_2/__init__.py | 4 - .../models/blip_2/configuration_blip_2.py | 4 - .../models/blip_2/modeling_blip_2.py | 5 - src/transformers/models/bloom/__init__.py | 6 +- .../models/bloom/configuration_bloom.py | 9 - .../models/bloom/modeling_bloom.py | 10 - .../models/bloom/tokenization_bloom_fast.py | 13 - .../models/bridgetower/__init__.py | 4 - .../bridgetower/configuration_bridgetower.py | 7 - .../bridgetower/modeling_bridgetower.py | 6 - src/transformers/models/bros/__init__.py | 6 +- .../models/bros/configuration_bros.py | 5 - src/transformers/models/bros/modeling_bros.py | 5 - src/transformers/models/camembert/__init__.py | 8 +- .../camembert/configuration_camembert.py | 10 - .../models/camembert/modeling_camembert.py | 6 - .../models/camembert/modeling_tf_camembert.py | 4 - .../camembert/tokenization_camembert.py | 11 - .../camembert/tokenization_camembert_fast.py | 14 - src/transformers/models/canine/__init__.py | 6 +- .../models/canine/configuration_canine.py | 5 - .../models/canine/modeling_canine.py | 5 - .../models/canine/tokenization_canine.py | 6 - .../models/chinese_clip/__init__.py | 4 - .../configuration_chinese_clip.py | 6 - .../chinese_clip/modeling_chinese_clip.py | 5 - src/transformers/models/clap/__init__.py | 4 - .../models/clap/configuration_clap.py | 5 - src/transformers/models/clap/modeling_clap.py | 6 - src/transformers/models/clip/__init__.py | 6 - .../models/clip/configuration_clip.py | 5 - src/transformers/models/clip/modeling_clip.py | 5 - .../models/clip/modeling_tf_clip.py | 5 - .../models/clip/tokenization_clip.py | 20 - .../models/clip/tokenization_clip_fast.py | 20 - src/transformers/models/clipseg/__init__.py | 4 - .../models/clipseg/configuration_clipseg.py | 4 - .../models/clipseg/modeling_clipseg.py | 5 - src/transformers/models/clvp/__init__.py | 4 - .../models/clvp/configuration_clvp.py | 4 - src/transformers/models/clvp/modeling_clvp.py | 5 - .../models/clvp/tokenization_clvp.py | 15 - .../code_llama/tokenization_code_llama.py | 13 - src/transformers/models/codegen/__init__.py | 6 +- .../models/codegen/configuration_codegen.py | 16 - .../models/codegen/modeling_codegen.py | 17 - .../models/codegen/tokenization_codegen.py | 15 - .../codegen/tokenization_codegen_fast.py | 20 - .../models/conditional_detr/__init__.py | 4 - .../configuration_conditional_detr.py | 6 - .../modeling_conditional_detr.py | 5 - src/transformers/models/convbert/__init__.py | 8 +- .../models/convbert/configuration_convbert.py | 9 - .../models/convbert/modeling_convbert.py | 7 - .../models/convbert/modeling_tf_convbert.py | 7 - .../models/convbert/tokenization_convbert.py | 26 - .../convbert/tokenization_convbert_fast.py | 26 - src/transformers/models/convnext/__init__.py | 8 +- .../models/convnext/configuration_convnext.py | 5 - .../models/convnext/modeling_convnext.py | 5 - .../models/convnextv2/__init__.py | 10 +- .../convnextv2/configuration_convnextv2.py | 4 - .../models/convnextv2/modeling_convnextv2.py | 5 - .../convnextv2/modeling_tf_convnextv2.py | 5 - .../models/cpm/tokenization_cpm.py | 7 - .../models/cpm/tokenization_cpm_fast.py | 9 - src/transformers/models/cpmant/__init__.py | 6 +- .../models/cpmant/configuration_cpmant.py | 5 - .../models/cpmant/modeling_cpmant.py | 5 - .../models/cpmant/tokenization_cpmant.py | 12 - src/transformers/models/ctrl/__init__.py | 8 +- .../models/ctrl/configuration_ctrl.py | 4 - src/transformers/models/ctrl/modeling_ctrl.py | 5 - .../models/ctrl/modeling_tf_ctrl.py | 5 - .../models/ctrl/tokenization_ctrl.py | 10 - src/transformers/models/cvt/__init__.py | 8 +- .../models/cvt/configuration_cvt.py | 5 - src/transformers/models/cvt/modeling_cvt.py | 11 - .../models/cvt/modeling_tf_cvt.py | 10 - src/transformers/models/data2vec/__init__.py | 14 +- .../data2vec/configuration_data2vec_audio.py | 5 - .../data2vec/configuration_data2vec_text.py | 4 - .../data2vec/configuration_data2vec_vision.py | 6 - .../data2vec/modeling_data2vec_audio.py | 9 - .../models/data2vec/modeling_data2vec_text.py | 6 - .../data2vec/modeling_data2vec_vision.py | 5 - .../data2vec/modeling_tf_data2vec_vision.py | 5 - src/transformers/models/deberta/__init__.py | 8 +- .../models/deberta/configuration_deberta.py | 9 - .../models/deberta/modeling_deberta.py | 10 - .../models/deberta/modeling_tf_deberta.py | 5 - .../models/deberta/tokenization_deberta.py | 39 - .../deberta/tokenization_deberta_fast.py | 39 - .../models/deberta_v2/__init__.py | 7 +- .../deberta_v2/configuration_deberta_v2.py | 11 - .../models/deberta_v2/modeling_deberta_v2.py | 7 - .../deberta_v2/modeling_tf_deberta_v2.py | 5 - .../deberta_v2/tokenization_deberta_v2.py | 29 - .../tokenization_deberta_v2_fast.py | 30 - .../models/decision_transformer/__init__.py | 8 +- .../configuration_decision_transformer.py | 7 - .../modeling_decision_transformer.py | 5 - .../models/deformable_detr/__init__.py | 6 +- .../configuration_deformable_detr.py | 5 - .../modeling_deformable_detr.py | 5 - src/transformers/models/deit/__init__.py | 8 +- .../models/deit/configuration_deit.py | 7 - src/transformers/models/deit/modeling_deit.py | 6 - .../models/deit/modeling_tf_deit.py | 6 - .../models/deprecated/mctct/__init__.py | 7 +- .../deprecated/mctct/configuration_mctct.py | 5 - .../models/deprecated/mctct/modeling_mctct.py | 6 - .../models/deprecated/open_llama/__init__.py | 4 +- .../open_llama/configuration_open_llama.py | 4 - .../models/deprecated/retribert/__init__.py | 6 +- .../retribert/configuration_retribert.py | 7 - .../retribert/modeling_retribert.py | 5 - .../retribert/tokenization_retribert.py | 2 - .../retribert/tokenization_retribert_fast.py | 2 - .../deprecated/tapex/tokenization_tapex.py | 2 - .../trajectory_transformer/__init__.py | 8 +- .../configuration_trajectory_transformer.py | 7 - .../modeling_trajectory_transformer.py | 5 - .../models/deprecated/transfo_xl/__init__.py | 8 +- .../transfo_xl/configuration_transfo_xl.py | 4 - .../transfo_xl/modeling_tf_transfo_xl.py | 5 - .../transfo_xl/modeling_transfo_xl.py | 5 - .../transfo_xl/tokenization_transfo_xl.py | 11 - .../models/deprecated/van/__init__.py | 6 +- .../deprecated/van/configuration_van.py | 6 - .../models/deprecated/van/modeling_van.py | 5 - .../models/depth_anything/__init__.py | 8 +- .../configuration_depth_anything.py | 4 - .../depth_anything/modeling_depth_anything.py | 5 - src/transformers/models/deta/__init__.py | 6 +- .../models/deta/configuration_deta.py | 4 - src/transformers/models/deta/modeling_deta.py | 5 - src/transformers/models/detr/__init__.py | 6 +- .../models/detr/configuration_detr.py | 5 - src/transformers/models/detr/modeling_detr.py | 5 - src/transformers/models/dinat/__init__.py | 6 +- .../models/dinat/configuration_dinat.py | 5 - .../models/dinat/modeling_dinat.py | 5 - src/transformers/models/dinov2/__init__.py | 8 +- .../models/dinov2/configuration_dinov2.py | 4 - .../models/dinov2/modeling_dinov2.py | 6 - .../models/distilbert/__init__.py | 6 - .../distilbert/configuration_distilbert.py | 18 - .../models/distilbert/modeling_distilbert.py | 11 - .../distilbert/modeling_tf_distilbert.py | 10 - .../distilbert/tokenization_distilbert.py | 39 - .../tokenization_distilbert_fast.py | 55 - src/transformers/models/donut/__init__.py | 6 +- .../models/donut/configuration_donut_swin.py | 5 - .../models/donut/modeling_donut_swin.py | 5 - src/transformers/models/dpr/__init__.py | 16 +- .../models/dpr/configuration_dpr.py | 21 - src/transformers/models/dpr/modeling_dpr.py | 13 - .../models/dpr/modeling_tf_dpr.py | 13 - .../models/dpr/tokenization_dpr.py | 91 -- .../models/dpr/tokenization_dpr_fast.py | 91 -- src/transformers/models/dpt/__init__.py | 6 +- .../models/dpt/configuration_dpt.py | 5 - src/transformers/models/dpt/modeling_dpt.py | 7 - .../models/efficientformer/__init__.py | 13 +- .../configuration_efficientformer.py | 6 - .../modeling_efficientformer.py | 6 - .../modeling_tf_efficientformer.py | 6 - .../models/efficientnet/__init__.py | 4 - .../configuration_efficientnet.py | 4 - .../efficientnet/modeling_efficientnet.py | 5 - src/transformers/models/electra/__init__.py | 8 +- .../models/electra/configuration_electra.py | 15 - .../models/electra/modeling_electra.py | 10 - .../models/electra/modeling_tf_electra.py | 10 - .../models/electra/tokenization_electra.py | 43 - .../electra/tokenization_electra_fast.py | 62 - src/transformers/models/encodec/__init__.py | 8 +- .../models/encodec/configuration_encodec.py | 5 - .../models/encodec/modeling_encodec.py | 7 - src/transformers/models/ernie/__init__.py | 6 +- .../models/ernie/configuration_ernie.py | 13 - .../models/ernie/modeling_ernie.py | 15 - src/transformers/models/ernie_m/__init__.py | 6 +- .../models/ernie_m/configuration_ernie_m.py | 6 - .../models/ernie_m/modeling_ernie_m.py | 6 - .../models/ernie_m/tokenization_ernie_m.py | 24 - src/transformers/models/esm/__init__.py | 8 +- .../models/esm/configuration_esm.py | 4 - src/transformers/models/esm/modeling_esm.py | 7 - .../models/esm/modeling_tf_esm.py | 7 - .../models/esm/tokenization_esm.py | 14 - src/transformers/models/falcon/__init__.py | 6 +- .../models/falcon/configuration_falcon.py | 5 - .../models/falcon/modeling_falcon.py | 8 - .../models/fastspeech2_conformer/__init__.py | 8 - .../configuration_fastspeech2_conformer.py | 13 - .../modeling_fastspeech2_conformer.py | 5 - .../tokenization_fastspeech2_conformer.py | 14 - src/transformers/models/flaubert/__init__.py | 8 +- .../models/flaubert/configuration_flaubert.py | 7 - .../models/flaubert/modeling_flaubert.py | 8 - .../models/flaubert/modeling_tf_flaubert.py | 3 - .../models/flaubert/tokenization_flaubert.py | 44 - src/transformers/models/flava/__init__.py | 4 - .../models/flava/configuration_flava.py | 4 - .../models/flava/modeling_flava.py | 5 - src/transformers/models/fnet/__init__.py | 6 +- .../models/fnet/configuration_fnet.py | 6 - src/transformers/models/fnet/modeling_fnet.py | 6 - .../models/fnet/tokenization_fnet.py | 13 - .../models/fnet/tokenization_fnet_fast.py | 17 - src/transformers/models/focalnet/__init__.py | 6 +- .../models/focalnet/configuration_focalnet.py | 4 - .../models/focalnet/modeling_focalnet.py | 6 - src/transformers/models/fsmt/__init__.py | 4 +- .../models/fsmt/configuration_fsmt.py | 2 - .../models/fsmt/tokenization_fsmt.py | 23 - src/transformers/models/funnel/__init__.py | 8 +- .../models/funnel/configuration_funnel.py | 17 - .../models/funnel/modeling_funnel.py | 12 - .../models/funnel/modeling_tf_funnel.py | 12 - .../models/funnel/tokenization_funnel.py | 28 - .../models/funnel/tokenization_funnel_fast.py | 52 - src/transformers/models/fuyu/__init__.py | 4 +- .../models/fuyu/configuration_fuyu.py | 4 - src/transformers/models/gemma/__init__.py | 4 +- .../models/gemma/configuration_gemma.py | 2 - src/transformers/models/git/__init__.py | 6 +- .../models/git/configuration_git.py | 4 - src/transformers/models/git/modeling_git.py | 5 - src/transformers/models/glpn/__init__.py | 6 +- .../models/glpn/configuration_glpn.py | 5 - src/transformers/models/glpn/modeling_glpn.py | 5 - src/transformers/models/gpt2/__init__.py | 8 +- .../models/gpt2/configuration_gpt2.py | 8 - src/transformers/models/gpt2/modeling_gpt2.py | 9 - .../models/gpt2/modeling_tf_gpt2.py | 9 - .../models/gpt2/tokenization_gpt2.py | 27 - .../models/gpt2/tokenization_gpt2_fast.py | 34 - .../models/gpt_bigcode/__init__.py | 6 +- .../gpt_bigcode/configuration_gpt_bigcode.py | 4 - .../gpt_bigcode/modeling_gpt_bigcode.py | 5 - src/transformers/models/gpt_neo/__init__.py | 6 +- .../models/gpt_neo/configuration_gpt_neo.py | 5 - .../models/gpt_neo/modeling_gpt_neo.py | 4 - src/transformers/models/gpt_neox/__init__.py | 6 +- .../models/gpt_neox/configuration_gpt_neox.py | 5 - .../models/gpt_neox/modeling_gpt_neox.py | 5 - .../gpt_neox/tokenization_gpt_neox_fast.py | 12 - .../models/gpt_neox_japanese/__init__.py | 6 +- .../configuration_gpt_neox_japanese.py | 4 - .../modeling_gpt_neox_japanese.py | 5 - .../tokenization_gpt_neox_japanese.py | 15 - .../models/gpt_sw3/tokenization_gpt_sw3.py | 24 - src/transformers/models/gptj/__init__.py | 6 +- .../models/gptj/configuration_gptj.py | 5 - src/transformers/models/gptj/modeling_gptj.py | 6 - .../models/gptj/modeling_tf_gptj.py | 5 - .../models/gptsan_japanese/__init__.py | 6 +- .../configuration_gptsan_japanese.py | 6 - .../modeling_gptsan_japanese.py | 4 - .../tokenization_gptsan_japanese.py | 15 - .../models/graphormer/__init__.py | 6 +- .../graphormer/configuration_graphormer.py | 6 - .../models/graphormer/modeling_graphormer.py | 7 - src/transformers/models/groupvit/__init__.py | 6 - .../models/groupvit/configuration_groupvit.py | 4 - .../models/groupvit/modeling_groupvit.py | 5 - .../models/groupvit/modeling_tf_groupvit.py | 5 - .../models/herbert/tokenization_herbert.py | 15 - .../herbert/tokenization_herbert_fast.py | 15 - src/transformers/models/hubert/__init__.py | 8 +- .../models/hubert/configuration_hubert.py | 5 - .../models/hubert/modeling_hubert.py | 6 - .../models/hubert/modeling_tf_hubert.py | 4 - src/transformers/models/ibert/__init__.py | 6 +- .../models/ibert/configuration_ibert.py | 8 - .../models/ibert/modeling_ibert.py | 6 - src/transformers/models/idefics/__init__.py | 6 +- .../models/idefics/configuration_idefics.py | 5 - .../models/idefics/modeling_idefics.py | 6 - src/transformers/models/imagegpt/__init__.py | 8 +- .../models/imagegpt/configuration_imagegpt.py | 6 - .../models/imagegpt/modeling_imagegpt.py | 7 - src/transformers/models/informer/__init__.py | 9 +- .../models/informer/configuration_informer.py | 7 - .../models/informer/modeling_informer.py | 6 - .../models/instructblip/__init__.py | 4 - .../configuration_instructblip.py | 4 - .../instructblip/modeling_instructblip.py | 5 - src/transformers/models/jukebox/__init__.py | 4 - .../models/jukebox/configuration_jukebox.py | 4 - .../models/jukebox/modeling_jukebox.py | 6 - .../models/jukebox/tokenization_jukebox.py | 18 - src/transformers/models/kosmos2/__init__.py | 6 +- .../models/kosmos2/configuration_kosmos2.py | 7 - .../models/kosmos2/modeling_kosmos2.py | 5 - src/transformers/models/layoutlm/__init__.py | 8 +- .../models/layoutlm/configuration_layoutlm.py | 9 - .../models/layoutlm/modeling_layoutlm.py | 6 - .../models/layoutlm/modeling_tf_layoutlm.py | 5 - .../models/layoutlm/tokenization_layoutlm.py | 24 - .../layoutlm/tokenization_layoutlm_fast.py | 32 - .../models/layoutlmv2/__init__.py | 6 +- .../layoutlmv2/configuration_layoutlmv2.py | 5 - .../models/layoutlmv2/modeling_layoutlmv2.py | 7 - .../layoutlmv2/tokenization_layoutlmv2.py | 26 - .../tokenization_layoutlmv2_fast.py | 24 - .../models/layoutlmv3/__init__.py | 6 - .../layoutlmv3/configuration_layoutlmv3.py | 4 - .../models/layoutlmv3/modeling_layoutlmv3.py | 5 - .../layoutlmv3/modeling_tf_layoutlmv3.py | 5 - .../layoutlmv3/tokenization_layoutlmv3.py | 18 - .../tokenization_layoutlmv3_fast.py | 18 - .../layoutxlm/tokenization_layoutxlm.py | 4 - .../layoutxlm/tokenization_layoutxlm_fast.py | 4 - src/transformers/models/led/__init__.py | 6 +- .../models/led/configuration_led.py | 5 - src/transformers/models/led/modeling_led.py | 6 - .../models/led/tokenization_led.py | 17 - .../models/led/tokenization_led_fast.py | 18 - src/transformers/models/levit/__init__.py | 6 +- .../models/levit/configuration_levit.py | 5 - .../models/levit/modeling_levit.py | 5 - src/transformers/models/lilt/__init__.py | 6 +- .../models/lilt/configuration_lilt.py | 6 - src/transformers/models/lilt/modeling_lilt.py | 5 - src/transformers/models/llama/__init__.py | 4 +- .../models/llama/configuration_llama.py | 2 - .../models/llama/tokenization_llama.py | 13 - .../models/llama/tokenization_llama_fast.py | 11 - src/transformers/models/llava/__init__.py | 10 +- .../models/llava/configuration_llava.py | 4 - .../models/llava/modeling_llava.py | 7 - .../models/longformer/__init__.py | 6 - .../longformer/configuration_longformer.py | 14 - .../models/longformer/modeling_longformer.py | 9 - .../longformer/modeling_tf_longformer.py | 9 - .../longformer/tokenization_longformer.py | 43 - .../tokenization_longformer_fast.py | 60 - src/transformers/models/longt5/__init__.py | 6 +- .../models/longt5/configuration_longt5.py | 7 - .../models/longt5/modeling_longt5.py | 6 - src/transformers/models/luke/__init__.py | 6 +- .../models/luke/configuration_luke.py | 5 - src/transformers/models/luke/modeling_luke.py | 6 - .../models/luke/tokenization_luke.py | 21 - src/transformers/models/lxmert/__init__.py | 6 +- .../models/lxmert/configuration_lxmert.py | 4 - .../models/lxmert/modeling_lxmert.py | 4 - .../models/lxmert/modeling_tf_lxmert.py | 4 - .../models/lxmert/tokenization_lxmert.py | 17 - .../models/lxmert/tokenization_lxmert_fast.py | 22 - src/transformers/models/m2m_100/__init__.py | 6 +- .../models/m2m_100/configuration_m2m_100.py | 5 - .../models/m2m_100/modeling_m2m_100.py | 6 - .../models/m2m_100/tokenization_m2m_100.py | 20 - src/transformers/models/mamba/__init__.py | 6 +- .../models/mamba/configuration_mamba.py | 4 - .../models/mamba/modeling_mamba.py | 2 - src/transformers/models/marian/__init__.py | 6 +- .../models/marian/configuration_marian.py | 5 - .../models/marian/modeling_marian.py | 6 - .../models/marian/tokenization_marian.py | 22 - src/transformers/models/markuplm/__init__.py | 6 +- .../models/markuplm/configuration_markuplm.py | 5 - .../models/markuplm/modeling_markuplm.py | 6 - .../models/markuplm/tokenization_markuplm.py | 19 - .../markuplm/tokenization_markuplm_fast.py | 19 - .../models/mask2former/__init__.py | 9 +- .../mask2former/configuration_mask2former.py | 7 - .../mask2former/modeling_mask2former.py | 5 - .../models/maskformer/__init__.py | 6 +- .../maskformer/configuration_maskformer.py | 7 - .../models/maskformer/modeling_maskformer.py | 5 - src/transformers/models/mbart/__init__.py | 6 +- .../models/mbart/configuration_mbart.py | 5 - .../models/mbart/modeling_mbart.py | 5 - .../models/mbart/tokenization_mbart.py | 17 - .../models/mbart/tokenization_mbart_fast.py | 21 - .../models/mbart50/tokenization_mbart50.py | 13 - .../mbart50/tokenization_mbart50_fast.py | 18 - src/transformers/models/mega/__init__.py | 6 +- .../models/mega/configuration_mega.py | 4 - src/transformers/models/mega/modeling_mega.py | 5 - .../models/megatron_bert/__init__.py | 6 +- .../configuration_megatron_bert.py | 4 - .../megatron_bert/modeling_megatron_bert.py | 5 - src/transformers/models/mgp_str/__init__.py | 6 +- .../models/mgp_str/configuration_mgp_str.py | 4 - .../models/mgp_str/modeling_mgp_str.py | 5 - .../models/mgp_str/tokenization_mgp_str.py | 10 - src/transformers/models/mistral/__init__.py | 4 +- .../models/mistral/configuration_mistral.py | 5 - src/transformers/models/mixtral/__init__.py | 4 +- .../models/mixtral/configuration_mixtral.py | 4 - .../models/mluke/tokenization_mluke.py | 17 - .../models/mobilebert/__init__.py | 6 - .../mobilebert/configuration_mobilebert.py | 10 - .../models/mobilebert/modeling_mobilebert.py | 3 - .../mobilebert/modeling_tf_mobilebert.py | 5 - .../mobilebert/tokenization_mobilebert.py | 12 - .../tokenization_mobilebert_fast.py | 15 - .../models/mobilenet_v1/__init__.py | 4 - .../configuration_mobilenet_v1.py | 6 - .../mobilenet_v1/modeling_mobilenet_v1.py | 7 - .../models/mobilenet_v2/__init__.py | 4 - .../configuration_mobilenet_v2.py | 8 - .../mobilenet_v2/modeling_mobilenet_v2.py | 9 - src/transformers/models/mobilevit/__init__.py | 8 +- .../mobilevit/configuration_mobilevit.py | 16 - .../models/mobilevit/modeling_mobilevit.py | 11 - .../models/mobilevit/modeling_tf_mobilevit.py | 11 - .../models/mobilevitv2/__init__.py | 4 - .../mobilevitv2/configuration_mobilevitv2.py | 4 - .../mobilevitv2/modeling_mobilevitv2.py | 6 - src/transformers/models/mpnet/__init__.py | 8 +- .../models/mpnet/configuration_mpnet.py | 4 - .../models/mpnet/modeling_mpnet.py | 6 - .../models/mpnet/modeling_tf_mpnet.py | 4 - .../models/mpnet/tokenization_mpnet.py | 17 - .../models/mpnet/tokenization_mpnet_fast.py | 20 - src/transformers/models/mpt/__init__.py | 6 +- .../models/mpt/configuration_mpt.py | 4 - src/transformers/models/mpt/modeling_mpt.py | 13 - src/transformers/models/mra/__init__.py | 6 +- .../models/mra/configuration_mra.py | 4 - src/transformers/models/mra/modeling_mra.py | 4 - src/transformers/models/mt5/modeling_mt5.py | 8 - src/transformers/models/musicgen/__init__.py | 4 - .../models/musicgen/configuration_musicgen.py | 5 - .../models/musicgen/modeling_musicgen.py | 5 - src/transformers/models/mvp/__init__.py | 6 +- .../models/mvp/configuration_mvp.py | 4 - src/transformers/models/mvp/modeling_mvp.py | 19 - .../models/mvp/tokenization_mvp.py | 17 - .../models/mvp/tokenization_mvp_fast.py | 20 - src/transformers/models/nat/__init__.py | 6 +- .../models/nat/configuration_nat.py | 5 - src/transformers/models/nat/modeling_nat.py | 5 - src/transformers/models/nezha/__init__.py | 6 +- .../models/nezha/configuration_nezha.py | 6 - .../models/nezha/modeling_nezha.py | 8 - .../models/nllb/tokenization_nllb.py | 13 - .../models/nllb/tokenization_nllb_fast.py | 19 - src/transformers/models/nllb_moe/__init__.py | 10 +- .../models/nllb_moe/configuration_nllb_moe.py | 4 - .../models/nllb_moe/modeling_nllb_moe.py | 4 - .../models/nougat/tokenization_nougat_fast.py | 9 - .../models/nystromformer/__init__.py | 6 +- .../configuration_nystromformer.py | 5 - .../nystromformer/modeling_nystromformer.py | 5 - src/transformers/models/oneformer/__init__.py | 6 +- .../oneformer/configuration_oneformer.py | 7 - .../models/oneformer/modeling_oneformer.py | 5 - src/transformers/models/openai/__init__.py | 8 +- .../models/openai/configuration_openai.py | 4 - .../models/openai/modeling_openai.py | 5 - .../models/openai/modeling_tf_openai.py | 5 - .../models/openai/tokenization_openai.py | 15 - .../models/openai/tokenization_openai_fast.py | 18 - src/transformers/models/opt/__init__.py | 6 +- .../models/opt/configuration_opt.py | 9 - src/transformers/models/opt/modeling_opt.py | 11 - src/transformers/models/owlv2/__init__.py | 4 - .../models/owlv2/configuration_owlv2.py | 4 - .../models/owlv2/modeling_owlv2.py | 4 - src/transformers/models/owlvit/__init__.py | 4 - .../models/owlvit/configuration_owlvit.py | 6 - .../models/owlvit/modeling_owlvit.py | 5 - .../models/patchtsmixer/__init__.py | 8 +- .../configuration_patchtsmixer.py | 4 - .../patchtsmixer/modeling_patchtsmixer.py | 6 - src/transformers/models/patchtst/__init__.py | 9 +- .../models/patchtst/configuration_patchtst.py | 5 - .../models/patchtst/modeling_patchtst.py | 5 - src/transformers/models/pegasus/__init__.py | 6 +- .../models/pegasus/configuration_pegasus.py | 5 - .../models/pegasus/modeling_pegasus.py | 6 - .../models/pegasus/tokenization_pegasus.py | 10 - .../pegasus/tokenization_pegasus_fast.py | 13 - src/transformers/models/pegasus_x/__init__.py | 6 +- .../pegasus_x/configuration_pegasus_x.py | 6 - .../models/pegasus_x/modeling_pegasus_x.py | 7 - src/transformers/models/perceiver/__init__.py | 6 +- .../perceiver/configuration_perceiver.py | 5 - .../models/perceiver/modeling_perceiver.py | 5 - src/transformers/models/persimmon/__init__.py | 4 +- .../persimmon/configuration_persimmon.py | 4 - src/transformers/models/phi/__init__.py | 6 +- .../models/phi/configuration_phi.py | 6 - src/transformers/models/phi/modeling_phi.py | 7 - .../models/phobert/tokenization_phobert.py | 18 - .../models/pix2struct/__init__.py | 4 - .../pix2struct/configuration_pix2struct.py | 6 - .../models/pix2struct/modeling_pix2struct.py | 22 - src/transformers/models/plbart/__init__.py | 6 +- .../models/plbart/configuration_plbart.py | 5 - .../models/plbart/modeling_plbart.py | 7 - .../models/plbart/tokenization_plbart.py | 59 - .../models/poolformer/__init__.py | 4 - .../poolformer/configuration_poolformer.py | 5 - .../models/poolformer/modeling_poolformer.py | 5 - src/transformers/models/pop2piano/__init__.py | 6 +- .../pop2piano/configuration_pop2piano.py | 4 - .../models/pop2piano/modeling_pop2piano.py | 5 - .../pop2piano/tokenization_pop2piano.py | 7 - .../models/prophetnet/__init__.py | 6 +- .../prophetnet/configuration_prophetnet.py | 6 - .../models/prophetnet/modeling_prophetnet.py | 5 - .../prophetnet/tokenization_prophetnet.py | 19 - src/transformers/models/pvt/__init__.py | 6 +- .../models/pvt/configuration_pvt.py | 5 - src/transformers/models/pvt/modeling_pvt.py | 5 - src/transformers/models/qdqbert/__init__.py | 6 +- .../models/qdqbert/configuration_qdqbert.py | 5 - .../models/qdqbert/modeling_qdqbert.py | 5 - src/transformers/models/qwen2/__init__.py | 4 +- .../models/qwen2/configuration_qwen2.py | 4 - .../models/qwen2/modeling_qwen2.py | 5 - .../models/qwen2/tokenization_qwen2.py | 6 - .../models/qwen2/tokenization_qwen2_fast.py | 9 - src/transformers/models/realm/__init__.py | 6 +- .../models/realm/configuration_realm.py | 20 - .../models/realm/modeling_realm.py | 12 - .../models/realm/tokenization_realm.py | 46 - .../models/realm/tokenization_realm_fast.py | 72 - src/transformers/models/reformer/__init__.py | 6 +- .../models/reformer/configuration_reformer.py | 7 - .../models/reformer/modeling_reformer.py | 6 - .../models/reformer/tokenization_reformer.py | 14 - .../reformer/tokenization_reformer_fast.py | 19 - src/transformers/models/regnet/__init__.py | 8 +- .../models/regnet/configuration_regnet.py | 4 - .../models/regnet/modeling_regnet.py | 5 - .../models/regnet/modeling_tf_regnet.py | 5 - src/transformers/models/rembert/__init__.py | 10 +- .../models/rembert/configuration_rembert.py | 5 - .../models/rembert/modeling_rembert.py | 5 - .../models/rembert/modeling_tf_rembert.py | 5 - .../models/rembert/tokenization_rembert.py | 12 - .../rembert/tokenization_rembert_fast.py | 14 - src/transformers/models/resnet/__init__.py | 10 +- .../models/resnet/configuration_resnet.py | 4 - .../models/resnet/modeling_resnet.py | 5 - .../models/resnet/modeling_tf_resnet.py | 5 - src/transformers/models/roberta/__init__.py | 8 +- .../models/roberta/configuration_roberta.py | 9 - .../models/roberta/modeling_roberta.py | 10 - .../models/roberta/modeling_tf_roberta.py | 8 - .../models/roberta/tokenization_roberta.py | 34 - .../roberta/tokenization_roberta_fast.py | 46 - .../models/roberta_prelayernorm/__init__.py | 6 - .../configuration_roberta_prelayernorm.py | 6 - .../modeling_roberta_prelayernorm.py | 12 - .../modeling_tf_roberta_prelayernorm.py | 12 - src/transformers/models/roc_bert/__init__.py | 6 +- .../models/roc_bert/configuration_roc_bert.py | 4 - .../models/roc_bert/modeling_roc_bert.py | 4 - .../models/roc_bert/tokenization_roc_bert.py | 25 - src/transformers/models/roformer/__init__.py | 10 +- .../models/roformer/configuration_roformer.py | 18 - .../models/roformer/modeling_flax_roformer.py | 10 - .../models/roformer/modeling_roformer.py | 10 - .../models/roformer/modeling_tf_roformer.py | 10 - .../models/roformer/tokenization_roformer.py | 41 - .../roformer/tokenization_roformer_fast.py | 41 - src/transformers/models/rwkv/__init__.py | 6 +- .../models/rwkv/configuration_rwkv.py | 13 - src/transformers/models/rwkv/modeling_rwkv.py | 14 - src/transformers/models/sam/__init__.py | 8 +- .../models/sam/configuration_sam.py | 6 - src/transformers/models/sam/modeling_sam.py | 7 - .../models/sam/modeling_tf_sam.py | 7 - .../models/seamless_m4t/__init__.py | 6 +- .../configuration_seamless_m4t.py | 5 - .../seamless_m4t/modeling_seamless_m4t.py | 9 - .../seamless_m4t/tokenization_seamless_m4t.py | 14 - .../tokenization_seamless_m4t_fast.py | 15 - .../models/seamless_m4t_v2/__init__.py | 6 +- .../configuration_seamless_m4t_v2.py | 4 - .../modeling_seamless_m4t_v2.py | 10 - src/transformers/models/segformer/__init__.py | 10 +- .../segformer/configuration_segformer.py | 7 - .../models/segformer/modeling_segformer.py | 5 - .../models/segformer/modeling_tf_segformer.py | 5 - src/transformers/models/seggpt/__init__.py | 8 +- .../models/seggpt/configuration_seggpt.py | 4 - .../models/seggpt/modeling_seggpt.py | 6 - src/transformers/models/sew/__init__.py | 6 +- .../models/sew/configuration_sew.py | 5 - src/transformers/models/sew/modeling_sew.py | 7 - src/transformers/models/sew_d/__init__.py | 6 +- .../models/sew_d/configuration_sew_d.py | 5 - .../models/sew_d/modeling_sew_d.py | 13 - src/transformers/models/siglip/__init__.py | 4 - .../models/siglip/configuration_siglip.py | 4 - .../models/siglip/modeling_siglip.py | 6 - .../models/siglip/tokenization_siglip.py | 11 - .../models/speech_to_text/__init__.py | 8 +- .../configuration_speech_to_text.py | 7 - .../speech_to_text/modeling_speech_to_text.py | 6 - .../modeling_tf_speech_to_text.py | 6 - .../tokenization_speech_to_text.py | 14 - .../models/speech_to_text_2/__init__.py | 6 +- .../configuration_speech_to_text_2.py | 7 - .../modeling_speech_to_text_2.py | 6 - .../tokenization_speech_to_text_2.py | 20 - src/transformers/models/speecht5/__init__.py | 6 - .../models/speecht5/configuration_speecht5.py | 10 - .../models/speecht5/modeling_speecht5.py | 8 - .../models/speecht5/tokenization_speecht5.py | 16 - src/transformers/models/splinter/__init__.py | 6 +- .../models/splinter/configuration_splinter.py | 8 - .../models/splinter/modeling_splinter.py | 8 - .../models/splinter/tokenization_splinter.py | 26 - .../splinter/tokenization_splinter_fast.py | 26 - .../models/squeezebert/__init__.py | 4 - .../squeezebert/configuration_squeezebert.py | 14 - .../squeezebert/modeling_squeezebert.py | 6 - .../squeezebert/tokenization_squeezebert.py | 28 - .../tokenization_squeezebert_fast.py | 39 - src/transformers/models/stablelm/__init__.py | 4 +- .../models/stablelm/configuration_stablelm.py | 5 - .../models/starcoder2/__init__.py | 4 +- .../starcoder2/configuration_starcoder2.py | 2 - .../models/swiftformer/__init__.py | 4 - .../swiftformer/configuration_swiftformer.py | 4 - .../swiftformer/modeling_swiftformer.py | 6 - src/transformers/models/swin/__init__.py | 8 +- .../models/swin/configuration_swin.py | 7 - src/transformers/models/swin/modeling_swin.py | 5 - .../models/swin/modeling_tf_swin.py | 5 - src/transformers/models/swin2sr/__init__.py | 6 +- .../models/swin2sr/configuration_swin2sr.py | 6 - .../models/swin2sr/modeling_swin2sr.py | 6 - src/transformers/models/swinv2/__init__.py | 6 +- .../models/swinv2/configuration_swinv2.py | 6 - .../models/swinv2/modeling_swinv2.py | 6 - .../models/switch_transformers/__init__.py | 4 - .../configuration_switch_transformers.py | 4 - .../modeling_switch_transformers.py | 12 - src/transformers/models/t5/__init__.py | 8 +- .../models/t5/configuration_t5.py | 8 - src/transformers/models/t5/modeling_t5.py | 8 - src/transformers/models/t5/modeling_tf_t5.py | 8 - src/transformers/models/t5/tokenization_t5.py | 19 - .../models/t5/tokenization_t5_fast.py | 26 - .../models/table_transformer/__init__.py | 4 - .../configuration_table_transformer.py | 6 - .../modeling_table_transformer.py | 5 - src/transformers/models/tapas/__init__.py | 8 +- .../models/tapas/configuration_tapas.py | 16 - .../models/tapas/modeling_tapas.py | 33 - .../models/tapas/modeling_tf_tapas.py | 33 - .../models/tapas/tokenization_tapas.py | 88 -- .../time_series_transformer/__init__.py | 8 +- .../configuration_time_series_transformer.py | 7 - .../modeling_time_series_transformer.py | 6 - .../models/timesformer/__init__.py | 6 +- .../timesformer/configuration_timesformer.py | 4 - .../timesformer/modeling_timesformer.py | 5 - src/transformers/models/trocr/__init__.py | 7 +- .../models/trocr/configuration_trocr.py | 7 - .../models/trocr/modeling_trocr.py | 6 - src/transformers/models/tvlt/__init__.py | 6 +- .../models/tvlt/configuration_tvlt.py | 4 - src/transformers/models/tvlt/modeling_tvlt.py | 5 - src/transformers/models/tvp/__init__.py | 8 +- .../models/tvp/configuration_tvp.py | 5 - src/transformers/models/tvp/modeling_tvp.py | 6 - src/transformers/models/udop/__init__.py | 6 +- .../models/udop/configuration_udop.py | 4 - src/transformers/models/udop/modeling_udop.py | 5 - .../models/umt5/configuration_umt5.py | 5 - src/transformers/models/unispeech/__init__.py | 6 +- .../unispeech/configuration_unispeech.py | 7 - .../models/unispeech/modeling_unispeech.py | 6 - .../models/unispeech_sat/__init__.py | 6 +- .../configuration_unispeech_sat.py | 7 - .../unispeech_sat/modeling_unispeech_sat.py | 4 - src/transformers/models/univnet/__init__.py | 8 +- .../models/univnet/configuration_univnet.py | 5 - .../models/univnet/modeling_univnet.py | 5 - .../models/upernet/modeling_upernet.py | 5 - src/transformers/models/videomae/__init__.py | 6 +- .../models/videomae/configuration_videomae.py | 4 - .../models/videomae/modeling_videomae.py | 5 - src/transformers/models/vilt/__init__.py | 6 +- .../models/vilt/configuration_vilt.py | 4 - src/transformers/models/vilt/modeling_vilt.py | 5 - src/transformers/models/vipllava/__init__.py | 6 +- .../models/vipllava/configuration_vipllava.py | 4 - .../models/vipllava/modeling_vipllava.py | 5 - .../models/visual_bert/__init__.py | 6 +- .../visual_bert/configuration_visual_bert.py | 19 - .../visual_bert/modeling_visual_bert.py | 13 - src/transformers/models/vit/__init__.py | 6 +- .../models/vit/configuration_vit.py | 5 - src/transformers/models/vit/modeling_vit.py | 6 - .../models/vit_hybrid/__init__.py | 6 +- .../vit_hybrid/configuration_vit_hybrid.py | 5 - .../models/vit_hybrid/modeling_vit_hybrid.py | 6 - src/transformers/models/vit_mae/__init__.py | 6 +- .../models/vit_mae/configuration_vit_mae.py | 5 - .../models/vit_mae/modeling_vit_mae.py | 5 - src/transformers/models/vit_msn/__init__.py | 6 +- .../models/vit_msn/configuration_vit_msn.py | 5 - .../models/vit_msn/modeling_vit_msn.py | 4 - src/transformers/models/vitdet/__init__.py | 6 +- .../models/vitdet/configuration_vitdet.py | 4 - .../models/vitdet/modeling_vitdet.py | 6 - src/transformers/models/vitmatte/__init__.py | 6 +- .../models/vitmatte/configuration_vitmatte.py | 4 - .../models/vitmatte/modeling_vitmatte.py | 6 - src/transformers/models/vits/__init__.py | 8 +- .../models/vits/configuration_vits.py | 4 - src/transformers/models/vits/modeling_vits.py | 7 - .../models/vits/tokenization_vits.py | 13 - src/transformers/models/vivit/__init__.py | 6 +- .../models/vivit/configuration_vivit.py | 7 - .../models/vivit/modeling_vivit.py | 5 - src/transformers/models/wav2vec2/__init__.py | 8 +- .../models/wav2vec2/configuration_wav2vec2.py | 5 - .../models/wav2vec2/modeling_tf_wav2vec2.py | 7 - .../models/wav2vec2/modeling_wav2vec2.py | 9 - .../models/wav2vec2/tokenization_wav2vec2.py | 14 - .../models/wav2vec2_bert/__init__.py | 8 +- .../configuration_wav2vec2_bert.py | 4 - .../wav2vec2_bert/modeling_wav2vec2_bert.py | 6 - .../models/wav2vec2_conformer/__init__.py | 8 +- .../configuration_wav2vec2_conformer.py | 6 - .../modeling_wav2vec2_conformer.py | 6 - .../tokenization_wav2vec2_phoneme.py | 16 - src/transformers/models/wavlm/__init__.py | 6 +- .../models/wavlm/configuration_wavlm.py | 5 - .../models/wavlm/modeling_wavlm.py | 7 - src/transformers/models/whisper/__init__.py | 8 +- .../models/whisper/configuration_whisper.py | 3 - .../models/whisper/modeling_tf_whisper.py | 5 - .../models/whisper/modeling_whisper.py | 6 - .../models/whisper/tokenization_whisper.py | 11 - .../whisper/tokenization_whisper_fast.py | 50 - src/transformers/models/x_clip/__init__.py | 4 - .../models/x_clip/configuration_x_clip.py | 4 - .../models/x_clip/modeling_x_clip.py | 5 - src/transformers/models/xglm/__init__.py | 9 +- .../models/xglm/configuration_xglm.py | 5 - .../models/xglm/modeling_tf_xglm.py | 6 - src/transformers/models/xglm/modeling_xglm.py | 5 - .../models/xglm/tokenization_xglm.py | 12 - .../models/xglm/tokenization_xglm_fast.py | 15 - src/transformers/models/xlm/__init__.py | 8 +- .../models/xlm/configuration_xlm.py | 13 - .../models/xlm/modeling_tf_xlm.py | 14 - src/transformers/models/xlm/modeling_xlm.py | 14 - .../models/xlm/tokenization_xlm.py | 394 ------ .../models/xlm_prophetnet/__init__.py | 6 +- .../configuration_xlm_prophetnet.py | 6 - .../xlm_prophetnet/modeling_xlm_prophetnet.py | 4 - .../tokenization_xlm_prophetnet.py | 18 - .../models/xlm_roberta/__init__.py | 8 - .../xlm_roberta/configuration_xlm_roberta.py | 17 - .../xlm_roberta/modeling_flax_xlm_roberta.py | 6 - .../xlm_roberta/modeling_tf_xlm_roberta.py | 7 - .../xlm_roberta/modeling_xlm_roberta.py | 10 - .../xlm_roberta/tokenization_xlm_roberta.py | 30 - .../tokenization_xlm_roberta_fast.py | 46 - .../models/xlm_roberta_xl/__init__.py | 4 - .../configuration_xlm_roberta_xl.py | 6 - .../xlm_roberta_xl/modeling_xlm_roberta_xl.py | 6 - src/transformers/models/xlnet/__init__.py | 8 +- .../models/xlnet/configuration_xlnet.py | 5 - .../models/xlnet/modeling_tf_xlnet.py | 6 - .../models/xlnet/modeling_xlnet.py | 6 - .../models/xlnet/tokenization_xlnet.py | 13 - .../models/xlnet/tokenization_xlnet_fast.py | 17 - src/transformers/models/xmod/__init__.py | 5 +- .../models/xmod/configuration_xmod.py | 12 - src/transformers/models/xmod/modeling_xmod.py | 13 - src/transformers/models/yolos/__init__.py | 6 +- .../models/yolos/configuration_yolos.py | 5 - .../models/yolos/modeling_yolos.py | 6 - src/transformers/models/yoso/__init__.py | 6 +- .../models/yoso/configuration_yoso.py | 5 - src/transformers/models/yoso/modeling_yoso.py | 4 - src/transformers/tokenization_utils_base.py | 26 - .../utils/dummy_detectron2_objects.py | 3 - src/transformers/utils/dummy_flax_objects.py | 3 - src/transformers/utils/dummy_pt_objects.py | 694 --------- src/transformers/utils/dummy_tf_objects.py | 150 -- .../__init__.py | 16 +- ...on_{{cookiecutter.lowercase_modelname}}.py | 5 - ...tf_{{cookiecutter.lowercase_modelname}}.py | 5 - ...ng_{{cookiecutter.lowercase_modelname}}.py | 10 - ...ng_{{cookiecutter.lowercase_modelname}}.py | 9 +- ...ce_{{cookiecutter.lowercase_modelname}}.py | 23 +- ...st_{{cookiecutter.lowercase_modelname}}.py | 44 - ...on_{{cookiecutter.lowercase_modelname}}.py | 39 - tests/models/albert/test_modeling_albert.py | 7 +- .../models/albert/test_modeling_tf_albert.py | 7 +- tests/models/align/test_modeling_align.py | 19 +- tests/models/altclip/test_modeling_altclip.py | 13 +- ..._modeling_audio_spectrogram_transformer.py | 9 +- tests/models/auto/test_modeling_auto.py | 200 ++- tests/models/auto/test_modeling_tf_auto.py | 90 +- tests/models/auto/test_modeling_tf_pytorch.py | 131 +- tests/models/auto/test_tokenization_auto.py | 6 +- tests/models/beit/test_modeling_beit.py | 7 +- tests/models/bert/test_modeling_bert.py | 7 +- .../models/big_bird/test_modeling_big_bird.py | 7 +- tests/models/biogpt/test_modeling_biogpt.py | 7 +- tests/models/bit/test_modeling_bit.py | 13 +- tests/models/blip/test_modeling_blip.py | 31 +- tests/models/blip/test_modeling_blip_text.py | 7 +- tests/models/blip/test_modeling_tf_blip.py | 31 +- .../models/blip/test_modeling_tf_blip_text.py | 7 +- tests/models/blip_2/test_modeling_blip_2.py | 19 +- tests/models/bloom/test_modeling_bloom.py | 7 +- .../bridgetower/test_modeling_bridgetower.py | 7 +- tests/models/bros/test_modeling_bros.py | 9 +- tests/models/canine/test_modeling_canine.py | 7 +- .../test_modeling_chinese_clip.py | 19 +- tests/models/clap/test_modeling_clap.py | 35 +- tests/models/clip/test_modeling_clip.py | 35 +- tests/models/clip/test_modeling_tf_clip.py | 19 +- tests/models/clipseg/test_modeling_clipseg.py | 19 +- tests/models/clvp/test_modeling_clvp.py | 7 +- tests/models/codegen/test_modeling_codegen.py | 8 +- .../models/convbert/test_modeling_convbert.py | 7 +- .../models/convnext/test_modeling_convnext.py | 7 +- .../convnextv2/test_modeling_convnextv2.py | 7 +- tests/models/ctrl/test_modeling_ctrl.py | 7 +- tests/models/ctrl/test_modeling_tf_ctrl.py | 7 +- tests/models/cvt/test_modeling_cvt.py | 11 +- tests/models/cvt/test_modeling_tf_cvt.py | 11 +- .../data2vec/test_modeling_data2vec_text.py | 7 +- .../data2vec/test_modeling_data2vec_vision.py | 7 +- .../test_modeling_tf_data2vec_vision.py | 9 +- tests/models/deberta/test_modeling_deberta.py | 7 +- .../deberta_v2/test_modeling_deberta_v2.py | 7 +- .../test_modeling_decision_transformer.py | 9 +- tests/models/deit/test_modeling_deit.py | 7 +- tests/models/deit/test_modeling_tf_deit.py | 7 +- .../test_modeling_depth_anything.py | 7 +- tests/models/dinat/test_modeling_dinat.py | 7 +- tests/models/dinov2/test_modeling_dinov2.py | 7 +- .../distilbert/test_modeling_distilbert.py | 7 +- .../distilbert/test_modeling_tf_distilbert.py | 7 +- .../models/donut/test_modeling_donut_swin.py | 7 +- tests/models/dpr/test_modeling_dpr.py | 29 +- tests/models/dpr/test_modeling_tf_dpr.py | 27 +- tests/models/dpt/test_modeling_dpt.py | 7 +- .../dpt/test_modeling_dpt_auto_backbone.py | 7 +- tests/models/dpt/test_modeling_dpt_hybrid.py | 7 +- .../test_modeling_efficientformer.py | 9 +- .../test_modeling_tf_efficientformer.py | 9 +- .../test_modeling_efficientnet.py | 7 +- tests/models/electra/test_modeling_electra.py | 7 +- .../electra/test_modeling_tf_electra.py | 2 +- tests/models/ernie/test_modeling_ernie.py | 7 +- tests/models/ernie_m/test_modeling_ernie_m.py | 7 +- tests/models/esm/test_modeling_esm.py | 7 +- tests/models/esm/test_modeling_tf_esm.py | 7 +- .../models/flaubert/test_modeling_flaubert.py | 7 +- .../flaubert/test_modeling_tf_flaubert.py | 7 +- tests/models/flava/test_modeling_flava.py | 34 +- tests/models/fnet/test_modeling_fnet.py | 7 +- .../models/focalnet/test_modeling_focalnet.py | 7 +- tests/models/git/test_modeling_git.py | 13 +- tests/models/glpn/test_modeling_glpn.py | 11 +- tests/models/gpt2/test_modeling_gpt2.py | 7 +- tests/models/gpt2/test_modeling_tf_gpt2.py | 7 +- tests/models/gpt_neo/test_modeling_gpt_neo.py | 7 +- tests/models/gptj/test_modeling_gptj.py | 7 +- .../graphormer/test_modeling_graphormer.py | 7 +- .../models/groupvit/test_modeling_groupvit.py | 19 +- .../groupvit/test_modeling_tf_groupvit.py | 19 +- tests/models/ibert/test_modeling_ibert.py | 7 +- tests/models/idefics/test_modeling_idefics.py | 7 +- .../models/imagegpt/test_modeling_imagegpt.py | 7 +- .../test_modeling_instructblip.py | 13 +- tests/models/kosmos2/test_modeling_kosmos2.py | 7 +- .../layoutlm/test_modeling_tf_layoutlm.py | 7 +- .../layoutlmv2/test_modeling_layoutlmv2.py | 7 +- .../layoutlmv3/test_modeling_layoutlmv3.py | 7 +- .../layoutlmv3/test_modeling_tf_layoutlmv3.py | 7 +- tests/models/levit/test_modeling_levit.py | 13 +- tests/models/lilt/test_modeling_lilt.py | 7 +- tests/models/longt5/test_modeling_longt5.py | 7 +- tests/models/luke/test_modeling_luke.py | 7 +- tests/models/lxmert/test_modeling_lxmert.py | 11 +- tests/models/mega/test_modeling_mega.py | 7 +- .../mobilebert/test_modeling_tf_mobilebert.py | 2 +- .../test_modeling_mobilenet_v1.py | 7 +- .../test_modeling_mobilenet_v2.py | 7 +- .../mobilevit/test_modeling_mobilevit.py | 7 +- .../mobilevit/test_modeling_tf_mobilevit.py | 7 +- .../mobilevitv2/test_modeling_mobilevitv2.py | 7 +- tests/models/mpt/test_modeling_mpt.py | 7 +- tests/models/mra/test_modeling_mra.py | 7 +- tests/models/mt5/test_modeling_mt5.py | 9 +- tests/models/nat/test_modeling_nat.py | 7 +- tests/models/nezha/test_modeling_nezha.py | 7 +- .../test_modeling_nystromformer.py | 7 +- tests/models/openai/test_modeling_openai.py | 7 +- .../models/openai/test_modeling_tf_openai.py | 7 +- tests/models/owlv2/test_modeling_owlv2.py | 33 +- tests/models/owlvit/test_modeling_owlvit.py | 25 +- .../perceiver/test_modeling_perceiver.py | 7 +- .../pix2struct/test_modeling_pix2struct.py | 13 +- .../poolformer/test_modeling_poolformer.py | 7 +- .../pop2piano/test_modeling_pop2piano.py | 7 +- tests/models/pvt/test_modeling_pvt.py | 7 +- tests/models/qdqbert/test_modeling_qdqbert.py | 7 +- .../models/reformer/test_modeling_reformer.py | 7 +- tests/models/regnet/test_modeling_regnet.py | 15 +- .../models/regnet/test_modeling_tf_regnet.py | 16 +- tests/models/rembert/test_modeling_rembert.py | 7 +- tests/models/resnet/test_modeling_resnet.py | 15 +- .../models/resnet/test_modeling_tf_resnet.py | 15 +- tests/models/roberta/test_modeling_roberta.py | 7 +- .../roberta/test_modeling_tf_roberta.py | 7 +- .../test_modeling_roberta_prelayernorm.py | 8 +- .../test_modeling_tf_roberta_prelayernorm.py | 9 +- .../models/roc_bert/test_modeling_roc_bert.py | 7 +- .../models/roformer/test_modeling_roformer.py | 7 +- tests/models/rwkv/test_modeling_rwkv.py | 7 +- tests/models/sam/test_modeling_sam.py | 7 +- .../test_modeling_seamless_m4t.py | 15 +- .../test_modeling_seamless_m4t_v2.py | 15 +- .../segformer/test_modeling_segformer.py | 7 +- .../segformer/test_modeling_tf_segformer.py | 7 +- tests/models/seggpt/test_modeling_seggpt.py | 7 +- tests/models/siglip/test_modeling_siglip.py | 20 +- .../models/splinter/test_modeling_splinter.py | 7 +- .../squeezebert/test_modeling_squeezebert.py | 7 +- .../swiftformer/test_modeling_swiftformer.py | 7 +- tests/models/swin/test_modeling_swin.py | 7 +- tests/models/swin/test_modeling_tf_swin.py | 7 +- tests/models/swin2sr/test_modeling_swin2sr.py | 7 +- tests/models/swinv2/test_modeling_swinv2.py | 7 +- .../test_modeling_switch_transformers.py | 7 +- tests/models/t5/test_modeling_t5.py | 7 +- .../timesformer/test_modeling_timesformer.py | 7 +- tests/models/tvlt/test_modeling_tvlt.py | 7 +- tests/models/udop/test_modeling_udop.py | 7 +- tests/models/upernet/test_modeling_upernet.py | 7 +- .../models/videomae/test_modeling_videomae.py | 7 +- tests/models/vilt/test_modeling_vilt.py | 7 +- .../visual_bert/test_modeling_visual_bert.py | 7 +- tests/models/vit/test_modeling_vit.py | 7 +- .../vit_hybrid/test_modeling_vit_hybrid.py | 13 +- tests/models/vit_mae/test_modeling_vit_mae.py | 7 +- tests/models/vit_msn/test_modeling_vit_msn.py | 7 +- .../models/vitmatte/test_modeling_vitmatte.py | 7 +- tests/models/vivit/test_modeling_vivit.py | 7 +- .../test_feature_extraction_wav2vec2.py | 14 +- .../wav2vec2/test_tokenization_wav2vec2.py | 13 +- tests/models/x_clip/test_modeling_x_clip.py | 19 +- tests/models/xglm/test_modeling_tf_xglm.py | 7 +- tests/models/xglm/test_modeling_xglm.py | 8 +- tests/models/xlm/test_modeling_tf_xlm.py | 7 +- tests/models/xlm/test_modeling_xlm.py | 7 +- tests/models/xlnet/test_modeling_tf_xlnet.py | 7 +- tests/models/xlnet/test_modeling_xlnet.py | 7 +- tests/models/yolos/test_modeling_yolos.py | 7 +- tests/models/yoso/test_modeling_yoso.py | 7 +- tests/test_modeling_utils.py | 37 +- tests/utils/test_add_new_model_like.py | 32 +- 1047 files changed, 1488 insertions(+), 11919 deletions(-) diff --git a/examples/research_projects/bertabs/modeling_bertabs.py b/examples/research_projects/bertabs/modeling_bertabs.py index 2ebce466561393..66f2320ebd167c 100644 --- a/examples/research_projects/bertabs/modeling_bertabs.py +++ b/examples/research_projects/bertabs/modeling_bertabs.py @@ -33,10 +33,6 @@ MAX_SIZE = 5000 -BERTABS_FINETUNED_MODEL_ARCHIVE_LIST = [ - "remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization", -] - class BertAbsPreTrainedModel(PreTrainedModel): config_class = BertAbsConfig diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py index cd5852924ee099..3fb0bbaaaf09a2 100644 --- a/src/transformers/__init__.py +++ b/src/transformers/__init__.py @@ -131,28 +131,24 @@ ], "models": [], # Models - "models.albert": ["ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlbertConfig"], + "models.albert": ["AlbertConfig"], "models.align": [ - "ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlignConfig", "AlignProcessor", "AlignTextConfig", "AlignVisionConfig", ], "models.altclip": [ - "ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "AltCLIPConfig", "AltCLIPProcessor", "AltCLIPTextConfig", "AltCLIPVisionConfig", ], "models.audio_spectrogram_transformer": [ - "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ASTConfig", "ASTFeatureExtractor", ], "models.auto": [ - "ALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CONFIG_MAPPING", "FEATURE_EXTRACTOR_MAPPING", "IMAGE_PROCESSOR_MAPPING", @@ -165,10 +161,7 @@ "AutoProcessor", "AutoTokenizer", ], - "models.autoformer": [ - "AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "AutoformerConfig", - ], + "models.autoformer": ["AutoformerConfig"], "models.bark": [ "BarkCoarseConfig", "BarkConfig", @@ -179,9 +172,8 @@ "models.bart": ["BartConfig", "BartTokenizer"], "models.barthez": [], "models.bartpho": [], - "models.beit": ["BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BeitConfig"], + "models.beit": ["BeitConfig"], "models.bert": [ - "BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BasicTokenizer", "BertConfig", "BertTokenizer", @@ -194,77 +186,63 @@ "MecabTokenizer", ], "models.bertweet": ["BertweetTokenizer"], - "models.big_bird": ["BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP", "BigBirdConfig"], - "models.bigbird_pegasus": [ - "BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", - "BigBirdPegasusConfig", - ], + "models.big_bird": ["BigBirdConfig"], + "models.bigbird_pegasus": ["BigBirdPegasusConfig"], "models.biogpt": [ - "BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BioGptConfig", "BioGptTokenizer", ], - "models.bit": ["BIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BitConfig"], + "models.bit": ["BitConfig"], "models.blenderbot": [ - "BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotConfig", "BlenderbotTokenizer", ], "models.blenderbot_small": [ - "BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotSmallConfig", "BlenderbotSmallTokenizer", ], "models.blip": [ - "BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlipConfig", "BlipProcessor", "BlipTextConfig", "BlipVisionConfig", ], "models.blip_2": [ - "BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Blip2Config", "Blip2Processor", "Blip2QFormerConfig", "Blip2VisionConfig", ], - "models.bloom": ["BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP", "BloomConfig"], + "models.bloom": ["BloomConfig"], "models.bridgetower": [ - "BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP", "BridgeTowerConfig", "BridgeTowerProcessor", "BridgeTowerTextConfig", "BridgeTowerVisionConfig", ], "models.bros": [ - "BROS_PRETRAINED_CONFIG_ARCHIVE_MAP", "BrosConfig", "BrosProcessor", ], "models.byt5": ["ByT5Tokenizer"], - "models.camembert": ["CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CamembertConfig"], + "models.camembert": ["CamembertConfig"], "models.canine": [ - "CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP", "CanineConfig", "CanineTokenizer", ], "models.chinese_clip": [ - "CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ChineseCLIPConfig", "ChineseCLIPProcessor", "ChineseCLIPTextConfig", "ChineseCLIPVisionConfig", ], "models.clap": [ - "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapAudioConfig", "ClapConfig", "ClapProcessor", "ClapTextConfig", ], "models.clip": [ - "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPConfig", "CLIPProcessor", "CLIPTextConfig", @@ -272,14 +250,12 @@ "CLIPVisionConfig", ], "models.clipseg": [ - "CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPSegConfig", "CLIPSegProcessor", "CLIPSegTextConfig", "CLIPSegVisionConfig", ], "models.clvp": [ - "CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ClvpConfig", "ClvpDecoderConfig", "ClvpEncoderConfig", @@ -289,7 +265,6 @@ ], "models.code_llama": [], "models.codegen": [ - "CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "CodeGenConfig", "CodeGenTokenizer", ], @@ -299,240 +274,172 @@ "ConditionalDetrConfig", ], "models.convbert": [ - "CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvBertConfig", "ConvBertTokenizer", ], - "models.convnext": ["CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvNextConfig"], - "models.convnextv2": [ - "CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP", - "ConvNextV2Config", - ], + "models.convnext": ["ConvNextConfig"], + "models.convnextv2": ["ConvNextV2Config"], "models.cpm": [], "models.cpmant": [ - "CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CpmAntConfig", "CpmAntTokenizer", ], "models.ctrl": [ - "CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CTRLConfig", "CTRLTokenizer", ], - "models.cvt": ["CVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CvtConfig"], + "models.cvt": ["CvtConfig"], "models.data2vec": [ - "DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", - "DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecAudioConfig", "Data2VecTextConfig", "Data2VecVisionConfig", ], "models.deberta": [ - "DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaTokenizer", ], - "models.deberta_v2": [ - "DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", - "DebertaV2Config", - ], - "models.decision_transformer": [ - "DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "DecisionTransformerConfig", - ], - "models.deformable_detr": [ - "DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", - "DeformableDetrConfig", - ], - "models.deit": ["DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeiTConfig"], + "models.deberta_v2": ["DebertaV2Config"], + "models.decision_transformer": ["DecisionTransformerConfig"], + "models.deformable_detr": ["DeformableDetrConfig"], + "models.deit": ["DeiTConfig"], "models.deprecated": [], "models.deprecated.bort": [], "models.deprecated.mctct": [ - "MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MCTCTConfig", "MCTCTFeatureExtractor", "MCTCTProcessor", ], "models.deprecated.mmbt": ["MMBTConfig"], - "models.deprecated.open_llama": [ - "OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", - "OpenLlamaConfig", - ], + "models.deprecated.open_llama": ["OpenLlamaConfig"], "models.deprecated.retribert": [ - "RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RetriBertConfig", "RetriBertTokenizer", ], "models.deprecated.tapex": ["TapexTokenizer"], - "models.deprecated.trajectory_transformer": [ - "TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "TrajectoryTransformerConfig", - ], + "models.deprecated.trajectory_transformer": ["TrajectoryTransformerConfig"], "models.deprecated.transfo_xl": [ - "TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", "TransfoXLConfig", "TransfoXLCorpus", "TransfoXLTokenizer", ], - "models.deprecated.van": ["VAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "VanConfig"], - "models.depth_anything": ["DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP", "DepthAnythingConfig"], - "models.deta": ["DETA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetaConfig"], - "models.detr": ["DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetrConfig"], + "models.deprecated.van": ["VanConfig"], + "models.depth_anything": ["DepthAnythingConfig"], + "models.deta": ["DetaConfig"], + "models.detr": ["DetrConfig"], "models.dialogpt": [], - "models.dinat": ["DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DinatConfig"], - "models.dinov2": ["DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Dinov2Config"], + "models.dinat": ["DinatConfig"], + "models.dinov2": ["Dinov2Config"], "models.distilbert": [ - "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DistilBertConfig", "DistilBertTokenizer", ], "models.dit": [], "models.donut": [ - "DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "DonutProcessor", "DonutSwinConfig", ], "models.dpr": [ - "DPR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPRConfig", "DPRContextEncoderTokenizer", "DPRQuestionEncoderTokenizer", "DPRReaderOutput", "DPRReaderTokenizer", ], - "models.dpt": ["DPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPTConfig"], - "models.efficientformer": [ - "EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "EfficientFormerConfig", - ], - "models.efficientnet": [ - "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP", - "EfficientNetConfig", - ], + "models.dpt": ["DPTConfig"], + "models.efficientformer": ["EfficientFormerConfig"], + "models.efficientnet": ["EfficientNetConfig"], "models.electra": [ - "ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "ElectraConfig", "ElectraTokenizer", ], "models.encodec": [ - "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", "EncodecConfig", "EncodecFeatureExtractor", ], "models.encoder_decoder": ["EncoderDecoderConfig"], - "models.ernie": [ - "ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP", - "ErnieConfig", - ], - "models.ernie_m": ["ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieMConfig"], - "models.esm": ["ESM_PRETRAINED_CONFIG_ARCHIVE_MAP", "EsmConfig", "EsmTokenizer"], - "models.falcon": ["FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP", "FalconConfig"], + "models.ernie": ["ErnieConfig"], + "models.ernie_m": ["ErnieMConfig"], + "models.esm": ["EsmConfig", "EsmTokenizer"], + "models.falcon": ["FalconConfig"], "models.fastspeech2_conformer": [ - "FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", - "FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "FastSpeech2ConformerConfig", "FastSpeech2ConformerHifiGanConfig", "FastSpeech2ConformerTokenizer", "FastSpeech2ConformerWithHifiGanConfig", ], - "models.flaubert": ["FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlaubertConfig", "FlaubertTokenizer"], + "models.flaubert": ["FlaubertConfig", "FlaubertTokenizer"], "models.flava": [ - "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlavaConfig", "FlavaImageCodebookConfig", "FlavaImageConfig", "FlavaMultimodalConfig", "FlavaTextConfig", ], - "models.fnet": ["FNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FNetConfig"], - "models.focalnet": ["FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FocalNetConfig"], + "models.fnet": ["FNetConfig"], + "models.focalnet": ["FocalNetConfig"], "models.fsmt": [ - "FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FSMTConfig", "FSMTTokenizer", ], "models.funnel": [ - "FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig", "FunnelTokenizer", ], - "models.fuyu": ["FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP", "FuyuConfig"], - "models.gemma": ["GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "GemmaConfig"], + "models.fuyu": ["FuyuConfig"], + "models.gemma": ["GemmaConfig"], "models.git": [ - "GIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GitConfig", "GitProcessor", "GitVisionConfig", ], - "models.glpn": ["GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP", "GLPNConfig"], + "models.glpn": ["GLPNConfig"], "models.gpt2": [ - "GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2Tokenizer", ], - "models.gpt_bigcode": [ - "GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP", - "GPTBigCodeConfig", - ], - "models.gpt_neo": ["GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoConfig"], - "models.gpt_neox": ["GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXConfig"], - "models.gpt_neox_japanese": [ - "GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", - "GPTNeoXJapaneseConfig", - ], + "models.gpt_bigcode": ["GPTBigCodeConfig"], + "models.gpt_neo": ["GPTNeoConfig"], + "models.gpt_neox": ["GPTNeoXConfig"], + "models.gpt_neox_japanese": ["GPTNeoXJapaneseConfig"], "models.gpt_sw3": [], - "models.gptj": ["GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTJConfig"], + "models.gptj": ["GPTJConfig"], "models.gptsan_japanese": [ - "GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTSanJapaneseConfig", "GPTSanJapaneseTokenizer", ], - "models.graphormer": [ - "GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "GraphormerConfig", - ], + "models.graphormer": ["GraphormerConfig"], "models.groupvit": [ - "GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GroupViTConfig", "GroupViTTextConfig", "GroupViTVisionConfig", ], "models.herbert": ["HerbertTokenizer"], - "models.hubert": ["HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "HubertConfig"], - "models.ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig"], - "models.idefics": [ - "IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP", - "IdeficsConfig", - ], - "models.imagegpt": ["IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ImageGPTConfig"], - "models.informer": ["INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "InformerConfig"], + "models.hubert": ["HubertConfig"], + "models.ibert": ["IBertConfig"], + "models.idefics": ["IdeficsConfig"], + "models.imagegpt": ["ImageGPTConfig"], + "models.informer": ["InformerConfig"], "models.instructblip": [ - "INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "InstructBlipConfig", "InstructBlipProcessor", "InstructBlipQFormerConfig", "InstructBlipVisionConfig", ], "models.jukebox": [ - "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "JukeboxConfig", "JukeboxPriorConfig", "JukeboxTokenizer", "JukeboxVQVAEConfig", ], "models.kosmos2": [ - "KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Kosmos2Config", "Kosmos2Processor", ], "models.layoutlm": [ - "LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMConfig", "LayoutLMTokenizer", ], "models.layoutlmv2": [ - "LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv2Config", "LayoutLMv2FeatureExtractor", "LayoutLMv2ImageProcessor", @@ -540,7 +447,6 @@ "LayoutLMv2Tokenizer", ], "models.layoutlmv3": [ - "LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv3Config", "LayoutLMv3FeatureExtractor", "LayoutLMv3ImageProcessor", @@ -563,85 +469,61 @@ "LlavaNextProcessor", ], "models.longformer": [ - "LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongformerConfig", "LongformerTokenizer", ], - "models.longt5": ["LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongT5Config"], + "models.longt5": ["LongT5Config"], "models.luke": [ - "LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP", "LukeConfig", "LukeTokenizer", ], "models.lxmert": [ - "LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LxmertConfig", "LxmertTokenizer", ], - "models.m2m_100": ["M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP", "M2M100Config"], - "models.mamba": ["MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MambaConfig"], + "models.m2m_100": ["M2M100Config"], + "models.mamba": ["MambaConfig"], "models.marian": ["MarianConfig"], "models.markuplm": [ - "MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "MarkupLMConfig", "MarkupLMFeatureExtractor", "MarkupLMProcessor", "MarkupLMTokenizer", ], - "models.mask2former": [ - "MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "Mask2FormerConfig", - ], + "models.mask2former": ["Mask2FormerConfig"], "models.maskformer": [ - "MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "MaskFormerConfig", "MaskFormerSwinConfig", ], "models.mbart": ["MBartConfig"], "models.mbart50": [], - "models.mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig"], - "models.megatron_bert": [ - "MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", - "MegatronBertConfig", - ], + "models.mega": ["MegaConfig"], + "models.megatron_bert": ["MegatronBertConfig"], "models.megatron_gpt2": [], "models.mgp_str": [ - "MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP", "MgpstrConfig", "MgpstrProcessor", "MgpstrTokenizer", ], - "models.mistral": ["MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MistralConfig"], - "models.mixtral": ["MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MixtralConfig"], + "models.mistral": ["MistralConfig"], + "models.mixtral": ["MixtralConfig"], "models.mluke": [], "models.mobilebert": [ - "MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileBertConfig", "MobileBertTokenizer", ], - "models.mobilenet_v1": [ - "MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP", - "MobileNetV1Config", - ], - "models.mobilenet_v2": [ - "MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", - "MobileNetV2Config", - ], - "models.mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTConfig"], - "models.mobilevitv2": [ - "MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP", - "MobileViTV2Config", - ], + "models.mobilenet_v1": ["MobileNetV1Config"], + "models.mobilenet_v2": ["MobileNetV2Config"], + "models.mobilevit": ["MobileViTConfig"], + "models.mobilevitv2": ["MobileViTV2Config"], "models.mpnet": [ - "MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "MPNetConfig", "MPNetTokenizer", ], - "models.mpt": ["MPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MptConfig"], - "models.mra": ["MRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MraConfig"], + "models.mpt": ["MptConfig"], + "models.mra": ["MraConfig"], "models.mt5": ["MT5Config"], "models.musicgen": [ - "MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "MusicgenConfig", "MusicgenDecoderConfig", ], @@ -651,120 +533,91 @@ "MusicgenMelodyDecoderConfig", ], "models.mvp": ["MvpConfig", "MvpTokenizer"], - "models.nat": ["NAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "NatConfig"], - "models.nezha": ["NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP", "NezhaConfig"], + "models.nat": ["NatConfig"], + "models.nezha": ["NezhaConfig"], "models.nllb": [], - "models.nllb_moe": ["NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP", "NllbMoeConfig"], + "models.nllb_moe": ["NllbMoeConfig"], "models.nougat": ["NougatProcessor"], - "models.nystromformer": [ - "NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "NystromformerConfig", - ], + "models.nystromformer": ["NystromformerConfig"], "models.oneformer": [ - "ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "OneFormerConfig", "OneFormerProcessor", ], "models.openai": [ - "OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenAIGPTConfig", "OpenAIGPTTokenizer", ], "models.opt": ["OPTConfig"], "models.owlv2": [ - "OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Owlv2Config", "Owlv2Processor", "Owlv2TextConfig", "Owlv2VisionConfig", ], "models.owlvit": [ - "OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OwlViTConfig", "OwlViTProcessor", "OwlViTTextConfig", "OwlViTVisionConfig", ], - "models.patchtsmixer": [ - "PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "PatchTSMixerConfig", - ], - "models.patchtst": ["PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP", "PatchTSTConfig"], + "models.patchtsmixer": ["PatchTSMixerConfig"], + "models.patchtst": ["PatchTSTConfig"], "models.pegasus": [ - "PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusConfig", "PegasusTokenizer", ], - "models.pegasus_x": ["PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusXConfig"], + "models.pegasus_x": ["PegasusXConfig"], "models.perceiver": [ - "PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PerceiverConfig", "PerceiverTokenizer", ], - "models.persimmon": ["PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP", "PersimmonConfig"], - "models.phi": ["PHI_PRETRAINED_CONFIG_ARCHIVE_MAP", "PhiConfig"], + "models.persimmon": ["PersimmonConfig"], + "models.phi": ["PhiConfig"], "models.phobert": ["PhobertTokenizer"], "models.pix2struct": [ - "PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Pix2StructConfig", "Pix2StructProcessor", "Pix2StructTextConfig", "Pix2StructVisionConfig", ], - "models.plbart": ["PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP", "PLBartConfig"], - "models.poolformer": [ - "POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "PoolFormerConfig", - ], - "models.pop2piano": [ - "POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP", - "Pop2PianoConfig", - ], + "models.plbart": ["PLBartConfig"], + "models.poolformer": ["PoolFormerConfig"], + "models.pop2piano": ["Pop2PianoConfig"], "models.prophetnet": [ - "PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ProphetNetConfig", "ProphetNetTokenizer", ], - "models.pvt": ["PVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtConfig"], + "models.pvt": ["PvtConfig"], "models.pvt_v2": ["PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtV2Config"], - "models.qdqbert": ["QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "QDQBertConfig"], + "models.qdqbert": ["QDQBertConfig"], "models.qwen2": [ - "QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Qwen2Config", "Qwen2Tokenizer", ], "models.rag": ["RagConfig", "RagRetriever", "RagTokenizer"], "models.realm": [ - "REALM_PRETRAINED_CONFIG_ARCHIVE_MAP", "RealmConfig", "RealmTokenizer", ], - "models.reformer": ["REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ReformerConfig"], - "models.regnet": ["REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "RegNetConfig"], - "models.rembert": ["REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RemBertConfig"], - "models.resnet": ["RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ResNetConfig"], + "models.reformer": ["ReformerConfig"], + "models.regnet": ["RegNetConfig"], + "models.rembert": ["RemBertConfig"], + "models.resnet": ["ResNetConfig"], "models.roberta": [ - "ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "RobertaConfig", "RobertaTokenizer", ], - "models.roberta_prelayernorm": [ - "ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP", - "RobertaPreLayerNormConfig", - ], + "models.roberta_prelayernorm": ["RobertaPreLayerNormConfig"], "models.roc_bert": [ - "ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoCBertConfig", "RoCBertTokenizer", ], "models.roformer": [ - "ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoFormerConfig", "RoFormerTokenizer", ], - "models.rwkv": ["RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP", "RwkvConfig"], + "models.rwkv": ["RwkvConfig"], "models.sam": [ - "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP", "SamConfig", "SamMaskDecoderConfig", "SamProcessor", @@ -772,21 +625,16 @@ "SamVisionConfig", ], "models.seamless_m4t": [ - "SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP", "SeamlessM4TConfig", "SeamlessM4TFeatureExtractor", "SeamlessM4TProcessor", ], - "models.seamless_m4t_v2": [ - "SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", - "SeamlessM4Tv2Config", - ], - "models.segformer": ["SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegformerConfig"], - "models.seggpt": ["SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegGptConfig"], - "models.sew": ["SEW_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWConfig"], - "models.sew_d": ["SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWDConfig"], + "models.seamless_m4t_v2": ["SeamlessM4Tv2Config"], + "models.segformer": ["SegformerConfig"], + "models.seggpt": ["SegGptConfig"], + "models.sew": ["SEWConfig"], + "models.sew_d": ["SEWDConfig"], "models.siglip": [ - "SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "SiglipConfig", "SiglipProcessor", "SiglipTextConfig", @@ -794,32 +642,26 @@ ], "models.speech_encoder_decoder": ["SpeechEncoderDecoderConfig"], "models.speech_to_text": [ - "SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2TextConfig", "Speech2TextFeatureExtractor", "Speech2TextProcessor", ], "models.speech_to_text_2": [ - "SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2Text2Config", "Speech2Text2Processor", "Speech2Text2Tokenizer", ], "models.speecht5": [ - "SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP", - "SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP", "SpeechT5Config", "SpeechT5FeatureExtractor", "SpeechT5HifiGanConfig", "SpeechT5Processor", ], "models.splinter": [ - "SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SplinterConfig", "SplinterTokenizer", ], "models.squeezebert": [ - "SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SqueezeBertConfig", "SqueezeBertTokenizer", ], @@ -843,96 +685,63 @@ "TableTransformerConfig", ], "models.tapas": [ - "TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig", "TapasTokenizer", ], - "models.time_series_transformer": [ - "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "TimeSeriesTransformerConfig", - ], - "models.timesformer": [ - "TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "TimesformerConfig", - ], + "models.time_series_transformer": ["TimeSeriesTransformerConfig"], + "models.timesformer": ["TimesformerConfig"], "models.timm_backbone": ["TimmBackboneConfig"], "models.trocr": [ - "TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP", "TrOCRConfig", "TrOCRProcessor", ], "models.tvlt": [ - "TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP", "TvltConfig", "TvltFeatureExtractor", "TvltProcessor", ], "models.tvp": [ - "TVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "TvpConfig", "TvpProcessor", ], "models.udop": [ - "UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP", "UdopConfig", "UdopProcessor", ], "models.umt5": ["UMT5Config"], - "models.unispeech": [ - "UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP", - "UniSpeechConfig", - ], - "models.unispeech_sat": [ - "UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP", - "UniSpeechSatConfig", - ], + "models.unispeech": ["UniSpeechConfig"], + "models.unispeech_sat": ["UniSpeechSatConfig"], "models.univnet": [ - "UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "UnivNetConfig", "UnivNetFeatureExtractor", ], "models.upernet": ["UperNetConfig"], - "models.videomae": ["VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VideoMAEConfig"], + "models.videomae": ["VideoMAEConfig"], "models.vilt": [ - "VILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViltConfig", "ViltFeatureExtractor", "ViltImageProcessor", "ViltProcessor", ], - "models.vipllava": [ - "VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", - "VipLlavaConfig", - ], + "models.vipllava": ["VipLlavaConfig"], "models.vision_encoder_decoder": ["VisionEncoderDecoderConfig"], "models.vision_text_dual_encoder": [ "VisionTextDualEncoderConfig", "VisionTextDualEncoderProcessor", ], - "models.visual_bert": [ - "VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", - "VisualBertConfig", - ], - "models.vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig"], - "models.vit_hybrid": [ - "VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP", - "ViTHybridConfig", - ], - "models.vit_mae": ["VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMAEConfig"], - "models.vit_msn": ["VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMSNConfig"], - "models.vitdet": ["VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitDetConfig"], - "models.vitmatte": ["VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitMatteConfig"], + "models.visual_bert": ["VisualBertConfig"], + "models.vit": ["ViTConfig"], + "models.vit_hybrid": ["ViTHybridConfig"], + "models.vit_mae": ["ViTMAEConfig"], + "models.vit_msn": ["ViTMSNConfig"], + "models.vitdet": ["VitDetConfig"], + "models.vitmatte": ["VitMatteConfig"], "models.vits": [ - "VITS_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitsConfig", "VitsTokenizer", ], - "models.vivit": [ - "VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", - "VivitConfig", - ], + "models.vivit": ["VivitConfig"], "models.wav2vec2": [ - "WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Wav2Vec2Config", "Wav2Vec2CTCTokenizer", "Wav2Vec2FeatureExtractor", @@ -940,52 +749,34 @@ "Wav2Vec2Tokenizer", ], "models.wav2vec2_bert": [ - "WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Wav2Vec2BertConfig", "Wav2Vec2BertProcessor", ], - "models.wav2vec2_conformer": [ - "WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "Wav2Vec2ConformerConfig", - ], + "models.wav2vec2_conformer": ["Wav2Vec2ConformerConfig"], "models.wav2vec2_phoneme": ["Wav2Vec2PhonemeCTCTokenizer"], "models.wav2vec2_with_lm": ["Wav2Vec2ProcessorWithLM"], - "models.wavlm": [ - "WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP", - "WavLMConfig", - ], + "models.wavlm": ["WavLMConfig"], "models.whisper": [ - "WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP", "WhisperConfig", "WhisperFeatureExtractor", "WhisperProcessor", "WhisperTokenizer", ], "models.x_clip": [ - "XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "XCLIPConfig", "XCLIPProcessor", "XCLIPTextConfig", "XCLIPVisionConfig", ], - "models.xglm": ["XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XGLMConfig"], - "models.xlm": ["XLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMConfig", "XLMTokenizer"], - "models.xlm_prophetnet": [ - "XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", - "XLMProphetNetConfig", - ], - "models.xlm_roberta": [ - "XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", - "XLMRobertaConfig", - ], - "models.xlm_roberta_xl": [ - "XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", - "XLMRobertaXLConfig", - ], - "models.xlnet": ["XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLNetConfig"], - "models.xmod": ["XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP", "XmodConfig"], - "models.yolos": ["YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP", "YolosConfig"], - "models.yoso": ["YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP", "YosoConfig"], + "models.xglm": ["XGLMConfig"], + "models.xlm": ["XLMConfig", "XLMTokenizer"], + "models.xlm_prophetnet": ["XLMProphetNetConfig"], + "models.xlm_roberta": ["XLMRobertaConfig"], + "models.xlm_roberta_xl": ["XLMRobertaXLConfig"], + "models.xlnet": ["XLNetConfig"], + "models.xmod": ["XmodConfig"], + "models.yolos": ["YolosConfig"], + "models.yoso": ["YosoConfig"], "onnx": [], "pipelines": [ "AudioClassificationPipeline", @@ -1438,7 +1229,6 @@ _import_structure["models.albert"].extend( [ - "ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "AlbertForMaskedLM", "AlbertForMultipleChoice", "AlbertForPreTraining", @@ -1453,7 +1243,6 @@ _import_structure["models.align"].extend( [ - "ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST", "AlignModel", "AlignPreTrainedModel", "AlignTextModel", @@ -1462,7 +1251,6 @@ ) _import_structure["models.altclip"].extend( [ - "ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "AltCLIPModel", "AltCLIPPreTrainedModel", "AltCLIPTextModel", @@ -1471,7 +1259,6 @@ ) _import_structure["models.audio_spectrogram_transformer"].extend( [ - "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ASTForAudioClassification", "ASTModel", "ASTPreTrainedModel", @@ -1563,7 +1350,6 @@ ) _import_structure["models.autoformer"].extend( [ - "AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "AutoformerForPrediction", "AutoformerModel", "AutoformerPreTrainedModel", @@ -1571,7 +1357,6 @@ ) _import_structure["models.bark"].extend( [ - "BARK_PRETRAINED_MODEL_ARCHIVE_LIST", "BarkCausalModel", "BarkCoarseModel", "BarkFineModel", @@ -1582,7 +1367,6 @@ ) _import_structure["models.bart"].extend( [ - "BART_PRETRAINED_MODEL_ARCHIVE_LIST", "BartForCausalLM", "BartForConditionalGeneration", "BartForQuestionAnswering", @@ -1595,7 +1379,6 @@ ) _import_structure["models.beit"].extend( [ - "BEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BeitBackbone", "BeitForImageClassification", "BeitForMaskedImageModeling", @@ -1606,7 +1389,6 @@ ) _import_structure["models.bert"].extend( [ - "BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "BertForMaskedLM", "BertForMultipleChoice", "BertForNextSentencePrediction", @@ -1631,7 +1413,6 @@ ) _import_structure["models.big_bird"].extend( [ - "BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdForCausalLM", "BigBirdForMaskedLM", "BigBirdForMultipleChoice", @@ -1647,7 +1428,6 @@ ) _import_structure["models.bigbird_pegasus"].extend( [ - "BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdPegasusForCausalLM", "BigBirdPegasusForConditionalGeneration", "BigBirdPegasusForQuestionAnswering", @@ -1658,7 +1438,6 @@ ) _import_structure["models.biogpt"].extend( [ - "BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "BioGptForCausalLM", "BioGptForSequenceClassification", "BioGptForTokenClassification", @@ -1668,7 +1447,6 @@ ) _import_structure["models.bit"].extend( [ - "BIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BitBackbone", "BitForImageClassification", "BitModel", @@ -1677,7 +1455,6 @@ ) _import_structure["models.blenderbot"].extend( [ - "BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotForCausalLM", "BlenderbotForConditionalGeneration", "BlenderbotModel", @@ -1686,7 +1463,6 @@ ) _import_structure["models.blenderbot_small"].extend( [ - "BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotSmallForCausalLM", "BlenderbotSmallForConditionalGeneration", "BlenderbotSmallModel", @@ -1695,7 +1471,6 @@ ) _import_structure["models.blip"].extend( [ - "BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "BlipForConditionalGeneration", "BlipForImageTextRetrieval", "BlipForQuestionAnswering", @@ -1707,7 +1482,6 @@ ) _import_structure["models.blip_2"].extend( [ - "BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Blip2ForConditionalGeneration", "Blip2Model", "Blip2PreTrainedModel", @@ -1717,7 +1491,6 @@ ) _import_structure["models.bloom"].extend( [ - "BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST", "BloomForCausalLM", "BloomForQuestionAnswering", "BloomForSequenceClassification", @@ -1728,7 +1501,6 @@ ) _import_structure["models.bridgetower"].extend( [ - "BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST", "BridgeTowerForContrastiveLearning", "BridgeTowerForImageAndTextRetrieval", "BridgeTowerForMaskedLM", @@ -1738,7 +1510,6 @@ ) _import_structure["models.bros"].extend( [ - "BROS_PRETRAINED_MODEL_ARCHIVE_LIST", "BrosForTokenClassification", "BrosModel", "BrosPreTrainedModel", @@ -1749,7 +1520,6 @@ ) _import_structure["models.camembert"].extend( [ - "CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "CamembertForCausalLM", "CamembertForMaskedLM", "CamembertForMultipleChoice", @@ -1762,7 +1532,6 @@ ) _import_structure["models.canine"].extend( [ - "CANINE_PRETRAINED_MODEL_ARCHIVE_LIST", "CanineForMultipleChoice", "CanineForQuestionAnswering", "CanineForSequenceClassification", @@ -1775,7 +1544,6 @@ ) _import_structure["models.chinese_clip"].extend( [ - "CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "ChineseCLIPModel", "ChineseCLIPPreTrainedModel", "ChineseCLIPTextModel", @@ -1784,7 +1552,6 @@ ) _import_structure["models.clap"].extend( [ - "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapAudioModel", "ClapAudioModelWithProjection", "ClapFeatureExtractor", @@ -1796,7 +1563,6 @@ ) _import_structure["models.clip"].extend( [ - "CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPForImageClassification", "CLIPModel", "CLIPPreTrainedModel", @@ -1808,7 +1574,6 @@ ) _import_structure["models.clipseg"].extend( [ - "CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPSegForImageSegmentation", "CLIPSegModel", "CLIPSegPreTrainedModel", @@ -1818,7 +1583,6 @@ ) _import_structure["models.clvp"].extend( [ - "CLVP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClvpDecoder", "ClvpEncoder", "ClvpForCausalLM", @@ -1829,7 +1593,6 @@ ) _import_structure["models.codegen"].extend( [ - "CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "CodeGenForCausalLM", "CodeGenModel", "CodeGenPreTrainedModel", @@ -1838,7 +1601,6 @@ _import_structure["models.cohere"].extend(["CohereForCausalLM", "CohereModel", "CoherePreTrainedModel"]) _import_structure["models.conditional_detr"].extend( [ - "CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "ConditionalDetrForObjectDetection", "ConditionalDetrForSegmentation", "ConditionalDetrModel", @@ -1847,7 +1609,6 @@ ) _import_structure["models.convbert"].extend( [ - "CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvBertForMaskedLM", "ConvBertForMultipleChoice", "ConvBertForQuestionAnswering", @@ -1861,7 +1622,6 @@ ) _import_structure["models.convnext"].extend( [ - "CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextBackbone", "ConvNextForImageClassification", "ConvNextModel", @@ -1870,7 +1630,6 @@ ) _import_structure["models.convnextv2"].extend( [ - "CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextV2Backbone", "ConvNextV2ForImageClassification", "ConvNextV2Model", @@ -1879,7 +1638,6 @@ ) _import_structure["models.cpmant"].extend( [ - "CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST", "CpmAntForCausalLM", "CpmAntModel", "CpmAntPreTrainedModel", @@ -1887,7 +1645,6 @@ ) _import_structure["models.ctrl"].extend( [ - "CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "CTRLForSequenceClassification", "CTRLLMHeadModel", "CTRLModel", @@ -1896,7 +1653,6 @@ ) _import_structure["models.cvt"].extend( [ - "CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "CvtForImageClassification", "CvtModel", "CvtPreTrainedModel", @@ -1904,9 +1660,6 @@ ) _import_structure["models.data2vec"].extend( [ - "DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST", - "DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", - "DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecAudioForAudioFrameClassification", "Data2VecAudioForCTC", "Data2VecAudioForSequenceClassification", @@ -1929,7 +1682,6 @@ ) _import_structure["models.deberta"].extend( [ - "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaForMaskedLM", "DebertaForQuestionAnswering", "DebertaForSequenceClassification", @@ -1940,7 +1692,6 @@ ) _import_structure["models.deberta_v2"].extend( [ - "DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaV2ForMaskedLM", "DebertaV2ForMultipleChoice", "DebertaV2ForQuestionAnswering", @@ -1952,7 +1703,6 @@ ) _import_structure["models.decision_transformer"].extend( [ - "DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "DecisionTransformerGPT2Model", "DecisionTransformerGPT2PreTrainedModel", "DecisionTransformerModel", @@ -1961,7 +1711,6 @@ ) _import_structure["models.deformable_detr"].extend( [ - "DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DeformableDetrForObjectDetection", "DeformableDetrModel", "DeformableDetrPreTrainedModel", @@ -1969,7 +1718,6 @@ ) _import_structure["models.deit"].extend( [ - "DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "DeiTForImageClassification", "DeiTForImageClassificationWithTeacher", "DeiTForMaskedImageModeling", @@ -1979,7 +1727,6 @@ ) _import_structure["models.deprecated.mctct"].extend( [ - "MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST", "MCTCTForCTC", "MCTCTModel", "MCTCTPreTrainedModel", @@ -1996,21 +1743,18 @@ ) _import_structure["models.deprecated.retribert"].extend( [ - "RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RetriBertModel", "RetriBertPreTrainedModel", ] ) _import_structure["models.deprecated.trajectory_transformer"].extend( [ - "TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TrajectoryTransformerModel", "TrajectoryTransformerPreTrainedModel", ] ) _import_structure["models.deprecated.transfo_xl"].extend( [ - "TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "AdaptiveEmbedding", "TransfoXLForSequenceClassification", "TransfoXLLMHeadModel", @@ -2021,7 +1765,6 @@ ) _import_structure["models.deprecated.van"].extend( [ - "VAN_PRETRAINED_MODEL_ARCHIVE_LIST", "VanForImageClassification", "VanModel", "VanPreTrainedModel", @@ -2029,14 +1772,12 @@ ) _import_structure["models.depth_anything"].extend( [ - "DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST", "DepthAnythingForDepthEstimation", "DepthAnythingPreTrainedModel", ] ) _import_structure["models.deta"].extend( [ - "DETA_PRETRAINED_MODEL_ARCHIVE_LIST", "DetaForObjectDetection", "DetaModel", "DetaPreTrainedModel", @@ -2044,7 +1785,6 @@ ) _import_structure["models.detr"].extend( [ - "DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DetrForObjectDetection", "DetrForSegmentation", "DetrModel", @@ -2053,7 +1793,6 @@ ) _import_structure["models.dinat"].extend( [ - "DINAT_PRETRAINED_MODEL_ARCHIVE_LIST", "DinatBackbone", "DinatForImageClassification", "DinatModel", @@ -2062,7 +1801,6 @@ ) _import_structure["models.dinov2"].extend( [ - "DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Dinov2Backbone", "Dinov2ForImageClassification", "Dinov2Model", @@ -2071,7 +1809,6 @@ ) _import_structure["models.distilbert"].extend( [ - "DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "DistilBertForMaskedLM", "DistilBertForMultipleChoice", "DistilBertForQuestionAnswering", @@ -2083,16 +1820,12 @@ ) _import_structure["models.donut"].extend( [ - "DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "DonutSwinModel", "DonutSwinPreTrainedModel", ] ) _import_structure["models.dpr"].extend( [ - "DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "DPRContextEncoder", "DPRPretrainedContextEncoder", "DPRPreTrainedModel", @@ -2104,7 +1837,6 @@ ) _import_structure["models.dpt"].extend( [ - "DPT_PRETRAINED_MODEL_ARCHIVE_LIST", "DPTForDepthEstimation", "DPTForSemanticSegmentation", "DPTModel", @@ -2113,7 +1845,6 @@ ) _import_structure["models.efficientformer"].extend( [ - "EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientFormerForImageClassification", "EfficientFormerForImageClassificationWithTeacher", "EfficientFormerModel", @@ -2122,7 +1853,6 @@ ) _import_structure["models.efficientnet"].extend( [ - "EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientNetForImageClassification", "EfficientNetModel", "EfficientNetPreTrainedModel", @@ -2130,7 +1860,6 @@ ) _import_structure["models.electra"].extend( [ - "ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "ElectraForCausalLM", "ElectraForMaskedLM", "ElectraForMultipleChoice", @@ -2145,7 +1874,6 @@ ) _import_structure["models.encodec"].extend( [ - "ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST", "EncodecModel", "EncodecPreTrainedModel", ] @@ -2153,7 +1881,6 @@ _import_structure["models.encoder_decoder"].append("EncoderDecoderModel") _import_structure["models.ernie"].extend( [ - "ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieForCausalLM", "ErnieForMaskedLM", "ErnieForMultipleChoice", @@ -2168,7 +1895,6 @@ ) _import_structure["models.ernie_m"].extend( [ - "ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieMForInformationExtraction", "ErnieMForMultipleChoice", "ErnieMForQuestionAnswering", @@ -2180,7 +1906,6 @@ ) _import_structure["models.esm"].extend( [ - "ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "EsmFoldPreTrainedModel", "EsmForMaskedLM", "EsmForProteinFolding", @@ -2192,7 +1917,6 @@ ) _import_structure["models.falcon"].extend( [ - "FALCON_PRETRAINED_MODEL_ARCHIVE_LIST", "FalconForCausalLM", "FalconForQuestionAnswering", "FalconForSequenceClassification", @@ -2203,7 +1927,6 @@ ) _import_structure["models.fastspeech2_conformer"].extend( [ - "FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "FastSpeech2ConformerHifiGan", "FastSpeech2ConformerModel", "FastSpeech2ConformerPreTrainedModel", @@ -2212,7 +1935,6 @@ ) _import_structure["models.flaubert"].extend( [ - "FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaubertForMultipleChoice", "FlaubertForQuestionAnswering", "FlaubertForQuestionAnsweringSimple", @@ -2225,7 +1947,6 @@ ) _import_structure["models.flava"].extend( [ - "FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlavaForPreTraining", "FlavaImageCodebook", "FlavaImageModel", @@ -2237,7 +1958,6 @@ ) _import_structure["models.fnet"].extend( [ - "FNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FNetForMaskedLM", "FNetForMultipleChoice", "FNetForNextSentencePrediction", @@ -2252,7 +1972,6 @@ ) _import_structure["models.focalnet"].extend( [ - "FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FocalNetBackbone", "FocalNetForImageClassification", "FocalNetForMaskedImageModeling", @@ -2263,7 +1982,6 @@ _import_structure["models.fsmt"].extend(["FSMTForConditionalGeneration", "FSMTModel", "PretrainedFSMTModel"]) _import_structure["models.funnel"].extend( [ - "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "FunnelBaseModel", "FunnelForMaskedLM", "FunnelForMultipleChoice", @@ -2287,7 +2005,6 @@ ) _import_structure["models.git"].extend( [ - "GIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GitForCausalLM", "GitModel", "GitPreTrainedModel", @@ -2296,7 +2013,6 @@ ) _import_structure["models.glpn"].extend( [ - "GLPN_PRETRAINED_MODEL_ARCHIVE_LIST", "GLPNForDepthEstimation", "GLPNModel", "GLPNPreTrainedModel", @@ -2304,7 +2020,6 @@ ) _import_structure["models.gpt2"].extend( [ - "GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "GPT2DoubleHeadsModel", "GPT2ForQuestionAnswering", "GPT2ForSequenceClassification", @@ -2317,7 +2032,6 @@ ) _import_structure["models.gpt_bigcode"].extend( [ - "GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTBigCodeForCausalLM", "GPTBigCodeForSequenceClassification", "GPTBigCodeForTokenClassification", @@ -2327,7 +2041,6 @@ ) _import_structure["models.gpt_neo"].extend( [ - "GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoForCausalLM", "GPTNeoForQuestionAnswering", "GPTNeoForSequenceClassification", @@ -2339,7 +2052,6 @@ ) _import_structure["models.gpt_neox"].extend( [ - "GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXForCausalLM", "GPTNeoXForQuestionAnswering", "GPTNeoXForSequenceClassification", @@ -2351,7 +2063,6 @@ ) _import_structure["models.gpt_neox_japanese"].extend( [ - "GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXJapaneseForCausalLM", "GPTNeoXJapaneseLayer", "GPTNeoXJapaneseModel", @@ -2360,7 +2071,6 @@ ) _import_structure["models.gptj"].extend( [ - "GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTJForCausalLM", "GPTJForQuestionAnswering", "GPTJForSequenceClassification", @@ -2370,7 +2080,6 @@ ) _import_structure["models.gptsan_japanese"].extend( [ - "GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTSanJapaneseForConditionalGeneration", "GPTSanJapaneseModel", "GPTSanJapanesePreTrainedModel", @@ -2378,7 +2087,6 @@ ) _import_structure["models.graphormer"].extend( [ - "GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "GraphormerForGraphClassification", "GraphormerModel", "GraphormerPreTrainedModel", @@ -2386,7 +2094,6 @@ ) _import_structure["models.groupvit"].extend( [ - "GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GroupViTModel", "GroupViTPreTrainedModel", "GroupViTTextModel", @@ -2395,7 +2102,6 @@ ) _import_structure["models.hubert"].extend( [ - "HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "HubertForCTC", "HubertForSequenceClassification", "HubertModel", @@ -2404,7 +2110,6 @@ ) _import_structure["models.ibert"].extend( [ - "IBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "IBertForMaskedLM", "IBertForMultipleChoice", "IBertForQuestionAnswering", @@ -2416,7 +2121,6 @@ ) _import_structure["models.idefics"].extend( [ - "IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST", "IdeficsForVisionText2Text", "IdeficsModel", "IdeficsPreTrainedModel", @@ -2425,7 +2129,6 @@ ) _import_structure["models.imagegpt"].extend( [ - "IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "ImageGPTForCausalImageModeling", "ImageGPTForImageClassification", "ImageGPTModel", @@ -2435,7 +2138,6 @@ ) _import_structure["models.informer"].extend( [ - "INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "InformerForPrediction", "InformerModel", "InformerPreTrainedModel", @@ -2443,7 +2145,6 @@ ) _import_structure["models.instructblip"].extend( [ - "INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "InstructBlipForConditionalGeneration", "InstructBlipPreTrainedModel", "InstructBlipQFormerModel", @@ -2452,7 +2153,6 @@ ) _import_structure["models.jukebox"].extend( [ - "JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST", "JukeboxModel", "JukeboxPreTrainedModel", "JukeboxPrior", @@ -2461,7 +2161,6 @@ ) _import_structure["models.kosmos2"].extend( [ - "KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST", "Kosmos2ForConditionalGeneration", "Kosmos2Model", "Kosmos2PreTrainedModel", @@ -2469,7 +2168,6 @@ ) _import_structure["models.layoutlm"].extend( [ - "LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMForMaskedLM", "LayoutLMForQuestionAnswering", "LayoutLMForSequenceClassification", @@ -2480,7 +2178,6 @@ ) _import_structure["models.layoutlmv2"].extend( [ - "LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv2ForQuestionAnswering", "LayoutLMv2ForSequenceClassification", "LayoutLMv2ForTokenClassification", @@ -2490,7 +2187,6 @@ ) _import_structure["models.layoutlmv3"].extend( [ - "LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv3ForQuestionAnswering", "LayoutLMv3ForSequenceClassification", "LayoutLMv3ForTokenClassification", @@ -2500,7 +2196,6 @@ ) _import_structure["models.led"].extend( [ - "LED_PRETRAINED_MODEL_ARCHIVE_LIST", "LEDForConditionalGeneration", "LEDForQuestionAnswering", "LEDForSequenceClassification", @@ -2510,7 +2205,6 @@ ) _import_structure["models.levit"].extend( [ - "LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "LevitForImageClassification", "LevitForImageClassificationWithTeacher", "LevitModel", @@ -2519,7 +2213,6 @@ ) _import_structure["models.lilt"].extend( [ - "LILT_PRETRAINED_MODEL_ARCHIVE_LIST", "LiltForQuestionAnswering", "LiltForSequenceClassification", "LiltForTokenClassification", @@ -2538,7 +2231,6 @@ ) _import_structure["models.llava"].extend( [ - "LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "LlavaForConditionalGeneration", "LlavaPreTrainedModel", ] @@ -2552,7 +2244,6 @@ ) _import_structure["models.longformer"].extend( [ - "LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "LongformerForMaskedLM", "LongformerForMultipleChoice", "LongformerForQuestionAnswering", @@ -2565,7 +2256,6 @@ ) _import_structure["models.longt5"].extend( [ - "LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST", "LongT5EncoderModel", "LongT5ForConditionalGeneration", "LongT5Model", @@ -2574,7 +2264,6 @@ ) _import_structure["models.luke"].extend( [ - "LUKE_PRETRAINED_MODEL_ARCHIVE_LIST", "LukeForEntityClassification", "LukeForEntityPairClassification", "LukeForEntitySpanClassification", @@ -2600,7 +2289,6 @@ ) _import_structure["models.m2m_100"].extend( [ - "M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST", "M2M100ForConditionalGeneration", "M2M100Model", "M2M100PreTrainedModel", @@ -2608,7 +2296,6 @@ ) _import_structure["models.mamba"].extend( [ - "MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST", "MambaForCausalLM", "MambaModel", "MambaPreTrainedModel", @@ -2617,7 +2304,6 @@ _import_structure["models.marian"].extend(["MarianForCausalLM", "MarianModel", "MarianMTModel"]) _import_structure["models.markuplm"].extend( [ - "MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST", "MarkupLMForQuestionAnswering", "MarkupLMForSequenceClassification", "MarkupLMForTokenClassification", @@ -2627,7 +2313,6 @@ ) _import_structure["models.mask2former"].extend( [ - "MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Mask2FormerForUniversalSegmentation", "Mask2FormerModel", "Mask2FormerPreTrainedModel", @@ -2635,7 +2320,6 @@ ) _import_structure["models.maskformer"].extend( [ - "MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "MaskFormerForInstanceSegmentation", "MaskFormerModel", "MaskFormerPreTrainedModel", @@ -2654,7 +2338,6 @@ ) _import_structure["models.mega"].extend( [ - "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST", "MegaForCausalLM", "MegaForMaskedLM", "MegaForMultipleChoice", @@ -2667,7 +2350,6 @@ ) _import_structure["models.megatron_bert"].extend( [ - "MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MegatronBertForCausalLM", "MegatronBertForMaskedLM", "MegatronBertForMultipleChoice", @@ -2682,7 +2364,6 @@ ) _import_structure["models.mgp_str"].extend( [ - "MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST", "MgpstrForSceneTextRecognition", "MgpstrModel", "MgpstrPreTrainedModel", @@ -2701,7 +2382,6 @@ ) _import_structure["models.mobilebert"].extend( [ - "MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileBertForMaskedLM", "MobileBertForMultipleChoice", "MobileBertForNextSentencePrediction", @@ -2717,7 +2397,6 @@ ) _import_structure["models.mobilenet_v1"].extend( [ - "MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV1ForImageClassification", "MobileNetV1Model", "MobileNetV1PreTrainedModel", @@ -2726,7 +2405,6 @@ ) _import_structure["models.mobilenet_v2"].extend( [ - "MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV2ForImageClassification", "MobileNetV2ForSemanticSegmentation", "MobileNetV2Model", @@ -2736,7 +2414,6 @@ ) _import_structure["models.mobilevit"].extend( [ - "MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTForImageClassification", "MobileViTForSemanticSegmentation", "MobileViTModel", @@ -2745,7 +2422,6 @@ ) _import_structure["models.mobilevitv2"].extend( [ - "MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTV2ForImageClassification", "MobileViTV2ForSemanticSegmentation", "MobileViTV2Model", @@ -2754,7 +2430,6 @@ ) _import_structure["models.mpnet"].extend( [ - "MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "MPNetForMaskedLM", "MPNetForMultipleChoice", "MPNetForQuestionAnswering", @@ -2767,7 +2442,6 @@ ) _import_structure["models.mpt"].extend( [ - "MPT_PRETRAINED_MODEL_ARCHIVE_LIST", "MptForCausalLM", "MptForQuestionAnswering", "MptForSequenceClassification", @@ -2778,7 +2452,6 @@ ) _import_structure["models.mra"].extend( [ - "MRA_PRETRAINED_MODEL_ARCHIVE_LIST", "MraForMaskedLM", "MraForMultipleChoice", "MraForQuestionAnswering", @@ -2801,7 +2474,6 @@ ) _import_structure["models.musicgen"].extend( [ - "MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "MusicgenForCausalLM", "MusicgenForConditionalGeneration", "MusicgenModel", @@ -2820,7 +2492,6 @@ ) _import_structure["models.mvp"].extend( [ - "MVP_PRETRAINED_MODEL_ARCHIVE_LIST", "MvpForCausalLM", "MvpForConditionalGeneration", "MvpForQuestionAnswering", @@ -2831,7 +2502,6 @@ ) _import_structure["models.nat"].extend( [ - "NAT_PRETRAINED_MODEL_ARCHIVE_LIST", "NatBackbone", "NatForImageClassification", "NatModel", @@ -2840,7 +2510,6 @@ ) _import_structure["models.nezha"].extend( [ - "NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST", "NezhaForMaskedLM", "NezhaForMultipleChoice", "NezhaForNextSentencePrediction", @@ -2854,7 +2523,6 @@ ) _import_structure["models.nllb_moe"].extend( [ - "NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST", "NllbMoeForConditionalGeneration", "NllbMoeModel", "NllbMoePreTrainedModel", @@ -2864,7 +2532,6 @@ ) _import_structure["models.nystromformer"].extend( [ - "NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "NystromformerForMaskedLM", "NystromformerForMultipleChoice", "NystromformerForQuestionAnswering", @@ -2877,7 +2544,6 @@ ) _import_structure["models.oneformer"].extend( [ - "ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "OneFormerForUniversalSegmentation", "OneFormerModel", "OneFormerPreTrainedModel", @@ -2885,7 +2551,6 @@ ) _import_structure["models.openai"].extend( [ - "OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OpenAIGPTDoubleHeadsModel", "OpenAIGPTForSequenceClassification", "OpenAIGPTLMHeadModel", @@ -2896,7 +2561,6 @@ ) _import_structure["models.opt"].extend( [ - "OPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OPTForCausalLM", "OPTForQuestionAnswering", "OPTForSequenceClassification", @@ -2906,7 +2570,6 @@ ) _import_structure["models.owlv2"].extend( [ - "OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Owlv2ForObjectDetection", "Owlv2Model", "Owlv2PreTrainedModel", @@ -2916,7 +2579,6 @@ ) _import_structure["models.owlvit"].extend( [ - "OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "OwlViTForObjectDetection", "OwlViTModel", "OwlViTPreTrainedModel", @@ -2926,7 +2588,6 @@ ) _import_structure["models.patchtsmixer"].extend( [ - "PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSMixerForPrediction", "PatchTSMixerForPretraining", "PatchTSMixerForRegression", @@ -2937,7 +2598,6 @@ ) _import_structure["models.patchtst"].extend( [ - "PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSTForClassification", "PatchTSTForPrediction", "PatchTSTForPretraining", @@ -2956,7 +2616,6 @@ ) _import_structure["models.pegasus_x"].extend( [ - "PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST", "PegasusXForConditionalGeneration", "PegasusXModel", "PegasusXPreTrainedModel", @@ -2964,7 +2623,6 @@ ) _import_structure["models.perceiver"].extend( [ - "PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST", "PerceiverForImageClassificationConvProcessing", "PerceiverForImageClassificationFourier", "PerceiverForImageClassificationLearned", @@ -2987,7 +2645,6 @@ ) _import_structure["models.phi"].extend( [ - "PHI_PRETRAINED_MODEL_ARCHIVE_LIST", "PhiForCausalLM", "PhiForSequenceClassification", "PhiForTokenClassification", @@ -2997,7 +2654,6 @@ ) _import_structure["models.pix2struct"].extend( [ - "PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST", "Pix2StructForConditionalGeneration", "Pix2StructPreTrainedModel", "Pix2StructTextModel", @@ -3006,7 +2662,6 @@ ) _import_structure["models.plbart"].extend( [ - "PLBART_PRETRAINED_MODEL_ARCHIVE_LIST", "PLBartForCausalLM", "PLBartForConditionalGeneration", "PLBartForSequenceClassification", @@ -3016,7 +2671,6 @@ ) _import_structure["models.poolformer"].extend( [ - "POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "PoolFormerForImageClassification", "PoolFormerModel", "PoolFormerPreTrainedModel", @@ -3024,14 +2678,12 @@ ) _import_structure["models.pop2piano"].extend( [ - "POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST", "Pop2PianoForConditionalGeneration", "Pop2PianoPreTrainedModel", ] ) _import_structure["models.prophetnet"].extend( [ - "PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ProphetNetDecoder", "ProphetNetEncoder", "ProphetNetForCausalLM", @@ -3042,7 +2694,6 @@ ) _import_structure["models.pvt"].extend( [ - "PVT_PRETRAINED_MODEL_ARCHIVE_LIST", "PvtForImageClassification", "PvtModel", "PvtPreTrainedModel", @@ -3059,7 +2710,6 @@ ) _import_structure["models.qdqbert"].extend( [ - "QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "QDQBertForMaskedLM", "QDQBertForMultipleChoice", "QDQBertForNextSentencePrediction", @@ -3091,7 +2741,6 @@ ) _import_structure["models.realm"].extend( [ - "REALM_PRETRAINED_MODEL_ARCHIVE_LIST", "RealmEmbedder", "RealmForOpenQA", "RealmKnowledgeAugEncoder", @@ -3104,7 +2753,6 @@ ) _import_structure["models.reformer"].extend( [ - "REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ReformerAttention", "ReformerForMaskedLM", "ReformerForQuestionAnswering", @@ -3117,7 +2765,6 @@ ) _import_structure["models.regnet"].extend( [ - "REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "RegNetForImageClassification", "RegNetModel", "RegNetPreTrainedModel", @@ -3125,7 +2772,6 @@ ) _import_structure["models.rembert"].extend( [ - "REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RemBertForCausalLM", "RemBertForMaskedLM", "RemBertForMultipleChoice", @@ -3140,7 +2786,6 @@ ) _import_structure["models.resnet"].extend( [ - "RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ResNetBackbone", "ResNetForImageClassification", "ResNetModel", @@ -3149,7 +2794,6 @@ ) _import_structure["models.roberta"].extend( [ - "ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaForCausalLM", "RobertaForMaskedLM", "RobertaForMultipleChoice", @@ -3162,7 +2806,6 @@ ) _import_structure["models.roberta_prelayernorm"].extend( [ - "ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaPreLayerNormForCausalLM", "RobertaPreLayerNormForMaskedLM", "RobertaPreLayerNormForMultipleChoice", @@ -3175,7 +2818,6 @@ ) _import_structure["models.roc_bert"].extend( [ - "ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RoCBertForCausalLM", "RoCBertForMaskedLM", "RoCBertForMultipleChoice", @@ -3191,7 +2833,6 @@ ) _import_structure["models.roformer"].extend( [ - "ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "RoFormerForCausalLM", "RoFormerForMaskedLM", "RoFormerForMultipleChoice", @@ -3206,7 +2847,6 @@ ) _import_structure["models.rwkv"].extend( [ - "RWKV_PRETRAINED_MODEL_ARCHIVE_LIST", "RwkvForCausalLM", "RwkvModel", "RwkvPreTrainedModel", @@ -3214,14 +2854,12 @@ ) _import_structure["models.sam"].extend( [ - "SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "SamModel", "SamPreTrainedModel", ] ) _import_structure["models.seamless_m4t"].extend( [ - "SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4TCodeHifiGan", "SeamlessM4TForSpeechToSpeech", "SeamlessM4TForSpeechToText", @@ -3236,7 +2874,6 @@ ) _import_structure["models.seamless_m4t_v2"].extend( [ - "SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4Tv2ForSpeechToSpeech", "SeamlessM4Tv2ForSpeechToText", "SeamlessM4Tv2ForTextToSpeech", @@ -3247,7 +2884,6 @@ ) _import_structure["models.segformer"].extend( [ - "SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SegformerDecodeHead", "SegformerForImageClassification", "SegformerForSemanticSegmentation", @@ -3258,7 +2894,6 @@ ) _import_structure["models.seggpt"].extend( [ - "SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "SegGptForImageSegmentation", "SegGptModel", "SegGptPreTrainedModel", @@ -3266,7 +2901,6 @@ ) _import_structure["models.sew"].extend( [ - "SEW_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWForCTC", "SEWForSequenceClassification", "SEWModel", @@ -3275,7 +2909,6 @@ ) _import_structure["models.sew_d"].extend( [ - "SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWDForCTC", "SEWDForSequenceClassification", "SEWDModel", @@ -3284,7 +2917,6 @@ ) _import_structure["models.siglip"].extend( [ - "SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "SiglipForImageClassification", "SiglipModel", "SiglipPreTrainedModel", @@ -3295,7 +2927,6 @@ _import_structure["models.speech_encoder_decoder"].extend(["SpeechEncoderDecoderModel"]) _import_structure["models.speech_to_text"].extend( [ - "SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "Speech2TextForConditionalGeneration", "Speech2TextModel", "Speech2TextPreTrainedModel", @@ -3304,7 +2935,6 @@ _import_structure["models.speech_to_text_2"].extend(["Speech2Text2ForCausalLM", "Speech2Text2PreTrainedModel"]) _import_structure["models.speecht5"].extend( [ - "SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST", "SpeechT5ForSpeechToSpeech", "SpeechT5ForSpeechToText", "SpeechT5ForTextToSpeech", @@ -3315,7 +2945,6 @@ ) _import_structure["models.splinter"].extend( [ - "SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST", "SplinterForPreTraining", "SplinterForQuestionAnswering", "SplinterLayer", @@ -3325,7 +2954,6 @@ ) _import_structure["models.squeezebert"].extend( [ - "SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "SqueezeBertForMaskedLM", "SqueezeBertForMultipleChoice", "SqueezeBertForQuestionAnswering", @@ -3361,7 +2989,6 @@ ) _import_structure["models.swiftformer"].extend( [ - "SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SwiftFormerForImageClassification", "SwiftFormerModel", "SwiftFormerPreTrainedModel", @@ -3369,7 +2996,6 @@ ) _import_structure["models.swin"].extend( [ - "SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "SwinBackbone", "SwinForImageClassification", "SwinForMaskedImageModeling", @@ -3379,7 +3005,6 @@ ) _import_structure["models.swin2sr"].extend( [ - "SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST", "Swin2SRForImageSuperResolution", "Swin2SRModel", "Swin2SRPreTrainedModel", @@ -3387,7 +3012,6 @@ ) _import_structure["models.swinv2"].extend( [ - "SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Swinv2Backbone", "Swinv2ForImageClassification", "Swinv2ForMaskedImageModeling", @@ -3397,7 +3021,6 @@ ) _import_structure["models.switch_transformers"].extend( [ - "SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST", "SwitchTransformersEncoderModel", "SwitchTransformersForConditionalGeneration", "SwitchTransformersModel", @@ -3408,7 +3031,6 @@ ) _import_structure["models.t5"].extend( [ - "T5_PRETRAINED_MODEL_ARCHIVE_LIST", "T5EncoderModel", "T5ForConditionalGeneration", "T5ForQuestionAnswering", @@ -3421,7 +3043,6 @@ ) _import_structure["models.table_transformer"].extend( [ - "TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TableTransformerForObjectDetection", "TableTransformerModel", "TableTransformerPreTrainedModel", @@ -3429,7 +3050,6 @@ ) _import_structure["models.tapas"].extend( [ - "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TapasForMaskedLM", "TapasForQuestionAnswering", "TapasForSequenceClassification", @@ -3440,7 +3060,6 @@ ) _import_structure["models.time_series_transformer"].extend( [ - "TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimeSeriesTransformerForPrediction", "TimeSeriesTransformerModel", "TimeSeriesTransformerPreTrainedModel", @@ -3448,7 +3067,6 @@ ) _import_structure["models.timesformer"].extend( [ - "TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimesformerForVideoClassification", "TimesformerModel", "TimesformerPreTrainedModel", @@ -3457,14 +3075,12 @@ _import_structure["models.timm_backbone"].extend(["TimmBackbone"]) _import_structure["models.trocr"].extend( [ - "TROCR_PRETRAINED_MODEL_ARCHIVE_LIST", "TrOCRForCausalLM", "TrOCRPreTrainedModel", ] ) _import_structure["models.tvlt"].extend( [ - "TVLT_PRETRAINED_MODEL_ARCHIVE_LIST", "TvltForAudioVisualClassification", "TvltForPreTraining", "TvltModel", @@ -3473,7 +3089,6 @@ ) _import_structure["models.tvp"].extend( [ - "TVP_PRETRAINED_MODEL_ARCHIVE_LIST", "TvpForVideoGrounding", "TvpModel", "TvpPreTrainedModel", @@ -3481,7 +3096,6 @@ ) _import_structure["models.udop"].extend( [ - "UDOP_PRETRAINED_MODEL_ARCHIVE_LIST", "UdopEncoderModel", "UdopForConditionalGeneration", "UdopModel", @@ -3501,7 +3115,6 @@ ) _import_structure["models.unispeech"].extend( [ - "UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechForCTC", "UniSpeechForPreTraining", "UniSpeechForSequenceClassification", @@ -3511,7 +3124,6 @@ ) _import_structure["models.unispeech_sat"].extend( [ - "UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechSatForAudioFrameClassification", "UniSpeechSatForCTC", "UniSpeechSatForPreTraining", @@ -3523,7 +3135,6 @@ ) _import_structure["models.univnet"].extend( [ - "UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST", "UnivNetModel", ] ) @@ -3535,7 +3146,6 @@ ) _import_structure["models.videomae"].extend( [ - "VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST", "VideoMAEForPreTraining", "VideoMAEForVideoClassification", "VideoMAEModel", @@ -3544,7 +3154,6 @@ ) _import_structure["models.vilt"].extend( [ - "VILT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViltForImageAndTextRetrieval", "ViltForImagesAndTextClassification", "ViltForMaskedLM", @@ -3557,7 +3166,6 @@ ) _import_structure["models.vipllava"].extend( [ - "VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "VipLlavaForConditionalGeneration", "VipLlavaPreTrainedModel", ] @@ -3566,7 +3174,6 @@ _import_structure["models.vision_text_dual_encoder"].extend(["VisionTextDualEncoderModel"]) _import_structure["models.visual_bert"].extend( [ - "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "VisualBertForMultipleChoice", "VisualBertForPreTraining", "VisualBertForQuestionAnswering", @@ -3579,7 +3186,6 @@ ) _import_structure["models.vit"].extend( [ - "VIT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTForImageClassification", "ViTForMaskedImageModeling", "ViTModel", @@ -3588,7 +3194,6 @@ ) _import_structure["models.vit_hybrid"].extend( [ - "VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTHybridForImageClassification", "ViTHybridModel", "ViTHybridPreTrainedModel", @@ -3596,7 +3201,6 @@ ) _import_structure["models.vit_mae"].extend( [ - "VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMAEForPreTraining", "ViTMAELayer", "ViTMAEModel", @@ -3605,7 +3209,6 @@ ) _import_structure["models.vit_msn"].extend( [ - "VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMSNForImageClassification", "ViTMSNModel", "ViTMSNPreTrainedModel", @@ -3613,7 +3216,6 @@ ) _import_structure["models.vitdet"].extend( [ - "VITDET_PRETRAINED_MODEL_ARCHIVE_LIST", "VitDetBackbone", "VitDetModel", "VitDetPreTrainedModel", @@ -3621,21 +3223,18 @@ ) _import_structure["models.vitmatte"].extend( [ - "VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST", "VitMatteForImageMatting", "VitMattePreTrainedModel", ] ) _import_structure["models.vits"].extend( [ - "VITS_PRETRAINED_MODEL_ARCHIVE_LIST", "VitsModel", "VitsPreTrainedModel", ] ) _import_structure["models.vivit"].extend( [ - "VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "VivitForVideoClassification", "VivitModel", "VivitPreTrainedModel", @@ -3643,7 +3242,6 @@ ) _import_structure["models.wav2vec2"].extend( [ - "WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ForAudioFrameClassification", "Wav2Vec2ForCTC", "Wav2Vec2ForMaskedLM", @@ -3656,7 +3254,6 @@ ) _import_structure["models.wav2vec2_bert"].extend( [ - "WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2BertForAudioFrameClassification", "Wav2Vec2BertForCTC", "Wav2Vec2BertForSequenceClassification", @@ -3667,7 +3264,6 @@ ) _import_structure["models.wav2vec2_conformer"].extend( [ - "WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ConformerForAudioFrameClassification", "Wav2Vec2ConformerForCTC", "Wav2Vec2ConformerForPreTraining", @@ -3679,7 +3275,6 @@ ) _import_structure["models.wavlm"].extend( [ - "WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST", "WavLMForAudioFrameClassification", "WavLMForCTC", "WavLMForSequenceClassification", @@ -3690,7 +3285,6 @@ ) _import_structure["models.whisper"].extend( [ - "WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "WhisperForAudioClassification", "WhisperForCausalLM", "WhisperForConditionalGeneration", @@ -3700,7 +3294,6 @@ ) _import_structure["models.x_clip"].extend( [ - "XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "XCLIPModel", "XCLIPPreTrainedModel", "XCLIPTextModel", @@ -3709,7 +3302,6 @@ ) _import_structure["models.xglm"].extend( [ - "XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XGLMForCausalLM", "XGLMModel", "XGLMPreTrainedModel", @@ -3717,7 +3309,6 @@ ) _import_structure["models.xlm"].extend( [ - "XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMForMultipleChoice", "XLMForQuestionAnswering", "XLMForQuestionAnsweringSimple", @@ -3730,7 +3321,6 @@ ) _import_structure["models.xlm_prophetnet"].extend( [ - "XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMProphetNetDecoder", "XLMProphetNetEncoder", "XLMProphetNetForCausalLM", @@ -3741,7 +3331,6 @@ ) _import_structure["models.xlm_roberta"].extend( [ - "XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaForCausalLM", "XLMRobertaForMaskedLM", "XLMRobertaForMultipleChoice", @@ -3754,7 +3343,6 @@ ) _import_structure["models.xlm_roberta_xl"].extend( [ - "XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaXLForCausalLM", "XLMRobertaXLForMaskedLM", "XLMRobertaXLForMultipleChoice", @@ -3767,7 +3355,6 @@ ) _import_structure["models.xlnet"].extend( [ - "XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLNetForMultipleChoice", "XLNetForQuestionAnswering", "XLNetForQuestionAnsweringSimple", @@ -3781,7 +3368,6 @@ ) _import_structure["models.xmod"].extend( [ - "XMOD_PRETRAINED_MODEL_ARCHIVE_LIST", "XmodForCausalLM", "XmodForMaskedLM", "XmodForMultipleChoice", @@ -3794,7 +3380,6 @@ ) _import_structure["models.yolos"].extend( [ - "YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST", "YolosForObjectDetection", "YolosModel", "YolosPreTrainedModel", @@ -3802,7 +3387,6 @@ ) _import_structure["models.yoso"].extend( [ - "YOSO_PRETRAINED_MODEL_ARCHIVE_LIST", "YosoForMaskedLM", "YosoForMultipleChoice", "YosoForQuestionAnswering", @@ -3879,7 +3463,6 @@ # TensorFlow models structure _import_structure["models.albert"].extend( [ - "TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAlbertForMaskedLM", "TFAlbertForMultipleChoice", "TFAlbertForPreTraining", @@ -3949,7 +3532,6 @@ ) _import_structure["models.bert"].extend( [ - "TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBertEmbeddings", "TFBertForMaskedLM", "TFBertForMultipleChoice", @@ -3980,7 +3562,6 @@ ) _import_structure["models.blip"].extend( [ - "TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBlipForConditionalGeneration", "TFBlipForImageTextRetrieval", "TFBlipForQuestionAnswering", @@ -3992,7 +3573,6 @@ ) _import_structure["models.camembert"].extend( [ - "TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCamembertForCausalLM", "TFCamembertForMaskedLM", "TFCamembertForMultipleChoice", @@ -4005,7 +3585,6 @@ ) _import_structure["models.clip"].extend( [ - "TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCLIPModel", "TFCLIPPreTrainedModel", "TFCLIPTextModel", @@ -4014,7 +3593,6 @@ ) _import_structure["models.convbert"].extend( [ - "TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFConvBertForMaskedLM", "TFConvBertForMultipleChoice", "TFConvBertForQuestionAnswering", @@ -4041,7 +3619,6 @@ ) _import_structure["models.ctrl"].extend( [ - "TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCTRLForSequenceClassification", "TFCTRLLMHeadModel", "TFCTRLModel", @@ -4050,7 +3627,6 @@ ) _import_structure["models.cvt"].extend( [ - "TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCvtForImageClassification", "TFCvtModel", "TFCvtPreTrainedModel", @@ -4066,7 +3642,6 @@ ) _import_structure["models.deberta"].extend( [ - "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaForMaskedLM", "TFDebertaForQuestionAnswering", "TFDebertaForSequenceClassification", @@ -4077,7 +3652,6 @@ ) _import_structure["models.deberta_v2"].extend( [ - "TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaV2ForMaskedLM", "TFDebertaV2ForMultipleChoice", "TFDebertaV2ForQuestionAnswering", @@ -4089,7 +3663,6 @@ ) _import_structure["models.deit"].extend( [ - "TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDeiTForImageClassification", "TFDeiTForImageClassificationWithTeacher", "TFDeiTForMaskedImageModeling", @@ -4099,7 +3672,6 @@ ) _import_structure["models.deprecated.transfo_xl"].extend( [ - "TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAdaptiveEmbedding", "TFTransfoXLForSequenceClassification", "TFTransfoXLLMHeadModel", @@ -4110,7 +3682,6 @@ ) _import_structure["models.distilbert"].extend( [ - "TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDistilBertForMaskedLM", "TFDistilBertForMultipleChoice", "TFDistilBertForQuestionAnswering", @@ -4123,9 +3694,6 @@ ) _import_structure["models.dpr"].extend( [ - "TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDPRContextEncoder", "TFDPRPretrainedContextEncoder", "TFDPRPretrainedQuestionEncoder", @@ -4136,7 +3704,6 @@ ) _import_structure["models.efficientformer"].extend( [ - "TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEfficientFormerForImageClassification", "TFEfficientFormerForImageClassificationWithTeacher", "TFEfficientFormerModel", @@ -4145,7 +3712,6 @@ ) _import_structure["models.electra"].extend( [ - "TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFElectraForMaskedLM", "TFElectraForMultipleChoice", "TFElectraForPreTraining", @@ -4159,7 +3725,6 @@ _import_structure["models.encoder_decoder"].append("TFEncoderDecoderModel") _import_structure["models.esm"].extend( [ - "ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEsmForMaskedLM", "TFEsmForSequenceClassification", "TFEsmForTokenClassification", @@ -4169,7 +3734,6 @@ ) _import_structure["models.flaubert"].extend( [ - "TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFlaubertForMultipleChoice", "TFFlaubertForQuestionAnsweringSimple", "TFFlaubertForSequenceClassification", @@ -4181,7 +3745,6 @@ ) _import_structure["models.funnel"].extend( [ - "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFunnelBaseModel", "TFFunnelForMaskedLM", "TFFunnelForMultipleChoice", @@ -4195,7 +3758,6 @@ ) _import_structure["models.gpt2"].extend( [ - "TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGPT2DoubleHeadsModel", "TFGPT2ForSequenceClassification", "TFGPT2LMHeadModel", @@ -4215,7 +3777,6 @@ ) _import_structure["models.groupvit"].extend( [ - "TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGroupViTModel", "TFGroupViTPreTrainedModel", "TFGroupViTTextModel", @@ -4224,7 +3785,6 @@ ) _import_structure["models.hubert"].extend( [ - "TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFHubertForCTC", "TFHubertModel", "TFHubertPreTrainedModel", @@ -4232,7 +3792,6 @@ ) _import_structure["models.layoutlm"].extend( [ - "TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMForMaskedLM", "TFLayoutLMForQuestionAnswering", "TFLayoutLMForSequenceClassification", @@ -4244,7 +3803,6 @@ ) _import_structure["models.layoutlmv3"].extend( [ - "TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMv3ForQuestionAnswering", "TFLayoutLMv3ForSequenceClassification", "TFLayoutLMv3ForTokenClassification", @@ -4255,7 +3813,6 @@ _import_structure["models.led"].extend(["TFLEDForConditionalGeneration", "TFLEDModel", "TFLEDPreTrainedModel"]) _import_structure["models.longformer"].extend( [ - "TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLongformerForMaskedLM", "TFLongformerForMultipleChoice", "TFLongformerForQuestionAnswering", @@ -4268,7 +3825,6 @@ ) _import_structure["models.lxmert"].extend( [ - "TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLxmertForPreTraining", "TFLxmertMainLayer", "TFLxmertModel", @@ -4282,7 +3838,6 @@ ) _import_structure["models.mobilebert"].extend( [ - "TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileBertForMaskedLM", "TFMobileBertForMultipleChoice", "TFMobileBertForNextSentencePrediction", @@ -4297,7 +3852,6 @@ ) _import_structure["models.mobilevit"].extend( [ - "TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileViTForImageClassification", "TFMobileViTForSemanticSegmentation", "TFMobileViTModel", @@ -4306,7 +3860,6 @@ ) _import_structure["models.mpnet"].extend( [ - "TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMPNetForMaskedLM", "TFMPNetForMultipleChoice", "TFMPNetForQuestionAnswering", @@ -4320,7 +3873,6 @@ _import_structure["models.mt5"].extend(["TFMT5EncoderModel", "TFMT5ForConditionalGeneration", "TFMT5Model"]) _import_structure["models.openai"].extend( [ - "TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFOpenAIGPTDoubleHeadsModel", "TFOpenAIGPTForSequenceClassification", "TFOpenAIGPTLMHeadModel", @@ -4353,7 +3905,6 @@ ) _import_structure["models.regnet"].extend( [ - "TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRegNetForImageClassification", "TFRegNetModel", "TFRegNetPreTrainedModel", @@ -4361,7 +3912,6 @@ ) _import_structure["models.rembert"].extend( [ - "TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRemBertForCausalLM", "TFRemBertForMaskedLM", "TFRemBertForMultipleChoice", @@ -4375,7 +3925,6 @@ ) _import_structure["models.resnet"].extend( [ - "TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFResNetForImageClassification", "TFResNetModel", "TFResNetPreTrainedModel", @@ -4383,7 +3932,6 @@ ) _import_structure["models.roberta"].extend( [ - "TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaForCausalLM", "TFRobertaForMaskedLM", "TFRobertaForMultipleChoice", @@ -4397,7 +3945,6 @@ ) _import_structure["models.roberta_prelayernorm"].extend( [ - "TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaPreLayerNormForCausalLM", "TFRobertaPreLayerNormForMaskedLM", "TFRobertaPreLayerNormForMultipleChoice", @@ -4411,7 +3958,6 @@ ) _import_structure["models.roformer"].extend( [ - "TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRoFormerForCausalLM", "TFRoFormerForMaskedLM", "TFRoFormerForMultipleChoice", @@ -4425,14 +3971,12 @@ ) _import_structure["models.sam"].extend( [ - "TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSamModel", "TFSamPreTrainedModel", ] ) _import_structure["models.segformer"].extend( [ - "TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSegformerDecodeHead", "TFSegformerForImageClassification", "TFSegformerForSemanticSegmentation", @@ -4442,7 +3986,6 @@ ) _import_structure["models.speech_to_text"].extend( [ - "TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSpeech2TextForConditionalGeneration", "TFSpeech2TextModel", "TFSpeech2TextPreTrainedModel", @@ -4450,7 +3993,6 @@ ) _import_structure["models.swin"].extend( [ - "TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSwinForImageClassification", "TFSwinForMaskedImageModeling", "TFSwinModel", @@ -4459,7 +4001,6 @@ ) _import_structure["models.t5"].extend( [ - "TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST", "TFT5EncoderModel", "TFT5ForConditionalGeneration", "TFT5Model", @@ -4468,7 +4009,6 @@ ) _import_structure["models.tapas"].extend( [ - "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TFTapasForMaskedLM", "TFTapasForQuestionAnswering", "TFTapasForSequenceClassification", @@ -4494,7 +4034,6 @@ ) _import_structure["models.wav2vec2"].extend( [ - "TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWav2Vec2ForCTC", "TFWav2Vec2ForSequenceClassification", "TFWav2Vec2Model", @@ -4503,7 +4042,6 @@ ) _import_structure["models.whisper"].extend( [ - "TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWhisperForConditionalGeneration", "TFWhisperModel", "TFWhisperPreTrainedModel", @@ -4511,7 +4049,6 @@ ) _import_structure["models.xglm"].extend( [ - "TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXGLMForCausalLM", "TFXGLMModel", "TFXGLMPreTrainedModel", @@ -4519,7 +4056,6 @@ ) _import_structure["models.xlm"].extend( [ - "TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMForMultipleChoice", "TFXLMForQuestionAnsweringSimple", "TFXLMForSequenceClassification", @@ -4532,7 +4068,6 @@ ) _import_structure["models.xlm_roberta"].extend( [ - "TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMRobertaForCausalLM", "TFXLMRobertaForMaskedLM", "TFXLMRobertaForMultipleChoice", @@ -4545,7 +4080,6 @@ ) _import_structure["models.xlnet"].extend( [ - "TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLNetForMultipleChoice", "TFXLNetForQuestionAnsweringSimple", "TFXLNetForSequenceClassification", @@ -4924,7 +4458,6 @@ ) _import_structure["models.xlm_roberta"].extend( [ - "FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaxXLMRobertaForMaskedLM", "FlaxXLMRobertaForMultipleChoice", "FlaxXLMRobertaForQuestionAnswering", @@ -5011,28 +4544,24 @@ load_tf2_model_in_pytorch_model, load_tf2_weights_in_pytorch_model, ) - from .models.albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig + from .models.albert import AlbertConfig from .models.align import ( - ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP, AlignConfig, AlignProcessor, AlignTextConfig, AlignVisionConfig, ) from .models.altclip import ( - ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, AltCLIPConfig, AltCLIPProcessor, AltCLIPTextConfig, AltCLIPVisionConfig, ) from .models.audio_spectrogram_transformer import ( - AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ASTConfig, ASTFeatureExtractor, ) from .models.auto import ( - ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, CONFIG_MAPPING, FEATURE_EXTRACTOR_MAPPING, IMAGE_PROCESSOR_MAPPING, @@ -5046,7 +4575,6 @@ AutoTokenizer, ) from .models.autoformer import ( - AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, AutoformerConfig, ) from .models.bark import ( @@ -5057,9 +4585,8 @@ BarkSemanticConfig, ) from .models.bart import BartConfig, BartTokenizer - from .models.beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig + from .models.beit import BeitConfig from .models.bert import ( - BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, BasicTokenizer, BertConfig, BertTokenizer, @@ -5072,80 +4599,67 @@ MecabTokenizer, ) from .models.bertweet import BertweetTokenizer - from .models.big_bird import BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdConfig + from .models.big_bird import BigBirdConfig from .models.bigbird_pegasus import ( - BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdPegasusConfig, ) from .models.biogpt import ( - BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, BioGptConfig, BioGptTokenizer, ) - from .models.bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig + from .models.bit import BitConfig from .models.blenderbot import ( - BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotConfig, BlenderbotTokenizer, ) from .models.blenderbot_small import ( - BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotSmallConfig, BlenderbotSmallTokenizer, ) from .models.blip import ( - BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, BlipConfig, BlipProcessor, BlipTextConfig, BlipVisionConfig, ) from .models.blip_2 import ( - BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Blip2Config, Blip2Processor, Blip2QFormerConfig, Blip2VisionConfig, ) - from .models.bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig + from .models.bloom import BloomConfig from .models.bridgetower import ( - BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP, BridgeTowerConfig, BridgeTowerProcessor, BridgeTowerTextConfig, BridgeTowerVisionConfig, ) from .models.bros import ( - BROS_PRETRAINED_CONFIG_ARCHIVE_MAP, BrosConfig, BrosProcessor, ) from .models.byt5 import ByT5Tokenizer from .models.camembert import ( - CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, CamembertConfig, ) from .models.canine import ( - CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP, CanineConfig, CanineTokenizer, ) from .models.chinese_clip import ( - CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, ChineseCLIPConfig, ChineseCLIPProcessor, ChineseCLIPTextConfig, ChineseCLIPVisionConfig, ) from .models.clap import ( - CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioConfig, ClapConfig, ClapProcessor, ClapTextConfig, ) from .models.clip import ( - CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPConfig, CLIPProcessor, CLIPTextConfig, @@ -5153,14 +4667,12 @@ CLIPVisionConfig, ) from .models.clipseg import ( - CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPSegConfig, CLIPSegProcessor, CLIPSegTextConfig, CLIPSegVisionConfig, ) from .models.clvp import ( - CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP, ClvpConfig, ClvpDecoderConfig, ClvpEncoderConfig, @@ -5169,241 +4681,198 @@ ClvpTokenizer, ) from .models.codegen import ( - CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, CodeGenConfig, CodeGenTokenizer, ) from .models.cohere import COHERE_PRETRAINED_CONFIG_ARCHIVE_MAP, CohereConfig from .models.conditional_detr import ( - CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, ConditionalDetrConfig, ) from .models.convbert import ( - CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertTokenizer, ) - from .models.convnext import CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextConfig + from .models.convnext import ConvNextConfig from .models.convnextv2 import ( - CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextV2Config, ) from .models.cpmant import ( - CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP, CpmAntConfig, CpmAntTokenizer, ) from .models.ctrl import ( - CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig, CTRLTokenizer, ) - from .models.cvt import CVT_PRETRAINED_CONFIG_ARCHIVE_MAP, CvtConfig + from .models.cvt import CvtConfig from .models.data2vec import ( - DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, - DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecAudioConfig, Data2VecTextConfig, Data2VecVisionConfig, ) from .models.deberta import ( - DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaTokenizer, ) from .models.deberta_v2 import ( - DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaV2Config, ) from .models.decision_transformer import ( - DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, DecisionTransformerConfig, ) from .models.deformable_detr import ( - DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DeformableDetrConfig, ) - from .models.deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig + from .models.deit import DeiTConfig from .models.deprecated.mctct import ( - MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig, MCTCTFeatureExtractor, MCTCTProcessor, ) from .models.deprecated.mmbt import MMBTConfig from .models.deprecated.open_llama import ( - OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenLlamaConfig, ) from .models.deprecated.retribert import ( - RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RetriBertConfig, RetriBertTokenizer, ) from .models.deprecated.tapex import TapexTokenizer from .models.deprecated.trajectory_transformer import ( - TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TrajectoryTransformerConfig, ) from .models.deprecated.transfo_xl import ( - TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig, TransfoXLCorpus, TransfoXLTokenizer, ) - from .models.deprecated.van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig - from .models.depth_anything import DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP, DepthAnythingConfig - from .models.deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig - from .models.detr import DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DetrConfig - from .models.dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig - from .models.dinov2 import DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Dinov2Config + from .models.deprecated.van import VanConfig + from .models.depth_anything import DepthAnythingConfig + from .models.deta import DetaConfig + from .models.detr import DetrConfig + from .models.dinat import DinatConfig + from .models.dinov2 import Dinov2Config from .models.distilbert import ( - DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, DistilBertConfig, DistilBertTokenizer, ) from .models.donut import ( - DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutProcessor, DonutSwinConfig, ) from .models.dpr import ( - DPR_PRETRAINED_CONFIG_ARCHIVE_MAP, DPRConfig, DPRContextEncoderTokenizer, DPRQuestionEncoderTokenizer, DPRReaderOutput, DPRReaderTokenizer, ) - from .models.dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig + from .models.dpt import DPTConfig from .models.efficientformer import ( - EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientFormerConfig, ) from .models.efficientnet import ( - EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientNetConfig, ) from .models.electra import ( - ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraTokenizer, ) from .models.encodec import ( - ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP, EncodecConfig, EncodecFeatureExtractor, ) from .models.encoder_decoder import EncoderDecoderConfig - from .models.ernie import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieConfig - from .models.ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig - from .models.esm import ESM_PRETRAINED_CONFIG_ARCHIVE_MAP, EsmConfig, EsmTokenizer - from .models.falcon import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP, FalconConfig + from .models.ernie import ErnieConfig + from .models.ernie_m import ErnieMConfig + from .models.esm import EsmConfig, EsmTokenizer + from .models.falcon import FalconConfig from .models.fastspeech2_conformer import ( - FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, - FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, - FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, FastSpeech2ConformerConfig, FastSpeech2ConformerHifiGanConfig, FastSpeech2ConformerTokenizer, FastSpeech2ConformerWithHifiGanConfig, ) - from .models.flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertTokenizer + from .models.flaubert import FlaubertConfig, FlaubertTokenizer from .models.flava import ( - FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, FlavaConfig, FlavaImageCodebookConfig, FlavaImageConfig, FlavaMultimodalConfig, FlavaTextConfig, ) - from .models.fnet import FNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FNetConfig - from .models.focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig + from .models.fnet import FNetConfig + from .models.focalnet import FocalNetConfig from .models.fsmt import ( - FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP, FSMTConfig, FSMTTokenizer, ) from .models.funnel import ( - FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig, FunnelTokenizer, ) - from .models.fuyu import FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP, FuyuConfig - from .models.gemma import GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP, GemmaConfig + from .models.fuyu import FuyuConfig + from .models.gemma import GemmaConfig from .models.git import ( - GIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GitConfig, GitProcessor, GitVisionConfig, ) - from .models.glpn import GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP, GLPNConfig + from .models.glpn import GLPNConfig from .models.gpt2 import ( - GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2Tokenizer, ) from .models.gpt_bigcode import ( - GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig, ) - from .models.gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig - from .models.gpt_neox import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXConfig + from .models.gpt_neo import GPTNeoConfig + from .models.gpt_neox import GPTNeoXConfig from .models.gpt_neox_japanese import ( - GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig, ) - from .models.gptj import GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTJConfig + from .models.gptj import GPTJConfig from .models.gptsan_japanese import ( - GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTSanJapaneseConfig, GPTSanJapaneseTokenizer, ) from .models.graphormer import ( - GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, GraphormerConfig, ) from .models.groupvit import ( - GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GroupViTConfig, GroupViTTextConfig, GroupViTVisionConfig, ) from .models.herbert import HerbertTokenizer - from .models.hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig - from .models.ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig + from .models.hubert import HubertConfig + from .models.ibert import IBertConfig from .models.idefics import ( - IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP, IdeficsConfig, ) - from .models.imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig - from .models.informer import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, InformerConfig + from .models.imagegpt import ImageGPTConfig + from .models.informer import InformerConfig from .models.instructblip import ( - INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, InstructBlipConfig, InstructBlipProcessor, InstructBlipQFormerConfig, InstructBlipVisionConfig, ) from .models.jukebox import ( - JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP, JukeboxConfig, JukeboxPriorConfig, JukeboxTokenizer, JukeboxVQVAEConfig, ) from .models.kosmos2 import ( - KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP, Kosmos2Config, Kosmos2Processor, ) from .models.layoutlm import ( - LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig, LayoutLMTokenizer, ) from .models.layoutlmv2 import ( - LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv2Config, LayoutLMv2FeatureExtractor, LayoutLMv2ImageProcessor, @@ -5411,7 +4880,6 @@ LayoutLMv2Tokenizer, ) from .models.layoutlmv3 import ( - LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv3Config, LayoutLMv3FeatureExtractor, LayoutLMv3ImageProcessor, @@ -5419,12 +4887,11 @@ LayoutLMv3Tokenizer, ) from .models.layoutxlm import LayoutXLMProcessor - from .models.led import LED_PRETRAINED_CONFIG_ARCHIVE_MAP, LEDConfig, LEDTokenizer - from .models.levit import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, LevitConfig - from .models.lilt import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP, LiltConfig - from .models.llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig + from .models.led import LEDConfig, LEDTokenizer + from .models.levit import LevitConfig + from .models.lilt import LiltConfig + from .models.llama import LlamaConfig from .models.llava import ( - LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlavaConfig, LlavaProcessor, ) @@ -5434,85 +4901,70 @@ LlavaNextProcessor, ) from .models.longformer import ( - LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, LongformerConfig, LongformerTokenizer, ) - from .models.longt5 import LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP, LongT5Config + from .models.longt5 import LongT5Config from .models.luke import ( - LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig, LukeTokenizer, ) from .models.lxmert import ( - LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, LxmertConfig, LxmertTokenizer, ) - from .models.m2m_100 import M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP, M2M100Config - from .models.mamba import MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP, MambaConfig + from .models.m2m_100 import M2M100Config + from .models.mamba import MambaConfig from .models.marian import MarianConfig from .models.markuplm import ( - MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig, MarkupLMFeatureExtractor, MarkupLMProcessor, MarkupLMTokenizer, ) from .models.mask2former import ( - MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Mask2FormerConfig, ) from .models.maskformer import ( - MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, MaskFormerConfig, MaskFormerSwinConfig, ) from .models.mbart import MBartConfig - from .models.mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig + from .models.mega import MegaConfig from .models.megatron_bert import ( - MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig, ) from .models.mgp_str import ( - MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig, MgpstrProcessor, MgpstrTokenizer, ) - from .models.mistral import MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MistralConfig - from .models.mixtral import MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MixtralConfig + from .models.mistral import MistralConfig + from .models.mixtral import MixtralConfig from .models.mobilebert import ( - MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileBertConfig, MobileBertTokenizer, ) from .models.mobilenet_v1 import ( - MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV1Config, ) from .models.mobilenet_v2 import ( - MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV2Config, ) from .models.mobilevit import ( - MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTConfig, ) from .models.mobilevitv2 import ( - MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTV2Config, ) from .models.mpnet import ( - MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig, MPNetTokenizer, ) - from .models.mpt import MPT_PRETRAINED_CONFIG_ARCHIVE_MAP, MptConfig - from .models.mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig + from .models.mpt import MptConfig + from .models.mra import MraConfig from .models.mt5 import MT5Config from .models.musicgen import ( - MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, MusicgenConfig, MusicgenDecoderConfig, ) @@ -5522,121 +4974,101 @@ MusicgenMelodyDecoderConfig, ) from .models.mvp import MvpConfig, MvpTokenizer - from .models.nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig - from .models.nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig - from .models.nllb_moe import NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP, NllbMoeConfig + from .models.nat import NatConfig + from .models.nezha import NezhaConfig + from .models.nllb_moe import NllbMoeConfig from .models.nougat import NougatProcessor from .models.nystromformer import ( - NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, NystromformerConfig, ) from .models.oneformer import ( - ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, OneFormerConfig, OneFormerProcessor, ) from .models.openai import ( - OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig, OpenAIGPTTokenizer, ) from .models.opt import OPTConfig from .models.owlv2 import ( - OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Owlv2Config, Owlv2Processor, Owlv2TextConfig, Owlv2VisionConfig, ) from .models.owlvit import ( - OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, OwlViTConfig, OwlViTProcessor, OwlViTTextConfig, OwlViTVisionConfig, ) from .models.patchtsmixer import ( - PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSMixerConfig, ) - from .models.patchtst import PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSTConfig + from .models.patchtst import PatchTSTConfig from .models.pegasus import ( - PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig, PegasusTokenizer, ) from .models.pegasus_x import ( - PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig, ) from .models.perceiver import ( - PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverTokenizer, ) from .models.persimmon import ( - PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP, PersimmonConfig, ) - from .models.phi import PHI_PRETRAINED_CONFIG_ARCHIVE_MAP, PhiConfig + from .models.phi import PhiConfig from .models.phobert import PhobertTokenizer from .models.pix2struct import ( - PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP, Pix2StructConfig, Pix2StructProcessor, Pix2StructTextConfig, Pix2StructVisionConfig, ) - from .models.plbart import PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP, PLBartConfig + from .models.plbart import PLBartConfig from .models.poolformer import ( - POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, PoolFormerConfig, ) from .models.pop2piano import ( - POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP, Pop2PianoConfig, ) from .models.prophetnet import ( - PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ProphetNetConfig, ProphetNetTokenizer, ) - from .models.pvt import PVT_PRETRAINED_CONFIG_ARCHIVE_MAP, PvtConfig + from .models.pvt import PvtConfig from .models.pvt_v2 import PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, PvtV2Config - from .models.qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig - from .models.qwen2 import QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP, Qwen2Config, Qwen2Tokenizer + from .models.qdqbert import QDQBertConfig + from .models.qwen2 import Qwen2Config, Qwen2Tokenizer from .models.rag import RagConfig, RagRetriever, RagTokenizer from .models.realm import ( - REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, RealmConfig, RealmTokenizer, ) - from .models.reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig - from .models.regnet import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP, RegNetConfig - from .models.rembert import REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RemBertConfig - from .models.resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig + from .models.reformer import ReformerConfig + from .models.regnet import RegNetConfig + from .models.rembert import RemBertConfig + from .models.resnet import ResNetConfig from .models.roberta import ( - ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaConfig, RobertaTokenizer, ) from .models.roberta_prelayernorm import ( - ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaPreLayerNormConfig, ) from .models.roc_bert import ( - ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RoCBertConfig, RoCBertTokenizer, ) from .models.roformer import ( - ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, RoFormerConfig, RoFormerTokenizer, ) - from .models.rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig + from .models.rwkv import RwkvConfig from .models.sam import ( - SAM_PRETRAINED_CONFIG_ARCHIVE_MAP, SamConfig, SamMaskDecoderConfig, SamProcessor, @@ -5644,21 +5076,18 @@ SamVisionConfig, ) from .models.seamless_m4t import ( - SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4TConfig, SeamlessM4TFeatureExtractor, SeamlessM4TProcessor, ) from .models.seamless_m4t_v2 import ( - SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4Tv2Config, ) - from .models.segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig - from .models.seggpt import SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, SegGptConfig - from .models.sew import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWConfig - from .models.sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig + from .models.segformer import SegformerConfig + from .models.seggpt import SegGptConfig + from .models.sew import SEWConfig + from .models.sew_d import SEWDConfig from .models.siglip import ( - SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, SiglipConfig, SiglipProcessor, SiglipTextConfig, @@ -5666,32 +5095,26 @@ ) from .models.speech_encoder_decoder import SpeechEncoderDecoderConfig from .models.speech_to_text import ( - SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2TextConfig, Speech2TextFeatureExtractor, Speech2TextProcessor, ) from .models.speech_to_text_2 import ( - SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2Text2Config, Speech2Text2Processor, Speech2Text2Tokenizer, ) from .models.speecht5 import ( - SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP, - SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP, SpeechT5Config, SpeechT5FeatureExtractor, SpeechT5HifiGanConfig, SpeechT5Processor, ) from .models.splinter import ( - SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig, SplinterTokenizer, ) from .models.squeezebert import ( - SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, SqueezeBertConfig, SqueezeBertTokenizer, ) @@ -5699,77 +5122,63 @@ from .models.starcoder2 import STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP, Starcoder2Config from .models.superpoint import SUPERPOINT_PRETRAINED_CONFIG_ARCHIVE_MAP, SuperPointConfig from .models.swiftformer import ( - SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SwiftFormerConfig, ) - from .models.swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig - from .models.swin2sr import SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP, Swin2SRConfig - from .models.swinv2 import SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Swinv2Config + from .models.swin import SwinConfig + from .models.swin2sr import Swin2SRConfig + from .models.swinv2 import Swinv2Config from .models.switch_transformers import ( - SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP, SwitchTransformersConfig, ) - from .models.t5 import T5_PRETRAINED_CONFIG_ARCHIVE_MAP, T5Config + from .models.t5 import T5Config from .models.table_transformer import ( - TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TableTransformerConfig, ) from .models.tapas import ( - TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig, TapasTokenizer, ) from .models.time_series_transformer import ( - TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimeSeriesTransformerConfig, ) from .models.timesformer import ( - TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig, ) from .models.timm_backbone import TimmBackboneConfig from .models.trocr import ( - TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig, TrOCRProcessor, ) from .models.tvlt import ( - TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP, TvltConfig, TvltFeatureExtractor, TvltProcessor, ) from .models.tvp import ( - TVP_PRETRAINED_CONFIG_ARCHIVE_MAP, TvpConfig, TvpProcessor, ) - from .models.udop import UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP, UdopConfig, UdopProcessor + from .models.udop import UdopConfig, UdopProcessor from .models.umt5 import UMT5Config from .models.unispeech import ( - UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechConfig, ) from .models.unispeech_sat import ( - UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig, ) from .models.univnet import ( - UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP, UnivNetConfig, UnivNetFeatureExtractor, ) from .models.upernet import UperNetConfig - from .models.videomae import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP, VideoMAEConfig + from .models.videomae import VideoMAEConfig from .models.vilt import ( - VILT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViltConfig, ViltFeatureExtractor, ViltImageProcessor, ViltProcessor, ) from .models.vipllava import ( - VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, VipLlavaConfig, ) from .models.vision_encoder_decoder import VisionEncoderDecoderConfig @@ -5778,26 +5187,22 @@ VisionTextDualEncoderProcessor, ) from .models.visual_bert import ( - VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig, ) - from .models.vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig + from .models.vit import ViTConfig from .models.vit_hybrid import ( - VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTHybridConfig, ) - from .models.vit_mae import VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMAEConfig - from .models.vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig - from .models.vitdet import VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP, VitDetConfig - from .models.vitmatte import VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP, VitMatteConfig + from .models.vit_mae import ViTMAEConfig + from .models.vit_msn import ViTMSNConfig + from .models.vitdet import VitDetConfig + from .models.vitmatte import VitMatteConfig from .models.vits import ( - VITS_PRETRAINED_CONFIG_ARCHIVE_MAP, VitsConfig, VitsTokenizer, ) - from .models.vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig + from .models.vivit import VivitConfig from .models.wav2vec2 import ( - WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2Config, Wav2Vec2CTCTokenizer, Wav2Vec2FeatureExtractor, @@ -5805,49 +5210,42 @@ Wav2Vec2Tokenizer, ) from .models.wav2vec2_bert import ( - WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2BertConfig, Wav2Vec2BertProcessor, ) from .models.wav2vec2_conformer import ( - WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2ConformerConfig, ) from .models.wav2vec2_phoneme import Wav2Vec2PhonemeCTCTokenizer from .models.wav2vec2_with_lm import Wav2Vec2ProcessorWithLM - from .models.wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig + from .models.wavlm import WavLMConfig from .models.whisper import ( - WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperFeatureExtractor, WhisperProcessor, WhisperTokenizer, ) from .models.x_clip import ( - XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, XCLIPConfig, XCLIPProcessor, XCLIPTextConfig, XCLIPVisionConfig, ) - from .models.xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig - from .models.xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMTokenizer + from .models.xglm import XGLMConfig + from .models.xlm import XLMConfig, XLMTokenizer from .models.xlm_prophetnet import ( - XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig, ) from .models.xlm_roberta import ( - XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaConfig, ) from .models.xlm_roberta_xl import ( - XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaXLConfig, ) - from .models.xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig - from .models.xmod import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP, XmodConfig - from .models.yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig - from .models.yoso import YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP, YosoConfig + from .models.xlnet import XLNetConfig + from .models.xmod import XmodConfig + from .models.yolos import YolosConfig + from .models.yoso import YosoConfig # Pipelines from .pipelines import ( @@ -6292,7 +5690,6 @@ ) from .modeling_utils import PreTrainedModel from .models.albert import ( - ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, AlbertForMaskedLM, AlbertForMultipleChoice, AlbertForPreTraining, @@ -6304,21 +5701,18 @@ load_tf_weights_in_albert, ) from .models.align import ( - ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST, AlignModel, AlignPreTrainedModel, AlignTextModel, AlignVisionModel, ) from .models.altclip import ( - ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, AltCLIPModel, AltCLIPPreTrainedModel, AltCLIPTextModel, AltCLIPVisionModel, ) from .models.audio_spectrogram_transformer import ( - AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ASTForAudioClassification, ASTModel, ASTPreTrainedModel, @@ -6406,13 +5800,11 @@ AutoModelWithLMHead, ) from .models.autoformer import ( - AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, AutoformerForPrediction, AutoformerModel, AutoformerPreTrainedModel, ) from .models.bark import ( - BARK_PRETRAINED_MODEL_ARCHIVE_LIST, BarkCausalModel, BarkCoarseModel, BarkFineModel, @@ -6421,7 +5813,6 @@ BarkSemanticModel, ) from .models.bart import ( - BART_PRETRAINED_MODEL_ARCHIVE_LIST, BartForCausalLM, BartForConditionalGeneration, BartForQuestionAnswering, @@ -6432,7 +5823,6 @@ PretrainedBartModel, ) from .models.beit import ( - BEIT_PRETRAINED_MODEL_ARCHIVE_LIST, BeitBackbone, BeitForImageClassification, BeitForMaskedImageModeling, @@ -6441,7 +5831,6 @@ BeitPreTrainedModel, ) from .models.bert import ( - BERT_PRETRAINED_MODEL_ARCHIVE_LIST, BertForMaskedLM, BertForMultipleChoice, BertForNextSentencePrediction, @@ -6462,7 +5851,6 @@ load_tf_weights_in_bert_generation, ) from .models.big_bird import ( - BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdForCausalLM, BigBirdForMaskedLM, BigBirdForMultipleChoice, @@ -6476,7 +5864,6 @@ load_tf_weights_in_big_bird, ) from .models.bigbird_pegasus import ( - BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdPegasusForCausalLM, BigBirdPegasusForConditionalGeneration, BigBirdPegasusForQuestionAnswering, @@ -6485,7 +5872,6 @@ BigBirdPegasusPreTrainedModel, ) from .models.biogpt import ( - BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST, BioGptForCausalLM, BioGptForSequenceClassification, BioGptForTokenClassification, @@ -6493,28 +5879,24 @@ BioGptPreTrainedModel, ) from .models.bit import ( - BIT_PRETRAINED_MODEL_ARCHIVE_LIST, BitBackbone, BitForImageClassification, BitModel, BitPreTrainedModel, ) from .models.blenderbot import ( - BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotForCausalLM, BlenderbotForConditionalGeneration, BlenderbotModel, BlenderbotPreTrainedModel, ) from .models.blenderbot_small import ( - BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotSmallForCausalLM, BlenderbotSmallForConditionalGeneration, BlenderbotSmallModel, BlenderbotSmallPreTrainedModel, ) from .models.blip import ( - BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, BlipForConditionalGeneration, BlipForImageTextRetrieval, BlipForQuestionAnswering, @@ -6524,7 +5906,6 @@ BlipVisionModel, ) from .models.blip_2 import ( - BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST, Blip2ForConditionalGeneration, Blip2Model, Blip2PreTrainedModel, @@ -6532,7 +5913,6 @@ Blip2VisionModel, ) from .models.bloom import ( - BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST, BloomForCausalLM, BloomForQuestionAnswering, BloomForSequenceClassification, @@ -6541,7 +5921,6 @@ BloomPreTrainedModel, ) from .models.bridgetower import ( - BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST, BridgeTowerForContrastiveLearning, BridgeTowerForImageAndTextRetrieval, BridgeTowerForMaskedLM, @@ -6549,7 +5928,6 @@ BridgeTowerPreTrainedModel, ) from .models.bros import ( - BROS_PRETRAINED_MODEL_ARCHIVE_LIST, BrosForTokenClassification, BrosModel, BrosPreTrainedModel, @@ -6558,7 +5936,6 @@ BrosSpadeELForTokenClassification, ) from .models.camembert import ( - CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, CamembertForCausalLM, CamembertForMaskedLM, CamembertForMultipleChoice, @@ -6569,7 +5946,6 @@ CamembertPreTrainedModel, ) from .models.canine import ( - CANINE_PRETRAINED_MODEL_ARCHIVE_LIST, CanineForMultipleChoice, CanineForQuestionAnswering, CanineForSequenceClassification, @@ -6580,14 +5956,12 @@ load_tf_weights_in_canine, ) from .models.chinese_clip import ( - CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, ChineseCLIPModel, ChineseCLIPPreTrainedModel, ChineseCLIPTextModel, ChineseCLIPVisionModel, ) from .models.clap import ( - CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioModel, ClapAudioModelWithProjection, ClapFeatureExtractor, @@ -6597,7 +5971,6 @@ ClapTextModelWithProjection, ) from .models.clip import ( - CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPForImageClassification, CLIPModel, CLIPPreTrainedModel, @@ -6607,7 +5980,6 @@ CLIPVisionModelWithProjection, ) from .models.clipseg import ( - CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPSegForImageSegmentation, CLIPSegModel, CLIPSegPreTrainedModel, @@ -6615,7 +5987,6 @@ CLIPSegVisionModel, ) from .models.clvp import ( - CLVP_PRETRAINED_MODEL_ARCHIVE_LIST, ClvpDecoder, ClvpEncoder, ClvpForCausalLM, @@ -6624,7 +5995,6 @@ ClvpPreTrainedModel, ) from .models.codegen import ( - CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST, CodeGenForCausalLM, CodeGenModel, CodeGenPreTrainedModel, @@ -6635,14 +6005,12 @@ CoherePreTrainedModel, ) from .models.conditional_detr import ( - CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, ConditionalDetrForObjectDetection, ConditionalDetrForSegmentation, ConditionalDetrModel, ConditionalDetrPreTrainedModel, ) from .models.convbert import ( - CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvBertForMaskedLM, ConvBertForMultipleChoice, ConvBertForQuestionAnswering, @@ -6654,42 +6022,34 @@ load_tf_weights_in_convbert, ) from .models.convnext import ( - CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextBackbone, ConvNextForImageClassification, ConvNextModel, ConvNextPreTrainedModel, ) from .models.convnextv2 import ( - CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextV2Backbone, ConvNextV2ForImageClassification, ConvNextV2Model, ConvNextV2PreTrainedModel, ) from .models.cpmant import ( - CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST, CpmAntForCausalLM, CpmAntModel, CpmAntPreTrainedModel, ) from .models.ctrl import ( - CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, CTRLForSequenceClassification, CTRLLMHeadModel, CTRLModel, CTRLPreTrainedModel, ) from .models.cvt import ( - CVT_PRETRAINED_MODEL_ARCHIVE_LIST, CvtForImageClassification, CvtModel, CvtPreTrainedModel, ) from .models.data2vec import ( - DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST, - DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, - DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecAudioForAudioFrameClassification, Data2VecAudioForCTC, Data2VecAudioForSequenceClassification, @@ -6710,7 +6070,6 @@ Data2VecVisionPreTrainedModel, ) from .models.deberta import ( - DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaForMaskedLM, DebertaForQuestionAnswering, DebertaForSequenceClassification, @@ -6719,7 +6078,6 @@ DebertaPreTrainedModel, ) from .models.deberta_v2 import ( - DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaV2ForMaskedLM, DebertaV2ForMultipleChoice, DebertaV2ForQuestionAnswering, @@ -6729,20 +6087,17 @@ DebertaV2PreTrainedModel, ) from .models.decision_transformer import ( - DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, DecisionTransformerGPT2Model, DecisionTransformerGPT2PreTrainedModel, DecisionTransformerModel, DecisionTransformerPreTrainedModel, ) from .models.deformable_detr import ( - DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DeformableDetrForObjectDetection, DeformableDetrModel, DeformableDetrPreTrainedModel, ) from .models.deit import ( - DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, DeiTForImageClassification, DeiTForImageClassificationWithTeacher, DeiTForMaskedImageModeling, @@ -6750,7 +6105,6 @@ DeiTPreTrainedModel, ) from .models.deprecated.mctct import ( - MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel, @@ -6767,17 +6121,14 @@ OpenLlamaPreTrainedModel, ) from .models.deprecated.retribert import ( - RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RetriBertModel, RetriBertPreTrainedModel, ) from .models.deprecated.trajectory_transformer import ( - TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TrajectoryTransformerModel, TrajectoryTransformerPreTrainedModel, ) from .models.deprecated.transfo_xl import ( - TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, AdaptiveEmbedding, TransfoXLForSequenceClassification, TransfoXLLMHeadModel, @@ -6786,45 +6137,38 @@ load_tf_weights_in_transfo_xl, ) from .models.deprecated.van import ( - VAN_PRETRAINED_MODEL_ARCHIVE_LIST, VanForImageClassification, VanModel, VanPreTrainedModel, ) from .models.depth_anything import ( - DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST, DepthAnythingForDepthEstimation, DepthAnythingPreTrainedModel, ) from .models.deta import ( - DETA_PRETRAINED_MODEL_ARCHIVE_LIST, DetaForObjectDetection, DetaModel, DetaPreTrainedModel, ) from .models.detr import ( - DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DetrForObjectDetection, DetrForSegmentation, DetrModel, DetrPreTrainedModel, ) from .models.dinat import ( - DINAT_PRETRAINED_MODEL_ARCHIVE_LIST, DinatBackbone, DinatForImageClassification, DinatModel, DinatPreTrainedModel, ) from .models.dinov2 import ( - DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST, Dinov2Backbone, Dinov2ForImageClassification, Dinov2Model, Dinov2PreTrainedModel, ) from .models.distilbert import ( - DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, DistilBertForMaskedLM, DistilBertForMultipleChoice, DistilBertForQuestionAnswering, @@ -6834,14 +6178,10 @@ DistilBertPreTrainedModel, ) from .models.donut import ( - DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, DonutSwinModel, DonutSwinPreTrainedModel, ) from .models.dpr import ( - DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, DPRContextEncoder, DPRPretrainedContextEncoder, DPRPreTrainedModel, @@ -6851,27 +6191,23 @@ DPRReader, ) from .models.dpt import ( - DPT_PRETRAINED_MODEL_ARCHIVE_LIST, DPTForDepthEstimation, DPTForSemanticSegmentation, DPTModel, DPTPreTrainedModel, ) from .models.efficientformer import ( - EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientFormerForImageClassification, EfficientFormerForImageClassificationWithTeacher, EfficientFormerModel, EfficientFormerPreTrainedModel, ) from .models.efficientnet import ( - EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientNetForImageClassification, EfficientNetModel, EfficientNetPreTrainedModel, ) from .models.electra import ( - ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, ElectraForCausalLM, ElectraForMaskedLM, ElectraForMultipleChoice, @@ -6884,13 +6220,11 @@ load_tf_weights_in_electra, ) from .models.encodec import ( - ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST, EncodecModel, EncodecPreTrainedModel, ) from .models.encoder_decoder import EncoderDecoderModel from .models.ernie import ( - ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieForCausalLM, ErnieForMaskedLM, ErnieForMultipleChoice, @@ -6903,7 +6237,6 @@ ErniePreTrainedModel, ) from .models.ernie_m import ( - ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieMForInformationExtraction, ErnieMForMultipleChoice, ErnieMForQuestionAnswering, @@ -6913,7 +6246,6 @@ ErnieMPreTrainedModel, ) from .models.esm import ( - ESM_PRETRAINED_MODEL_ARCHIVE_LIST, EsmFoldPreTrainedModel, EsmForMaskedLM, EsmForProteinFolding, @@ -6923,7 +6255,6 @@ EsmPreTrainedModel, ) from .models.falcon import ( - FALCON_PRETRAINED_MODEL_ARCHIVE_LIST, FalconForCausalLM, FalconForQuestionAnswering, FalconForSequenceClassification, @@ -6932,14 +6263,12 @@ FalconPreTrainedModel, ) from .models.fastspeech2_conformer import ( - FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, FastSpeech2ConformerHifiGan, FastSpeech2ConformerModel, FastSpeech2ConformerPreTrainedModel, FastSpeech2ConformerWithHifiGan, ) from .models.flaubert import ( - FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, FlaubertForMultipleChoice, FlaubertForQuestionAnswering, FlaubertForQuestionAnsweringSimple, @@ -6950,7 +6279,6 @@ FlaubertWithLMHeadModel, ) from .models.flava import ( - FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, FlavaForPreTraining, FlavaImageCodebook, FlavaImageModel, @@ -6960,7 +6288,6 @@ FlavaTextModel, ) from .models.fnet import ( - FNET_PRETRAINED_MODEL_ARCHIVE_LIST, FNetForMaskedLM, FNetForMultipleChoice, FNetForNextSentencePrediction, @@ -6973,7 +6300,6 @@ FNetPreTrainedModel, ) from .models.focalnet import ( - FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST, FocalNetBackbone, FocalNetForImageClassification, FocalNetForMaskedImageModeling, @@ -6986,7 +6312,6 @@ PretrainedFSMTModel, ) from .models.funnel import ( - FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, FunnelBaseModel, FunnelForMaskedLM, FunnelForMultipleChoice, @@ -7009,20 +6334,17 @@ GemmaPreTrainedModel, ) from .models.git import ( - GIT_PRETRAINED_MODEL_ARCHIVE_LIST, GitForCausalLM, GitModel, GitPreTrainedModel, GitVisionModel, ) from .models.glpn import ( - GLPN_PRETRAINED_MODEL_ARCHIVE_LIST, GLPNForDepthEstimation, GLPNModel, GLPNPreTrainedModel, ) from .models.gpt2 import ( - GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, GPT2DoubleHeadsModel, GPT2ForQuestionAnswering, GPT2ForSequenceClassification, @@ -7033,7 +6355,6 @@ load_tf_weights_in_gpt2, ) from .models.gpt_bigcode import ( - GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTBigCodeForCausalLM, GPTBigCodeForSequenceClassification, GPTBigCodeForTokenClassification, @@ -7041,7 +6362,6 @@ GPTBigCodePreTrainedModel, ) from .models.gpt_neo import ( - GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoForCausalLM, GPTNeoForQuestionAnswering, GPTNeoForSequenceClassification, @@ -7051,7 +6371,6 @@ load_tf_weights_in_gpt_neo, ) from .models.gpt_neox import ( - GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXForCausalLM, GPTNeoXForQuestionAnswering, GPTNeoXForSequenceClassification, @@ -7061,14 +6380,12 @@ GPTNeoXPreTrainedModel, ) from .models.gpt_neox_japanese import ( - GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseLayer, GPTNeoXJapaneseModel, GPTNeoXJapanesePreTrainedModel, ) from .models.gptj import ( - GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST, GPTJForCausalLM, GPTJForQuestionAnswering, GPTJForSequenceClassification, @@ -7076,33 +6393,28 @@ GPTJPreTrainedModel, ) from .models.gptsan_japanese import ( - GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTSanJapaneseForConditionalGeneration, GPTSanJapaneseModel, GPTSanJapanesePreTrainedModel, ) from .models.graphormer import ( - GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST, GraphormerForGraphClassification, GraphormerModel, GraphormerPreTrainedModel, ) from .models.groupvit import ( - GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, GroupViTModel, GroupViTPreTrainedModel, GroupViTTextModel, GroupViTVisionModel, ) from .models.hubert import ( - HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, HubertForCTC, HubertForSequenceClassification, HubertModel, HubertPreTrainedModel, ) from .models.ibert import ( - IBERT_PRETRAINED_MODEL_ARCHIVE_LIST, IBertForMaskedLM, IBertForMultipleChoice, IBertForQuestionAnswering, @@ -7112,14 +6424,12 @@ IBertPreTrainedModel, ) from .models.idefics import ( - IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST, IdeficsForVisionText2Text, IdeficsModel, IdeficsPreTrainedModel, IdeficsProcessor, ) from .models.imagegpt import ( - IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST, ImageGPTForCausalImageModeling, ImageGPTForImageClassification, ImageGPTModel, @@ -7127,33 +6437,28 @@ load_tf_weights_in_imagegpt, ) from .models.informer import ( - INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, InformerForPrediction, InformerModel, InformerPreTrainedModel, ) from .models.instructblip import ( - INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST, InstructBlipForConditionalGeneration, InstructBlipPreTrainedModel, InstructBlipQFormerModel, InstructBlipVisionModel, ) from .models.jukebox import ( - JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST, JukeboxModel, JukeboxPreTrainedModel, JukeboxPrior, JukeboxVQVAE, ) from .models.kosmos2 import ( - KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST, Kosmos2ForConditionalGeneration, Kosmos2Model, Kosmos2PreTrainedModel, ) from .models.layoutlm import ( - LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMForMaskedLM, LayoutLMForQuestionAnswering, LayoutLMForSequenceClassification, @@ -7162,7 +6467,6 @@ LayoutLMPreTrainedModel, ) from .models.layoutlmv2 import ( - LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv2ForQuestionAnswering, LayoutLMv2ForSequenceClassification, LayoutLMv2ForTokenClassification, @@ -7170,7 +6474,6 @@ LayoutLMv2PreTrainedModel, ) from .models.layoutlmv3 import ( - LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv3ForQuestionAnswering, LayoutLMv3ForSequenceClassification, LayoutLMv3ForTokenClassification, @@ -7178,7 +6481,6 @@ LayoutLMv3PreTrainedModel, ) from .models.led import ( - LED_PRETRAINED_MODEL_ARCHIVE_LIST, LEDForConditionalGeneration, LEDForQuestionAnswering, LEDForSequenceClassification, @@ -7186,14 +6488,12 @@ LEDPreTrainedModel, ) from .models.levit import ( - LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, LevitForImageClassification, LevitForImageClassificationWithTeacher, LevitModel, LevitPreTrainedModel, ) from .models.lilt import ( - LILT_PRETRAINED_MODEL_ARCHIVE_LIST, LiltForQuestionAnswering, LiltForSequenceClassification, LiltForTokenClassification, @@ -7208,7 +6508,6 @@ LlamaPreTrainedModel, ) from .models.llava import ( - LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, LlavaForConditionalGeneration, LlavaPreTrainedModel, ) @@ -7218,7 +6517,6 @@ LlavaNextPreTrainedModel, ) from .models.longformer import ( - LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, LongformerForMaskedLM, LongformerForMultipleChoice, LongformerForQuestionAnswering, @@ -7229,14 +6527,12 @@ LongformerSelfAttention, ) from .models.longt5 import ( - LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST, LongT5EncoderModel, LongT5ForConditionalGeneration, LongT5Model, LongT5PreTrainedModel, ) from .models.luke import ( - LUKE_PRETRAINED_MODEL_ARCHIVE_LIST, LukeForEntityClassification, LukeForEntityPairClassification, LukeForEntitySpanClassification, @@ -7258,20 +6554,17 @@ LxmertXLayer, ) from .models.m2m_100 import ( - M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST, M2M100ForConditionalGeneration, M2M100Model, M2M100PreTrainedModel, ) from .models.mamba import ( - MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST, MambaForCausalLM, MambaModel, MambaPreTrainedModel, ) from .models.marian import MarianForCausalLM, MarianModel, MarianMTModel from .models.markuplm import ( - MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST, MarkupLMForQuestionAnswering, MarkupLMForSequenceClassification, MarkupLMForTokenClassification, @@ -7279,13 +6572,11 @@ MarkupLMPreTrainedModel, ) from .models.mask2former import ( - MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Mask2FormerForUniversalSegmentation, Mask2FormerModel, Mask2FormerPreTrainedModel, ) from .models.maskformer import ( - MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, MaskFormerForInstanceSegmentation, MaskFormerModel, MaskFormerPreTrainedModel, @@ -7300,7 +6591,6 @@ MBartPreTrainedModel, ) from .models.mega import ( - MEGA_PRETRAINED_MODEL_ARCHIVE_LIST, MegaForCausalLM, MegaForMaskedLM, MegaForMultipleChoice, @@ -7311,7 +6601,6 @@ MegaPreTrainedModel, ) from .models.megatron_bert import ( - MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, MegatronBertForCausalLM, MegatronBertForMaskedLM, MegatronBertForMultipleChoice, @@ -7324,7 +6613,6 @@ MegatronBertPreTrainedModel, ) from .models.mgp_str import ( - MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST, MgpstrForSceneTextRecognition, MgpstrModel, MgpstrPreTrainedModel, @@ -7342,7 +6630,6 @@ MixtralPreTrainedModel, ) from .models.mobilebert import ( - MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileBertForMaskedLM, MobileBertForMultipleChoice, MobileBertForNextSentencePrediction, @@ -7356,14 +6643,12 @@ load_tf_weights_in_mobilebert, ) from .models.mobilenet_v1 import ( - MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV1ForImageClassification, MobileNetV1Model, MobileNetV1PreTrainedModel, load_tf_weights_in_mobilenet_v1, ) from .models.mobilenet_v2 import ( - MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV2ForImageClassification, MobileNetV2ForSemanticSegmentation, MobileNetV2Model, @@ -7371,21 +6656,18 @@ load_tf_weights_in_mobilenet_v2, ) from .models.mobilevit import ( - MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTForImageClassification, MobileViTForSemanticSegmentation, MobileViTModel, MobileViTPreTrainedModel, ) from .models.mobilevitv2 import ( - MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTV2ForImageClassification, MobileViTV2ForSemanticSegmentation, MobileViTV2Model, MobileViTV2PreTrainedModel, ) from .models.mpnet import ( - MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, MPNetForMaskedLM, MPNetForMultipleChoice, MPNetForQuestionAnswering, @@ -7396,7 +6678,6 @@ MPNetPreTrainedModel, ) from .models.mpt import ( - MPT_PRETRAINED_MODEL_ARCHIVE_LIST, MptForCausalLM, MptForQuestionAnswering, MptForSequenceClassification, @@ -7405,7 +6686,6 @@ MptPreTrainedModel, ) from .models.mra import ( - MRA_PRETRAINED_MODEL_ARCHIVE_LIST, MraForMaskedLM, MraForMultipleChoice, MraForQuestionAnswering, @@ -7424,7 +6704,6 @@ MT5PreTrainedModel, ) from .models.musicgen import ( - MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST, MusicgenForCausalLM, MusicgenForConditionalGeneration, MusicgenModel, @@ -7439,7 +6718,6 @@ MusicgenMelodyPreTrainedModel, ) from .models.mvp import ( - MVP_PRETRAINED_MODEL_ARCHIVE_LIST, MvpForCausalLM, MvpForConditionalGeneration, MvpForQuestionAnswering, @@ -7448,14 +6726,12 @@ MvpPreTrainedModel, ) from .models.nat import ( - NAT_PRETRAINED_MODEL_ARCHIVE_LIST, NatBackbone, NatForImageClassification, NatModel, NatPreTrainedModel, ) from .models.nezha import ( - NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST, NezhaForMaskedLM, NezhaForMultipleChoice, NezhaForNextSentencePrediction, @@ -7467,7 +6743,6 @@ NezhaPreTrainedModel, ) from .models.nllb_moe import ( - NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST, NllbMoeForConditionalGeneration, NllbMoeModel, NllbMoePreTrainedModel, @@ -7475,7 +6750,6 @@ NllbMoeTop2Router, ) from .models.nystromformer import ( - NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, NystromformerForMaskedLM, NystromformerForMultipleChoice, NystromformerForQuestionAnswering, @@ -7486,13 +6760,11 @@ NystromformerPreTrainedModel, ) from .models.oneformer import ( - ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, OneFormerForUniversalSegmentation, OneFormerModel, OneFormerPreTrainedModel, ) from .models.openai import ( - OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, OpenAIGPTDoubleHeadsModel, OpenAIGPTForSequenceClassification, OpenAIGPTLMHeadModel, @@ -7501,7 +6773,6 @@ load_tf_weights_in_openai_gpt, ) from .models.opt import ( - OPT_PRETRAINED_MODEL_ARCHIVE_LIST, OPTForCausalLM, OPTForQuestionAnswering, OPTForSequenceClassification, @@ -7509,7 +6780,6 @@ OPTPreTrainedModel, ) from .models.owlv2 import ( - OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST, Owlv2ForObjectDetection, Owlv2Model, Owlv2PreTrainedModel, @@ -7517,7 +6787,6 @@ Owlv2VisionModel, ) from .models.owlvit import ( - OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST, OwlViTForObjectDetection, OwlViTModel, OwlViTPreTrainedModel, @@ -7525,7 +6794,6 @@ OwlViTVisionModel, ) from .models.patchtsmixer import ( - PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSMixerForPrediction, PatchTSMixerForPretraining, PatchTSMixerForRegression, @@ -7534,7 +6802,6 @@ PatchTSMixerPreTrainedModel, ) from .models.patchtst import ( - PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSTForClassification, PatchTSTForPrediction, PatchTSTForPretraining, @@ -7549,13 +6816,11 @@ PegasusPreTrainedModel, ) from .models.pegasus_x import ( - PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST, PegasusXForConditionalGeneration, PegasusXModel, PegasusXPreTrainedModel, ) from .models.perceiver import ( - PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST, PerceiverForImageClassificationConvProcessing, PerceiverForImageClassificationFourier, PerceiverForImageClassificationLearned, @@ -7574,7 +6839,6 @@ PersimmonPreTrainedModel, ) from .models.phi import ( - PHI_PRETRAINED_MODEL_ARCHIVE_LIST, PhiForCausalLM, PhiForSequenceClassification, PhiForTokenClassification, @@ -7582,14 +6846,12 @@ PhiPreTrainedModel, ) from .models.pix2struct import ( - PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST, Pix2StructForConditionalGeneration, Pix2StructPreTrainedModel, Pix2StructTextModel, Pix2StructVisionModel, ) from .models.plbart import ( - PLBART_PRETRAINED_MODEL_ARCHIVE_LIST, PLBartForCausalLM, PLBartForConditionalGeneration, PLBartForSequenceClassification, @@ -7597,18 +6859,15 @@ PLBartPreTrainedModel, ) from .models.poolformer import ( - POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, PoolFormerForImageClassification, PoolFormerModel, PoolFormerPreTrainedModel, ) from .models.pop2piano import ( - POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST, Pop2PianoForConditionalGeneration, Pop2PianoPreTrainedModel, ) from .models.prophetnet import ( - PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, ProphetNetDecoder, ProphetNetEncoder, ProphetNetForCausalLM, @@ -7617,7 +6876,6 @@ ProphetNetPreTrainedModel, ) from .models.pvt import ( - PVT_PRETRAINED_MODEL_ARCHIVE_LIST, PvtForImageClassification, PvtModel, PvtPreTrainedModel, @@ -7630,7 +6888,6 @@ PvtV2PreTrainedModel, ) from .models.qdqbert import ( - QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST, QDQBertForMaskedLM, QDQBertForMultipleChoice, QDQBertForNextSentencePrediction, @@ -7656,7 +6913,6 @@ RagTokenForGeneration, ) from .models.realm import ( - REALM_PRETRAINED_MODEL_ARCHIVE_LIST, RealmEmbedder, RealmForOpenQA, RealmKnowledgeAugEncoder, @@ -7667,7 +6923,6 @@ load_tf_weights_in_realm, ) from .models.reformer import ( - REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ReformerAttention, ReformerForMaskedLM, ReformerForQuestionAnswering, @@ -7678,13 +6933,11 @@ ReformerPreTrainedModel, ) from .models.regnet import ( - REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, RegNetForImageClassification, RegNetModel, RegNetPreTrainedModel, ) from .models.rembert import ( - REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RemBertForCausalLM, RemBertForMaskedLM, RemBertForMultipleChoice, @@ -7697,14 +6950,12 @@ load_tf_weights_in_rembert, ) from .models.resnet import ( - RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, ResNetBackbone, ResNetForImageClassification, ResNetModel, ResNetPreTrainedModel, ) from .models.roberta import ( - ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaForCausalLM, RobertaForMaskedLM, RobertaForMultipleChoice, @@ -7715,7 +6966,6 @@ RobertaPreTrainedModel, ) from .models.roberta_prelayernorm import ( - ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaPreLayerNormForCausalLM, RobertaPreLayerNormForMaskedLM, RobertaPreLayerNormForMultipleChoice, @@ -7726,7 +6976,6 @@ RobertaPreLayerNormPreTrainedModel, ) from .models.roc_bert import ( - ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, RoCBertForCausalLM, RoCBertForMaskedLM, RoCBertForMultipleChoice, @@ -7740,7 +6989,6 @@ load_tf_weights_in_roc_bert, ) from .models.roformer import ( - ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, RoFormerForCausalLM, RoFormerForMaskedLM, RoFormerForMultipleChoice, @@ -7753,20 +7001,17 @@ load_tf_weights_in_roformer, ) from .models.rwkv import ( - RWKV_PRETRAINED_MODEL_ARCHIVE_LIST, RwkvForCausalLM, RwkvModel, RwkvPreTrainedModel, ) from .models.sam import ( - SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel, ) # PyTorch model imports from .models.seamless_m4t import ( - SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4TCodeHifiGan, SeamlessM4TForSpeechToSpeech, SeamlessM4TForSpeechToText, @@ -7779,7 +7024,6 @@ SeamlessM4TTextToUnitModel, ) from .models.seamless_m4t_v2 import ( - SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4Tv2ForSpeechToSpeech, SeamlessM4Tv2ForSpeechToText, SeamlessM4Tv2ForTextToSpeech, @@ -7788,7 +7032,6 @@ SeamlessM4Tv2PreTrainedModel, ) from .models.segformer import ( - SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SegformerDecodeHead, SegformerForImageClassification, SegformerForSemanticSegmentation, @@ -7797,27 +7040,23 @@ SegformerPreTrainedModel, ) from .models.seggpt import ( - SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST, SegGptForImageSegmentation, SegGptModel, SegGptPreTrainedModel, ) from .models.sew import ( - SEW_PRETRAINED_MODEL_ARCHIVE_LIST, SEWForCTC, SEWForSequenceClassification, SEWModel, SEWPreTrainedModel, ) from .models.sew_d import ( - SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST, SEWDForCTC, SEWDForSequenceClassification, SEWDModel, SEWDPreTrainedModel, ) from .models.siglip import ( - SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST, SiglipForImageClassification, SiglipModel, SiglipPreTrainedModel, @@ -7826,7 +7065,6 @@ ) from .models.speech_encoder_decoder import SpeechEncoderDecoderModel from .models.speech_to_text import ( - SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, Speech2TextForConditionalGeneration, Speech2TextModel, Speech2TextPreTrainedModel, @@ -7836,7 +7074,6 @@ Speech2Text2PreTrainedModel, ) from .models.speecht5 import ( - SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST, SpeechT5ForSpeechToSpeech, SpeechT5ForSpeechToText, SpeechT5ForTextToSpeech, @@ -7845,7 +7082,6 @@ SpeechT5PreTrainedModel, ) from .models.splinter import ( - SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST, SplinterForPreTraining, SplinterForQuestionAnswering, SplinterLayer, @@ -7853,7 +7089,6 @@ SplinterPreTrainedModel, ) from .models.squeezebert import ( - SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, SqueezeBertForMaskedLM, SqueezeBertForMultipleChoice, SqueezeBertForQuestionAnswering, @@ -7881,13 +7116,11 @@ SuperPointPreTrainedModel, ) from .models.swiftformer import ( - SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SwiftFormerForImageClassification, SwiftFormerModel, SwiftFormerPreTrainedModel, ) from .models.swin import ( - SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, SwinBackbone, SwinForImageClassification, SwinForMaskedImageModeling, @@ -7895,13 +7128,11 @@ SwinPreTrainedModel, ) from .models.swin2sr import ( - SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST, Swin2SRForImageSuperResolution, Swin2SRModel, Swin2SRPreTrainedModel, ) from .models.swinv2 import ( - SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST, Swinv2Backbone, Swinv2ForImageClassification, Swinv2ForMaskedImageModeling, @@ -7909,7 +7140,6 @@ Swinv2PreTrainedModel, ) from .models.switch_transformers import ( - SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST, SwitchTransformersEncoderModel, SwitchTransformersForConditionalGeneration, SwitchTransformersModel, @@ -7918,7 +7148,6 @@ SwitchTransformersTop1Router, ) from .models.t5 import ( - T5_PRETRAINED_MODEL_ARCHIVE_LIST, T5EncoderModel, T5ForConditionalGeneration, T5ForQuestionAnswering, @@ -7929,13 +7158,11 @@ load_tf_weights_in_t5, ) from .models.table_transformer import ( - TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TableTransformerForObjectDetection, TableTransformerModel, TableTransformerPreTrainedModel, ) from .models.tapas import ( - TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TapasForMaskedLM, TapasForQuestionAnswering, TapasForSequenceClassification, @@ -7944,38 +7171,32 @@ load_tf_weights_in_tapas, ) from .models.time_series_transformer import ( - TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimeSeriesTransformerForPrediction, TimeSeriesTransformerModel, TimeSeriesTransformerPreTrainedModel, ) from .models.timesformer import ( - TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimesformerForVideoClassification, TimesformerModel, TimesformerPreTrainedModel, ) from .models.timm_backbone import TimmBackbone from .models.trocr import ( - TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel, ) from .models.tvlt import ( - TVLT_PRETRAINED_MODEL_ARCHIVE_LIST, TvltForAudioVisualClassification, TvltForPreTraining, TvltModel, TvltPreTrainedModel, ) from .models.tvp import ( - TVP_PRETRAINED_MODEL_ARCHIVE_LIST, TvpForVideoGrounding, TvpModel, TvpPreTrainedModel, ) from .models.udop import ( - UDOP_PRETRAINED_MODEL_ARCHIVE_LIST, UdopEncoderModel, UdopForConditionalGeneration, UdopModel, @@ -7991,7 +7212,6 @@ UMT5PreTrainedModel, ) from .models.unispeech import ( - UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechForCTC, UniSpeechForPreTraining, UniSpeechForSequenceClassification, @@ -7999,7 +7219,6 @@ UniSpeechPreTrainedModel, ) from .models.unispeech_sat import ( - UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechSatForAudioFrameClassification, UniSpeechSatForCTC, UniSpeechSatForPreTraining, @@ -8008,20 +7227,18 @@ UniSpeechSatModel, UniSpeechSatPreTrainedModel, ) - from .models.univnet import UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST, UnivNetModel + from .models.univnet import UnivNetModel from .models.upernet import ( UperNetForSemanticSegmentation, UperNetPreTrainedModel, ) from .models.videomae import ( - VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST, VideoMAEForPreTraining, VideoMAEForVideoClassification, VideoMAEModel, VideoMAEPreTrainedModel, ) from .models.vilt import ( - VILT_PRETRAINED_MODEL_ARCHIVE_LIST, ViltForImageAndTextRetrieval, ViltForImagesAndTextClassification, ViltForMaskedLM, @@ -8032,14 +7249,12 @@ ViltPreTrainedModel, ) from .models.vipllava import ( - VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, VipLlavaForConditionalGeneration, VipLlavaPreTrainedModel, ) from .models.vision_encoder_decoder import VisionEncoderDecoderModel from .models.vision_text_dual_encoder import VisionTextDualEncoderModel from .models.visual_bert import ( - VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, VisualBertForMultipleChoice, VisualBertForPreTraining, VisualBertForQuestionAnswering, @@ -8050,55 +7265,46 @@ VisualBertPreTrainedModel, ) from .models.vit import ( - VIT_PRETRAINED_MODEL_ARCHIVE_LIST, ViTForImageClassification, ViTForMaskedImageModeling, ViTModel, ViTPreTrainedModel, ) from .models.vit_hybrid import ( - VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST, ViTHybridForImageClassification, ViTHybridModel, ViTHybridPreTrainedModel, ) from .models.vit_mae import ( - VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMAEForPreTraining, ViTMAELayer, ViTMAEModel, ViTMAEPreTrainedModel, ) from .models.vit_msn import ( - VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMSNForImageClassification, ViTMSNModel, ViTMSNPreTrainedModel, ) from .models.vitdet import ( - VITDET_PRETRAINED_MODEL_ARCHIVE_LIST, VitDetBackbone, VitDetModel, VitDetPreTrainedModel, ) from .models.vitmatte import ( - VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST, VitMatteForImageMatting, VitMattePreTrainedModel, ) from .models.vits import ( - VITS_PRETRAINED_MODEL_ARCHIVE_LIST, VitsModel, VitsPreTrainedModel, ) from .models.vivit import ( - VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST, VivitForVideoClassification, VivitModel, VivitPreTrainedModel, ) from .models.wav2vec2 import ( - WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ForAudioFrameClassification, Wav2Vec2ForCTC, Wav2Vec2ForMaskedLM, @@ -8109,7 +7315,6 @@ Wav2Vec2PreTrainedModel, ) from .models.wav2vec2_bert import ( - WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2BertForAudioFrameClassification, Wav2Vec2BertForCTC, Wav2Vec2BertForSequenceClassification, @@ -8118,7 +7323,6 @@ Wav2Vec2BertPreTrainedModel, ) from .models.wav2vec2_conformer import ( - WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ConformerForAudioFrameClassification, Wav2Vec2ConformerForCTC, Wav2Vec2ConformerForPreTraining, @@ -8128,7 +7332,6 @@ Wav2Vec2ConformerPreTrainedModel, ) from .models.wavlm import ( - WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST, WavLMForAudioFrameClassification, WavLMForCTC, WavLMForSequenceClassification, @@ -8137,7 +7340,6 @@ WavLMPreTrainedModel, ) from .models.whisper import ( - WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, WhisperForAudioClassification, WhisperForCausalLM, WhisperForConditionalGeneration, @@ -8145,20 +7347,17 @@ WhisperPreTrainedModel, ) from .models.x_clip import ( - XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, XCLIPModel, XCLIPPreTrainedModel, XCLIPTextModel, XCLIPVisionModel, ) from .models.xglm import ( - XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel, ) from .models.xlm import ( - XLM_PRETRAINED_MODEL_ARCHIVE_LIST, XLMForMultipleChoice, XLMForQuestionAnswering, XLMForQuestionAnsweringSimple, @@ -8169,7 +7368,6 @@ XLMWithLMHeadModel, ) from .models.xlm_prophetnet import ( - XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLMProphetNetDecoder, XLMProphetNetEncoder, XLMProphetNetForCausalLM, @@ -8178,7 +7376,6 @@ XLMProphetNetPreTrainedModel, ) from .models.xlm_roberta import ( - XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaForCausalLM, XLMRobertaForMaskedLM, XLMRobertaForMultipleChoice, @@ -8189,7 +7386,6 @@ XLMRobertaPreTrainedModel, ) from .models.xlm_roberta_xl import ( - XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaXLForCausalLM, XLMRobertaXLForMaskedLM, XLMRobertaXLForMultipleChoice, @@ -8200,7 +7396,6 @@ XLMRobertaXLPreTrainedModel, ) from .models.xlnet import ( - XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLNetForMultipleChoice, XLNetForQuestionAnswering, XLNetForQuestionAnsweringSimple, @@ -8212,7 +7407,6 @@ load_tf_weights_in_xlnet, ) from .models.xmod import ( - XMOD_PRETRAINED_MODEL_ARCHIVE_LIST, XmodForCausalLM, XmodForMaskedLM, XmodForMultipleChoice, @@ -8223,13 +7417,11 @@ XmodPreTrainedModel, ) from .models.yolos import ( - YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST, YolosForObjectDetection, YolosModel, YolosPreTrainedModel, ) from .models.yoso import ( - YOSO_PRETRAINED_MODEL_ARCHIVE_LIST, YosoForMaskedLM, YosoForMultipleChoice, YosoForQuestionAnswering, @@ -8301,7 +7493,6 @@ # TensorFlow model imports from .models.albert import ( - TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFAlbertForMaskedLM, TFAlbertForMultipleChoice, TFAlbertForPreTraining, @@ -8365,7 +7556,6 @@ TFBartPretrainedModel, ) from .models.bert import ( - TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFBertEmbeddings, TFBertForMaskedLM, TFBertForMultipleChoice, @@ -8390,7 +7580,6 @@ TFBlenderbotSmallPreTrainedModel, ) from .models.blip import ( - TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFBlipForConditionalGeneration, TFBlipForImageTextRetrieval, TFBlipForQuestionAnswering, @@ -8400,7 +7589,6 @@ TFBlipVisionModel, ) from .models.camembert import ( - TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCamembertForCausalLM, TFCamembertForMaskedLM, TFCamembertForMultipleChoice, @@ -8411,14 +7599,12 @@ TFCamembertPreTrainedModel, ) from .models.clip import ( - TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFCLIPModel, TFCLIPPreTrainedModel, TFCLIPTextModel, TFCLIPVisionModel, ) from .models.convbert import ( - TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFConvBertForMaskedLM, TFConvBertForMultipleChoice, TFConvBertForQuestionAnswering, @@ -8439,14 +7625,12 @@ TFConvNextV2PreTrainedModel, ) from .models.ctrl import ( - TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, TFCTRLForSequenceClassification, TFCTRLLMHeadModel, TFCTRLModel, TFCTRLPreTrainedModel, ) from .models.cvt import ( - TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCvtForImageClassification, TFCvtModel, TFCvtPreTrainedModel, @@ -8458,7 +7642,6 @@ TFData2VecVisionPreTrainedModel, ) from .models.deberta import ( - TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaForMaskedLM, TFDebertaForQuestionAnswering, TFDebertaForSequenceClassification, @@ -8467,7 +7650,6 @@ TFDebertaPreTrainedModel, ) from .models.deberta_v2 import ( - TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaV2ForMaskedLM, TFDebertaV2ForMultipleChoice, TFDebertaV2ForQuestionAnswering, @@ -8477,7 +7659,6 @@ TFDebertaV2PreTrainedModel, ) from .models.deit import ( - TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDeiTForImageClassification, TFDeiTForImageClassificationWithTeacher, TFDeiTForMaskedImageModeling, @@ -8485,7 +7666,6 @@ TFDeiTPreTrainedModel, ) from .models.deprecated.transfo_xl import ( - TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, TFAdaptiveEmbedding, TFTransfoXLForSequenceClassification, TFTransfoXLLMHeadModel, @@ -8494,7 +7674,6 @@ TFTransfoXLPreTrainedModel, ) from .models.distilbert import ( - TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDistilBertForMaskedLM, TFDistilBertForMultipleChoice, TFDistilBertForQuestionAnswering, @@ -8505,9 +7684,6 @@ TFDistilBertPreTrainedModel, ) from .models.dpr import ( - TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, TFDPRContextEncoder, TFDPRPretrainedContextEncoder, TFDPRPretrainedQuestionEncoder, @@ -8516,14 +7692,12 @@ TFDPRReader, ) from .models.efficientformer import ( - TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFEfficientFormerForImageClassification, TFEfficientFormerForImageClassificationWithTeacher, TFEfficientFormerModel, TFEfficientFormerPreTrainedModel, ) from .models.electra import ( - TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, TFElectraForMaskedLM, TFElectraForMultipleChoice, TFElectraForPreTraining, @@ -8535,7 +7709,6 @@ ) from .models.encoder_decoder import TFEncoderDecoderModel from .models.esm import ( - ESM_PRETRAINED_MODEL_ARCHIVE_LIST, TFEsmForMaskedLM, TFEsmForSequenceClassification, TFEsmForTokenClassification, @@ -8543,7 +7716,6 @@ TFEsmPreTrainedModel, ) from .models.flaubert import ( - TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFFlaubertForMultipleChoice, TFFlaubertForQuestionAnsweringSimple, TFFlaubertForSequenceClassification, @@ -8553,7 +7725,6 @@ TFFlaubertWithLMHeadModel, ) from .models.funnel import ( - TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, TFFunnelBaseModel, TFFunnelForMaskedLM, TFFunnelForMultipleChoice, @@ -8565,7 +7736,6 @@ TFFunnelPreTrainedModel, ) from .models.gpt2 import ( - TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, TFGPT2DoubleHeadsModel, TFGPT2ForSequenceClassification, TFGPT2LMHeadModel, @@ -8581,20 +7751,17 @@ TFGPTJPreTrainedModel, ) from .models.groupvit import ( - TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFGroupViTModel, TFGroupViTPreTrainedModel, TFGroupViTTextModel, TFGroupViTVisionModel, ) from .models.hubert import ( - TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFHubertForCTC, TFHubertModel, TFHubertPreTrainedModel, ) from .models.layoutlm import ( - TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMForMaskedLM, TFLayoutLMForQuestionAnswering, TFLayoutLMForSequenceClassification, @@ -8604,7 +7771,6 @@ TFLayoutLMPreTrainedModel, ) from .models.layoutlmv3 import ( - TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMv3ForQuestionAnswering, TFLayoutLMv3ForSequenceClassification, TFLayoutLMv3ForTokenClassification, @@ -8617,7 +7783,6 @@ TFLEDPreTrainedModel, ) from .models.longformer import ( - TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFLongformerForMaskedLM, TFLongformerForMultipleChoice, TFLongformerForQuestionAnswering, @@ -8628,7 +7793,6 @@ TFLongformerSelfAttention, ) from .models.lxmert import ( - TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFLxmertForPreTraining, TFLxmertMainLayer, TFLxmertModel, @@ -8646,7 +7810,6 @@ TFMBartPreTrainedModel, ) from .models.mobilebert import ( - TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileBertForMaskedLM, TFMobileBertForMultipleChoice, TFMobileBertForNextSentencePrediction, @@ -8659,14 +7822,12 @@ TFMobileBertPreTrainedModel, ) from .models.mobilevit import ( - TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileViTForImageClassification, TFMobileViTForSemanticSegmentation, TFMobileViTModel, TFMobileViTPreTrainedModel, ) from .models.mpnet import ( - TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFMPNetForMaskedLM, TFMPNetForMultipleChoice, TFMPNetForQuestionAnswering, @@ -8682,7 +7843,6 @@ TFMT5Model, ) from .models.openai import ( - TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, TFOpenAIGPTDoubleHeadsModel, TFOpenAIGPTForSequenceClassification, TFOpenAIGPTLMHeadModel, @@ -8703,13 +7863,11 @@ TFRagTokenForGeneration, ) from .models.regnet import ( - TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFRegNetForImageClassification, TFRegNetModel, TFRegNetPreTrainedModel, ) from .models.rembert import ( - TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFRemBertForCausalLM, TFRemBertForMaskedLM, TFRemBertForMultipleChoice, @@ -8721,13 +7879,11 @@ TFRemBertPreTrainedModel, ) from .models.resnet import ( - TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFResNetForImageClassification, TFResNetModel, TFResNetPreTrainedModel, ) from .models.roberta import ( - TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaForCausalLM, TFRobertaForMaskedLM, TFRobertaForMultipleChoice, @@ -8739,7 +7895,6 @@ TFRobertaPreTrainedModel, ) from .models.roberta_prelayernorm import ( - TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaPreLayerNormForCausalLM, TFRobertaPreLayerNormForMaskedLM, TFRobertaPreLayerNormForMultipleChoice, @@ -8751,7 +7906,6 @@ TFRobertaPreLayerNormPreTrainedModel, ) from .models.roformer import ( - TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFRoFormerForCausalLM, TFRoFormerForMaskedLM, TFRoFormerForMultipleChoice, @@ -8763,12 +7917,10 @@ TFRoFormerPreTrainedModel, ) from .models.sam import ( - TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel, ) from .models.segformer import ( - TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFSegformerDecodeHead, TFSegformerForImageClassification, TFSegformerForSemanticSegmentation, @@ -8776,27 +7928,23 @@ TFSegformerPreTrainedModel, ) from .models.speech_to_text import ( - TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, TFSpeech2TextForConditionalGeneration, TFSpeech2TextModel, TFSpeech2TextPreTrainedModel, ) from .models.swin import ( - TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, TFSwinForImageClassification, TFSwinForMaskedImageModeling, TFSwinModel, TFSwinPreTrainedModel, ) from .models.t5 import ( - TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST, TFT5EncoderModel, TFT5ForConditionalGeneration, TFT5Model, TFT5PreTrainedModel, ) from .models.tapas import ( - TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TFTapasForMaskedLM, TFTapasForQuestionAnswering, TFTapasForSequenceClassification, @@ -8816,26 +7964,22 @@ TFViTMAEPreTrainedModel, ) from .models.wav2vec2 import ( - TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, TFWav2Vec2ForCTC, TFWav2Vec2ForSequenceClassification, TFWav2Vec2Model, TFWav2Vec2PreTrainedModel, ) from .models.whisper import ( - TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, TFWhisperForConditionalGeneration, TFWhisperModel, TFWhisperPreTrainedModel, ) from .models.xglm import ( - TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXGLMForCausalLM, TFXGLMModel, TFXGLMPreTrainedModel, ) from .models.xlm import ( - TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMForMultipleChoice, TFXLMForQuestionAnsweringSimple, TFXLMForSequenceClassification, @@ -8846,7 +7990,6 @@ TFXLMWithLMHeadModel, ) from .models.xlm_roberta import ( - TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMRobertaForCausalLM, TFXLMRobertaForMaskedLM, TFXLMRobertaForMultipleChoice, @@ -8857,7 +8000,6 @@ TFXLMRobertaPreTrainedModel, ) from .models.xlnet import ( - TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLNetForMultipleChoice, TFXLNetForQuestionAnsweringSimple, TFXLNetForSequenceClassification, @@ -9179,7 +8321,6 @@ FlaxXGLMPreTrainedModel, ) from .models.xlm_roberta import ( - FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, FlaxXLMRobertaForCausalLM, FlaxXLMRobertaForMaskedLM, FlaxXLMRobertaForMultipleChoice, diff --git a/src/transformers/commands/add_new_model_like.py b/src/transformers/commands/add_new_model_like.py index 3b7fcdf19f869f..626e8373192a6c 100644 --- a/src/transformers/commands/add_new_model_like.py +++ b/src/transformers/commands/add_new_model_like.py @@ -527,35 +527,6 @@ def duplicate_module( # Loop and treat all objects new_objects = [] for obj in objects: - # Special cases - if "PRETRAINED_CONFIG_ARCHIVE_MAP = {" in obj: - # docstyle-ignore - obj = ( - f"{new_model_patterns.model_upper_cased}_PRETRAINED_CONFIG_ARCHIVE_MAP = " - + "{" - + f""" - "{new_model_patterns.checkpoint}": "https://huggingface.co/{new_model_patterns.checkpoint}/resolve/main/config.json", -""" - + "}\n" - ) - new_objects.append(obj) - continue - elif "PRETRAINED_MODEL_ARCHIVE_LIST = [" in obj: - if obj.startswith("TF_"): - prefix = "TF_" - elif obj.startswith("FLAX_"): - prefix = "FLAX_" - else: - prefix = "" - # docstyle-ignore - obj = f"""{prefix}{new_model_patterns.model_upper_cased}_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "{new_model_patterns.checkpoint}", - # See all {new_model_patterns.model_name} models at https://huggingface.co/models?filter={new_model_patterns.model_type} -] -""" - new_objects.append(obj) - continue - special_pattern = False for pattern, attr in SPECIAL_PATTERNS.items(): if pattern in obj: @@ -785,7 +756,6 @@ def retrieve_info_for_model(model_type, frameworks: Optional[List[str]] = None): model_name = auto_module.MODEL_NAMES_MAPPING[model_type] config_class = auto_module.configuration_auto.CONFIG_MAPPING_NAMES[model_type] - archive_map = auto_module.configuration_auto.CONFIG_ARCHIVE_MAP_MAPPING_NAMES.get(model_type, None) if model_type in auto_module.tokenization_auto.TOKENIZER_MAPPING_NAMES: tokenizer_classes = auto_module.tokenization_auto.TOKENIZER_MAPPING_NAMES[model_type] tokenizer_class = tokenizer_classes[0] if tokenizer_classes[0] is not None else tokenizer_classes[1] @@ -814,19 +784,7 @@ def retrieve_info_for_model(model_type, frameworks: Optional[List[str]] = None): model_classes = retrieve_model_classes(model_type, frameworks=frameworks) - # Retrieve model upper-cased name from the constant name of the pretrained archive map. - if archive_map is None: - model_upper_cased = model_camel_cased.upper() - else: - parts = archive_map.split("_") - idx = 0 - while idx < len(parts) and parts[idx] != "PRETRAINED": - idx += 1 - if idx < len(parts): - model_upper_cased = "_".join(parts[:idx]) - else: - model_upper_cased = model_camel_cased.upper() - + model_upper_cased = model_camel_cased.upper() model_patterns = ModelPatterns( model_name, checkpoint=find_base_model_checkpoint(model_type, model_files=model_files), @@ -1135,14 +1093,6 @@ def add_model_to_auto_classes( for attr in ["model_type", "model_name"]: old_model_line = old_model_line.replace("{" + attr + "}", getattr(old_model_patterns, attr)) new_model_line = new_model_line.replace("{" + attr + "}", getattr(new_model_patterns, attr)) - if "pretrained_archive_map" in pattern: - old_model_line = old_model_line.replace( - "{pretrained_archive_map}", f"{old_model_patterns.model_upper_cased}_PRETRAINED_CONFIG_ARCHIVE_MAP" - ) - new_model_line = new_model_line.replace( - "{pretrained_archive_map}", f"{new_model_patterns.model_upper_cased}_PRETRAINED_CONFIG_ARCHIVE_MAP" - ) - new_model_line = new_model_line.replace( old_model_patterns.model_camel_cased, new_model_patterns.model_camel_cased ) diff --git a/src/transformers/convert_pytorch_checkpoint_to_tf2.py b/src/transformers/convert_pytorch_checkpoint_to_tf2.py index 12f89ff2e57f23..c544c8c9e10ca9 100755 --- a/src/transformers/convert_pytorch_checkpoint_to_tf2.py +++ b/src/transformers/convert_pytorch_checkpoint_to_tf2.py @@ -19,28 +19,6 @@ import os from . import ( - ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, - BART_PRETRAINED_MODEL_ARCHIVE_LIST, - BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, - CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, - CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, - DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, - DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, - ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, - FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, - GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, - LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, - LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, - OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, - ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, - T5_PRETRAINED_CONFIG_ARCHIVE_MAP, - TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, - WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP, - XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, - XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, - XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig, BartConfig, BertConfig, @@ -140,31 +118,26 @@ TFBartForConditionalGeneration, TFBartForSequenceClassification, BartForConditionalGeneration, - BART_PRETRAINED_MODEL_ARCHIVE_LIST, ), "bert": ( BertConfig, TFBertForPreTraining, BertForPreTraining, - BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": ( BertConfig, TFBertForQuestionAnswering, BertForQuestionAnswering, - BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": ( BertConfig, TFBertForQuestionAnswering, BertForQuestionAnswering, - BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "google-bert/bert-base-cased-finetuned-mrpc": ( BertConfig, TFBertForSequenceClassification, BertForSequenceClassification, - BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "dpr": ( DPRConfig, @@ -174,130 +147,107 @@ DPRQuestionEncoder, DPRContextEncoder, DPRReader, - DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, ), "openai-community/gpt2": ( GPT2Config, TFGPT2LMHeadModel, GPT2LMHeadModel, - GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "xlnet": ( XLNetConfig, TFXLNetLMHeadModel, XLNetLMHeadModel, - XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "xlm": ( XLMConfig, TFXLMWithLMHeadModel, XLMWithLMHeadModel, - XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "xlm-roberta": ( XLMRobertaConfig, TFXLMRobertaForMaskedLM, XLMRobertaForMaskedLM, - XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "transfo-xl": ( TransfoXLConfig, TFTransfoXLLMHeadModel, TransfoXLLMHeadModel, - TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "openai-community/openai-gpt": ( OpenAIGPTConfig, TFOpenAIGPTLMHeadModel, OpenAIGPTLMHeadModel, - OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "roberta": ( RobertaConfig, TFRobertaForCausalLM, TFRobertaForMaskedLM, RobertaForMaskedLM, - ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "layoutlm": ( LayoutLMConfig, TFLayoutLMForMaskedLM, LayoutLMForMaskedLM, - LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, ), "FacebookAI/roberta-large-mnli": ( RobertaConfig, TFRobertaForSequenceClassification, RobertaForSequenceClassification, - ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "camembert": ( CamembertConfig, TFCamembertForMaskedLM, CamembertForMaskedLM, - CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "flaubert": ( FlaubertConfig, TFFlaubertWithLMHeadModel, FlaubertWithLMHeadModel, - FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "distilbert": ( DistilBertConfig, TFDistilBertForMaskedLM, DistilBertForMaskedLM, - DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "distilbert-base-distilled-squad": ( DistilBertConfig, TFDistilBertForQuestionAnswering, DistilBertForQuestionAnswering, - DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "lxmert": ( LxmertConfig, TFLxmertForPreTraining, LxmertForPreTraining, - LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "lxmert-visual-feature-encoder": ( LxmertConfig, TFLxmertVisualFeatureEncoder, LxmertVisualFeatureEncoder, - LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "Salesforce/ctrl": ( CTRLConfig, TFCTRLLMHeadModel, CTRLLMHeadModel, - CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "albert": ( AlbertConfig, TFAlbertForPreTraining, AlbertForPreTraining, - ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "t5": ( T5Config, TFT5ForConditionalGeneration, T5ForConditionalGeneration, - T5_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "electra": ( ElectraConfig, TFElectraForPreTraining, ElectraForPreTraining, - ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ), "wav2vec2": ( Wav2Vec2Config, TFWav2Vec2Model, Wav2Vec2Model, - WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP, ), } diff --git a/src/transformers/models/albert/__init__.py b/src/transformers/models/albert/__init__.py index 168c68db837d08..1d0a4a4d02845c 100644 --- a/src/transformers/models/albert/__init__.py +++ b/src/transformers/models/albert/__init__.py @@ -26,7 +26,7 @@ _import_structure = { - "configuration_albert": ["ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlbertConfig", "AlbertOnnxConfig"], + "configuration_albert": ["AlbertConfig", "AlbertOnnxConfig"], } try: @@ -52,7 +52,6 @@ pass else: _import_structure["modeling_albert"] = [ - "ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "AlbertForMaskedLM", "AlbertForMultipleChoice", "AlbertForPreTraining", @@ -71,7 +70,6 @@ pass else: _import_structure["modeling_tf_albert"] = [ - "TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAlbertForMaskedLM", "TFAlbertForMultipleChoice", "TFAlbertForPreTraining", @@ -101,7 +99,7 @@ ] if TYPE_CHECKING: - from .configuration_albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig, AlbertOnnxConfig + from .configuration_albert import AlbertConfig, AlbertOnnxConfig try: if not is_sentencepiece_available(): @@ -126,7 +124,6 @@ pass else: from .modeling_albert import ( - ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, AlbertForMaskedLM, AlbertForMultipleChoice, AlbertForPreTraining, @@ -145,7 +142,6 @@ pass else: from .modeling_tf_albert import ( - TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFAlbertForMaskedLM, TFAlbertForMultipleChoice, TFAlbertForPreTraining, diff --git a/src/transformers/models/albert/configuration_albert.py b/src/transformers/models/albert/configuration_albert.py index 690be7fbbf2c0c..492ca2f65b33ee 100644 --- a/src/transformers/models/albert/configuration_albert.py +++ b/src/transformers/models/albert/configuration_albert.py @@ -21,18 +21,6 @@ from ...onnx import OnnxConfig -ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "albert/albert-base-v1": "https://huggingface.co/albert/albert-base-v1/resolve/main/config.json", - "albert/albert-large-v1": "https://huggingface.co/albert/albert-large-v1/resolve/main/config.json", - "albert/albert-xlarge-v1": "https://huggingface.co/albert/albert-xlarge-v1/resolve/main/config.json", - "albert/albert-xxlarge-v1": "https://huggingface.co/albert/albert-xxlarge-v1/resolve/main/config.json", - "albert/albert-base-v2": "https://huggingface.co/albert/albert-base-v2/resolve/main/config.json", - "albert/albert-large-v2": "https://huggingface.co/albert/albert-large-v2/resolve/main/config.json", - "albert/albert-xlarge-v2": "https://huggingface.co/albert/albert-xlarge-v2/resolve/main/config.json", - "albert/albert-xxlarge-v2": "https://huggingface.co/albert/albert-xxlarge-v2/resolve/main/config.json", -} - - class AlbertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`AlbertModel`] or a [`TFAlbertModel`]. It is used diff --git a/src/transformers/models/albert/modeling_albert.py b/src/transformers/models/albert/modeling_albert.py index 25ae832b03a00a..49324d58e12872 100755 --- a/src/transformers/models/albert/modeling_albert.py +++ b/src/transformers/models/albert/modeling_albert.py @@ -52,19 +52,6 @@ _CONFIG_FOR_DOC = "AlbertConfig" -ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "albert/albert-base-v1", - "albert/albert-large-v1", - "albert/albert-xlarge-v1", - "albert/albert-xxlarge-v1", - "albert/albert-base-v2", - "albert/albert-large-v2", - "albert/albert-xlarge-v2", - "albert/albert-xxlarge-v2", - # See all ALBERT models at https://huggingface.co/models?filter=albert -] - - def load_tf_weights_in_albert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/albert/modeling_tf_albert.py b/src/transformers/models/albert/modeling_tf_albert.py index 1225465c5260a8..ad2c2d637a0143 100644 --- a/src/transformers/models/albert/modeling_tf_albert.py +++ b/src/transformers/models/albert/modeling_tf_albert.py @@ -65,18 +65,6 @@ _CHECKPOINT_FOR_DOC = "albert/albert-base-v2" _CONFIG_FOR_DOC = "AlbertConfig" -TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "albert/albert-base-v1", - "albert/albert-large-v1", - "albert/albert-xlarge-v1", - "albert/albert-xxlarge-v1", - "albert/albert-base-v2", - "albert/albert-large-v2", - "albert/albert-xlarge-v2", - "albert/albert-xxlarge-v2", - # See all ALBERT models at https://huggingface.co/models?filter=albert -] - class TFAlbertPreTrainingLoss: """ diff --git a/src/transformers/models/albert/tokenization_albert.py b/src/transformers/models/albert/tokenization_albert.py index 7baaa0a6000e6f..786f9eeafc513c 100644 --- a/src/transformers/models/albert/tokenization_albert.py +++ b/src/transformers/models/albert/tokenization_albert.py @@ -29,29 +29,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "albert/albert-base-v1": "https://huggingface.co/albert/albert-base-v1/resolve/main/spiece.model", - "albert/albert-large-v1": "https://huggingface.co/albert/albert-large-v1/resolve/main/spiece.model", - "albert/albert-xlarge-v1": "https://huggingface.co/albert/albert-xlarge-v1/resolve/main/spiece.model", - "albert/albert-xxlarge-v1": "https://huggingface.co/albert/albert-xxlarge-v1/resolve/main/spiece.model", - "albert/albert-base-v2": "https://huggingface.co/albert/albert-base-v2/resolve/main/spiece.model", - "albert/albert-large-v2": "https://huggingface.co/albert/albert-large-v2/resolve/main/spiece.model", - "albert/albert-xlarge-v2": "https://huggingface.co/albert/albert-xlarge-v2/resolve/main/spiece.model", - "albert/albert-xxlarge-v2": "https://huggingface.co/albert/albert-xxlarge-v2/resolve/main/spiece.model", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "albert/albert-base-v1": 512, - "albert/albert-large-v1": 512, - "albert/albert-xlarge-v1": 512, - "albert/albert-xxlarge-v1": 512, - "albert/albert-base-v2": 512, - "albert/albert-large-v2": 512, - "albert/albert-xlarge-v2": 512, - "albert/albert-xxlarge-v2": 512, -} SPIECE_UNDERLINE = "▁" @@ -130,8 +107,6 @@ class AlbertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/albert/tokenization_albert_fast.py b/src/transformers/models/albert/tokenization_albert_fast.py index 91cf403d07eefd..e0b09a73560ac1 100644 --- a/src/transformers/models/albert/tokenization_albert_fast.py +++ b/src/transformers/models/albert/tokenization_albert_fast.py @@ -32,39 +32,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "albert/albert-base-v1": "https://huggingface.co/albert/albert-base-v1/resolve/main/spiece.model", - "albert/albert-large-v1": "https://huggingface.co/albert/albert-large-v1/resolve/main/spiece.model", - "albert/albert-xlarge-v1": "https://huggingface.co/albert/albert-xlarge-v1/resolve/main/spiece.model", - "albert/albert-xxlarge-v1": "https://huggingface.co/albert/albert-xxlarge-v1/resolve/main/spiece.model", - "albert/albert-base-v2": "https://huggingface.co/albert/albert-base-v2/resolve/main/spiece.model", - "albert/albert-large-v2": "https://huggingface.co/albert/albert-large-v2/resolve/main/spiece.model", - "albert/albert-xlarge-v2": "https://huggingface.co/albert/albert-xlarge-v2/resolve/main/spiece.model", - "albert/albert-xxlarge-v2": "https://huggingface.co/albert/albert-xxlarge-v2/resolve/main/spiece.model", - }, - "tokenizer_file": { - "albert/albert-base-v1": "https://huggingface.co/albert/albert-base-v1/resolve/main/tokenizer.json", - "albert/albert-large-v1": "https://huggingface.co/albert/albert-large-v1/resolve/main/tokenizer.json", - "albert/albert-xlarge-v1": "https://huggingface.co/albert/albert-xlarge-v1/resolve/main/tokenizer.json", - "albert/albert-xxlarge-v1": "https://huggingface.co/albert/albert-xxlarge-v1/resolve/main/tokenizer.json", - "albert/albert-base-v2": "https://huggingface.co/albert/albert-base-v2/resolve/main/tokenizer.json", - "albert/albert-large-v2": "https://huggingface.co/albert/albert-large-v2/resolve/main/tokenizer.json", - "albert/albert-xlarge-v2": "https://huggingface.co/albert/albert-xlarge-v2/resolve/main/tokenizer.json", - "albert/albert-xxlarge-v2": "https://huggingface.co/albert/albert-xxlarge-v2/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "albert/albert-base-v1": 512, - "albert/albert-large-v1": 512, - "albert/albert-xlarge-v1": 512, - "albert/albert-xxlarge-v1": 512, - "albert/albert-base-v2": 512, - "albert/albert-large-v2": 512, - "albert/albert-xlarge-v2": 512, - "albert/albert-xxlarge-v2": 512, -} SPIECE_UNDERLINE = "▁" @@ -117,8 +84,6 @@ class AlbertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = AlbertTokenizer def __init__( diff --git a/src/transformers/models/align/__init__.py b/src/transformers/models/align/__init__.py index 8f9a6c40a7169f..650b25c3e5d1ee 100644 --- a/src/transformers/models/align/__init__.py +++ b/src/transformers/models/align/__init__.py @@ -22,7 +22,6 @@ _import_structure = { "configuration_align": [ - "ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlignConfig", "AlignTextConfig", "AlignVisionConfig", @@ -37,7 +36,6 @@ pass else: _import_structure["modeling_align"] = [ - "ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST", "AlignModel", "AlignPreTrainedModel", "AlignTextModel", @@ -46,7 +44,6 @@ if TYPE_CHECKING: from .configuration_align import ( - ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP, AlignConfig, AlignTextConfig, AlignVisionConfig, @@ -60,7 +57,6 @@ pass else: from .modeling_align import ( - ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST, AlignModel, AlignPreTrainedModel, AlignTextModel, diff --git a/src/transformers/models/align/configuration_align.py b/src/transformers/models/align/configuration_align.py index b7f377d4813679..9e96f5d15a1d35 100644 --- a/src/transformers/models/align/configuration_align.py +++ b/src/transformers/models/align/configuration_align.py @@ -27,10 +27,6 @@ logger = logging.get_logger(__name__) -ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "kakaobrain/align-base": "https://huggingface.co/kakaobrain/align-base/resolve/main/config.json", -} - class AlignTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/align/modeling_align.py b/src/transformers/models/align/modeling_align.py index f48fcbace12f4f..137b505d03cb1e 100644 --- a/src/transformers/models/align/modeling_align.py +++ b/src/transformers/models/align/modeling_align.py @@ -47,12 +47,6 @@ _CONFIG_FOR_DOC = "AlignConfig" -ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "kakaobrain/align-base", - # See all ALIGN models at https://huggingface.co/models?filter=align -] - - ALIGN_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads diff --git a/src/transformers/models/altclip/__init__.py b/src/transformers/models/altclip/__init__.py index 5fc02b192b256b..4e3cb99bbb16c9 100755 --- a/src/transformers/models/altclip/__init__.py +++ b/src/transformers/models/altclip/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_altclip": [ - "ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "AltCLIPConfig", "AltCLIPTextConfig", "AltCLIPVisionConfig", @@ -33,7 +32,6 @@ pass else: _import_structure["modeling_altclip"] = [ - "ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "AltCLIPPreTrainedModel", "AltCLIPModel", "AltCLIPTextModel", @@ -43,7 +41,6 @@ if TYPE_CHECKING: from .configuration_altclip import ( - ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig, @@ -57,7 +54,6 @@ pass else: from .modeling_altclip import ( - ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, AltCLIPModel, AltCLIPPreTrainedModel, AltCLIPTextModel, diff --git a/src/transformers/models/altclip/configuration_altclip.py b/src/transformers/models/altclip/configuration_altclip.py index b9d451d2c05050..d6e533e1f8101d 100755 --- a/src/transformers/models/altclip/configuration_altclip.py +++ b/src/transformers/models/altclip/configuration_altclip.py @@ -22,11 +22,6 @@ logger = logging.get_logger(__name__) -ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "BAAI/AltCLIP": "https://huggingface.co/BAAI/AltCLIP/resolve/main/config.json", - # See all AltCLIP models at https://huggingface.co/models?filter=altclip -} - class AltCLIPTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/altclip/modeling_altclip.py b/src/transformers/models/altclip/modeling_altclip.py index 2f511bace5fa25..fbd208a99e3892 100755 --- a/src/transformers/models/altclip/modeling_altclip.py +++ b/src/transformers/models/altclip/modeling_altclip.py @@ -40,11 +40,6 @@ _CHECKPOINT_FOR_DOC = "BAAI/AltCLIP" _CONFIG_FOR_DOC = "AltCLIPConfig" -ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "BAAI/AltCLIP", - # See all AltCLIP models at https://huggingface.co/models?filter=altclip -] - ALTCLIP_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/audio_spectrogram_transformer/__init__.py b/src/transformers/models/audio_spectrogram_transformer/__init__.py index 2b48fe07311c1e..9f1d65e1aac839 100644 --- a/src/transformers/models/audio_spectrogram_transformer/__init__.py +++ b/src/transformers/models/audio_spectrogram_transformer/__init__.py @@ -17,10 +17,7 @@ _import_structure = { - "configuration_audio_spectrogram_transformer": [ - "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "ASTConfig", - ], + "configuration_audio_spectrogram_transformer": ["ASTConfig"], "feature_extraction_audio_spectrogram_transformer": ["ASTFeatureExtractor"], } @@ -31,7 +28,6 @@ pass else: _import_structure["modeling_audio_spectrogram_transformer"] = [ - "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ASTForAudioClassification", "ASTModel", "ASTPreTrainedModel", @@ -40,7 +36,6 @@ if TYPE_CHECKING: from .configuration_audio_spectrogram_transformer import ( - AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ASTConfig, ) from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor @@ -52,7 +47,6 @@ pass else: from .modeling_audio_spectrogram_transformer import ( - AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ASTForAudioClassification, ASTModel, ASTPreTrainedModel, diff --git a/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py b/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py index 81a087f07f69f1..158f1ee5d97034 100644 --- a/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py +++ b/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py @@ -21,12 +21,6 @@ logger = logging.get_logger(__name__) -AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "MIT/ast-finetuned-audioset-10-10-0.4593": ( - "https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json" - ), -} - class ASTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py b/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py index 3fddccdea75273..1d70e57c2fd128 100644 --- a/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py +++ b/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py @@ -45,12 +45,6 @@ _SEQ_CLASS_EXPECTED_LOSS = 0.17 -AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "MIT/ast-finetuned-audioset-10-10-0.4593", - # See all Audio Spectrogram Transformer models at https://huggingface.co/models?filter=ast -] - - class ASTEmbeddings(nn.Module): """ Construct the CLS token, position and patch embeddings. diff --git a/src/transformers/models/auto/__init__.py b/src/transformers/models/auto/__init__.py index 96a159133cc005..3bb2b8e9d4c199 100644 --- a/src/transformers/models/auto/__init__.py +++ b/src/transformers/models/auto/__init__.py @@ -25,7 +25,7 @@ _import_structure = { "auto_factory": ["get_values"], - "configuration_auto": ["ALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CONFIG_MAPPING", "MODEL_NAMES_MAPPING", "AutoConfig"], + "configuration_auto": ["CONFIG_MAPPING", "MODEL_NAMES_MAPPING", "AutoConfig"], "feature_extraction_auto": ["FEATURE_EXTRACTOR_MAPPING", "AutoFeatureExtractor"], "image_processing_auto": ["IMAGE_PROCESSOR_MAPPING", "AutoImageProcessor"], "processing_auto": ["PROCESSOR_MAPPING", "AutoProcessor"], @@ -213,7 +213,7 @@ if TYPE_CHECKING: from .auto_factory import get_values - from .configuration_auto import ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, CONFIG_MAPPING, MODEL_NAMES_MAPPING, AutoConfig + from .configuration_auto import CONFIG_MAPPING, MODEL_NAMES_MAPPING, AutoConfig from .feature_extraction_auto import FEATURE_EXTRACTOR_MAPPING, AutoFeatureExtractor from .image_processing_auto import IMAGE_PROCESSOR_MAPPING, AutoImageProcessor from .processing_auto import PROCESSOR_MAPPING, AutoProcessor diff --git a/src/transformers/models/auto/configuration_auto.py b/src/transformers/models/auto/configuration_auto.py index 80551b84522350..86101639ea3e88 100755 --- a/src/transformers/models/auto/configuration_auto.py +++ b/src/transformers/models/auto/configuration_auto.py @@ -276,230 +276,6 @@ ] ) -CONFIG_ARCHIVE_MAP_MAPPING_NAMES = OrderedDict( - [ - # Add archive maps here) - ("albert", "ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("align", "ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("altclip", "ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("audio-spectrogram-transformer", "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("autoformer", "AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bark", "BARK_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bart", "BART_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("beit", "BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bert", "BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("big_bird", "BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bigbird_pegasus", "BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("biogpt", "BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bit", "BIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("blenderbot", "BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("blenderbot-small", "BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("blip", "BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("blip-2", "BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bloom", "BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bridgetower", "BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("bros", "BROS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("camembert", "CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("canine", "CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("chinese_clip", "CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("clap", "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST"), - ("clip", "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("clipseg", "CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("clvp", "CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("codegen", "CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("cohere", "COHERE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("conditional_detr", "CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("convbert", "CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("convnext", "CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("convnextv2", "CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("cpmant", "CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("ctrl", "CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("cvt", "CVT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("data2vec-audio", "DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("data2vec-text", "DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("data2vec-vision", "DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("deberta", "DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("deberta-v2", "DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("deformable_detr", "DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("deit", "DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("depth_anything", "DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("deta", "DETA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("detr", "DETR_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("dinat", "DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("dinov2", "DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("distilbert", "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("donut-swin", "DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("dpr", "DPR_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("dpt", "DPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("efficientformer", "EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("efficientnet", "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("electra", "ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("encodec", "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("ernie", "ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("ernie_m", "ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("esm", "ESM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("falcon", "FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("fastspeech2_conformer", "FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("flaubert", "FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("flava", "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("fnet", "FNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("focalnet", "FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("fsmt", "FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("funnel", "FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("fuyu", "FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gemma", "GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("git", "GIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("glpn", "GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gpt2", "GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gpt_bigcode", "GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gpt_neo", "GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gpt_neox", "GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gpt_neox_japanese", "GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gptj", "GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("gptsan-japanese", "GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("graphormer", "GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("groupvit", "GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("hubert", "HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("ibert", "IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("idefics", "IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("imagegpt", "IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("informer", "INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("instructblip", "INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("jukebox", "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("kosmos-2", "KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("layoutlm", "LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("layoutlmv2", "LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("layoutlmv3", "LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("led", "LED_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("levit", "LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("lilt", "LILT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("llama", "LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("llava", "LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("llava_next", "LLAVA_NEXT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("longformer", "LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("longt5", "LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("luke", "LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("lxmert", "LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("m2m_100", "M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mamba", "MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("markuplm", "MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mask2former", "MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("maskformer", "MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mbart", "MBART_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mctct", "MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mega", "MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("megatron-bert", "MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mgp-str", "MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mistral", "MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mixtral", "MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mobilenet_v1", "MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mobilenet_v2", "MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mobilevit", "MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mobilevitv2", "MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mpnet", "MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mpt", "MPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mra", "MRA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("musicgen", "MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("musicgen_melody", "MUSICGEN_MELODY_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("mvp", "MVP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("nat", "NAT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("nezha", "NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("nllb-moe", "NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("nystromformer", "NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("oneformer", "ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("open-llama", "OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("openai-gpt", "OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("opt", "OPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("owlv2", "OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("owlvit", "OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("patchtsmixer", "PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("patchtst", "PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("pegasus", "PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("pegasus_x", "PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("perceiver", "PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("persimmon", "PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("phi", "PHI_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("pix2struct", "PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("plbart", "PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("poolformer", "POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("pop2piano", "POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("prophetnet", "PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("pvt", "PVT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("pvt_v2", "PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("qdqbert", "QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("qwen2", "QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("realm", "REALM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("regnet", "REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("rembert", "REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("resnet", "RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("retribert", "RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("roberta", "ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("roberta-prelayernorm", "ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("roc_bert", "ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("roformer", "ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("rwkv", "RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("sam", "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("seamless_m4t", "SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("seamless_m4t_v2", "SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("segformer", "SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("seggpt", "SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("sew", "SEW_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("sew-d", "SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("siglip", "SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("speech_to_text", "SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("speech_to_text_2", "SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("speecht5", "SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("splinter", "SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("squeezebert", "SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("stablelm", "STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("starcoder2", "STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("superpoint", "SUPERPOINT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("swiftformer", "SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("swin", "SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("swin2sr", "SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("swinv2", "SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("switch_transformers", "SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("t5", "T5_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("table-transformer", "TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("tapas", "TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("time_series_transformer", "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("timesformer", "TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("transfo-xl", "TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("tvlt", "TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("tvp", "TVP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("udop", "UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("unispeech", "UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("unispeech-sat", "UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("univnet", "UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("van", "VAN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("videomae", "VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vilt", "VILT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vipllava", "VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("visual_bert", "VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vit", "VIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vit_hybrid", "VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vit_mae", "VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vit_msn", "VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vitdet", "VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vitmatte", "VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vits", "VITS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("vivit", "VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("wav2vec2", "WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("wav2vec2-bert", "WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("wav2vec2-conformer", "WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("whisper", "WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("xclip", "XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("xglm", "XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("xlm", "XLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("xlm-prophetnet", "XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("xlm-roberta", "XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("xlnet", "XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("xmod", "XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("yolos", "YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ("yoso", "YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP"), - ] -) - MODEL_NAMES_MAPPING = OrderedDict( [ # Add full (and cased) model names here @@ -906,11 +682,6 @@ def __init__(self, mapping): def _initialize(self): if self._initialized: return - warnings.warn( - "ALL_PRETRAINED_CONFIG_ARCHIVE_MAP is deprecated and will be removed in v5 of Transformers. " - "It does not contain all available model checkpoints, far from it. Checkout hf.co/models for that.", - FutureWarning, - ) for model_type, map_name in self._mapping.items(): module_name = model_type_to_module_name(model_type) @@ -945,9 +716,6 @@ def __contains__(self, item): return item in self._data -ALL_PRETRAINED_CONFIG_ARCHIVE_MAP = _LazyLoadAllMappings(CONFIG_ARCHIVE_MAP_MAPPING_NAMES) - - def _get_class_name(model_class: Union[str, List[str]]): if isinstance(model_class, (list, tuple)): return " or ".join([f"[`{c}`]" for c in model_class if c is not None]) diff --git a/src/transformers/models/autoformer/__init__.py b/src/transformers/models/autoformer/__init__.py index f87bfdea532d61..1ef70173e30a43 100644 --- a/src/transformers/models/autoformer/__init__.py +++ b/src/transformers/models/autoformer/__init__.py @@ -18,10 +18,7 @@ _import_structure = { - "configuration_autoformer": [ - "AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "AutoformerConfig", - ], + "configuration_autoformer": ["AutoformerConfig"], } try: @@ -31,7 +28,6 @@ pass else: _import_structure["modeling_autoformer"] = [ - "AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "AutoformerForPrediction", "AutoformerModel", "AutoformerPreTrainedModel", @@ -40,7 +36,6 @@ if TYPE_CHECKING: from .configuration_autoformer import ( - AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, AutoformerConfig, ) @@ -51,7 +46,6 @@ pass else: from .modeling_autoformer import ( - AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, AutoformerForPrediction, AutoformerModel, AutoformerPreTrainedModel, diff --git a/src/transformers/models/autoformer/configuration_autoformer.py b/src/transformers/models/autoformer/configuration_autoformer.py index 7604233e327369..4f499fd1cb6340 100644 --- a/src/transformers/models/autoformer/configuration_autoformer.py +++ b/src/transformers/models/autoformer/configuration_autoformer.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "huggingface/autoformer-tourism-monthly": "https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json", -} - class AutoformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/autoformer/modeling_autoformer.py b/src/transformers/models/autoformer/modeling_autoformer.py index 78dbb8a5de5f41..d7e1d7a4a33a70 100644 --- a/src/transformers/models/autoformer/modeling_autoformer.py +++ b/src/transformers/models/autoformer/modeling_autoformer.py @@ -167,12 +167,6 @@ class AutoformerModelOutput(ModelOutput): static_features: Optional[torch.FloatTensor] = None -AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "huggingface/autoformer-tourism-monthly", - # See all Autoformer models at https://huggingface.co/models?filter=autoformer -] - - # Copied from transformers.models.time_series_transformer.modeling_time_series_transformer.TimeSeriesFeatureEmbedder with TimeSeries->Autoformer class AutoformerFeatureEmbedder(nn.Module): """ diff --git a/src/transformers/models/bark/__init__.py b/src/transformers/models/bark/__init__.py index 03e5865ca4a483..4cb1a606cf6567 100644 --- a/src/transformers/models/bark/__init__.py +++ b/src/transformers/models/bark/__init__.py @@ -22,7 +22,6 @@ _import_structure = { "configuration_bark": [ - "BARK_PRETRAINED_CONFIG_ARCHIVE_MAP", "BarkCoarseConfig", "BarkConfig", "BarkFineConfig", @@ -38,7 +37,6 @@ pass else: _import_structure["modeling_bark"] = [ - "BARK_PRETRAINED_MODEL_ARCHIVE_LIST", "BarkFineModel", "BarkSemanticModel", "BarkCoarseModel", @@ -49,7 +47,6 @@ if TYPE_CHECKING: from .configuration_bark import ( - BARK_PRETRAINED_CONFIG_ARCHIVE_MAP, BarkCoarseConfig, BarkConfig, BarkFineConfig, @@ -64,7 +61,6 @@ pass else: from .modeling_bark import ( - BARK_PRETRAINED_MODEL_ARCHIVE_LIST, BarkCausalModel, BarkCoarseModel, BarkFineModel, diff --git a/src/transformers/models/bark/configuration_bark.py b/src/transformers/models/bark/configuration_bark.py index 15efb11dc7d4a5..a6bf2b546af1fd 100644 --- a/src/transformers/models/bark/configuration_bark.py +++ b/src/transformers/models/bark/configuration_bark.py @@ -25,11 +25,6 @@ logger = logging.get_logger(__name__) -BARK_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "suno/bark-small": "https://huggingface.co/suno/bark-small/resolve/main/config.json", - "suno/bark": "https://huggingface.co/suno/bark/resolve/main/config.json", -} - BARK_SUBMODELCONFIG_START_DOCSTRING = """ This is the configuration class to store the configuration of a [`{model}`]. It is used to instantiate the model according to the specified arguments, defining the model architecture. Instantiating a configuration with the diff --git a/src/transformers/models/bark/modeling_bark.py b/src/transformers/models/bark/modeling_bark.py index f26b723a49d237..bce2bdc794de7c 100644 --- a/src/transformers/models/bark/modeling_bark.py +++ b/src/transformers/models/bark/modeling_bark.py @@ -63,12 +63,6 @@ _CHECKPOINT_FOR_DOC = "suno/bark-small" _CONFIG_FOR_DOC = "BarkConfig" -BARK_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "suno/bark-small", - "suno/bark", - # See all Bark models at https://huggingface.co/models?filter=bark -] - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): diff --git a/src/transformers/models/bart/__init__.py b/src/transformers/models/bart/__init__.py index 4f104efce1a4d2..d538fbb7d34304 100644 --- a/src/transformers/models/bart/__init__.py +++ b/src/transformers/models/bart/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_bart": ["BART_PRETRAINED_CONFIG_ARCHIVE_MAP", "BartConfig", "BartOnnxConfig"], + "configuration_bart": ["BartConfig", "BartOnnxConfig"], "tokenization_bart": ["BartTokenizer"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_bart"] = [ - "BART_PRETRAINED_MODEL_ARCHIVE_LIST", "BartForCausalLM", "BartForConditionalGeneration", "BartForQuestionAnswering", @@ -84,7 +83,7 @@ ] if TYPE_CHECKING: - from .configuration_bart import BART_PRETRAINED_CONFIG_ARCHIVE_MAP, BartConfig, BartOnnxConfig + from .configuration_bart import BartConfig, BartOnnxConfig from .tokenization_bart import BartTokenizer try: @@ -102,7 +101,6 @@ pass else: from .modeling_bart import ( - BART_PRETRAINED_MODEL_ARCHIVE_LIST, BartForCausalLM, BartForConditionalGeneration, BartForQuestionAnswering, diff --git a/src/transformers/models/bart/configuration_bart.py b/src/transformers/models/bart/configuration_bart.py index 8c03be9a6202a8..1a6214c2eecfc5 100644 --- a/src/transformers/models/bart/configuration_bart.py +++ b/src/transformers/models/bart/configuration_bart.py @@ -26,11 +26,6 @@ logger = logging.get_logger(__name__) -BART_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/config.json", - # See all BART models at https://huggingface.co/models?filter=bart -} - class BartConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/bart/modeling_bart.py b/src/transformers/models/bart/modeling_bart.py index 1f90b82a104d42..c333d6e67615c1 100755 --- a/src/transformers/models/bart/modeling_bart.py +++ b/src/transformers/models/bart/modeling_bart.py @@ -78,12 +78,6 @@ _QA_EXPECTED_OUTPUT = "' nice puppet'" -BART_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/bart-large", - # see all BART models at https://huggingface.co/models?filter=bart -] - - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/bart/tokenization_bart.py b/src/transformers/models/bart/tokenization_bart.py index b21e81000f2daf..5207b9c92b07ff 100644 --- a/src/transformers/models/bart/tokenization_bart.py +++ b/src/transformers/models/bart/tokenization_bart.py @@ -30,33 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt"} # See all BART models at https://huggingface.co/models?filter=bart -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/bart-base": "https://huggingface.co/facebook/bart-base/resolve/main/vocab.json", - "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/vocab.json", - "facebook/bart-large-mnli": "https://huggingface.co/facebook/bart-large-mnli/resolve/main/vocab.json", - "facebook/bart-large-cnn": "https://huggingface.co/facebook/bart-large-cnn/resolve/main/vocab.json", - "facebook/bart-large-xsum": "https://huggingface.co/facebook/bart-large-xsum/resolve/main/vocab.json", - "yjernite/bart_eli5": "https://huggingface.co/yjernite/bart_eli5/resolve/main/vocab.json", - }, - "merges_file": { - "facebook/bart-base": "https://huggingface.co/facebook/bart-base/resolve/main/merges.txt", - "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/merges.txt", - "facebook/bart-large-mnli": "https://huggingface.co/facebook/bart-large-mnli/resolve/main/merges.txt", - "facebook/bart-large-cnn": "https://huggingface.co/facebook/bart-large-cnn/resolve/main/merges.txt", - "facebook/bart-large-xsum": "https://huggingface.co/facebook/bart-large-xsum/resolve/main/merges.txt", - "yjernite/bart_eli5": "https://huggingface.co/yjernite/bart_eli5/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/bart-base": 1024, - "facebook/bart-large": 1024, - "facebook/bart-large-mnli": 1024, - "facebook/bart-large-cnn": 1024, - "facebook/bart-large-xsum": 1024, - "yjernite/bart_eli5": 1024, -} @lru_cache() @@ -177,8 +150,6 @@ class BartTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/bart/tokenization_bart_fast.py b/src/transformers/models/bart/tokenization_bart_fast.py index 850c9636833aa2..e9fb8497c907b9 100644 --- a/src/transformers/models/bart/tokenization_bart_fast.py +++ b/src/transformers/models/bart/tokenization_bart_fast.py @@ -30,41 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} # See all BART models at https://huggingface.co/models?filter=bart -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/bart-base": "https://huggingface.co/facebook/bart-base/resolve/main/vocab.json", - "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/vocab.json", - "facebook/bart-large-mnli": "https://huggingface.co/facebook/bart-large-mnli/resolve/main/vocab.json", - "facebook/bart-large-cnn": "https://huggingface.co/facebook/bart-large-cnn/resolve/main/vocab.json", - "facebook/bart-large-xsum": "https://huggingface.co/facebook/bart-large-xsum/resolve/main/vocab.json", - "yjernite/bart_eli5": "https://huggingface.co/yjernite/bart_eli5/resolve/main/vocab.json", - }, - "merges_file": { - "facebook/bart-base": "https://huggingface.co/facebook/bart-base/resolve/main/merges.txt", - "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/merges.txt", - "facebook/bart-large-mnli": "https://huggingface.co/facebook/bart-large-mnli/resolve/main/merges.txt", - "facebook/bart-large-cnn": "https://huggingface.co/facebook/bart-large-cnn/resolve/main/merges.txt", - "facebook/bart-large-xsum": "https://huggingface.co/facebook/bart-large-xsum/resolve/main/merges.txt", - "yjernite/bart_eli5": "https://huggingface.co/yjernite/bart_eli5/resolve/main/merges.txt", - }, - "tokenizer_file": { - "facebook/bart-base": "https://huggingface.co/facebook/bart-base/resolve/main/tokenizer.json", - "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/tokenizer.json", - "facebook/bart-large-mnli": "https://huggingface.co/facebook/bart-large-mnli/resolve/main/tokenizer.json", - "facebook/bart-large-cnn": "https://huggingface.co/facebook/bart-large-cnn/resolve/main/tokenizer.json", - "facebook/bart-large-xsum": "https://huggingface.co/facebook/bart-large-xsum/resolve/main/tokenizer.json", - "yjernite/bart_eli5": "https://huggingface.co/yjernite/bart_eli5/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/bart-base": 1024, - "facebook/bart-large": 1024, - "facebook/bart-large-mnli": 1024, - "facebook/bart-large-cnn": 1024, - "facebook/bart-large-xsum": 1024, - "yjernite/bart_eli5": 1024, -} class BartTokenizerFast(PreTrainedTokenizerFast): @@ -149,8 +114,6 @@ class BartTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = BartTokenizer diff --git a/src/transformers/models/barthez/tokenization_barthez.py b/src/transformers/models/barthez/tokenization_barthez.py index f6ea253402f69a..d9bd67cf51b773 100644 --- a/src/transformers/models/barthez/tokenization_barthez.py +++ b/src/transformers/models/barthez/tokenization_barthez.py @@ -29,21 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "moussaKam/mbarthez": "https://huggingface.co/moussaKam/mbarthez/resolve/main/sentencepiece.bpe.model", - "moussaKam/barthez": "https://huggingface.co/moussaKam/barthez/resolve/main/sentencepiece.bpe.model", - "moussaKam/barthez-orangesum-title": ( - "https://huggingface.co/moussaKam/barthez-orangesum-title/resolve/main/sentencepiece.bpe.model" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "moussaKam/mbarthez": 1024, - "moussaKam/barthez": 1024, - "moussaKam/barthez-orangesum-title": 1024, -} SPIECE_UNDERLINE = "▁" @@ -119,8 +104,6 @@ class BarthezTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/barthez/tokenization_barthez_fast.py b/src/transformers/models/barthez/tokenization_barthez_fast.py index fb4a114b43bf62..e988b0d518a3f3 100644 --- a/src/transformers/models/barthez/tokenization_barthez_fast.py +++ b/src/transformers/models/barthez/tokenization_barthez_fast.py @@ -33,28 +33,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "moussaKam/mbarthez": "https://huggingface.co/moussaKam/mbarthez/resolve/main/sentencepiece.bpe.model", - "moussaKam/barthez": "https://huggingface.co/moussaKam/barthez/resolve/main/sentencepiece.bpe.model", - "moussaKam/barthez-orangesum-title": ( - "https://huggingface.co/moussaKam/barthez-orangesum-title/resolve/main/sentencepiece.bpe.model" - ), - }, - "tokenizer_file": { - "moussaKam/mbarthez": "https://huggingface.co/moussaKam/mbarthez/resolve/main/tokenizer.json", - "moussaKam/barthez": "https://huggingface.co/moussaKam/barthez/resolve/main/tokenizer.json", - "moussaKam/barthez-orangesum-title": ( - "https://huggingface.co/moussaKam/barthez-orangesum-title/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "moussaKam/mbarthez": 1024, - "moussaKam/barthez": 1024, - "moussaKam/barthez-orangesum-title": 1024, -} SPIECE_UNDERLINE = "▁" @@ -111,8 +89,6 @@ class BarthezTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = BarthezTokenizer diff --git a/src/transformers/models/bartpho/tokenization_bartpho.py b/src/transformers/models/bartpho/tokenization_bartpho.py index 6b9dc266b29ff4..d936be41c2c786 100644 --- a/src/transformers/models/bartpho/tokenization_bartpho.py +++ b/src/transformers/models/bartpho/tokenization_bartpho.py @@ -31,17 +31,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "monolingual_vocab_file": "dict.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "vinai/bartpho-syllable": "https://huggingface.co/vinai/bartpho-syllable/resolve/main/sentencepiece.bpe.model", - }, - "monolingual_vocab_file": { - "vinai/bartpho-syllable": "https://huggingface.co/vinai/bartpho-syllable/resolve/main/dict.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"vinai/bartpho-syllable": 1024} - class BartphoTokenizer(PreTrainedTokenizer): """ @@ -114,8 +103,6 @@ class BartphoTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/beit/__init__.py b/src/transformers/models/beit/__init__.py index ce399f92e0fa4d..c2f49240d6e64c 100644 --- a/src/transformers/models/beit/__init__.py +++ b/src/transformers/models/beit/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_beit": ["BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BeitConfig", "BeitOnnxConfig"]} +_import_structure = {"configuration_beit": ["BeitConfig", "BeitOnnxConfig"]} try: if not is_vision_available(): @@ -41,7 +41,6 @@ pass else: _import_structure["modeling_beit"] = [ - "BEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BeitForImageClassification", "BeitForMaskedImageModeling", "BeitForSemanticSegmentation", @@ -65,7 +64,7 @@ ] if TYPE_CHECKING: - from .configuration_beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig, BeitOnnxConfig + from .configuration_beit import BeitConfig, BeitOnnxConfig try: if not is_vision_available(): @@ -83,7 +82,6 @@ pass else: from .modeling_beit import ( - BEIT_PRETRAINED_MODEL_ARCHIVE_LIST, BeitBackbone, BeitForImageClassification, BeitForMaskedImageModeling, diff --git a/src/transformers/models/beit/configuration_beit.py b/src/transformers/models/beit/configuration_beit.py index b579eeea37c480..4664bdc898fba3 100644 --- a/src/transformers/models/beit/configuration_beit.py +++ b/src/transformers/models/beit/configuration_beit.py @@ -26,13 +26,6 @@ logger = logging.get_logger(__name__) -BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/beit-base-patch16-224-pt22k": ( - "https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json" - ), - # See all BEiT models at https://huggingface.co/models?filter=beit -} - class BeitConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/beit/modeling_beit.py b/src/transformers/models/beit/modeling_beit.py index da4721656c0285..b2d9bcf61f9ac7 100755 --- a/src/transformers/models/beit/modeling_beit.py +++ b/src/transformers/models/beit/modeling_beit.py @@ -60,11 +60,6 @@ _IMAGE_CLASS_CHECKPOINT = "microsoft/beit-base-patch16-224" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -BEIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/beit-base-patch16-224", - # See all BEiT models at https://huggingface.co/models?filter=beit -] - @dataclass class BeitModelOutputWithPooling(BaseModelOutputWithPooling): diff --git a/src/transformers/models/bert/__init__.py b/src/transformers/models/bert/__init__.py index 882655f394e9c9..17048a5d1c967a 100644 --- a/src/transformers/models/bert/__init__.py +++ b/src/transformers/models/bert/__init__.py @@ -26,7 +26,7 @@ _import_structure = { - "configuration_bert": ["BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BertConfig", "BertOnnxConfig"], + "configuration_bert": ["BertConfig", "BertOnnxConfig"], "tokenization_bert": ["BasicTokenizer", "BertTokenizer", "WordpieceTokenizer"], } @@ -45,7 +45,6 @@ pass else: _import_structure["modeling_bert"] = [ - "BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "BertForMaskedLM", "BertForMultipleChoice", "BertForNextSentencePrediction", @@ -67,7 +66,6 @@ pass else: _import_structure["modeling_tf_bert"] = [ - "TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBertEmbeddings", "TFBertForMaskedLM", "TFBertForMultipleChoice", @@ -109,7 +107,7 @@ ] if TYPE_CHECKING: - from .configuration_bert import BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, BertConfig, BertOnnxConfig + from .configuration_bert import BertConfig, BertOnnxConfig from .tokenization_bert import BasicTokenizer, BertTokenizer, WordpieceTokenizer try: @@ -127,7 +125,6 @@ pass else: from .modeling_bert import ( - BERT_PRETRAINED_MODEL_ARCHIVE_LIST, BertForMaskedLM, BertForMultipleChoice, BertForNextSentencePrediction, @@ -149,7 +146,6 @@ pass else: from .modeling_tf_bert import ( - TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFBertEmbeddings, TFBertForMaskedLM, TFBertForMultipleChoice, diff --git a/src/transformers/models/bert/configuration_bert.py b/src/transformers/models/bert/configuration_bert.py index 1f79260f510ff2..7ad3536c96e789 100644 --- a/src/transformers/models/bert/configuration_bert.py +++ b/src/transformers/models/bert/configuration_bert.py @@ -24,50 +24,6 @@ logger = logging.get_logger(__name__) -BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json", - "google-bert/bert-large-uncased": "https://huggingface.co/google-bert/bert-large-uncased/resolve/main/config.json", - "google-bert/bert-base-cased": "https://huggingface.co/google-bert/bert-base-cased/resolve/main/config.json", - "google-bert/bert-large-cased": "https://huggingface.co/google-bert/bert-large-cased/resolve/main/config.json", - "google-bert/bert-base-multilingual-uncased": "https://huggingface.co/google-bert/bert-base-multilingual-uncased/resolve/main/config.json", - "google-bert/bert-base-multilingual-cased": "https://huggingface.co/google-bert/bert-base-multilingual-cased/resolve/main/config.json", - "google-bert/bert-base-chinese": "https://huggingface.co/google-bert/bert-base-chinese/resolve/main/config.json", - "google-bert/bert-base-german-cased": "https://huggingface.co/google-bert/bert-base-german-cased/resolve/main/config.json", - "google-bert/bert-large-uncased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking/resolve/main/config.json" - ), - "google-bert/bert-large-cased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking/resolve/main/config.json" - ), - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json" - ), - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/config.json" - ), - "google-bert/bert-base-cased-finetuned-mrpc": "https://huggingface.co/google-bert/bert-base-cased-finetuned-mrpc/resolve/main/config.json", - "google-bert/bert-base-german-dbmdz-cased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-cased/resolve/main/config.json", - "google-bert/bert-base-german-dbmdz-uncased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-uncased/resolve/main/config.json", - "cl-tohoku/bert-base-japanese": "https://huggingface.co/cl-tohoku/bert-base-japanese/resolve/main/config.json", - "cl-tohoku/bert-base-japanese-whole-word-masking": ( - "https://huggingface.co/cl-tohoku/bert-base-japanese-whole-word-masking/resolve/main/config.json" - ), - "cl-tohoku/bert-base-japanese-char": ( - "https://huggingface.co/cl-tohoku/bert-base-japanese-char/resolve/main/config.json" - ), - "cl-tohoku/bert-base-japanese-char-whole-word-masking": ( - "https://huggingface.co/cl-tohoku/bert-base-japanese-char-whole-word-masking/resolve/main/config.json" - ), - "TurkuNLP/bert-base-finnish-cased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/config.json" - ), - "TurkuNLP/bert-base-finnish-uncased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/config.json" - ), - "wietsedv/bert-base-dutch-cased": "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/config.json", - # See all BERT models at https://huggingface.co/models?filter=bert -} - class BertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/bert/modeling_bert.py b/src/transformers/models/bert/modeling_bert.py index 4c068c4d4f1d76..e4ead7ac211639 100755 --- a/src/transformers/models/bert/modeling_bert.py +++ b/src/transformers/models/bert/modeling_bert.py @@ -77,33 +77,6 @@ _SEQ_CLASS_EXPECTED_LOSS = 0.01 -BERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google-bert/bert-base-uncased", - "google-bert/bert-large-uncased", - "google-bert/bert-base-cased", - "google-bert/bert-large-cased", - "google-bert/bert-base-multilingual-uncased", - "google-bert/bert-base-multilingual-cased", - "google-bert/bert-base-chinese", - "google-bert/bert-base-german-cased", - "google-bert/bert-large-uncased-whole-word-masking", - "google-bert/bert-large-cased-whole-word-masking", - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", - "google-bert/bert-base-cased-finetuned-mrpc", - "google-bert/bert-base-german-dbmdz-cased", - "google-bert/bert-base-german-dbmdz-uncased", - "cl-tohoku/bert-base-japanese", - "cl-tohoku/bert-base-japanese-whole-word-masking", - "cl-tohoku/bert-base-japanese-char", - "cl-tohoku/bert-base-japanese-char-whole-word-masking", - "TurkuNLP/bert-base-finnish-cased-v1", - "TurkuNLP/bert-base-finnish-uncased-v1", - "wietsedv/bert-base-dutch-cased", - # See all BERT models at https://huggingface.co/models?filter=bert -] - - def load_tf_weights_in_bert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/bert/modeling_tf_bert.py b/src/transformers/models/bert/modeling_tf_bert.py index cc1218bbea2e42..89885887c96a4c 100644 --- a/src/transformers/models/bert/modeling_tf_bert.py +++ b/src/transformers/models/bert/modeling_tf_bert.py @@ -89,30 +89,6 @@ _SEQ_CLASS_EXPECTED_OUTPUT = "'LABEL_1'" _SEQ_CLASS_EXPECTED_LOSS = 0.01 -TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google-bert/bert-base-uncased", - "google-bert/bert-large-uncased", - "google-bert/bert-base-cased", - "google-bert/bert-large-cased", - "google-bert/bert-base-multilingual-uncased", - "google-bert/bert-base-multilingual-cased", - "google-bert/bert-base-chinese", - "google-bert/bert-base-german-cased", - "google-bert/bert-large-uncased-whole-word-masking", - "google-bert/bert-large-cased-whole-word-masking", - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", - "google-bert/bert-base-cased-finetuned-mrpc", - "cl-tohoku/bert-base-japanese", - "cl-tohoku/bert-base-japanese-whole-word-masking", - "cl-tohoku/bert-base-japanese-char", - "cl-tohoku/bert-base-japanese-char-whole-word-masking", - "TurkuNLP/bert-base-finnish-cased-v1", - "TurkuNLP/bert-base-finnish-uncased-v1", - "wietsedv/bert-base-dutch-cased", - # See all BERT models at https://huggingface.co/models?filter=bert -] - class TFBertPreTrainingLoss: """ diff --git a/src/transformers/models/bert/tokenization_bert.py b/src/transformers/models/bert/tokenization_bert.py index c95e9ff0f8b43c..f645d7c08a327b 100644 --- a/src/transformers/models/bert/tokenization_bert.py +++ b/src/transformers/models/bert/tokenization_bert.py @@ -28,91 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/vocab.txt", - "google-bert/bert-large-uncased": "https://huggingface.co/google-bert/bert-large-uncased/resolve/main/vocab.txt", - "google-bert/bert-base-cased": "https://huggingface.co/google-bert/bert-base-cased/resolve/main/vocab.txt", - "google-bert/bert-large-cased": "https://huggingface.co/google-bert/bert-large-cased/resolve/main/vocab.txt", - "google-bert/bert-base-multilingual-uncased": ( - "https://huggingface.co/google-bert/bert-base-multilingual-uncased/resolve/main/vocab.txt" - ), - "google-bert/bert-base-multilingual-cased": "https://huggingface.co/google-bert/bert-base-multilingual-cased/resolve/main/vocab.txt", - "google-bert/bert-base-chinese": "https://huggingface.co/google-bert/bert-base-chinese/resolve/main/vocab.txt", - "google-bert/bert-base-german-cased": "https://huggingface.co/google-bert/bert-base-german-cased/resolve/main/vocab.txt", - "google-bert/bert-large-uncased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking/resolve/main/vocab.txt" - ), - "google-bert/bert-large-cased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking/resolve/main/vocab.txt" - ), - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt" - ), - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt" - ), - "google-bert/bert-base-cased-finetuned-mrpc": ( - "https://huggingface.co/google-bert/bert-base-cased-finetuned-mrpc/resolve/main/vocab.txt" - ), - "google-bert/bert-base-german-dbmdz-cased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-cased/resolve/main/vocab.txt", - "google-bert/bert-base-german-dbmdz-uncased": ( - "https://huggingface.co/google-bert/bert-base-german-dbmdz-uncased/resolve/main/vocab.txt" - ), - "TurkuNLP/bert-base-finnish-cased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/vocab.txt" - ), - "TurkuNLP/bert-base-finnish-uncased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/vocab.txt" - ), - "wietsedv/bert-base-dutch-cased": ( - "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google-bert/bert-base-uncased": 512, - "google-bert/bert-large-uncased": 512, - "google-bert/bert-base-cased": 512, - "google-bert/bert-large-cased": 512, - "google-bert/bert-base-multilingual-uncased": 512, - "google-bert/bert-base-multilingual-cased": 512, - "google-bert/bert-base-chinese": 512, - "google-bert/bert-base-german-cased": 512, - "google-bert/bert-large-uncased-whole-word-masking": 512, - "google-bert/bert-large-cased-whole-word-masking": 512, - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": 512, - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": 512, - "google-bert/bert-base-cased-finetuned-mrpc": 512, - "google-bert/bert-base-german-dbmdz-cased": 512, - "google-bert/bert-base-german-dbmdz-uncased": 512, - "TurkuNLP/bert-base-finnish-cased-v1": 512, - "TurkuNLP/bert-base-finnish-uncased-v1": 512, - "wietsedv/bert-base-dutch-cased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "google-bert/bert-base-uncased": {"do_lower_case": True}, - "google-bert/bert-large-uncased": {"do_lower_case": True}, - "google-bert/bert-base-cased": {"do_lower_case": False}, - "google-bert/bert-large-cased": {"do_lower_case": False}, - "google-bert/bert-base-multilingual-uncased": {"do_lower_case": True}, - "google-bert/bert-base-multilingual-cased": {"do_lower_case": False}, - "google-bert/bert-base-chinese": {"do_lower_case": False}, - "google-bert/bert-base-german-cased": {"do_lower_case": False}, - "google-bert/bert-large-uncased-whole-word-masking": {"do_lower_case": True}, - "google-bert/bert-large-cased-whole-word-masking": {"do_lower_case": False}, - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": {"do_lower_case": True}, - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": {"do_lower_case": False}, - "google-bert/bert-base-cased-finetuned-mrpc": {"do_lower_case": False}, - "google-bert/bert-base-german-dbmdz-cased": {"do_lower_case": False}, - "google-bert/bert-base-german-dbmdz-uncased": {"do_lower_case": True}, - "TurkuNLP/bert-base-finnish-cased-v1": {"do_lower_case": False}, - "TurkuNLP/bert-base-finnish-uncased-v1": {"do_lower_case": True}, - "wietsedv/bert-base-dutch-cased": {"do_lower_case": False}, -} - def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" @@ -177,9 +92,6 @@ class BertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/bert/tokenization_bert_fast.py b/src/transformers/models/bert/tokenization_bert_fast.py index e7754b2fb5a128..f4897772847029 100644 --- a/src/transformers/models/bert/tokenization_bert_fast.py +++ b/src/transformers/models/bert/tokenization_bert_fast.py @@ -28,135 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/vocab.txt", - "google-bert/bert-large-uncased": "https://huggingface.co/google-bert/bert-large-uncased/resolve/main/vocab.txt", - "google-bert/bert-base-cased": "https://huggingface.co/google-bert/bert-base-cased/resolve/main/vocab.txt", - "google-bert/bert-large-cased": "https://huggingface.co/google-bert/bert-large-cased/resolve/main/vocab.txt", - "google-bert/bert-base-multilingual-uncased": ( - "https://huggingface.co/google-bert/bert-base-multilingual-uncased/resolve/main/vocab.txt" - ), - "google-bert/bert-base-multilingual-cased": "https://huggingface.co/google-bert/bert-base-multilingual-cased/resolve/main/vocab.txt", - "google-bert/bert-base-chinese": "https://huggingface.co/google-bert/bert-base-chinese/resolve/main/vocab.txt", - "google-bert/bert-base-german-cased": "https://huggingface.co/google-bert/bert-base-german-cased/resolve/main/vocab.txt", - "google-bert/bert-large-uncased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking/resolve/main/vocab.txt" - ), - "google-bert/bert-large-cased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking/resolve/main/vocab.txt" - ), - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt" - ), - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt" - ), - "google-bert/bert-base-cased-finetuned-mrpc": ( - "https://huggingface.co/google-bert/bert-base-cased-finetuned-mrpc/resolve/main/vocab.txt" - ), - "google-bert/bert-base-german-dbmdz-cased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-cased/resolve/main/vocab.txt", - "google-bert/bert-base-german-dbmdz-uncased": ( - "https://huggingface.co/google-bert/bert-base-german-dbmdz-uncased/resolve/main/vocab.txt" - ), - "TurkuNLP/bert-base-finnish-cased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/vocab.txt" - ), - "TurkuNLP/bert-base-finnish-uncased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/vocab.txt" - ), - "wietsedv/bert-base-dutch-cased": ( - "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/tokenizer.json", - "google-bert/bert-large-uncased": "https://huggingface.co/google-bert/bert-large-uncased/resolve/main/tokenizer.json", - "google-bert/bert-base-cased": "https://huggingface.co/google-bert/bert-base-cased/resolve/main/tokenizer.json", - "google-bert/bert-large-cased": "https://huggingface.co/google-bert/bert-large-cased/resolve/main/tokenizer.json", - "google-bert/bert-base-multilingual-uncased": ( - "https://huggingface.co/google-bert/bert-base-multilingual-uncased/resolve/main/tokenizer.json" - ), - "google-bert/bert-base-multilingual-cased": ( - "https://huggingface.co/google-bert/bert-base-multilingual-cased/resolve/main/tokenizer.json" - ), - "google-bert/bert-base-chinese": "https://huggingface.co/google-bert/bert-base-chinese/resolve/main/tokenizer.json", - "google-bert/bert-base-german-cased": "https://huggingface.co/google-bert/bert-base-german-cased/resolve/main/tokenizer.json", - "google-bert/bert-large-uncased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking/resolve/main/tokenizer.json" - ), - "google-bert/bert-large-cased-whole-word-masking": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking/resolve/main/tokenizer.json" - ), - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json" - ), - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": ( - "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json" - ), - "google-bert/bert-base-cased-finetuned-mrpc": ( - "https://huggingface.co/google-bert/bert-base-cased-finetuned-mrpc/resolve/main/tokenizer.json" - ), - "google-bert/bert-base-german-dbmdz-cased": ( - "https://huggingface.co/google-bert/bert-base-german-dbmdz-cased/resolve/main/tokenizer.json" - ), - "google-bert/bert-base-german-dbmdz-uncased": ( - "https://huggingface.co/google-bert/bert-base-german-dbmdz-uncased/resolve/main/tokenizer.json" - ), - "TurkuNLP/bert-base-finnish-cased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/tokenizer.json" - ), - "TurkuNLP/bert-base-finnish-uncased-v1": ( - "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/tokenizer.json" - ), - "wietsedv/bert-base-dutch-cased": ( - "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google-bert/bert-base-uncased": 512, - "google-bert/bert-large-uncased": 512, - "google-bert/bert-base-cased": 512, - "google-bert/bert-large-cased": 512, - "google-bert/bert-base-multilingual-uncased": 512, - "google-bert/bert-base-multilingual-cased": 512, - "google-bert/bert-base-chinese": 512, - "google-bert/bert-base-german-cased": 512, - "google-bert/bert-large-uncased-whole-word-masking": 512, - "google-bert/bert-large-cased-whole-word-masking": 512, - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": 512, - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": 512, - "google-bert/bert-base-cased-finetuned-mrpc": 512, - "google-bert/bert-base-german-dbmdz-cased": 512, - "google-bert/bert-base-german-dbmdz-uncased": 512, - "TurkuNLP/bert-base-finnish-cased-v1": 512, - "TurkuNLP/bert-base-finnish-uncased-v1": 512, - "wietsedv/bert-base-dutch-cased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "google-bert/bert-base-uncased": {"do_lower_case": True}, - "google-bert/bert-large-uncased": {"do_lower_case": True}, - "google-bert/bert-base-cased": {"do_lower_case": False}, - "google-bert/bert-large-cased": {"do_lower_case": False}, - "google-bert/bert-base-multilingual-uncased": {"do_lower_case": True}, - "google-bert/bert-base-multilingual-cased": {"do_lower_case": False}, - "google-bert/bert-base-chinese": {"do_lower_case": False}, - "google-bert/bert-base-german-cased": {"do_lower_case": False}, - "google-bert/bert-large-uncased-whole-word-masking": {"do_lower_case": True}, - "google-bert/bert-large-cased-whole-word-masking": {"do_lower_case": False}, - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": {"do_lower_case": True}, - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": {"do_lower_case": False}, - "google-bert/bert-base-cased-finetuned-mrpc": {"do_lower_case": False}, - "google-bert/bert-base-german-dbmdz-cased": {"do_lower_case": False}, - "google-bert/bert-base-german-dbmdz-uncased": {"do_lower_case": True}, - "TurkuNLP/bert-base-finnish-cased-v1": {"do_lower_case": False}, - "TurkuNLP/bert-base-finnish-uncased-v1": {"do_lower_case": True}, - "wietsedv/bert-base-dutch-cased": {"do_lower_case": False}, -} - class BertTokenizerFast(PreTrainedTokenizerFast): r""" @@ -199,9 +70,6 @@ class BertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = BertTokenizer def __init__( diff --git a/src/transformers/models/bert_generation/tokenization_bert_generation.py b/src/transformers/models/bert_generation/tokenization_bert_generation.py index 3b6298fcbd8f6e..772eb123c39888 100644 --- a/src/transformers/models/bert_generation/tokenization_bert_generation.py +++ b/src/transformers/models/bert_generation/tokenization_bert_generation.py @@ -29,16 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "bert_for_seq_generation": ( - "https://huggingface.co/google/bert_for_seq_generation_L-24_bbc_encoder/resolve/main/spiece.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"bert_for_seq_generation": 512} - class BertGenerationTokenizer(PreTrainedTokenizer): """ @@ -82,8 +72,6 @@ class BertGenerationTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES prefix_tokens: List[int] = [] model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/bert_japanese/tokenization_bert_japanese.py b/src/transformers/models/bert_japanese/tokenization_bert_japanese.py index b2d1ac19580191..fe5cd06f7f5854 100644 --- a/src/transformers/models/bert_japanese/tokenization_bert_japanese.py +++ b/src/transformers/models/bert_japanese/tokenization_bert_japanese.py @@ -36,51 +36,6 @@ SPIECE_UNDERLINE = "▁" -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "cl-tohoku/bert-base-japanese": "https://huggingface.co/cl-tohoku/bert-base-japanese/resolve/main/vocab.txt", - "cl-tohoku/bert-base-japanese-whole-word-masking": ( - "https://huggingface.co/cl-tohoku/bert-base-japanese-whole-word-masking/resolve/main/vocab.txt" - ), - "cl-tohoku/bert-base-japanese-char": ( - "https://huggingface.co/cl-tohoku/bert-base-japanese-char/resolve/main/vocab.txt" - ), - "cl-tohoku/bert-base-japanese-char-whole-word-masking": ( - "https://huggingface.co/cl-tohoku/bert-base-japanese-char-whole-word-masking/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "cl-tohoku/bert-base-japanese": 512, - "cl-tohoku/bert-base-japanese-whole-word-masking": 512, - "cl-tohoku/bert-base-japanese-char": 512, - "cl-tohoku/bert-base-japanese-char-whole-word-masking": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "cl-tohoku/bert-base-japanese": { - "do_lower_case": False, - "word_tokenizer_type": "mecab", - "subword_tokenizer_type": "wordpiece", - }, - "cl-tohoku/bert-base-japanese-whole-word-masking": { - "do_lower_case": False, - "word_tokenizer_type": "mecab", - "subword_tokenizer_type": "wordpiece", - }, - "cl-tohoku/bert-base-japanese-char": { - "do_lower_case": False, - "word_tokenizer_type": "mecab", - "subword_tokenizer_type": "character", - }, - "cl-tohoku/bert-base-japanese-char-whole-word-masking": { - "do_lower_case": False, - "word_tokenizer_type": "mecab", - "subword_tokenizer_type": "character", - }, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -136,9 +91,6 @@ class BertJapaneseTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/bertweet/tokenization_bertweet.py b/src/transformers/models/bertweet/tokenization_bertweet.py index 74bc040c25b13d..7f14ed61dac0f2 100644 --- a/src/transformers/models/bertweet/tokenization_bertweet.py +++ b/src/transformers/models/bertweet/tokenization_bertweet.py @@ -35,19 +35,6 @@ "merges_file": "bpe.codes", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "vinai/bertweet-base": "https://huggingface.co/vinai/bertweet-base/resolve/main/vocab.txt", - }, - "merges_file": { - "vinai/bertweet-base": "https://huggingface.co/vinai/bertweet-base/resolve/main/bpe.codes", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "vinai/bertweet-base": 128, -} - def get_pairs(word): """ @@ -117,8 +104,6 @@ class BertweetTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/big_bird/__init__.py b/src/transformers/models/big_bird/__init__.py index ef8ad80aa6b5e6..8eda33d9ee6608 100644 --- a/src/transformers/models/big_bird/__init__.py +++ b/src/transformers/models/big_bird/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_big_bird": ["BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP", "BigBirdConfig", "BigBirdOnnxConfig"], + "configuration_big_bird": ["BigBirdConfig", "BigBirdOnnxConfig"], } try: @@ -51,7 +51,6 @@ pass else: _import_structure["modeling_big_bird"] = [ - "BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdForCausalLM", "BigBirdForMaskedLM", "BigBirdForMultipleChoice", @@ -84,7 +83,7 @@ ] if TYPE_CHECKING: - from .configuration_big_bird import BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdConfig, BigBirdOnnxConfig + from .configuration_big_bird import BigBirdConfig, BigBirdOnnxConfig try: if not is_sentencepiece_available(): @@ -109,7 +108,6 @@ pass else: from .modeling_big_bird import ( - BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdForCausalLM, BigBirdForMaskedLM, BigBirdForMultipleChoice, diff --git a/src/transformers/models/big_bird/configuration_big_bird.py b/src/transformers/models/big_bird/configuration_big_bird.py index 9802e758539858..dfd36d82c37c3a 100644 --- a/src/transformers/models/big_bird/configuration_big_bird.py +++ b/src/transformers/models/big_bird/configuration_big_bird.py @@ -23,13 +23,6 @@ logger = logging.get_logger(__name__) -BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json", - "google/bigbird-roberta-large": "https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json", - "google/bigbird-base-trivia-itc": "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json", - # See all BigBird models at https://huggingface.co/models?filter=big_bird -} - class BigBirdConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/big_bird/modeling_big_bird.py b/src/transformers/models/big_bird/modeling_big_bird.py index 008985f760e867..28cb2ddf535ac1 100755 --- a/src/transformers/models/big_bird/modeling_big_bird.py +++ b/src/transformers/models/big_bird/modeling_big_bird.py @@ -54,12 +54,6 @@ _CHECKPOINT_FOR_DOC = "google/bigbird-roberta-base" _CONFIG_FOR_DOC = "BigBirdConfig" -BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/bigbird-roberta-base", - "google/bigbird-roberta-large", - "google/bigbird-base-trivia-itc", - # See all BigBird models at https://huggingface.co/models?filter=big_bird -] _TRIVIA_QA_MAPPING = { "big_bird_attention": "attention/self", diff --git a/src/transformers/models/big_bird/tokenization_big_bird.py b/src/transformers/models/big_bird/tokenization_big_bird.py index e7c43a86a6cab4..58dc57ef6d2e04 100644 --- a/src/transformers/models/big_bird/tokenization_big_bird.py +++ b/src/transformers/models/big_bird/tokenization_big_bird.py @@ -30,24 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/spiece.model", - "google/bigbird-roberta-large": ( - "https://huggingface.co/google/bigbird-roberta-large/resolve/main/spiece.model" - ), - "google/bigbird-base-trivia-itc": ( - "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/spiece.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/bigbird-roberta-base": 4096, - "google/bigbird-roberta-large": 4096, - "google/bigbird-base-trivia-itc": 4096, -} - class BigBirdTokenizer(PreTrainedTokenizer): """ @@ -97,8 +79,6 @@ class BigBirdTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/big_bird/tokenization_big_bird_fast.py b/src/transformers/models/big_bird/tokenization_big_bird_fast.py index 24fc33d8052962..fa37cd4ac7e7d3 100644 --- a/src/transformers/models/big_bird/tokenization_big_bird_fast.py +++ b/src/transformers/models/big_bird/tokenization_big_bird_fast.py @@ -32,35 +32,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/spiece.model", - "google/bigbird-roberta-large": ( - "https://huggingface.co/google/bigbird-roberta-large/resolve/main/spiece.model" - ), - "google/bigbird-base-trivia-itc": ( - "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/spiece.model" - ), - }, - "tokenizer_file": { - "google/bigbird-roberta-base": ( - "https://huggingface.co/google/bigbird-roberta-base/resolve/main/tokenizer.json" - ), - "google/bigbird-roberta-large": ( - "https://huggingface.co/google/bigbird-roberta-large/resolve/main/tokenizer.json" - ), - "google/bigbird-base-trivia-itc": ( - "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/bigbird-roberta-base": 4096, - "google/bigbird-roberta-large": 4096, - "google/bigbird-base-trivia-itc": 4096, -} - SPIECE_UNDERLINE = "▁" @@ -107,8 +78,6 @@ class BigBirdTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = BigBirdTokenizer model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/bigbird_pegasus/__init__.py b/src/transformers/models/bigbird_pegasus/__init__.py index c4245496e73dc2..85621ce76d902b 100644 --- a/src/transformers/models/bigbird_pegasus/__init__.py +++ b/src/transformers/models/bigbird_pegasus/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_bigbird_pegasus": [ - "BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "BigBirdPegasusConfig", "BigBirdPegasusOnnxConfig", ], @@ -31,7 +30,6 @@ pass else: _import_structure["modeling_bigbird_pegasus"] = [ - "BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdPegasusForCausalLM", "BigBirdPegasusForConditionalGeneration", "BigBirdPegasusForQuestionAnswering", @@ -43,7 +41,6 @@ if TYPE_CHECKING: from .configuration_bigbird_pegasus import ( - BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdPegasusConfig, BigBirdPegasusOnnxConfig, ) @@ -55,7 +52,6 @@ pass else: from .modeling_bigbird_pegasus import ( - BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdPegasusForCausalLM, BigBirdPegasusForConditionalGeneration, BigBirdPegasusForQuestionAnswering, diff --git a/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py b/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py index 1c78803c4b1146..c548573f322d36 100644 --- a/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py +++ b/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py @@ -26,19 +26,6 @@ logger = logging.get_logger(__name__) -BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/bigbird-pegasus-large-arxiv": ( - "https://huggingface.co/google/bigbird-pegasus-large-arxiv/resolve/main/config.json" - ), - "google/bigbird-pegasus-large-pubmed": ( - "https://huggingface.co/google/bigbird-pegasus-large-pubmed/resolve/main/config.json" - ), - "google/bigbird-pegasus-large-bigpatent": ( - "https://huggingface.co/google/bigbird-pegasus-large-bigpatent/resolve/main/config.json" - ), - # See all BigBirdPegasus models at https://huggingface.co/models?filter=bigbird_pegasus -} - class BigBirdPegasusConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py b/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py index baf08143431693..552a8e760b2a54 100755 --- a/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py +++ b/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py @@ -54,14 +54,6 @@ _EXPECTED_OUTPUT_SHAPE = [1, 7, 1024] -BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/bigbird-pegasus-large-arxiv", - "google/bigbird-pegasus-large-pubmed", - "google/bigbird-pegasus-large-bigpatent", - # See all BigBirdPegasus models at https://huggingface.co/models?filter=bigbird_pegasus -] - - def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ Shift input ids one token to the right. diff --git a/src/transformers/models/biogpt/__init__.py b/src/transformers/models/biogpt/__init__.py index ec3d6966ac419d..355c87e67ba2b7 100644 --- a/src/transformers/models/biogpt/__init__.py +++ b/src/transformers/models/biogpt/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_biogpt": ["BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BioGptConfig"], + "configuration_biogpt": ["BioGptConfig"], "tokenization_biogpt": ["BioGptTokenizer"], } @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_biogpt"] = [ - "BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "BioGptForCausalLM", "BioGptForTokenClassification", "BioGptForSequenceClassification", @@ -38,7 +37,7 @@ if TYPE_CHECKING: - from .configuration_biogpt import BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, BioGptConfig + from .configuration_biogpt import BioGptConfig from .tokenization_biogpt import BioGptTokenizer try: @@ -48,7 +47,6 @@ pass else: from .modeling_biogpt import ( - BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST, BioGptForCausalLM, BioGptForSequenceClassification, BioGptForTokenClassification, diff --git a/src/transformers/models/biogpt/configuration_biogpt.py b/src/transformers/models/biogpt/configuration_biogpt.py index 1fb2933f2843eb..936fee76328f4d 100644 --- a/src/transformers/models/biogpt/configuration_biogpt.py +++ b/src/transformers/models/biogpt/configuration_biogpt.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/biogpt": "https://huggingface.co/microsoft/biogpt/resolve/main/config.json", - # See all BioGPT models at https://huggingface.co/models?filter=biogpt -} - class BioGptConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/biogpt/modeling_biogpt.py b/src/transformers/models/biogpt/modeling_biogpt.py index d98f0886dfa95c..8a1668ce3d782f 100755 --- a/src/transformers/models/biogpt/modeling_biogpt.py +++ b/src/transformers/models/biogpt/modeling_biogpt.py @@ -47,13 +47,6 @@ _CONFIG_FOR_DOC = "BioGptConfig" -BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/biogpt", - "microsoft/BioGPT-Large", - # See all BioGPT models at https://huggingface.co/models?filter=biogpt -] - - # Copied from transformers.models.opt.modeling_opt.OPTLearnedPositionalEmbedding with OPT->BioGpt class BioGptLearnedPositionalEmbedding(nn.Embedding): """ diff --git a/src/transformers/models/biogpt/tokenization_biogpt.py b/src/transformers/models/biogpt/tokenization_biogpt.py index 093991ecb3885d..e16742ec5aa4f0 100644 --- a/src/transformers/models/biogpt/tokenization_biogpt.py +++ b/src/transformers/models/biogpt/tokenization_biogpt.py @@ -28,17 +28,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/biogpt": "https://huggingface.co/microsoft/biogpt/resolve/main/vocab.json", - }, - "merges_file": {"microsoft/biogpt": "https://huggingface.co/microsoft/biogpt/resolve/main/merges.txt"}, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/biogpt": 1024, -} - def get_pairs(word): """ @@ -97,8 +86,6 @@ class BioGptTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/bit/__init__.py b/src/transformers/models/bit/__init__.py index fc50659d9fa068..8f298a9adf6535 100644 --- a/src/transformers/models/bit/__init__.py +++ b/src/transformers/models/bit/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_bit": ["BIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BitConfig", "BitOnnxConfig"]} +_import_structure = {"configuration_bit": ["BitConfig", "BitOnnxConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_bit"] = [ - "BIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BitForImageClassification", "BitModel", "BitPreTrainedModel", @@ -43,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig, BitOnnxConfig + from .configuration_bit import BitConfig, BitOnnxConfig try: if not is_torch_available(): @@ -52,7 +51,6 @@ pass else: from .modeling_bit import ( - BIT_PRETRAINED_MODEL_ARCHIVE_LIST, BitBackbone, BitForImageClassification, BitModel, diff --git a/src/transformers/models/bit/configuration_bit.py b/src/transformers/models/bit/configuration_bit.py index d11a8e38185113..f1532a74b9ae0f 100644 --- a/src/transformers/models/bit/configuration_bit.py +++ b/src/transformers/models/bit/configuration_bit.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -BIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/bit-50": "https://huggingface.co/google/bit-50/resolve/main/config.json", -} - class BitConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/bit/modeling_bit.py b/src/transformers/models/bit/modeling_bit.py index 49bc75b5f0aa6b..25249a13a7755f 100644 --- a/src/transformers/models/bit/modeling_bit.py +++ b/src/transformers/models/bit/modeling_bit.py @@ -56,11 +56,6 @@ _IMAGE_CLASS_CHECKPOINT = "google/bit-50" _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" -BIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/bit-50", - # See all BiT models at https://huggingface.co/models?filter=bit -] - def get_padding_value(padding=None, kernel_size=7, stride=1, dilation=1) -> Tuple[Tuple, bool]: r""" diff --git a/src/transformers/models/blenderbot/__init__.py b/src/transformers/models/blenderbot/__init__.py index 86d857b1e9a26d..8b53b9100a4af1 100644 --- a/src/transformers/models/blenderbot/__init__.py +++ b/src/transformers/models/blenderbot/__init__.py @@ -26,7 +26,6 @@ _import_structure = { "configuration_blenderbot": [ - "BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotConfig", "BlenderbotOnnxConfig", ], @@ -48,7 +47,6 @@ pass else: _import_structure["modeling_blenderbot"] = [ - "BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotForCausalLM", "BlenderbotForConditionalGeneration", "BlenderbotModel", @@ -84,7 +82,6 @@ if TYPE_CHECKING: from .configuration_blenderbot import ( - BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotConfig, BlenderbotOnnxConfig, ) @@ -105,7 +102,6 @@ pass else: from .modeling_blenderbot import ( - BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotForCausalLM, BlenderbotForConditionalGeneration, BlenderbotModel, diff --git a/src/transformers/models/blenderbot/configuration_blenderbot.py b/src/transformers/models/blenderbot/configuration_blenderbot.py index 4f55a96bf62b71..6b9a12e02e35b1 100644 --- a/src/transformers/models/blenderbot/configuration_blenderbot.py +++ b/src/transformers/models/blenderbot/configuration_blenderbot.py @@ -27,11 +27,6 @@ logger = logging.get_logger(__name__) -BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/config.json", - # See all Blenderbot models at https://huggingface.co/models?filter=blenderbot -} - class BlenderbotConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/blenderbot/modeling_blenderbot.py b/src/transformers/models/blenderbot/modeling_blenderbot.py index 28b81387c13e62..b85b33c1d00c11 100755 --- a/src/transformers/models/blenderbot/modeling_blenderbot.py +++ b/src/transformers/models/blenderbot/modeling_blenderbot.py @@ -53,12 +53,6 @@ _CHECKPOINT_FOR_DOC = "facebook/blenderbot-400M-distill" -BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/blenderbot-3B", - # See all Blenderbot models at https://huggingface.co/models?filter=blenderbot -] - - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/blenderbot/tokenization_blenderbot.py b/src/transformers/models/blenderbot/tokenization_blenderbot.py index 29386c1233adf0..b812f84b7d2d45 100644 --- a/src/transformers/models/blenderbot/tokenization_blenderbot.py +++ b/src/transformers/models/blenderbot/tokenization_blenderbot.py @@ -34,16 +34,6 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/vocab.json"}, - "merges_file": {"facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/merges.txt"}, - "tokenizer_config_file": { - "facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/tokenizer_config.json" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"facebook/blenderbot-3B": 128} - @lru_cache() # Copied from transformers.models.roberta.tokenization_roberta.bytes_to_unicode @@ -166,8 +156,6 @@ class BlenderbotTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] # Copied from transformers.models.roberta.tokenization_roberta.RobertaTokenizer.__init__ with Roberta->Blenderbot, RoBERTa->Blenderbot diff --git a/src/transformers/models/blenderbot/tokenization_blenderbot_fast.py b/src/transformers/models/blenderbot/tokenization_blenderbot_fast.py index 6245025b503d53..879173282da1e2 100644 --- a/src/transformers/models/blenderbot/tokenization_blenderbot_fast.py +++ b/src/transformers/models/blenderbot/tokenization_blenderbot_fast.py @@ -33,16 +33,6 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/vocab.json"}, - "merges_file": {"facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/merges.txt"}, - "tokenizer_config_file": { - "facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/tokenizer_config.json" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"facebook/blenderbot-3B": 128} - class BlenderbotTokenizerFast(PreTrainedTokenizerFast): """ @@ -126,8 +116,6 @@ class BlenderbotTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = BlenderbotTokenizer diff --git a/src/transformers/models/blenderbot_small/__init__.py b/src/transformers/models/blenderbot_small/__init__.py index 5622ab70de6429..e6cab05c0cae02 100644 --- a/src/transformers/models/blenderbot_small/__init__.py +++ b/src/transformers/models/blenderbot_small/__init__.py @@ -25,7 +25,6 @@ _import_structure = { "configuration_blenderbot_small": [ - "BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotSmallConfig", "BlenderbotSmallOnnxConfig", ], @@ -47,7 +46,6 @@ pass else: _import_structure["modeling_blenderbot_small"] = [ - "BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotSmallForCausalLM", "BlenderbotSmallForConditionalGeneration", "BlenderbotSmallModel", @@ -80,7 +78,6 @@ if TYPE_CHECKING: from .configuration_blenderbot_small import ( - BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotSmallConfig, BlenderbotSmallOnnxConfig, ) @@ -101,7 +98,6 @@ pass else: from .modeling_blenderbot_small import ( - BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotSmallForCausalLM, BlenderbotSmallForConditionalGeneration, BlenderbotSmallModel, diff --git a/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py b/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py index b41330656d39ab..667db5bd55bc40 100644 --- a/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py +++ b/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py @@ -27,11 +27,6 @@ logger = logging.get_logger(__name__) -BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/blenderbot_small-90M": "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/config.json", - # See all BlenderbotSmall models at https://huggingface.co/models?filter=blenderbot_small -} - class BlenderbotSmallConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py b/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py index f9a9508e590557..504f073ed0bec6 100755 --- a/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py +++ b/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py @@ -49,12 +49,6 @@ _CONFIG_FOR_DOC = "BlenderbotSmallConfig" -BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/blenderbot_small-90M", - # See all BlenderbotSmall models at https://huggingface.co/models?filter=blenderbot_small -] - - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/blenderbot_small/tokenization_blenderbot_small.py b/src/transformers/models/blenderbot_small/tokenization_blenderbot_small.py index 240495d73894ef..820868c8cbb769 100644 --- a/src/transformers/models/blenderbot_small/tokenization_blenderbot_small.py +++ b/src/transformers/models/blenderbot_small/tokenization_blenderbot_small.py @@ -33,22 +33,6 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/blenderbot_small-90M": "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/vocab.json" - }, - "merges_file": { - "facebook/blenderbot_small-90M": "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/merges.txt" - }, - "tokenizer_config_file": { - "facebook/blenderbot_small-90M": ( - "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/tokenizer_config.json" - ) - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"facebook/blenderbot_small-90M": 512} - def get_pairs(word): """ @@ -92,8 +76,6 @@ class BlenderbotSmallTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/blenderbot_small/tokenization_blenderbot_small_fast.py b/src/transformers/models/blenderbot_small/tokenization_blenderbot_small_fast.py index 4bf0017b5f2a29..a0c61505b14c3d 100644 --- a/src/transformers/models/blenderbot_small/tokenization_blenderbot_small_fast.py +++ b/src/transformers/models/blenderbot_small/tokenization_blenderbot_small_fast.py @@ -30,24 +30,6 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/blenderbot_small-90M": "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/vocab.json" - }, - "merges_file": { - "facebook/blenderbot_small-90M": "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/merges.txt" - }, - "tokenizer_config_file": { - "facebook/blenderbot_small-90M": ( - "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/tokenizer_config.json" - ) - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/blenderbot_small-90M": 512, -} - class BlenderbotSmallTokenizerFast(PreTrainedTokenizerFast): """ @@ -59,8 +41,6 @@ class BlenderbotSmallTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = BlenderbotSmallTokenizer def __init__( diff --git a/src/transformers/models/blip/__init__.py b/src/transformers/models/blip/__init__.py index a7001788e62916..f78c2500bd64f4 100644 --- a/src/transformers/models/blip/__init__.py +++ b/src/transformers/models/blip/__init__.py @@ -24,7 +24,6 @@ _import_structure = { "configuration_blip": [ - "BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlipConfig", "BlipTextConfig", "BlipVisionConfig", @@ -48,7 +47,6 @@ pass else: _import_structure["modeling_blip"] = [ - "BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "BlipModel", "BlipPreTrainedModel", "BlipForConditionalGeneration", @@ -65,7 +63,6 @@ pass else: _import_structure["modeling_tf_blip"] = [ - "TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBlipModel", "TFBlipPreTrainedModel", "TFBlipForConditionalGeneration", @@ -76,7 +73,7 @@ ] if TYPE_CHECKING: - from .configuration_blip import BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, BlipConfig, BlipTextConfig, BlipVisionConfig + from .configuration_blip import BlipConfig, BlipTextConfig, BlipVisionConfig from .processing_blip import BlipProcessor try: @@ -94,7 +91,6 @@ pass else: from .modeling_blip import ( - BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, BlipForConditionalGeneration, BlipForImageTextRetrieval, BlipForQuestionAnswering, @@ -111,7 +107,6 @@ pass else: from .modeling_tf_blip import ( - TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFBlipForConditionalGeneration, TFBlipForImageTextRetrieval, TFBlipForQuestionAnswering, diff --git a/src/transformers/models/blip/configuration_blip.py b/src/transformers/models/blip/configuration_blip.py index 42e35958ced3cf..1a6fe37aa4f278 100644 --- a/src/transformers/models/blip/configuration_blip.py +++ b/src/transformers/models/blip/configuration_blip.py @@ -23,25 +23,6 @@ logger = logging.get_logger(__name__) -BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Salesforce/blip-vqa-base": "https://huggingface.co/Salesforce/blip-vqa-base/resolve/main/config.json", - "Salesforce/blip-vqa-capfit-large": ( - "https://huggingface.co/Salesforce/blip-vqa-base-capfit/resolve/main/config.json" - ), - "Salesforce/blip-image-captioning-base": ( - "https://huggingface.co/Salesforce/blip-image-captioning-base/resolve/main/config.json" - ), - "Salesforce/blip-image-captioning-large": ( - "https://huggingface.co/Salesforce/blip-image-captioning-large/resolve/main/config.json" - ), - "Salesforce/blip-itm-base-coco": "https://huggingface.co/Salesforce/blip-itm-base-coco/resolve/main/config.json", - "Salesforce/blip-itm-large-coco": "https://huggingface.co/Salesforce/blip-itm-large-coco/resolve/main/config.json", - "Salesforce/blip-itm-base-flikr": "https://huggingface.co/Salesforce/blip-itm-base-flikr/resolve/main/config.json", - "Salesforce/blip-itm-large-flikr": ( - "https://huggingface.co/Salesforce/blip-itm-large-flikr/resolve/main/config.json" - ), -} - class BlipTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/blip/modeling_blip.py b/src/transformers/models/blip/modeling_blip.py index 1dc79efb6546af..2d16216590d2a6 100644 --- a/src/transformers/models/blip/modeling_blip.py +++ b/src/transformers/models/blip/modeling_blip.py @@ -41,18 +41,6 @@ _CHECKPOINT_FOR_DOC = "Salesforce/blip-vqa-base" -BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Salesforce/blip-vqa-base", - "Salesforce/blip-vqa-capfilt-large", - "Salesforce/blip-image-captioning-base", - "Salesforce/blip-image-captioning-large", - "Salesforce/blip-itm-base-coco", - "Salesforce/blip-itm-large-coco", - "Salesforce/blip-itm-base-flickr", - "Salesforce/blip-itm-large-flickr", - # See all BLIP models at https://huggingface.co/models?filter=blip -] - # Copied from transformers.models.clip.modeling_clip.contrastive_loss def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/blip/modeling_tf_blip.py b/src/transformers/models/blip/modeling_tf_blip.py index 5952aa145c9f78..5312cf2323b2e1 100644 --- a/src/transformers/models/blip/modeling_tf_blip.py +++ b/src/transformers/models/blip/modeling_tf_blip.py @@ -48,18 +48,6 @@ _CHECKPOINT_FOR_DOC = "Salesforce/blip-vqa-base" -TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Salesforce/blip-vqa-base", - "Salesforce/blip-vqa-capfilt-large", - "Salesforce/blip-image-captioning-base", - "Salesforce/blip-image-captioning-large", - "Salesforce/blip-itm-base-coco", - "Salesforce/blip-itm-large-coco", - "Salesforce/blip-itm-base-flickr", - "Salesforce/blip-itm-large-flickr", - # See all BLIP models at https://huggingface.co/models?filter=blip -] - # Copied from transformers.models.clip.modeling_tf_clip.contrastive_loss def contrastive_loss(logits: tf.Tensor) -> tf.Tensor: diff --git a/src/transformers/models/blip_2/__init__.py b/src/transformers/models/blip_2/__init__.py index 6fbfd53b3703fd..6897dd35c89bd4 100644 --- a/src/transformers/models/blip_2/__init__.py +++ b/src/transformers/models/blip_2/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_blip_2": [ - "BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Blip2Config", "Blip2QFormerConfig", "Blip2VisionConfig", @@ -33,7 +32,6 @@ pass else: _import_structure["modeling_blip_2"] = [ - "BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Blip2Model", "Blip2QFormerModel", "Blip2PreTrainedModel", @@ -43,7 +41,6 @@ if TYPE_CHECKING: from .configuration_blip_2 import ( - BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Blip2Config, Blip2QFormerConfig, Blip2VisionConfig, @@ -57,7 +54,6 @@ pass else: from .modeling_blip_2 import ( - BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST, Blip2ForConditionalGeneration, Blip2Model, Blip2PreTrainedModel, diff --git a/src/transformers/models/blip_2/configuration_blip_2.py b/src/transformers/models/blip_2/configuration_blip_2.py index 85749888a54bba..70dea87d352b27 100644 --- a/src/transformers/models/blip_2/configuration_blip_2.py +++ b/src/transformers/models/blip_2/configuration_blip_2.py @@ -25,10 +25,6 @@ logger = logging.get_logger(__name__) -BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "salesforce/blip2-opt-2.7b": "https://huggingface.co/salesforce/blip2-opt-2.7b/resolve/main/config.json", -} - class Blip2VisionConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/blip_2/modeling_blip_2.py b/src/transformers/models/blip_2/modeling_blip_2.py index c776df1bc04b7a..ace2736933ae54 100644 --- a/src/transformers/models/blip_2/modeling_blip_2.py +++ b/src/transformers/models/blip_2/modeling_blip_2.py @@ -47,11 +47,6 @@ _CHECKPOINT_FOR_DOC = "Salesforce/blip2-opt-2.7b" -BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Salesforce/blip2-opt-2.7b", - # See all BLIP-2 models at https://huggingface.co/models?filter=blip -] - @dataclass class Blip2ForConditionalGenerationModelOutput(ModelOutput): diff --git a/src/transformers/models/bloom/__init__.py b/src/transformers/models/bloom/__init__.py index 32e8617e8270e9..3c903b39dca23f 100644 --- a/src/transformers/models/bloom/__init__.py +++ b/src/transformers/models/bloom/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_bloom": ["BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP", "BloomConfig", "BloomOnnxConfig"], + "configuration_bloom": ["BloomConfig", "BloomOnnxConfig"], } try: if not is_tokenizers_available(): @@ -41,7 +41,6 @@ pass else: _import_structure["modeling_bloom"] = [ - "BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST", "BloomForCausalLM", "BloomModel", "BloomPreTrainedModel", @@ -64,7 +63,7 @@ if TYPE_CHECKING: - from .configuration_bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig, BloomOnnxConfig + from .configuration_bloom import BloomConfig, BloomOnnxConfig try: if not is_tokenizers_available(): @@ -81,7 +80,6 @@ pass else: from .modeling_bloom import ( - BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST, BloomForCausalLM, BloomForQuestionAnswering, BloomForSequenceClassification, diff --git a/src/transformers/models/bloom/configuration_bloom.py b/src/transformers/models/bloom/configuration_bloom.py index 17395625e0177e..ddea3f720a4d19 100644 --- a/src/transformers/models/bloom/configuration_bloom.py +++ b/src/transformers/models/bloom/configuration_bloom.py @@ -29,15 +29,6 @@ logger = logging.get_logger(__name__) -BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "bigscience/bloom": "https://huggingface.co/bigscience/bloom/resolve/main/config.json", - "bigscience/bloom-560m": "https://huggingface.co/bigscience/bloom-560m/blob/main/config.json", - "bigscience/bloom-1b1": "https://huggingface.co/bigscience/bloom-1b1/blob/main/config.json", - "bigscience/bloom-1b7": "https://huggingface.co/bigscience/bloom-1b7/blob/main/config.json", - "bigscience/bloom-3b": "https://huggingface.co/bigscience/bloom-3b/blob/main/config.json", - "bigscience/bloom-7b1": "https://huggingface.co/bigscience/bloom-7b1/blob/main/config.json", -} - class BloomConfig(PretrainedConfig): """ diff --git a/src/transformers/models/bloom/modeling_bloom.py b/src/transformers/models/bloom/modeling_bloom.py index 14700d6f12d3f7..0ef158b1f85f11 100644 --- a/src/transformers/models/bloom/modeling_bloom.py +++ b/src/transformers/models/bloom/modeling_bloom.py @@ -43,16 +43,6 @@ _CHECKPOINT_FOR_DOC = "bigscience/bloom-560m" _CONFIG_FOR_DOC = "BloomConfig" -BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "bigscience/bigscience-small-testing", - "bigscience/bloom-560m", - "bigscience/bloom-1b1", - "bigscience/bloom-1b7", - "bigscience/bloom-3b", - "bigscience/bloom-7b1", - "bigscience/bloom", -] - def build_alibi_tensor(attention_mask: torch.Tensor, num_heads: int, dtype: torch.dtype) -> torch.Tensor: """ diff --git a/src/transformers/models/bloom/tokenization_bloom_fast.py b/src/transformers/models/bloom/tokenization_bloom_fast.py index c0189e08b3d149..3a0972d87ae349 100644 --- a/src/transformers/models/bloom/tokenization_bloom_fast.py +++ b/src/transformers/models/bloom/tokenization_bloom_fast.py @@ -27,18 +27,6 @@ VOCAB_FILES_NAMES = {"tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "tokenizer_file": { - "bigscience/tokenizer": "https://huggingface.co/bigscience/tokenizer/blob/main/tokenizer.json", - "bigscience/bloom-560m": "https://huggingface.co/bigscience/bloom-560m/blob/main/tokenizer.json", - "bigscience/bloom-1b1": "https://huggingface.co/bigscience/bloom-1b1/blob/main/tokenizer.json", - "bigscience/bloom-1b7": "https://huggingface.co/bigscience/bloom-1b7/blob/main/tokenizer.json", - "bigscience/bloom-3b": "https://huggingface.co/bigscience/bloom-3b/blob/main/tokenizer.json", - "bigscience/bloom-7b1": "https://huggingface.co/bigscience/bloom-7b1/blob/main/tokenizer.json", - "bigscience/bloom": "https://huggingface.co/bigscience/bloom/blob/main/tokenizer.json", - }, -} - class BloomTokenizerFast(PreTrainedTokenizerFast): """ @@ -94,7 +82,6 @@ class BloomTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = None # No `max_model_input_sizes` as BLOOM uses ALiBi positional embeddings diff --git a/src/transformers/models/bridgetower/__init__.py b/src/transformers/models/bridgetower/__init__.py index cbd5bd4a366aed..3120ca9f2a163a 100644 --- a/src/transformers/models/bridgetower/__init__.py +++ b/src/transformers/models/bridgetower/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_bridgetower": [ - "BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP", "BridgeTowerConfig", "BridgeTowerTextConfig", "BridgeTowerVisionConfig", @@ -41,7 +40,6 @@ pass else: _import_structure["modeling_bridgetower"] = [ - "BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST", "BridgeTowerForContrastiveLearning", "BridgeTowerForImageAndTextRetrieval", "BridgeTowerForMaskedLM", @@ -52,7 +50,6 @@ if TYPE_CHECKING: from .configuration_bridgetower import ( - BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP, BridgeTowerConfig, BridgeTowerTextConfig, BridgeTowerVisionConfig, @@ -74,7 +71,6 @@ pass else: from .modeling_bridgetower import ( - BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST, BridgeTowerForContrastiveLearning, BridgeTowerForImageAndTextRetrieval, BridgeTowerForMaskedLM, diff --git a/src/transformers/models/bridgetower/configuration_bridgetower.py b/src/transformers/models/bridgetower/configuration_bridgetower.py index c12c1600e9b449..8513ce21f7606e 100644 --- a/src/transformers/models/bridgetower/configuration_bridgetower.py +++ b/src/transformers/models/bridgetower/configuration_bridgetower.py @@ -23,13 +23,6 @@ logger = logging.get_logger(__name__) -BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "BridgeTower/bridgetower-base": "https://huggingface.co/BridgeTower/bridgetower-base/blob/main/config.json", - "BridgeTower/bridgetower-base-itm-mlm": ( - "https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm/blob/main/config.json" - ), -} - class BridgeTowerVisionConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/bridgetower/modeling_bridgetower.py b/src/transformers/models/bridgetower/modeling_bridgetower.py index f5822070db6a3d..8e29413d747c06 100644 --- a/src/transformers/models/bridgetower/modeling_bridgetower.py +++ b/src/transformers/models/bridgetower/modeling_bridgetower.py @@ -44,12 +44,6 @@ _CHECKPOINT_FOR_DOC = "BridgeTower/bridgetower-base" _TOKENIZER_FOR_DOC = "RobertaTokenizer" -BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "BridgeTower/bridgetower-base", - "BridgeTower/bridgetower-base-itm-mlm", - # See all bridgetower models at https://huggingface.co/BridgeTower -] - BRIDGETOWER_START_DOCSTRING = r""" This model is a PyTorch `torch.nn.Module `_ subclass. Use diff --git a/src/transformers/models/bros/__init__.py b/src/transformers/models/bros/__init__.py index b08d55836488a0..516c6349cd120c 100644 --- a/src/transformers/models/bros/__init__.py +++ b/src/transformers/models/bros/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_bros": ["BROS_PRETRAINED_CONFIG_ARCHIVE_MAP", "BrosConfig"], + "configuration_bros": ["BrosConfig"], } try: @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_bros"] = [ - "BROS_PRETRAINED_MODEL_ARCHIVE_LIST", "BrosPreTrainedModel", "BrosModel", "BrosForTokenClassification", @@ -45,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_bros import BROS_PRETRAINED_CONFIG_ARCHIVE_MAP, BrosConfig + from .configuration_bros import BrosConfig try: if not is_tokenizers_available(): @@ -62,7 +61,6 @@ pass else: from .modeling_bros import ( - BROS_PRETRAINED_MODEL_ARCHIVE_LIST, BrosForTokenClassification, BrosModel, BrosPreTrainedModel, diff --git a/src/transformers/models/bros/configuration_bros.py b/src/transformers/models/bros/configuration_bros.py index 4384810a55a013..6a1ef6d948e9eb 100644 --- a/src/transformers/models/bros/configuration_bros.py +++ b/src/transformers/models/bros/configuration_bros.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -BROS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "jinho8345/bros-base-uncased": "https://huggingface.co/jinho8345/bros-base-uncased/blob/main/config.json", - "jinho8345/bros-large-uncased": "https://huggingface.co/jinho8345/bros-large-uncased/blob/main/config.json", -} - class BrosConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/bros/modeling_bros.py b/src/transformers/models/bros/modeling_bros.py index d3a17b23c94d48..0f80cec4049ef5 100755 --- a/src/transformers/models/bros/modeling_bros.py +++ b/src/transformers/models/bros/modeling_bros.py @@ -47,11 +47,6 @@ _CHECKPOINT_FOR_DOC = "jinho8345/bros-base-uncased" _CONFIG_FOR_DOC = "BrosConfig" -BROS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "jinho8345/bros-base-uncased", - "jinho8345/bros-large-uncased", - # See all Bros models at https://huggingface.co/models?filter=bros -] BROS_START_DOCSTRING = r""" This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. diff --git a/src/transformers/models/camembert/__init__.py b/src/transformers/models/camembert/__init__.py index 9882fc2b973355..1759762f47f1a1 100644 --- a/src/transformers/models/camembert/__init__.py +++ b/src/transformers/models/camembert/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_camembert": ["CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CamembertConfig", "CamembertOnnxConfig"], + "configuration_camembert": ["CamembertConfig", "CamembertOnnxConfig"], } try: @@ -51,7 +51,6 @@ pass else: _import_structure["modeling_camembert"] = [ - "CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "CamembertForCausalLM", "CamembertForMaskedLM", "CamembertForMultipleChoice", @@ -69,7 +68,6 @@ pass else: _import_structure["modeling_tf_camembert"] = [ - "TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCamembertForCausalLM", "TFCamembertForMaskedLM", "TFCamembertForMultipleChoice", @@ -82,7 +80,7 @@ if TYPE_CHECKING: - from .configuration_camembert import CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, CamembertConfig, CamembertOnnxConfig + from .configuration_camembert import CamembertConfig, CamembertOnnxConfig try: if not is_sentencepiece_available(): @@ -107,7 +105,6 @@ pass else: from .modeling_camembert import ( - CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, CamembertForCausalLM, CamembertForMaskedLM, CamembertForMultipleChoice, @@ -125,7 +122,6 @@ pass else: from .modeling_tf_camembert import ( - TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCamembertForCausalLM, TFCamembertForMaskedLM, TFCamembertForMultipleChoice, diff --git a/src/transformers/models/camembert/configuration_camembert.py b/src/transformers/models/camembert/configuration_camembert.py index d904c35ad7b7a5..124d14abec147b 100644 --- a/src/transformers/models/camembert/configuration_camembert.py +++ b/src/transformers/models/camembert/configuration_camembert.py @@ -25,16 +25,6 @@ logger = logging.get_logger(__name__) -CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "almanach/camembert-base": "https://huggingface.co/almanach/camembert-base/resolve/main/config.json", - "umberto-commoncrawl-cased-v1": ( - "https://huggingface.co/Musixmatch/umberto-commoncrawl-cased-v1/resolve/main/config.json" - ), - "umberto-wikipedia-uncased-v1": ( - "https://huggingface.co/Musixmatch/umberto-wikipedia-uncased-v1/resolve/main/config.json" - ), -} - class CamembertConfig(PretrainedConfig): """ diff --git a/src/transformers/models/camembert/modeling_camembert.py b/src/transformers/models/camembert/modeling_camembert.py index cd0b329b6ae00d..8e519ab90e0e8b 100644 --- a/src/transformers/models/camembert/modeling_camembert.py +++ b/src/transformers/models/camembert/modeling_camembert.py @@ -51,12 +51,6 @@ _CHECKPOINT_FOR_DOC = "almanach/camembert-base" _CONFIG_FOR_DOC = "CamembertConfig" -CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "almanach/camembert-base", - "Musixmatch/umberto-commoncrawl-cased-v1", - "Musixmatch/umberto-wikipedia-uncased-v1", - # See all CamemBERT models at https://huggingface.co/models?filter=camembert -] CAMEMBERT_START_DOCSTRING = r""" diff --git a/src/transformers/models/camembert/modeling_tf_camembert.py b/src/transformers/models/camembert/modeling_tf_camembert.py index e3e3fca4cef440..9e66f124689808 100644 --- a/src/transformers/models/camembert/modeling_tf_camembert.py +++ b/src/transformers/models/camembert/modeling_tf_camembert.py @@ -65,10 +65,6 @@ _CHECKPOINT_FOR_DOC = "almanach/camembert-base" _CONFIG_FOR_DOC = "CamembertConfig" -TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - # See all CamemBERT models at https://huggingface.co/models?filter=camembert -] - CAMEMBERT_START_DOCSTRING = r""" diff --git a/src/transformers/models/camembert/tokenization_camembert.py b/src/transformers/models/camembert/tokenization_camembert.py index 0949db02fbb850..51d70b198bba4a 100644 --- a/src/transformers/models/camembert/tokenization_camembert.py +++ b/src/transformers/models/camembert/tokenization_camembert.py @@ -29,15 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "almanach/camembert-base": "https://huggingface.co/almanach/camembert-base/resolve/main/sentencepiece.bpe.model", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "almanach/camembert-base": 512, -} SPIECE_UNDERLINE = "▁" @@ -113,8 +104,6 @@ class CamembertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/camembert/tokenization_camembert_fast.py b/src/transformers/models/camembert/tokenization_camembert_fast.py index 627971eb51db3e..d1f0db688a464a 100644 --- a/src/transformers/models/camembert/tokenization_camembert_fast.py +++ b/src/transformers/models/camembert/tokenization_camembert_fast.py @@ -34,18 +34,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "almanach/camembert-base": "https://huggingface.co/almanach/camembert-base/resolve/main/sentencepiece.bpe.model", - }, - "tokenizer_file": { - "almanach/camembert-base": "https://huggingface.co/almanach/camembert-base/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "almanach/camembert-base": 512, -} SPIECE_UNDERLINE = "▁" @@ -103,8 +91,6 @@ class CamembertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = CamembertTokenizer diff --git a/src/transformers/models/canine/__init__.py b/src/transformers/models/canine/__init__.py index d036045e2f2156..93f103344d476b 100644 --- a/src/transformers/models/canine/__init__.py +++ b/src/transformers/models/canine/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_canine": ["CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP", "CanineConfig"], + "configuration_canine": ["CanineConfig"], "tokenization_canine": ["CanineTokenizer"], } @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_canine"] = [ - "CANINE_PRETRAINED_MODEL_ARCHIVE_LIST", "CanineForMultipleChoice", "CanineForQuestionAnswering", "CanineForSequenceClassification", @@ -41,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_canine import CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP, CanineConfig + from .configuration_canine import CanineConfig from .tokenization_canine import CanineTokenizer try: @@ -51,7 +50,6 @@ pass else: from .modeling_canine import ( - CANINE_PRETRAINED_MODEL_ARCHIVE_LIST, CanineForMultipleChoice, CanineForQuestionAnswering, CanineForSequenceClassification, diff --git a/src/transformers/models/canine/configuration_canine.py b/src/transformers/models/canine/configuration_canine.py index f1e1bb415892a2..e3d2d1373b9983 100644 --- a/src/transformers/models/canine/configuration_canine.py +++ b/src/transformers/models/canine/configuration_canine.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/canine-s": "https://huggingface.co/google/canine-s/resolve/main/config.json", - # See all CANINE models at https://huggingface.co/models?filter=canine -} - class CanineConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/canine/modeling_canine.py b/src/transformers/models/canine/modeling_canine.py index 378a5775256f70..5454fbcd749184 100644 --- a/src/transformers/models/canine/modeling_canine.py +++ b/src/transformers/models/canine/modeling_canine.py @@ -52,11 +52,6 @@ _CHECKPOINT_FOR_DOC = "google/canine-s" _CONFIG_FOR_DOC = "CanineConfig" -CANINE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/canine-s", - "google/canine-r", - # See all CANINE models at https://huggingface.co/models?filter=canine -] # Support up to 16 hash functions. _PRIMES = [31, 43, 59, 61, 73, 97, 103, 113, 137, 149, 157, 173, 181, 193, 211, 223] diff --git a/src/transformers/models/canine/tokenization_canine.py b/src/transformers/models/canine/tokenization_canine.py index 25932ae75d2a87..024507f77877d7 100644 --- a/src/transformers/models/canine/tokenization_canine.py +++ b/src/transformers/models/canine/tokenization_canine.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "nielsr/canine-s": 2048, -} - # Unicode defines 1,114,112 total “codepoints” UNICODE_VOCAB_SIZE = 1114112 @@ -73,8 +69,6 @@ class CanineTokenizer(PreTrainedTokenizer): The maximum sentence length the model accepts. """ - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - def __init__( self, bos_token=chr(CLS), diff --git a/src/transformers/models/chinese_clip/__init__.py b/src/transformers/models/chinese_clip/__init__.py index dbc0a57e8324f3..03c9665ab0d09f 100644 --- a/src/transformers/models/chinese_clip/__init__.py +++ b/src/transformers/models/chinese_clip/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_chinese_clip": [ - "CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ChineseCLIPConfig", "ChineseCLIPOnnxConfig", "ChineseCLIPTextConfig", @@ -43,7 +42,6 @@ pass else: _import_structure["modeling_chinese_clip"] = [ - "CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "ChineseCLIPModel", "ChineseCLIPPreTrainedModel", "ChineseCLIPTextModel", @@ -52,7 +50,6 @@ if TYPE_CHECKING: from .configuration_chinese_clip import ( - CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, ChineseCLIPConfig, ChineseCLIPOnnxConfig, ChineseCLIPTextConfig, @@ -75,7 +72,6 @@ pass else: from .modeling_chinese_clip import ( - CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, ChineseCLIPModel, ChineseCLIPPreTrainedModel, ChineseCLIPTextModel, diff --git a/src/transformers/models/chinese_clip/configuration_chinese_clip.py b/src/transformers/models/chinese_clip/configuration_chinese_clip.py index 53b6d49b3f6698..0cd73f67f2d121 100644 --- a/src/transformers/models/chinese_clip/configuration_chinese_clip.py +++ b/src/transformers/models/chinese_clip/configuration_chinese_clip.py @@ -30,12 +30,6 @@ logger = logging.get_logger(__name__) -CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "OFA-Sys/chinese-clip-vit-base-patch16": ( - "https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16/resolve/main/config.json" - ), -} - class ChineseCLIPTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/chinese_clip/modeling_chinese_clip.py b/src/transformers/models/chinese_clip/modeling_chinese_clip.py index a16fb081b19357..d8efd8334e67f1 100644 --- a/src/transformers/models/chinese_clip/modeling_chinese_clip.py +++ b/src/transformers/models/chinese_clip/modeling_chinese_clip.py @@ -48,11 +48,6 @@ _CHECKPOINT_FOR_DOC = "OFA-Sys/chinese-clip-vit-base-patch16" _CONFIG_FOR_DOC = "ChineseCLIPConfig" -CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "OFA-Sys/chinese-clip-vit-base-patch16", - # See all Chinese-CLIP models at https://huggingface.co/models?filter=chinese_clip -] - # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html # Copied from transformers.models.clip.modeling_clip.contrastive_loss diff --git a/src/transformers/models/clap/__init__.py b/src/transformers/models/clap/__init__.py index 57e39b6e1fa660..4d3d3ba04e136f 100644 --- a/src/transformers/models/clap/__init__.py +++ b/src/transformers/models/clap/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_clap": [ - "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapAudioConfig", "ClapConfig", "ClapTextConfig", @@ -33,7 +32,6 @@ pass else: _import_structure["modeling_clap"] = [ - "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapModel", "ClapPreTrainedModel", "ClapTextModel", @@ -45,7 +43,6 @@ if TYPE_CHECKING: from .configuration_clap import ( - CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioConfig, ClapConfig, ClapTextConfig, @@ -60,7 +57,6 @@ else: from .feature_extraction_clap import ClapFeatureExtractor from .modeling_clap import ( - CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioModel, ClapAudioModelWithProjection, ClapModel, diff --git a/src/transformers/models/clap/configuration_clap.py b/src/transformers/models/clap/configuration_clap.py index 1a02d8460937d0..0a36402249e210 100644 --- a/src/transformers/models/clap/configuration_clap.py +++ b/src/transformers/models/clap/configuration_clap.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -CLAP_PRETRAINED_MODEL_ARCHIVE_LIST = { - "laion/clap-htsat-fused": "https://huggingface.co/laion/clap-htsat-fused/resolve/main/config.json", - "laion/clap-htsat-unfused": "https://huggingface.co/laion/clap-htsat-unfused/resolve/main/config.json", -} - class ClapTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/clap/modeling_clap.py b/src/transformers/models/clap/modeling_clap.py index 6310b9675fb654..2d8d7e458c1f04 100644 --- a/src/transformers/models/clap/modeling_clap.py +++ b/src/transformers/models/clap/modeling_clap.py @@ -44,12 +44,6 @@ _CHECKPOINT_FOR_DOC = "laion/clap-htsat-fused" -CLAP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "laion/clap-htsat-fused", - "laion/clap-htsat-unfused", - # See all clap models at https://huggingface.co/models?filter=clap -] - # Adapted from: https://github.com/LAION-AI/CLAP/blob/6ad05a971ba0622f6acee8c41993e0d02bbed639/src/open_clip/utils.py#L191 def interpolate(hidden_states, ratio): diff --git a/src/transformers/models/clip/__init__.py b/src/transformers/models/clip/__init__.py index 868c46616e9b33..36247e943ecaf7 100644 --- a/src/transformers/models/clip/__init__.py +++ b/src/transformers/models/clip/__init__.py @@ -26,7 +26,6 @@ _import_structure = { "configuration_clip": [ - "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPConfig", "CLIPOnnxConfig", "CLIPTextConfig", @@ -60,7 +59,6 @@ pass else: _import_structure["modeling_clip"] = [ - "CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPModel", "CLIPPreTrainedModel", "CLIPTextModel", @@ -77,7 +75,6 @@ pass else: _import_structure["modeling_tf_clip"] = [ - "TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCLIPModel", "TFCLIPPreTrainedModel", "TFCLIPTextModel", @@ -103,7 +100,6 @@ if TYPE_CHECKING: from .configuration_clip import ( - CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPConfig, CLIPOnnxConfig, CLIPTextConfig, @@ -136,7 +132,6 @@ pass else: from .modeling_clip import ( - CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPForImageClassification, CLIPModel, CLIPPreTrainedModel, @@ -153,7 +148,6 @@ pass else: from .modeling_tf_clip import ( - TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFCLIPModel, TFCLIPPreTrainedModel, TFCLIPTextModel, diff --git a/src/transformers/models/clip/configuration_clip.py b/src/transformers/models/clip/configuration_clip.py index 8c3e30ee0517af..827fe31d5b4533 100644 --- a/src/transformers/models/clip/configuration_clip.py +++ b/src/transformers/models/clip/configuration_clip.py @@ -30,11 +30,6 @@ logger = logging.get_logger(__name__) -CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/config.json", - # See all CLIP models at https://huggingface.co/models?filter=clip -} - class CLIPTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/clip/modeling_clip.py b/src/transformers/models/clip/modeling_clip.py index 06ee5f6e325db4..6e4e936f409cfe 100644 --- a/src/transformers/models/clip/modeling_clip.py +++ b/src/transformers/models/clip/modeling_clip.py @@ -48,11 +48,6 @@ _IMAGE_CLASS_CHECKPOINT = "openai/clip-vit-base-patch32" _IMAGE_CLASS_EXPECTED_OUTPUT = "LABEL_0" -CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai/clip-vit-base-patch32", - # See all CLIP models at https://huggingface.co/models?filter=clip -] - # contrastive loss function, adapted from # https://sachinruk.github.io/blog/2021-03-07-clip.html diff --git a/src/transformers/models/clip/modeling_tf_clip.py b/src/transformers/models/clip/modeling_tf_clip.py index d8dd7f0bd83c40..142141fdc4df4d 100644 --- a/src/transformers/models/clip/modeling_tf_clip.py +++ b/src/transformers/models/clip/modeling_tf_clip.py @@ -51,11 +51,6 @@ _CHECKPOINT_FOR_DOC = "openai/clip-vit-base-patch32" -TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai/clip-vit-base-patch32", - # See all CLIP models at https://huggingface.co/models?filter=clip -] - LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/clip/tokenization_clip.py b/src/transformers/models/clip/tokenization_clip.py index f62ef65c5ede02..7b4ad88b80a9e0 100644 --- a/src/transformers/models/clip/tokenization_clip.py +++ b/src/transformers/models/clip/tokenization_clip.py @@ -33,24 +33,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/vocab.json", - }, - "merges_file": { - "openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openai/clip-vit-base-patch32": 77, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "openai/clip-vit-base-patch32": {}, -} - @lru_cache() def bytes_to_unicode(): @@ -296,8 +278,6 @@ class CLIPTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/clip/tokenization_clip_fast.py b/src/transformers/models/clip/tokenization_clip_fast.py index 3b092b0f8d50fc..6198958a034f43 100644 --- a/src/transformers/models/clip/tokenization_clip_fast.py +++ b/src/transformers/models/clip/tokenization_clip_fast.py @@ -28,24 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/vocab.json", - }, - "merges_file": { - "openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/merges.txt", - }, - "tokenizer_file": { - "openai/clip-vit-base-patch32": ( - "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openai/clip-vit-base-patch32": 77, -} - class CLIPTokenizerFast(PreTrainedTokenizerFast): """ @@ -74,8 +56,6 @@ class CLIPTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = CLIPTokenizer diff --git a/src/transformers/models/clipseg/__init__.py b/src/transformers/models/clipseg/__init__.py index 0e2e250e507a81..cb7daf11553efd 100644 --- a/src/transformers/models/clipseg/__init__.py +++ b/src/transformers/models/clipseg/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_clipseg": [ - "CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPSegConfig", "CLIPSegTextConfig", "CLIPSegVisionConfig", @@ -33,7 +32,6 @@ pass else: _import_structure["modeling_clipseg"] = [ - "CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPSegModel", "CLIPSegPreTrainedModel", "CLIPSegTextModel", @@ -43,7 +41,6 @@ if TYPE_CHECKING: from .configuration_clipseg import ( - CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPSegConfig, CLIPSegTextConfig, CLIPSegVisionConfig, @@ -57,7 +54,6 @@ pass else: from .modeling_clipseg import ( - CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPSegForImageSegmentation, CLIPSegModel, CLIPSegPreTrainedModel, diff --git a/src/transformers/models/clipseg/configuration_clipseg.py b/src/transformers/models/clipseg/configuration_clipseg.py index 555d226e10d507..7df10bfe8cf771 100644 --- a/src/transformers/models/clipseg/configuration_clipseg.py +++ b/src/transformers/models/clipseg/configuration_clipseg.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "CIDAS/clipseg-rd64": "https://huggingface.co/CIDAS/clipseg-rd64/resolve/main/config.json", -} - class CLIPSegTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/clipseg/modeling_clipseg.py b/src/transformers/models/clipseg/modeling_clipseg.py index b250e09ad26dc9..a6d63fc92e6128 100644 --- a/src/transformers/models/clipseg/modeling_clipseg.py +++ b/src/transformers/models/clipseg/modeling_clipseg.py @@ -42,11 +42,6 @@ _CHECKPOINT_FOR_DOC = "CIDAS/clipseg-rd64-refined" -CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "CIDAS/clipseg-rd64-refined", - # See all CLIPSeg models at https://huggingface.co/models?filter=clipseg -] - # contrastive loss function, adapted from # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html diff --git a/src/transformers/models/clvp/__init__.py b/src/transformers/models/clvp/__init__.py index fb88e24171c369..6ef4bc60e32148 100644 --- a/src/transformers/models/clvp/__init__.py +++ b/src/transformers/models/clvp/__init__.py @@ -22,7 +22,6 @@ _import_structure = { "configuration_clvp": [ - "CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ClvpConfig", "ClvpDecoderConfig", "ClvpEncoderConfig", @@ -40,7 +39,6 @@ pass else: _import_structure["modeling_clvp"] = [ - "CLVP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClvpModelForConditionalGeneration", "ClvpForCausalLM", "ClvpModel", @@ -52,7 +50,6 @@ if TYPE_CHECKING: from .configuration_clvp import ( - CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP, ClvpConfig, ClvpDecoderConfig, ClvpEncoderConfig, @@ -68,7 +65,6 @@ pass else: from .modeling_clvp import ( - CLVP_PRETRAINED_MODEL_ARCHIVE_LIST, ClvpDecoder, ClvpEncoder, ClvpForCausalLM, diff --git a/src/transformers/models/clvp/configuration_clvp.py b/src/transformers/models/clvp/configuration_clvp.py index 3d20b5c16d5d10..505238b2a8a7fb 100644 --- a/src/transformers/models/clvp/configuration_clvp.py +++ b/src/transformers/models/clvp/configuration_clvp.py @@ -28,10 +28,6 @@ logger = logging.get_logger(__name__) -CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "susnato/clvp_dev": "https://huggingface.co/susnato/clvp_dev/resolve/main/config.json", -} - class ClvpEncoderConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/clvp/modeling_clvp.py b/src/transformers/models/clvp/modeling_clvp.py index b660f54e5d820f..a36e9822421ecc 100644 --- a/src/transformers/models/clvp/modeling_clvp.py +++ b/src/transformers/models/clvp/modeling_clvp.py @@ -55,11 +55,6 @@ _CHECKPOINT_FOR_DOC = "susnato/clvp_dev" -CLVP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "susnato/clvp_dev", - # See all Clvp models at https://huggingface.co/models?filter=clvp -] - # Copied from transformers.models.clip.modeling_clip.contrastive_loss def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/clvp/tokenization_clvp.py b/src/transformers/models/clvp/tokenization_clvp.py index f09245f94be8c5..d77564f718a53b 100644 --- a/src/transformers/models/clvp/tokenization_clvp.py +++ b/src/transformers/models/clvp/tokenization_clvp.py @@ -33,19 +33,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "clvp_dev": "https://huggingface.co/susnato/clvp_dev/blob/main/vocab.json", - }, - "merges_file": { - "clvp_dev": "https://huggingface.co/susnato/clvp_dev/blob/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "clvp_dev": 1024, -} - @lru_cache() # Copied from transformers.models.gpt2.tokenization_gpt2.bytes_to_unicode @@ -145,8 +132,6 @@ class ClvpTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = [ "input_ids", "attention_mask", diff --git a/src/transformers/models/code_llama/tokenization_code_llama.py b/src/transformers/models/code_llama/tokenization_code_llama.py index db280bbc156150..fa1433e107b925 100644 --- a/src/transformers/models/code_llama/tokenization_code_llama.py +++ b/src/transformers/models/code_llama/tokenization_code_llama.py @@ -30,17 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "tokenizer.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "hf-internal-testing/llama-code-tokenizer": "https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer.model", - }, - "tokenizer_file": { - "hf-internal-testing/llama-code-tokenizer": "https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer_config.json", - }, -} -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "hf-internal-testing/llama-code-tokenizer": 2048, -} SPIECE_UNDERLINE = "▁" B_INST, E_INST = "[INST]", "[/INST]" @@ -123,8 +112,6 @@ class CodeLlamaTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/codegen/__init__.py b/src/transformers/models/codegen/__init__.py index a1ce89620035d5..7d4cb05adb20e9 100644 --- a/src/transformers/models/codegen/__init__.py +++ b/src/transformers/models/codegen/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_codegen": ["CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "CodeGenConfig", "CodeGenOnnxConfig"], + "configuration_codegen": ["CodeGenConfig", "CodeGenOnnxConfig"], "tokenization_codegen": ["CodeGenTokenizer"], } @@ -36,14 +36,13 @@ pass else: _import_structure["modeling_codegen"] = [ - "CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "CodeGenForCausalLM", "CodeGenModel", "CodeGenPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_codegen import CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, CodeGenConfig, CodeGenOnnxConfig + from .configuration_codegen import CodeGenConfig, CodeGenOnnxConfig from .tokenization_codegen import CodeGenTokenizer try: @@ -61,7 +60,6 @@ pass else: from .modeling_codegen import ( - CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST, CodeGenForCausalLM, CodeGenModel, CodeGenPreTrainedModel, diff --git a/src/transformers/models/codegen/configuration_codegen.py b/src/transformers/models/codegen/configuration_codegen.py index 73c019870f1f6a..db0008a033312b 100644 --- a/src/transformers/models/codegen/configuration_codegen.py +++ b/src/transformers/models/codegen/configuration_codegen.py @@ -25,22 +25,6 @@ logger = logging.get_logger(__name__) -CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Salesforce/codegen-350M-nl": "https://huggingface.co/Salesforce/codegen-350M-nl/resolve/main/config.json", - "Salesforce/codegen-350M-multi": "https://huggingface.co/Salesforce/codegen-350M-multi/resolve/main/config.json", - "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/config.json", - "Salesforce/codegen-2B-nl": "https://huggingface.co/Salesforce/codegen-2B-nl/resolve/main/config.json", - "Salesforce/codegen-2B-multi": "https://huggingface.co/Salesforce/codegen-2B-multi/resolve/main/config.json", - "Salesforce/codegen-2B-mono": "https://huggingface.co/Salesforce/codegen-2B-mono/resolve/main/config.json", - "Salesforce/codegen-6B-nl": "https://huggingface.co/Salesforce/codegen-6B-nl/resolve/main/config.json", - "Salesforce/codegen-6B-multi": "https://huggingface.co/Salesforce/codegen-6B-multi/resolve/main/config.json", - "Salesforce/codegen-6B-mono": "https://huggingface.co/Salesforce/codegen-6B-mono/resolve/main/config.json", - "Salesforce/codegen-16B-nl": "https://huggingface.co/Salesforce/codegen-16B-nl/resolve/main/config.json", - "Salesforce/codegen-16B-multi": "https://huggingface.co/Salesforce/codegen-16B-multi/resolve/main/config.json", - "Salesforce/codegen-16B-mono": "https://huggingface.co/Salesforce/codegen-16B-mono/resolve/main/config.json", -} - - class CodeGenConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`CodeGenModel`]. It is used to instantiate a diff --git a/src/transformers/models/codegen/modeling_codegen.py b/src/transformers/models/codegen/modeling_codegen.py index f37ceccaace988..7014616d74edd8 100644 --- a/src/transformers/models/codegen/modeling_codegen.py +++ b/src/transformers/models/codegen/modeling_codegen.py @@ -34,23 +34,6 @@ _CONFIG_FOR_DOC = "CodeGenConfig" -CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Salesforce/codegen-350M-nl", - "Salesforce/codegen-350M-multi", - "Salesforce/codegen-350M-mono", - "Salesforce/codegen-2B-nl", - "Salesforce/codegen-2B-multi", - "Salesforce/codegen-2B-mono", - "Salesforce/codegen-6B-nl", - "Salesforce/codegen-6B-multi", - "Salesforce/codegen-6B-mono", - "Salesforce/codegen-16B-nl", - "Salesforce/codegen-16B-multi", - "Salesforce/codegen-16B-mono", - # See all CodeGen models at https://huggingface.co/models?filter=codegen -] - - # Copied from transformers.models.gptj.modeling_gptj.create_sinusoidal_positions def create_sinusoidal_positions(num_pos: int, dim: int) -> torch.Tensor: inv_freq = 1.0 / (10000 ** (torch.arange(0, dim, 2, dtype=torch.int64) / dim)) diff --git a/src/transformers/models/codegen/tokenization_codegen.py b/src/transformers/models/codegen/tokenization_codegen.py index c79a6d46e4ad34..abf64e1892250e 100644 --- a/src/transformers/models/codegen/tokenization_codegen.py +++ b/src/transformers/models/codegen/tokenization_codegen.py @@ -42,19 +42,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/vocab.json", - }, - "merges_file": { - "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "Salesforce/codegen-350M-mono": 2048, -} - @lru_cache() def bytes_to_unicode(): @@ -150,8 +137,6 @@ class CodeGenTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/codegen/tokenization_codegen_fast.py b/src/transformers/models/codegen/tokenization_codegen_fast.py index 3c2661db396162..fb9f0442e03001 100644 --- a/src/transformers/models/codegen/tokenization_codegen_fast.py +++ b/src/transformers/models/codegen/tokenization_codegen_fast.py @@ -41,24 +41,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/vocab.json", - }, - "merges_file": { - "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/merges.txt", - }, - "tokenizer_file": { - "Salesforce/codegen-350M-mono": ( - "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "Salesforce/codegen-350M-mono": 2048, -} - class CodeGenTokenizerFast(PreTrainedTokenizerFast): """ @@ -112,8 +94,6 @@ class CodeGenTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = CodeGenTokenizer diff --git a/src/transformers/models/conditional_detr/__init__.py b/src/transformers/models/conditional_detr/__init__.py index 565323321160ff..c7d5c5261d6e67 100644 --- a/src/transformers/models/conditional_detr/__init__.py +++ b/src/transformers/models/conditional_detr/__init__.py @@ -19,7 +19,6 @@ _import_structure = { "configuration_conditional_detr": [ - "CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConditionalDetrConfig", "ConditionalDetrOnnxConfig", ] @@ -41,7 +40,6 @@ pass else: _import_structure["modeling_conditional_detr"] = [ - "CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "ConditionalDetrForObjectDetection", "ConditionalDetrForSegmentation", "ConditionalDetrModel", @@ -51,7 +49,6 @@ if TYPE_CHECKING: from .configuration_conditional_detr import ( - CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, ConditionalDetrConfig, ConditionalDetrOnnxConfig, ) @@ -72,7 +69,6 @@ pass else: from .modeling_conditional_detr import ( - CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, ConditionalDetrForObjectDetection, ConditionalDetrForSegmentation, ConditionalDetrModel, diff --git a/src/transformers/models/conditional_detr/configuration_conditional_detr.py b/src/transformers/models/conditional_detr/configuration_conditional_detr.py index 7a6cd436385852..e7c454d97c1c3c 100644 --- a/src/transformers/models/conditional_detr/configuration_conditional_detr.py +++ b/src/transformers/models/conditional_detr/configuration_conditional_detr.py @@ -26,12 +26,6 @@ logger = logging.get_logger(__name__) -CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/conditional-detr-resnet-50": ( - "https://huggingface.co/microsoft/conditional-detr-resnet-50/resolve/main/config.json" - ), -} - class ConditionalDetrConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/conditional_detr/modeling_conditional_detr.py b/src/transformers/models/conditional_detr/modeling_conditional_detr.py index b6ea7cdf4cc3af..2ee644c3639e1a 100644 --- a/src/transformers/models/conditional_detr/modeling_conditional_detr.py +++ b/src/transformers/models/conditional_detr/modeling_conditional_detr.py @@ -60,11 +60,6 @@ _CONFIG_FOR_DOC = "ConditionalDetrConfig" _CHECKPOINT_FOR_DOC = "microsoft/conditional-detr-resnet-50" -CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/conditional-detr-resnet-50", - # See all Conditional DETR models at https://huggingface.co/models?filter=conditional_detr -] - @dataclass class ConditionalDetrDecoderOutput(BaseModelOutputWithCrossAttentions): diff --git a/src/transformers/models/convbert/__init__.py b/src/transformers/models/convbert/__init__.py index f1b19a949abbef..15c6bb51767af1 100644 --- a/src/transformers/models/convbert/__init__.py +++ b/src/transformers/models/convbert/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_convbert": ["CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvBertConfig", "ConvBertOnnxConfig"], + "configuration_convbert": ["ConvBertConfig", "ConvBertOnnxConfig"], "tokenization_convbert": ["ConvBertTokenizer"], } @@ -42,7 +42,6 @@ pass else: _import_structure["modeling_convbert"] = [ - "CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvBertForMaskedLM", "ConvBertForMultipleChoice", "ConvBertForQuestionAnswering", @@ -62,7 +61,6 @@ pass else: _import_structure["modeling_tf_convbert"] = [ - "TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFConvBertForMaskedLM", "TFConvBertForMultipleChoice", "TFConvBertForQuestionAnswering", @@ -75,7 +73,7 @@ if TYPE_CHECKING: - from .configuration_convbert import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertOnnxConfig + from .configuration_convbert import ConvBertConfig, ConvBertOnnxConfig from .tokenization_convbert import ConvBertTokenizer try: @@ -93,7 +91,6 @@ pass else: from .modeling_convbert import ( - CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvBertForMaskedLM, ConvBertForMultipleChoice, ConvBertForQuestionAnswering, @@ -112,7 +109,6 @@ pass else: from .modeling_tf_convbert import ( - TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFConvBertForMaskedLM, TFConvBertForMultipleChoice, TFConvBertForQuestionAnswering, diff --git a/src/transformers/models/convbert/configuration_convbert.py b/src/transformers/models/convbert/configuration_convbert.py index 62019796664660..82d555cd3a3ccf 100644 --- a/src/transformers/models/convbert/configuration_convbert.py +++ b/src/transformers/models/convbert/configuration_convbert.py @@ -24,15 +24,6 @@ logger = logging.get_logger(__name__) -CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "YituTech/conv-bert-base": "https://huggingface.co/YituTech/conv-bert-base/resolve/main/config.json", - "YituTech/conv-bert-medium-small": ( - "https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/config.json" - ), - "YituTech/conv-bert-small": "https://huggingface.co/YituTech/conv-bert-small/resolve/main/config.json", - # See all ConvBERT models at https://huggingface.co/models?filter=convbert -} - class ConvBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/convbert/modeling_convbert.py b/src/transformers/models/convbert/modeling_convbert.py index 032b9d0ce18ba3..dd5d06ef92541c 100755 --- a/src/transformers/models/convbert/modeling_convbert.py +++ b/src/transformers/models/convbert/modeling_convbert.py @@ -45,13 +45,6 @@ _CHECKPOINT_FOR_DOC = "YituTech/conv-bert-base" _CONFIG_FOR_DOC = "ConvBertConfig" -CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "YituTech/conv-bert-base", - "YituTech/conv-bert-medium-small", - "YituTech/conv-bert-small", - # See all ConvBERT models at https://huggingface.co/models?filter=convbert -] - def load_tf_weights_in_convbert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/convbert/modeling_tf_convbert.py b/src/transformers/models/convbert/modeling_tf_convbert.py index e6855c68e2f8a9..a8ac11a8cdf910 100644 --- a/src/transformers/models/convbert/modeling_tf_convbert.py +++ b/src/transformers/models/convbert/modeling_tf_convbert.py @@ -60,13 +60,6 @@ _CHECKPOINT_FOR_DOC = "YituTech/conv-bert-base" _CONFIG_FOR_DOC = "ConvBertConfig" -TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "YituTech/conv-bert-base", - "YituTech/conv-bert-medium-small", - "YituTech/conv-bert-small", - # See all ConvBERT models at https://huggingface.co/models?filter=convbert -] - # Copied from transformers.models.albert.modeling_tf_albert.TFAlbertEmbeddings with Albert->ConvBert class TFConvBertEmbeddings(keras.layers.Layer): diff --git a/src/transformers/models/convbert/tokenization_convbert.py b/src/transformers/models/convbert/tokenization_convbert.py index 8c359886cf7435..c0fe2c018341c5 100644 --- a/src/transformers/models/convbert/tokenization_convbert.py +++ b/src/transformers/models/convbert/tokenization_convbert.py @@ -26,29 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "YituTech/conv-bert-base": "https://huggingface.co/YituTech/conv-bert-base/resolve/main/vocab.txt", - "YituTech/conv-bert-medium-small": ( - "https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/vocab.txt" - ), - "YituTech/conv-bert-small": "https://huggingface.co/YituTech/conv-bert-small/resolve/main/vocab.txt", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "YituTech/conv-bert-base": 512, - "YituTech/conv-bert-medium-small": 512, - "YituTech/conv-bert-small": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "YituTech/conv-bert-base": {"do_lower_case": True}, - "YituTech/conv-bert-medium-small": {"do_lower_case": True}, - "YituTech/conv-bert-small": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -116,9 +93,6 @@ class ConvBertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/convbert/tokenization_convbert_fast.py b/src/transformers/models/convbert/tokenization_convbert_fast.py index 14909876ded885..65bedb73fe9171 100644 --- a/src/transformers/models/convbert/tokenization_convbert_fast.py +++ b/src/transformers/models/convbert/tokenization_convbert_fast.py @@ -27,29 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "YituTech/conv-bert-base": "https://huggingface.co/YituTech/conv-bert-base/resolve/main/vocab.txt", - "YituTech/conv-bert-medium-small": ( - "https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/vocab.txt" - ), - "YituTech/conv-bert-small": "https://huggingface.co/YituTech/conv-bert-small/resolve/main/vocab.txt", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "YituTech/conv-bert-base": 512, - "YituTech/conv-bert-medium-small": 512, - "YituTech/conv-bert-small": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "YituTech/conv-bert-base": {"do_lower_case": True}, - "YituTech/conv-bert-medium-small": {"do_lower_case": True}, - "YituTech/conv-bert-small": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert_fast.BertTokenizerFast with bert-base-cased->YituTech/conv-bert-base, Bert->ConvBert, BERT->ConvBERT class ConvBertTokenizerFast(PreTrainedTokenizerFast): @@ -93,9 +70,6 @@ class ConvBertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = ConvBertTokenizer def __init__( diff --git a/src/transformers/models/convnext/__init__.py b/src/transformers/models/convnext/__init__.py index 099a7fc9d63da4..4e9a90bd4deb33 100644 --- a/src/transformers/models/convnext/__init__.py +++ b/src/transformers/models/convnext/__init__.py @@ -22,9 +22,7 @@ ) -_import_structure = { - "configuration_convnext": ["CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvNextConfig", "ConvNextOnnxConfig"] -} +_import_structure = {"configuration_convnext": ["ConvNextConfig", "ConvNextOnnxConfig"]} try: if not is_vision_available(): @@ -42,7 +40,6 @@ pass else: _import_structure["modeling_convnext"] = [ - "CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextForImageClassification", "ConvNextModel", "ConvNextPreTrainedModel", @@ -62,7 +59,7 @@ ] if TYPE_CHECKING: - from .configuration_convnext import CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextConfig, ConvNextOnnxConfig + from .configuration_convnext import ConvNextConfig, ConvNextOnnxConfig try: if not is_vision_available(): @@ -80,7 +77,6 @@ pass else: from .modeling_convnext import ( - CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextBackbone, ConvNextForImageClassification, ConvNextModel, diff --git a/src/transformers/models/convnext/configuration_convnext.py b/src/transformers/models/convnext/configuration_convnext.py index 48647bd1224ecd..2549f06b9940dc 100644 --- a/src/transformers/models/convnext/configuration_convnext.py +++ b/src/transformers/models/convnext/configuration_convnext.py @@ -27,11 +27,6 @@ logger = logging.get_logger(__name__) -CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/convnext-tiny-224": "https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json", - # See all ConvNeXT models at https://huggingface.co/models?filter=convnext -} - class ConvNextConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/convnext/modeling_convnext.py b/src/transformers/models/convnext/modeling_convnext.py index a952e5d8165e15..68d23dd1b8ca70 100755 --- a/src/transformers/models/convnext/modeling_convnext.py +++ b/src/transformers/models/convnext/modeling_convnext.py @@ -54,11 +54,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/convnext-tiny-224" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/convnext-tiny-224", - # See all ConvNext models at https://huggingface.co/models?filter=convnext -] - # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/src/transformers/models/convnextv2/__init__.py b/src/transformers/models/convnextv2/__init__.py index d2a484b9b82850..5505868c14a4f4 100644 --- a/src/transformers/models/convnextv2/__init__.py +++ b/src/transformers/models/convnextv2/__init__.py @@ -26,12 +26,7 @@ ) -_import_structure = { - "configuration_convnextv2": [ - "CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP", - "ConvNextV2Config", - ] -} +_import_structure = {"configuration_convnextv2": ["ConvNextV2Config"]} try: if not is_torch_available(): @@ -40,7 +35,6 @@ pass else: _import_structure["modeling_convnextv2"] = [ - "CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextV2ForImageClassification", "ConvNextV2Model", "ConvNextV2PreTrainedModel", @@ -61,7 +55,6 @@ if TYPE_CHECKING: from .configuration_convnextv2 import ( - CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextV2Config, ) @@ -72,7 +65,6 @@ pass else: from .modeling_convnextv2 import ( - CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextV2Backbone, ConvNextV2ForImageClassification, ConvNextV2Model, diff --git a/src/transformers/models/convnextv2/configuration_convnextv2.py b/src/transformers/models/convnextv2/configuration_convnextv2.py index 3d7d1fa7397714..e7692250b2c186 100644 --- a/src/transformers/models/convnextv2/configuration_convnextv2.py +++ b/src/transformers/models/convnextv2/configuration_convnextv2.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json", -} - class ConvNextV2Config(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/convnextv2/modeling_convnextv2.py b/src/transformers/models/convnextv2/modeling_convnextv2.py index 8d166200d12253..881a995d312c54 100644 --- a/src/transformers/models/convnextv2/modeling_convnextv2.py +++ b/src/transformers/models/convnextv2/modeling_convnextv2.py @@ -54,11 +54,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/convnextv2-tiny-1k-224" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/convnextv2-tiny-1k-224", - # See all ConvNextV2 models at https://huggingface.co/models?filter=convnextv2 -] - # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/src/transformers/models/convnextv2/modeling_tf_convnextv2.py b/src/transformers/models/convnextv2/modeling_tf_convnextv2.py index d4bef6f161d2bf..0debe6fd0c54d6 100644 --- a/src/transformers/models/convnextv2/modeling_tf_convnextv2.py +++ b/src/transformers/models/convnextv2/modeling_tf_convnextv2.py @@ -61,11 +61,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/convnextv2-tiny-1k-224" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/convnextv2-tiny-1k-224", - # See all ConvNextV2 models at https://huggingface.co/models?filter=convnextv2 -] - # Copied from transformers.models.convnext.modeling_tf_convnext.TFConvNextDropPath with ConvNext->ConvNextV2 class TFConvNextV2DropPath(keras.layers.Layer): diff --git a/src/transformers/models/cpm/tokenization_cpm.py b/src/transformers/models/cpm/tokenization_cpm.py index 67281b3cf185f8..ac454898b5572a 100644 --- a/src/transformers/models/cpm/tokenization_cpm.py +++ b/src/transformers/models/cpm/tokenization_cpm.py @@ -28,18 +28,11 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "TsinghuaAI/CPM-Generate": "https://huggingface.co/TsinghuaAI/CPM-Generate/resolve/main/spiece.model", - } -} - class CpmTokenizer(PreTrainedTokenizer): """Runs pre-tokenization with Jieba segmentation tool. It is used in CPM models.""" vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP def __init__( self, diff --git a/src/transformers/models/cpm/tokenization_cpm_fast.py b/src/transformers/models/cpm/tokenization_cpm_fast.py index 8e8f927e813b64..9b7b6da118ab4b 100644 --- a/src/transformers/models/cpm/tokenization_cpm_fast.py +++ b/src/transformers/models/cpm/tokenization_cpm_fast.py @@ -25,15 +25,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "TsinghuaAI/CPM-Generate": "https://huggingface.co/TsinghuaAI/CPM-Generate/resolve/main/spiece.model", - }, - "tokenizer_file": { - "TsinghuaAI/CPM-Generate": "https://huggingface.co/TsinghuaAI/CPM-Generate/resolve/main/tokenizer.json", - }, -} - class CpmTokenizerFast(PreTrainedTokenizerFast): """Runs pre-tokenization with Jieba segmentation tool. It is used in CPM models.""" diff --git a/src/transformers/models/cpmant/__init__.py b/src/transformers/models/cpmant/__init__.py index 8140009b60f156..61db942a4f66bd 100644 --- a/src/transformers/models/cpmant/__init__.py +++ b/src/transformers/models/cpmant/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_cpmant": ["CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CpmAntConfig"], + "configuration_cpmant": ["CpmAntConfig"], "tokenization_cpmant": ["CpmAntTokenizer"], } @@ -33,7 +33,6 @@ pass else: _import_structure["modeling_cpmant"] = [ - "CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST", "CpmAntForCausalLM", "CpmAntModel", "CpmAntPreTrainedModel", @@ -41,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_cpmant import CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP, CpmAntConfig + from .configuration_cpmant import CpmAntConfig from .tokenization_cpmant import CpmAntTokenizer try: @@ -51,7 +50,6 @@ pass else: from .modeling_cpmant import ( - CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST, CpmAntForCausalLM, CpmAntModel, CpmAntPreTrainedModel, diff --git a/src/transformers/models/cpmant/configuration_cpmant.py b/src/transformers/models/cpmant/configuration_cpmant.py index 0ad5208566b337..4c2a8808669260 100644 --- a/src/transformers/models/cpmant/configuration_cpmant.py +++ b/src/transformers/models/cpmant/configuration_cpmant.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "openbmb/cpm-ant-10b": "https://huggingface.co/openbmb/cpm-ant-10b/blob/main/config.json" - # See all CPMAnt models at https://huggingface.co/models?filter=cpmant -} - class CpmAntConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/cpmant/modeling_cpmant.py b/src/transformers/models/cpmant/modeling_cpmant.py index 405d892c70ed70..9882d4ccc65831 100755 --- a/src/transformers/models/cpmant/modeling_cpmant.py +++ b/src/transformers/models/cpmant/modeling_cpmant.py @@ -36,11 +36,6 @@ _CHECKPOINT_FOR_DOC = "openbmb/cpm-ant-10b" _CONFIG_FOR_DOC = "CpmAntConfig" -CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openbmb/cpm-ant-10b", - # See all CPMAnt models at https://huggingface.co/models?filter=cpmant -] - class CpmAntLayerNorm(nn.Module): """ diff --git a/src/transformers/models/cpmant/tokenization_cpmant.py b/src/transformers/models/cpmant/tokenization_cpmant.py index c10f48e2de282e..a5e66c7679c728 100644 --- a/src/transformers/models/cpmant/tokenization_cpmant.py +++ b/src/transformers/models/cpmant/tokenization_cpmant.py @@ -31,16 +31,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openbmb/cpm-ant-10b": "https://huggingface.co/openbmb/cpm-ant-10b/blob/main/vocab.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openbmb/cpm-ant-10b": 1024, -} - def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" @@ -111,8 +101,6 @@ class CpmAntTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] add_prefix_space = False diff --git a/src/transformers/models/ctrl/__init__.py b/src/transformers/models/ctrl/__init__.py index 7463117bfbc623..f64cced4e28bfe 100644 --- a/src/transformers/models/ctrl/__init__.py +++ b/src/transformers/models/ctrl/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_ctrl": ["CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CTRLConfig"], + "configuration_ctrl": ["CTRLConfig"], "tokenization_ctrl": ["CTRLTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_ctrl"] = [ - "CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "CTRLForSequenceClassification", "CTRLLMHeadModel", "CTRLModel", @@ -43,7 +42,6 @@ pass else: _import_structure["modeling_tf_ctrl"] = [ - "TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCTRLForSequenceClassification", "TFCTRLLMHeadModel", "TFCTRLModel", @@ -52,7 +50,7 @@ if TYPE_CHECKING: - from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig + from .configuration_ctrl import CTRLConfig from .tokenization_ctrl import CTRLTokenizer try: @@ -62,7 +60,6 @@ pass else: from .modeling_ctrl import ( - CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, CTRLForSequenceClassification, CTRLLMHeadModel, CTRLModel, @@ -76,7 +73,6 @@ pass else: from .modeling_tf_ctrl import ( - TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, TFCTRLForSequenceClassification, TFCTRLLMHeadModel, TFCTRLModel, diff --git a/src/transformers/models/ctrl/configuration_ctrl.py b/src/transformers/models/ctrl/configuration_ctrl.py index 553e919b4a77d8..8fd01c10b560e2 100644 --- a/src/transformers/models/ctrl/configuration_ctrl.py +++ b/src/transformers/models/ctrl/configuration_ctrl.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Salesforce/ctrl": "https://huggingface.co/Salesforce/ctrl/resolve/main/config.json" -} - class CTRLConfig(PretrainedConfig): """ diff --git a/src/transformers/models/ctrl/modeling_ctrl.py b/src/transformers/models/ctrl/modeling_ctrl.py index 3814f897d545fa..1fe6951f40c166 100644 --- a/src/transformers/models/ctrl/modeling_ctrl.py +++ b/src/transformers/models/ctrl/modeling_ctrl.py @@ -33,11 +33,6 @@ _CONFIG_FOR_DOC = "CTRLConfig" -CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Salesforce/ctrl" - # See all CTRL models at https://huggingface.co/models?filter=ctrl -] - def angle_defn(pos, i, d_model_size): angle_rates = 1 / torch.pow(10000, (2 * (i // 2)) / d_model_size) diff --git a/src/transformers/models/ctrl/modeling_tf_ctrl.py b/src/transformers/models/ctrl/modeling_tf_ctrl.py index 19a6a84fc75f16..86808190c885e0 100644 --- a/src/transformers/models/ctrl/modeling_tf_ctrl.py +++ b/src/transformers/models/ctrl/modeling_tf_ctrl.py @@ -43,11 +43,6 @@ _CHECKPOINT_FOR_DOC = "Salesforce/ctrl" _CONFIG_FOR_DOC = "CTRLConfig" -TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Salesforce/ctrl" - # See all CTRL models at https://huggingface.co/models?filter=Salesforce/ctrl -] - def angle_defn(pos, i, d_model_size): angle_rates = 1 / np.power(10000, (2 * (i // 2)) / d_model_size) diff --git a/src/transformers/models/ctrl/tokenization_ctrl.py b/src/transformers/models/ctrl/tokenization_ctrl.py index 3aac022897d4c0..fdae22d2c30019 100644 --- a/src/transformers/models/ctrl/tokenization_ctrl.py +++ b/src/transformers/models/ctrl/tokenization_ctrl.py @@ -32,14 +32,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"Salesforce/ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-vocab.json"}, - "merges_file": {"Salesforce/ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-merges.txt"}, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "Salesforce/ctrl": 256, -} CONTROL_CODES = { "Pregnancy": 168629, @@ -134,8 +126,6 @@ class CTRLTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES control_codes = CONTROL_CODES def __init__(self, vocab_file, merges_file, unk_token="", **kwargs): diff --git a/src/transformers/models/cvt/__init__.py b/src/transformers/models/cvt/__init__.py index 5241bb5a5f3a7a..7018b41d58e8b2 100644 --- a/src/transformers/models/cvt/__init__.py +++ b/src/transformers/models/cvt/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available -_import_structure = {"configuration_cvt": ["CVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CvtConfig"]} +_import_structure = {"configuration_cvt": ["CvtConfig"]} try: @@ -26,7 +26,6 @@ pass else: _import_structure["modeling_cvt"] = [ - "CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "CvtForImageClassification", "CvtModel", "CvtPreTrainedModel", @@ -39,14 +38,13 @@ pass else: _import_structure["modeling_tf_cvt"] = [ - "TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCvtForImageClassification", "TFCvtModel", "TFCvtPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_cvt import CVT_PRETRAINED_CONFIG_ARCHIVE_MAP, CvtConfig + from .configuration_cvt import CvtConfig try: if not is_torch_available(): @@ -55,7 +53,6 @@ pass else: from .modeling_cvt import ( - CVT_PRETRAINED_MODEL_ARCHIVE_LIST, CvtForImageClassification, CvtModel, CvtPreTrainedModel, @@ -68,7 +65,6 @@ pass else: from .modeling_tf_cvt import ( - TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCvtForImageClassification, TFCvtModel, TFCvtPreTrainedModel, diff --git a/src/transformers/models/cvt/configuration_cvt.py b/src/transformers/models/cvt/configuration_cvt.py index f1d96fc17ea59d..e8c50fbf7746a0 100644 --- a/src/transformers/models/cvt/configuration_cvt.py +++ b/src/transformers/models/cvt/configuration_cvt.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -CVT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/cvt-13": "https://huggingface.co/microsoft/cvt-13/resolve/main/config.json", - # See all Cvt models at https://huggingface.co/models?filter=cvt -} - class CvtConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/cvt/modeling_cvt.py b/src/transformers/models/cvt/modeling_cvt.py index ef7e3671e69d35..910fb4c5d0dd46 100644 --- a/src/transformers/models/cvt/modeling_cvt.py +++ b/src/transformers/models/cvt/modeling_cvt.py @@ -45,17 +45,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -CVT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/cvt-13", - "microsoft/cvt-13-384", - "microsoft/cvt-13-384-22k", - "microsoft/cvt-21", - "microsoft/cvt-21-384", - "microsoft/cvt-21-384-22k", - # See all Cvt models at https://huggingface.co/models?filter=cvt -] - - @dataclass class BaseModelOutputWithCLSToken(ModelOutput): """ diff --git a/src/transformers/models/cvt/modeling_tf_cvt.py b/src/transformers/models/cvt/modeling_tf_cvt.py index c69973bdc828af..03df5033b06b7f 100644 --- a/src/transformers/models/cvt/modeling_tf_cvt.py +++ b/src/transformers/models/cvt/modeling_tf_cvt.py @@ -49,16 +49,6 @@ # General docstring _CONFIG_FOR_DOC = "CvtConfig" -TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/cvt-13", - "microsoft/cvt-13-384", - "microsoft/cvt-13-384-22k", - "microsoft/cvt-21", - "microsoft/cvt-21-384", - "microsoft/cvt-21-384-22k", - # See all Cvt models at https://huggingface.co/models?filter=cvt -] - @dataclass class TFBaseModelOutputWithCLSToken(ModelOutput): diff --git a/src/transformers/models/data2vec/__init__.py b/src/transformers/models/data2vec/__init__.py index 45522f4ba893a1..525068db59832c 100644 --- a/src/transformers/models/data2vec/__init__.py +++ b/src/transformers/models/data2vec/__init__.py @@ -18,14 +18,12 @@ _import_structure = { - "configuration_data2vec_audio": ["DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecAudioConfig"], + "configuration_data2vec_audio": ["Data2VecAudioConfig"], "configuration_data2vec_text": [ - "DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecTextConfig", "Data2VecTextOnnxConfig", ], "configuration_data2vec_vision": [ - "DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecVisionConfig", "Data2VecVisionOnnxConfig", ], @@ -38,7 +36,6 @@ pass else: _import_structure["modeling_data2vec_audio"] = [ - "DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecAudioForAudioFrameClassification", "Data2VecAudioForCTC", "Data2VecAudioForSequenceClassification", @@ -47,7 +44,6 @@ "Data2VecAudioPreTrainedModel", ] _import_structure["modeling_data2vec_text"] = [ - "DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecTextForCausalLM", "Data2VecTextForMaskedLM", "Data2VecTextForMultipleChoice", @@ -58,7 +54,6 @@ "Data2VecTextPreTrainedModel", ] _import_structure["modeling_data2vec_vision"] = [ - "DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecVisionForImageClassification", "Data2VecVisionForMaskedImageModeling", "Data2VecVisionForSemanticSegmentation", @@ -75,14 +70,12 @@ ] if TYPE_CHECKING: - from .configuration_data2vec_audio import DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecAudioConfig + from .configuration_data2vec_audio import Data2VecAudioConfig from .configuration_data2vec_text import ( - DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecTextConfig, Data2VecTextOnnxConfig, ) from .configuration_data2vec_vision import ( - DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecVisionConfig, Data2VecVisionOnnxConfig, ) @@ -94,7 +87,6 @@ pass else: from .modeling_data2vec_audio import ( - DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecAudioForAudioFrameClassification, Data2VecAudioForCTC, Data2VecAudioForSequenceClassification, @@ -103,7 +95,6 @@ Data2VecAudioPreTrainedModel, ) from .modeling_data2vec_text import ( - DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecTextForCausalLM, Data2VecTextForMaskedLM, Data2VecTextForMultipleChoice, @@ -114,7 +105,6 @@ Data2VecTextPreTrainedModel, ) from .modeling_data2vec_vision import ( - DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecVisionForImageClassification, Data2VecVisionForMaskedImageModeling, Data2VecVisionForSemanticSegmentation, diff --git a/src/transformers/models/data2vec/configuration_data2vec_audio.py b/src/transformers/models/data2vec/configuration_data2vec_audio.py index e37def379fbb15..32d505f157d63f 100644 --- a/src/transformers/models/data2vec/configuration_data2vec_audio.py +++ b/src/transformers/models/data2vec/configuration_data2vec_audio.py @@ -22,11 +22,6 @@ logger = logging.get_logger(__name__) -DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/data2vec-base-960h": "https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json", - # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio -} - class Data2VecAudioConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/data2vec/configuration_data2vec_text.py b/src/transformers/models/data2vec/configuration_data2vec_text.py index 01a81e95b412b7..e7b15270eda9fb 100644 --- a/src/transformers/models/data2vec/configuration_data2vec_text.py +++ b/src/transformers/models/data2vec/configuration_data2vec_text.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/data2vec-text-base": "https://huggingface.co/data2vec/resolve/main/config.json", -} - class Data2VecTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/data2vec/configuration_data2vec_vision.py b/src/transformers/models/data2vec/configuration_data2vec_vision.py index 5d8e4a252a7c29..315f24a55729b9 100644 --- a/src/transformers/models/data2vec/configuration_data2vec_vision.py +++ b/src/transformers/models/data2vec/configuration_data2vec_vision.py @@ -25,12 +25,6 @@ logger = logging.get_logger(__name__) -DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/data2vec-vision-base-ft": ( - "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json" - ), -} - class Data2VecVisionConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/data2vec/modeling_data2vec_audio.py b/src/transformers/models/data2vec/modeling_data2vec_audio.py index b3dde2438ab98f..04edd31fa156f3 100755 --- a/src/transformers/models/data2vec/modeling_data2vec_audio.py +++ b/src/transformers/models/data2vec/modeling_data2vec_audio.py @@ -62,15 +62,6 @@ _CTC_EXPECTED_LOSS = 66.95 -DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/data2vec-audio-base", - "facebook/data2vec-audio-base-10m", - "facebook/data2vec-audio-base-100h", - "facebook/data2vec-audio-base-960h", - # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio -] - - # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( shape: Tuple[int, int], diff --git a/src/transformers/models/data2vec/modeling_data2vec_text.py b/src/transformers/models/data2vec/modeling_data2vec_text.py index 567cc7b5c34f5e..0f4e3f2bc3125f 100644 --- a/src/transformers/models/data2vec/modeling_data2vec_text.py +++ b/src/transformers/models/data2vec/modeling_data2vec_text.py @@ -55,12 +55,6 @@ _CONFIG_FOR_DOC = "Data2VecTextConfig" -DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/data2vec-text-base", - # See all data2vec models at https://huggingface.co/models?filter=data2vec-text -] - - # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->Data2VecText class Data2VecTextForTextEmbeddings(nn.Module): """ diff --git a/src/transformers/models/data2vec/modeling_data2vec_vision.py b/src/transformers/models/data2vec/modeling_data2vec_vision.py index 77c9363fa217c4..fdd80884ea8358 100644 --- a/src/transformers/models/data2vec/modeling_data2vec_vision.py +++ b/src/transformers/models/data2vec/modeling_data2vec_vision.py @@ -57,11 +57,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/data2vec-vision-base-ft1k" _IMAGE_CLASS_EXPECTED_OUTPUT = "remote control, remote" -DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/data2vec-vision-base-ft1k", - # See all Data2VecVision models at https://huggingface.co/models?filter=data2vec-vision -] - @dataclass # Copied from transformers.models.beit.modeling_beit.BeitModelOutputWithPooling with Beit->Data2VecVision diff --git a/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py b/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py index bc8ff9cfc9e619..e65a61fae5f881 100644 --- a/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py +++ b/src/transformers/models/data2vec/modeling_tf_data2vec_vision.py @@ -65,11 +65,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/data2vec-vision-base-ft1k" _IMAGE_CLASS_EXPECTED_OUTPUT = "remote control, remote" -TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/data2vec-vision-base-ft1k", - # See all Data2VecVision models at https://huggingface.co/models?filter=data2vec-vision -] - @dataclass class TFData2VecVisionModelOutputWithPooling(TFBaseModelOutputWithPooling): diff --git a/src/transformers/models/deberta/__init__.py b/src/transformers/models/deberta/__init__.py index 87806dd60d60c5..76beee798ff075 100644 --- a/src/transformers/models/deberta/__init__.py +++ b/src/transformers/models/deberta/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_deberta": ["DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaOnnxConfig"], + "configuration_deberta": ["DebertaConfig", "DebertaOnnxConfig"], "tokenization_deberta": ["DebertaTokenizer"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_deberta"] = [ - "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaForMaskedLM", "DebertaForQuestionAnswering", "DebertaForSequenceClassification", @@ -59,7 +58,6 @@ pass else: _import_structure["modeling_tf_deberta"] = [ - "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaForMaskedLM", "TFDebertaForQuestionAnswering", "TFDebertaForSequenceClassification", @@ -70,7 +68,7 @@ if TYPE_CHECKING: - from .configuration_deberta import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaOnnxConfig + from .configuration_deberta import DebertaConfig, DebertaOnnxConfig from .tokenization_deberta import DebertaTokenizer try: @@ -88,7 +86,6 @@ pass else: from .modeling_deberta import ( - DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaForMaskedLM, DebertaForQuestionAnswering, DebertaForSequenceClassification, @@ -104,7 +101,6 @@ pass else: from .modeling_tf_deberta import ( - TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaForMaskedLM, TFDebertaForQuestionAnswering, TFDebertaForSequenceClassification, diff --git a/src/transformers/models/deberta/configuration_deberta.py b/src/transformers/models/deberta/configuration_deberta.py index f6db66f0d8d99c..e79e7238abcaba 100644 --- a/src/transformers/models/deberta/configuration_deberta.py +++ b/src/transformers/models/deberta/configuration_deberta.py @@ -27,15 +27,6 @@ logger = logging.get_logger(__name__) -DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/config.json", - "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/config.json", - "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/config.json", - "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/config.json", - "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/config.json", - "microsoft/deberta-xlarge-mnli": "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/config.json", -} - class DebertaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deberta/modeling_deberta.py b/src/transformers/models/deberta/modeling_deberta.py index b5136bcb88cd67..730959fc8dd4cd 100644 --- a/src/transformers/models/deberta/modeling_deberta.py +++ b/src/transformers/models/deberta/modeling_deberta.py @@ -53,16 +53,6 @@ _QA_TARGET_END_INDEX = 14 -DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/deberta-base", - "microsoft/deberta-large", - "microsoft/deberta-xlarge", - "microsoft/deberta-base-mnli", - "microsoft/deberta-large-mnli", - "microsoft/deberta-xlarge-mnli", -] - - class ContextPooler(nn.Module): def __init__(self, config): super().__init__() diff --git a/src/transformers/models/deberta/modeling_tf_deberta.py b/src/transformers/models/deberta/modeling_tf_deberta.py index 2a2a586c3592ef..774d6296d01c76 100644 --- a/src/transformers/models/deberta/modeling_tf_deberta.py +++ b/src/transformers/models/deberta/modeling_tf_deberta.py @@ -53,11 +53,6 @@ _CONFIG_FOR_DOC = "DebertaConfig" _CHECKPOINT_FOR_DOC = "kamalkraj/deberta-base" -TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "kamalkraj/deberta-base", - # See all DeBERTa models at https://huggingface.co/models?filter=DeBERTa -] - class TFDebertaContextPooler(keras.layers.Layer): def __init__(self, config: DebertaConfig, **kwargs): diff --git a/src/transformers/models/deberta/tokenization_deberta.py b/src/transformers/models/deberta/tokenization_deberta.py index 6a48b188d61897..b846a7891562d6 100644 --- a/src/transformers/models/deberta/tokenization_deberta.py +++ b/src/transformers/models/deberta/tokenization_deberta.py @@ -28,43 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/vocab.json", - "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/vocab.json", - "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/vocab.json", - "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/vocab.json", - "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/vocab.json", - "microsoft/deberta-xlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/vocab.json" - ), - }, - "merges_file": { - "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/merges.txt", - "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/merges.txt", - "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/merges.txt", - "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/merges.txt", - "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/merges.txt", - "microsoft/deberta-xlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/merges.txt" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/deberta-base": 512, - "microsoft/deberta-large": 512, - "microsoft/deberta-xlarge": 512, - "microsoft/deberta-base-mnli": 512, - "microsoft/deberta-large-mnli": 512, - "microsoft/deberta-xlarge-mnli": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/deberta-base": {"do_lower_case": False}, - "microsoft/deberta-large": {"do_lower_case": False}, -} - # Copied from transformers.models.gpt2.tokenization_gpt2.bytes_to_unicode def bytes_to_unicode(): @@ -172,8 +135,6 @@ class DebertaTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask", "token_type_ids"] def __init__( diff --git a/src/transformers/models/deberta/tokenization_deberta_fast.py b/src/transformers/models/deberta/tokenization_deberta_fast.py index 6d157fdf3c7066..07226443d30a9c 100644 --- a/src/transformers/models/deberta/tokenization_deberta_fast.py +++ b/src/transformers/models/deberta/tokenization_deberta_fast.py @@ -29,43 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/vocab.json", - "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/vocab.json", - "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/vocab.json", - "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/vocab.json", - "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/vocab.json", - "microsoft/deberta-xlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/vocab.json" - ), - }, - "merges_file": { - "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/merges.txt", - "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/merges.txt", - "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/merges.txt", - "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/merges.txt", - "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/merges.txt", - "microsoft/deberta-xlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/merges.txt" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/deberta-base": 512, - "microsoft/deberta-large": 512, - "microsoft/deberta-xlarge": 512, - "microsoft/deberta-base-mnli": 512, - "microsoft/deberta-large-mnli": 512, - "microsoft/deberta-xlarge-mnli": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/deberta-base": {"do_lower_case": False}, - "microsoft/deberta-large": {"do_lower_case": False}, -} - class DebertaTokenizerFast(PreTrainedTokenizerFast): """ @@ -133,8 +96,6 @@ class DebertaTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask", "token_type_ids"] slow_tokenizer_class = DebertaTokenizer diff --git a/src/transformers/models/deberta_v2/__init__.py b/src/transformers/models/deberta_v2/__init__.py index fb1b20a331fe11..314901aee1aed3 100644 --- a/src/transformers/models/deberta_v2/__init__.py +++ b/src/transformers/models/deberta_v2/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_deberta_v2": ["DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaV2Config", "DebertaV2OnnxConfig"], + "configuration_deberta_v2": ["DebertaV2Config", "DebertaV2OnnxConfig"], "tokenization_deberta_v2": ["DebertaV2Tokenizer"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_tf_deberta_v2"] = [ - "TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaV2ForMaskedLM", "TFDebertaV2ForQuestionAnswering", "TFDebertaV2ForMultipleChoice", @@ -60,7 +59,6 @@ pass else: _import_structure["modeling_deberta_v2"] = [ - "DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaV2ForMaskedLM", "DebertaV2ForMultipleChoice", "DebertaV2ForQuestionAnswering", @@ -73,7 +71,6 @@ if TYPE_CHECKING: from .configuration_deberta_v2 import ( - DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaV2Config, DebertaV2OnnxConfig, ) @@ -94,7 +91,6 @@ pass else: from .modeling_tf_deberta_v2 import ( - TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaV2ForMaskedLM, TFDebertaV2ForMultipleChoice, TFDebertaV2ForQuestionAnswering, @@ -111,7 +107,6 @@ pass else: from .modeling_deberta_v2 import ( - DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaV2ForMaskedLM, DebertaV2ForMultipleChoice, DebertaV2ForQuestionAnswering, diff --git a/src/transformers/models/deberta_v2/configuration_deberta_v2.py b/src/transformers/models/deberta_v2/configuration_deberta_v2.py index 68f2112754a4c1..02af8f9c1a2b5b 100644 --- a/src/transformers/models/deberta_v2/configuration_deberta_v2.py +++ b/src/transformers/models/deberta_v2/configuration_deberta_v2.py @@ -27,17 +27,6 @@ logger = logging.get_logger(__name__) -DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json", - "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json", - "microsoft/deberta-v2-xlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json" - ), - "microsoft/deberta-v2-xxlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json" - ), -} - class DebertaV2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/deberta_v2/modeling_deberta_v2.py b/src/transformers/models/deberta_v2/modeling_deberta_v2.py index a8f064369268b0..d6cf572ebfe687 100644 --- a/src/transformers/models/deberta_v2/modeling_deberta_v2.py +++ b/src/transformers/models/deberta_v2/modeling_deberta_v2.py @@ -44,13 +44,6 @@ _QA_TARGET_START_INDEX = 2 _QA_TARGET_END_INDEX = 9 -DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/deberta-v2-xlarge", - "microsoft/deberta-v2-xxlarge", - "microsoft/deberta-v2-xlarge-mnli", - "microsoft/deberta-v2-xxlarge-mnli", -] - # Copied from transformers.models.deberta.modeling_deberta.ContextPooler class ContextPooler(nn.Module): diff --git a/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py b/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py index 05b222ec8a595f..9bd62581006dd6 100644 --- a/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py +++ b/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py @@ -52,11 +52,6 @@ _CONFIG_FOR_DOC = "DebertaV2Config" _CHECKPOINT_FOR_DOC = "kamalkraj/deberta-v2-xlarge" -TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "kamalkraj/deberta-v2-xlarge", - # See all DeBERTa models at https://huggingface.co/models?filter=deberta-v2 -] - # Copied from transformers.models.deberta.modeling_tf_deberta.TFDebertaContextPooler with Deberta->DebertaV2 class TFDebertaV2ContextPooler(keras.layers.Layer): diff --git a/src/transformers/models/deberta_v2/tokenization_deberta_v2.py b/src/transformers/models/deberta_v2/tokenization_deberta_v2.py index 0cf8807ca61f2c..a92103945416d7 100644 --- a/src/transformers/models/deberta_v2/tokenization_deberta_v2.py +++ b/src/transformers/models/deberta_v2/tokenization_deberta_v2.py @@ -26,32 +26,6 @@ logger = logging.get_logger(__name__) -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/spm.model", - "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/spm.model", - "microsoft/deberta-v2-xlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/spm.model" - ), - "microsoft/deberta-v2-xxlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/spm.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/deberta-v2-xlarge": 512, - "microsoft/deberta-v2-xxlarge": 512, - "microsoft/deberta-v2-xlarge-mnli": 512, - "microsoft/deberta-v2-xxlarge-mnli": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/deberta-v2-xlarge": {"do_lower_case": False}, - "microsoft/deberta-v2-xxlarge": {"do_lower_case": False}, - "microsoft/deberta-v2-xlarge-mnli": {"do_lower_case": False}, - "microsoft/deberta-v2-xxlarge-mnli": {"do_lower_case": False}, -} VOCAB_FILES_NAMES = {"vocab_file": "spm.model"} @@ -106,9 +80,6 @@ class DebertaV2Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/deberta_v2/tokenization_deberta_v2_fast.py b/src/transformers/models/deberta_v2/tokenization_deberta_v2_fast.py index dab376ce95be8a..cb92a61edf1afb 100644 --- a/src/transformers/models/deberta_v2/tokenization_deberta_v2_fast.py +++ b/src/transformers/models/deberta_v2/tokenization_deberta_v2_fast.py @@ -32,33 +32,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spm.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/spm.model", - "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/spm.model", - "microsoft/deberta-v2-xlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/spm.model" - ), - "microsoft/deberta-v2-xxlarge-mnli": ( - "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/spm.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/deberta-v2-xlarge": 512, - "microsoft/deberta-v2-xxlarge": 512, - "microsoft/deberta-v2-xlarge-mnli": 512, - "microsoft/deberta-v2-xxlarge-mnli": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/deberta-v2-xlarge": {"do_lower_case": False}, - "microsoft/deberta-v2-xxlarge": {"do_lower_case": False}, - "microsoft/deberta-v2-xlarge-mnli": {"do_lower_case": False}, - "microsoft/deberta-v2-xxlarge-mnli": {"do_lower_case": False}, -} - class DebertaV2TokenizerFast(PreTrainedTokenizerFast): r""" @@ -110,9 +83,6 @@ class DebertaV2TokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = DebertaV2Tokenizer def __init__( diff --git a/src/transformers/models/decision_transformer/__init__.py b/src/transformers/models/decision_transformer/__init__.py index 44070229aaa859..ce97cf7352a782 100644 --- a/src/transformers/models/decision_transformer/__init__.py +++ b/src/transformers/models/decision_transformer/__init__.py @@ -17,10 +17,7 @@ _import_structure = { - "configuration_decision_transformer": [ - "DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "DecisionTransformerConfig", - ], + "configuration_decision_transformer": ["DecisionTransformerConfig"], } try: @@ -30,7 +27,6 @@ pass else: _import_structure["modeling_decision_transformer"] = [ - "DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "DecisionTransformerGPT2Model", "DecisionTransformerGPT2PreTrainedModel", "DecisionTransformerModel", @@ -40,7 +36,6 @@ if TYPE_CHECKING: from .configuration_decision_transformer import ( - DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, DecisionTransformerConfig, ) @@ -51,7 +46,6 @@ pass else: from .modeling_decision_transformer import ( - DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, DecisionTransformerGPT2Model, DecisionTransformerGPT2PreTrainedModel, DecisionTransformerModel, diff --git a/src/transformers/models/decision_transformer/configuration_decision_transformer.py b/src/transformers/models/decision_transformer/configuration_decision_transformer.py index 88ff005469cd6d..6f1fb500bab801 100644 --- a/src/transformers/models/decision_transformer/configuration_decision_transformer.py +++ b/src/transformers/models/decision_transformer/configuration_decision_transformer.py @@ -20,13 +20,6 @@ logger = logging.get_logger(__name__) -DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "edbeeching/decision-transformer-gym-hopper-medium": ( - "https://huggingface.co/edbeeching/decision-transformer-gym-hopper-medium/resolve/main/config.json" - ), - # See all DecisionTransformer models at https://huggingface.co/models?filter=decision_transformer -} - class DecisionTransformerConfig(PretrainedConfig): """ diff --git a/src/transformers/models/decision_transformer/modeling_decision_transformer.py b/src/transformers/models/decision_transformer/modeling_decision_transformer.py index fdfb5b37d22e62..9e2c9b23d8afbd 100755 --- a/src/transformers/models/decision_transformer/modeling_decision_transformer.py +++ b/src/transformers/models/decision_transformer/modeling_decision_transformer.py @@ -43,11 +43,6 @@ _CHECKPOINT_FOR_DOC = "edbeeching/decision-transformer-gym-hopper-medium" _CONFIG_FOR_DOC = "DecisionTransformerConfig" -DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "edbeeching/decision-transformer-gym-hopper-medium", - # See all DecisionTransformer models at https://huggingface.co/models?filter=decision_transformer -] - # Copied from transformers.models.gpt2.modeling_gpt2.load_tf_weights_in_gpt2 def load_tf_weights_in_gpt2(model, config, gpt2_checkpoint_path): diff --git a/src/transformers/models/deformable_detr/__init__.py b/src/transformers/models/deformable_detr/__init__.py index a560265f4bfcb8..ab44adf3718149 100644 --- a/src/transformers/models/deformable_detr/__init__.py +++ b/src/transformers/models/deformable_detr/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_deformable_detr": ["DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeformableDetrConfig"], + "configuration_deformable_detr": ["DeformableDetrConfig"], } try: @@ -37,7 +37,6 @@ pass else: _import_structure["modeling_deformable_detr"] = [ - "DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DeformableDetrForObjectDetection", "DeformableDetrModel", "DeformableDetrPreTrainedModel", @@ -45,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_deformable_detr import DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DeformableDetrConfig + from .configuration_deformable_detr import DeformableDetrConfig try: if not is_vision_available(): @@ -63,7 +62,6 @@ pass else: from .modeling_deformable_detr import ( - DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DeformableDetrForObjectDetection, DeformableDetrModel, DeformableDetrPreTrainedModel, diff --git a/src/transformers/models/deformable_detr/configuration_deformable_detr.py b/src/transformers/models/deformable_detr/configuration_deformable_detr.py index eb3b3807ab624b..456647ced9c412 100644 --- a/src/transformers/models/deformable_detr/configuration_deformable_detr.py +++ b/src/transformers/models/deformable_detr/configuration_deformable_detr.py @@ -21,11 +21,6 @@ logger = logging.get_logger(__name__) -DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "SenseTime/deformable-detr": "https://huggingface.co/sensetime/deformable-detr/resolve/main/config.json", - # See all Deformable DETR models at https://huggingface.co/models?filter=deformable-detr -} - class DeformableDetrConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deformable_detr/modeling_deformable_detr.py b/src/transformers/models/deformable_detr/modeling_deformable_detr.py index 4c122832ff2027..fd9501402ce217 100755 --- a/src/transformers/models/deformable_detr/modeling_deformable_detr.py +++ b/src/transformers/models/deformable_detr/modeling_deformable_detr.py @@ -152,11 +152,6 @@ def backward(context, grad_output): _CONFIG_FOR_DOC = "DeformableDetrConfig" _CHECKPOINT_FOR_DOC = "sensetime/deformable-detr" -DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "sensetime/deformable-detr", - # See all Deformable DETR models at https://huggingface.co/models?filter=deformable-detr -] - @dataclass class DeformableDetrDecoderOutput(ModelOutput): diff --git a/src/transformers/models/deit/__init__.py b/src/transformers/models/deit/__init__.py index a0b44186efbc05..8248823be24c73 100644 --- a/src/transformers/models/deit/__init__.py +++ b/src/transformers/models/deit/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_deit": ["DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeiTConfig", "DeiTOnnxConfig"]} +_import_structure = {"configuration_deit": ["DeiTConfig", "DeiTOnnxConfig"]} try: if not is_vision_available(): @@ -40,7 +40,6 @@ pass else: _import_structure["modeling_deit"] = [ - "DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "DeiTForImageClassification", "DeiTForImageClassificationWithTeacher", "DeiTForMaskedImageModeling", @@ -55,7 +54,6 @@ pass else: _import_structure["modeling_tf_deit"] = [ - "TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDeiTForImageClassification", "TFDeiTForImageClassificationWithTeacher", "TFDeiTForMaskedImageModeling", @@ -65,7 +63,7 @@ if TYPE_CHECKING: - from .configuration_deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig, DeiTOnnxConfig + from .configuration_deit import DeiTConfig, DeiTOnnxConfig try: if not is_vision_available(): @@ -83,7 +81,6 @@ pass else: from .modeling_deit import ( - DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, DeiTForImageClassification, DeiTForImageClassificationWithTeacher, DeiTForMaskedImageModeling, @@ -98,7 +95,6 @@ pass else: from .modeling_tf_deit import ( - TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDeiTForImageClassification, TFDeiTForImageClassificationWithTeacher, TFDeiTForMaskedImageModeling, diff --git a/src/transformers/models/deit/configuration_deit.py b/src/transformers/models/deit/configuration_deit.py index 20b874ff54a0dd..e1767c35fda838 100644 --- a/src/transformers/models/deit/configuration_deit.py +++ b/src/transformers/models/deit/configuration_deit.py @@ -26,13 +26,6 @@ logger = logging.get_logger(__name__) -DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/deit-base-distilled-patch16-224": ( - "https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json" - ), - # See all DeiT models at https://huggingface.co/models?filter=deit -} - class DeiTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deit/modeling_deit.py b/src/transformers/models/deit/modeling_deit.py index b8bd9d6ce629db..2f13cc2644dc96 100644 --- a/src/transformers/models/deit/modeling_deit.py +++ b/src/transformers/models/deit/modeling_deit.py @@ -59,12 +59,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/deit-base-distilled-patch16-224", - # See all DeiT models at https://huggingface.co/models?filter=deit -] - - class DeiTEmbeddings(nn.Module): """ Construct the CLS token, distillation token, position and patch embeddings. Optionally, also the mask token. diff --git a/src/transformers/models/deit/modeling_tf_deit.py b/src/transformers/models/deit/modeling_tf_deit.py index c6215c63b8ae8c..43a3465ba14d3a 100644 --- a/src/transformers/models/deit/modeling_tf_deit.py +++ b/src/transformers/models/deit/modeling_tf_deit.py @@ -65,12 +65,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/deit-base-distilled-patch16-224", - # See all DeiT models at https://huggingface.co/models?filter=deit -] - - @dataclass class TFDeiTForImageClassificationWithTeacherOutput(ModelOutput): """ diff --git a/src/transformers/models/deprecated/mctct/__init__.py b/src/transformers/models/deprecated/mctct/__init__.py index 567be97b7cd863..4e0a06b1779d2f 100644 --- a/src/transformers/models/deprecated/mctct/__init__.py +++ b/src/transformers/models/deprecated/mctct/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_mctct": ["MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MCTCTConfig"], + "configuration_mctct": ["MCTCTConfig"], "feature_extraction_mctct": ["MCTCTFeatureExtractor"], "processing_mctct": ["MCTCTProcessor"], } @@ -30,7 +30,6 @@ pass else: _import_structure["modeling_mctct"] = [ - "MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST", "MCTCTForCTC", "MCTCTModel", "MCTCTPreTrainedModel", @@ -38,7 +37,7 @@ if TYPE_CHECKING: - from .configuration_mctct import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig + from .configuration_mctct import MCTCTConfig from .feature_extraction_mctct import MCTCTFeatureExtractor from .processing_mctct import MCTCTProcessor @@ -48,7 +47,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_mctct import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel + from .modeling_mctct import MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel else: import sys diff --git a/src/transformers/models/deprecated/mctct/configuration_mctct.py b/src/transformers/models/deprecated/mctct/configuration_mctct.py index 9d4eab0d3f3d4a..c5de7347807733 100644 --- a/src/transformers/models/deprecated/mctct/configuration_mctct.py +++ b/src/transformers/models/deprecated/mctct/configuration_mctct.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json", - # See all M-CTC-T models at https://huggingface.co/models?filter=mctct -} - class MCTCTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deprecated/mctct/modeling_mctct.py b/src/transformers/models/deprecated/mctct/modeling_mctct.py index cb3186c9dd37b8..95c860fa9a49c5 100755 --- a/src/transformers/models/deprecated/mctct/modeling_mctct.py +++ b/src/transformers/models/deprecated/mctct/modeling_mctct.py @@ -52,12 +52,6 @@ _CTC_EXPECTED_LOSS = 1885.65 -MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "speechbrain/m-ctc-t-large", - # See all M-CTC-T models at https://huggingface.co/models?filter=mctct -] - - class MCTCTConv1dSubsampler(nn.Module): """ Convolutional subsampler: a stack of 1D convolution (along temporal dimension) followed by non-linear activation diff --git a/src/transformers/models/deprecated/open_llama/__init__.py b/src/transformers/models/deprecated/open_llama/__init__.py index 446c9f076d3134..085c91fdb69538 100644 --- a/src/transformers/models/deprecated/open_llama/__init__.py +++ b/src/transformers/models/deprecated/open_llama/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_open_llama": ["OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenLlamaConfig"], + "configuration_open_llama": ["OpenLlamaConfig"], } try: @@ -57,7 +57,7 @@ if TYPE_CHECKING: - from .configuration_open_llama import OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenLlamaConfig + from .configuration_open_llama import OpenLlamaConfig try: if not is_sentencepiece_available(): diff --git a/src/transformers/models/deprecated/open_llama/configuration_open_llama.py b/src/transformers/models/deprecated/open_llama/configuration_open_llama.py index 5786abac850dd3..7ffe618d46dcb0 100644 --- a/src/transformers/models/deprecated/open_llama/configuration_open_llama.py +++ b/src/transformers/models/deprecated/open_llama/configuration_open_llama.py @@ -25,10 +25,6 @@ logger = logging.get_logger(__name__) -OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "s-JoL/Open-Llama-V1": "https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json", -} - class OpenLlamaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deprecated/retribert/__init__.py b/src/transformers/models/deprecated/retribert/__init__.py index dba5e14594e16c..ff792f40a2a88c 100644 --- a/src/transformers/models/deprecated/retribert/__init__.py +++ b/src/transformers/models/deprecated/retribert/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_retribert": ["RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RetriBertConfig"], + "configuration_retribert": ["RetriBertConfig"], "tokenization_retribert": ["RetriBertTokenizer"], } @@ -37,14 +37,13 @@ pass else: _import_structure["modeling_retribert"] = [ - "RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RetriBertModel", "RetriBertPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_retribert import RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RetriBertConfig + from .configuration_retribert import RetriBertConfig from .tokenization_retribert import RetriBertTokenizer try: @@ -62,7 +61,6 @@ pass else: from .modeling_retribert import ( - RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RetriBertModel, RetriBertPreTrainedModel, ) diff --git a/src/transformers/models/deprecated/retribert/configuration_retribert.py b/src/transformers/models/deprecated/retribert/configuration_retribert.py index 3861b9c90f33ef..dfa7d3b65b6f23 100644 --- a/src/transformers/models/deprecated/retribert/configuration_retribert.py +++ b/src/transformers/models/deprecated/retribert/configuration_retribert.py @@ -20,13 +20,6 @@ logger = logging.get_logger(__name__) -# TODO: upload to AWS -RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "yjernite/retribert-base-uncased": ( - "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/config.json" - ), -} - class RetriBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deprecated/retribert/modeling_retribert.py b/src/transformers/models/deprecated/retribert/modeling_retribert.py index 00d47bce5121d4..d8af23fb49ef00 100644 --- a/src/transformers/models/deprecated/retribert/modeling_retribert.py +++ b/src/transformers/models/deprecated/retribert/modeling_retribert.py @@ -32,11 +32,6 @@ logger = logging.get_logger(__name__) -RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "yjernite/retribert-base-uncased", - # See all RetriBert models at https://huggingface.co/models?filter=retribert -] - # INTERFACE FOR ENCODER AND TASK SPECIFIC MODEL # class RetriBertPreTrainedModel(PreTrainedModel): diff --git a/src/transformers/models/deprecated/retribert/tokenization_retribert.py b/src/transformers/models/deprecated/retribert/tokenization_retribert.py index d0904e3c931e40..cb2ef58139c1e3 100644 --- a/src/transformers/models/deprecated/retribert/tokenization_retribert.py +++ b/src/transformers/models/deprecated/retribert/tokenization_retribert.py @@ -112,8 +112,6 @@ class RetriBertTokenizer(PreTrainedTokenizer): vocab_files_names = VOCAB_FILES_NAMES pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION model_input_names = ["input_ids", "attention_mask"] # Copied from transformers.models.bert.tokenization_bert.BertTokenizer.__init__ diff --git a/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py b/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py index 07f7964b9f3f8e..3d56f3641e1c28 100644 --- a/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py +++ b/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py @@ -96,8 +96,6 @@ class RetriBertTokenizerFast(PreTrainedTokenizerFast): vocab_files_names = VOCAB_FILES_NAMES pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION slow_tokenizer_class = RetriBertTokenizer model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/deprecated/tapex/tokenization_tapex.py b/src/transformers/models/deprecated/tapex/tokenization_tapex.py index a5ee093c56bd26..f05dbf56f955e5 100644 --- a/src/transformers/models/deprecated/tapex/tokenization_tapex.py +++ b/src/transformers/models/deprecated/tapex/tokenization_tapex.py @@ -265,8 +265,6 @@ class TapexTokenizer(PreTrainedTokenizer): vocab_files_names = VOCAB_FILES_NAMES pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/deprecated/trajectory_transformer/__init__.py b/src/transformers/models/deprecated/trajectory_transformer/__init__.py index b7af1bb48cb7d6..1ec0385898409b 100644 --- a/src/transformers/models/deprecated/trajectory_transformer/__init__.py +++ b/src/transformers/models/deprecated/trajectory_transformer/__init__.py @@ -17,10 +17,7 @@ _import_structure = { - "configuration_trajectory_transformer": [ - "TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "TrajectoryTransformerConfig", - ], + "configuration_trajectory_transformer": ["TrajectoryTransformerConfig"], } try: @@ -30,7 +27,6 @@ pass else: _import_structure["modeling_trajectory_transformer"] = [ - "TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TrajectoryTransformerModel", "TrajectoryTransformerPreTrainedModel", "load_tf_weights_in_trajectory_transformer", @@ -39,7 +35,6 @@ if TYPE_CHECKING: from .configuration_trajectory_transformer import ( - TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TrajectoryTransformerConfig, ) @@ -50,7 +45,6 @@ pass else: from .modeling_trajectory_transformer import ( - TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TrajectoryTransformerModel, TrajectoryTransformerPreTrainedModel, load_tf_weights_in_trajectory_transformer, diff --git a/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py b/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py index cfad075c6ae848..06ec12161fc31b 100644 --- a/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py +++ b/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py @@ -20,13 +20,6 @@ logger = logging.get_logger(__name__) -TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "CarlCochet/trajectory-transformer-halfcheetah-medium-v2": ( - "https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2/resolve/main/config.json" - ), - # See all TrajectoryTransformer models at https://huggingface.co/models?filter=trajectory_transformer -} - class TrajectoryTransformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py b/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py index 40c08e4d1d441a..24e1815218b256 100644 --- a/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py +++ b/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py @@ -41,11 +41,6 @@ _CHECKPOINT_FOR_DOC = "CarlCochet/trajectory-transformer-halfcheetah-medium-v2" _CONFIG_FOR_DOC = "TrajectoryTransformerConfig" -TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "CarlCochet/trajectory-transformer-halfcheetah-medium-v2", - # See all TrajectoryTransformer models at https://huggingface.co/models?filter=trajectory_transformer -] - def load_tf_weights_in_trajectory_transformer(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/deprecated/transfo_xl/__init__.py b/src/transformers/models/deprecated/transfo_xl/__init__.py index f3674e19665ca7..27829fd9ed169a 100644 --- a/src/transformers/models/deprecated/transfo_xl/__init__.py +++ b/src/transformers/models/deprecated/transfo_xl/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_transfo_xl": ["TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", "TransfoXLConfig"], + "configuration_transfo_xl": ["TransfoXLConfig"], "tokenization_transfo_xl": ["TransfoXLCorpus", "TransfoXLTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_transfo_xl"] = [ - "TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "AdaptiveEmbedding", "TransfoXLForSequenceClassification", "TransfoXLLMHeadModel", @@ -45,7 +44,6 @@ pass else: _import_structure["modeling_tf_transfo_xl"] = [ - "TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAdaptiveEmbedding", "TFTransfoXLForSequenceClassification", "TFTransfoXLLMHeadModel", @@ -56,7 +54,7 @@ if TYPE_CHECKING: - from .configuration_transfo_xl import TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig + from .configuration_transfo_xl import TransfoXLConfig from .tokenization_transfo_xl import TransfoXLCorpus, TransfoXLTokenizer try: @@ -66,7 +64,6 @@ pass else: from .modeling_transfo_xl import ( - TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, AdaptiveEmbedding, TransfoXLForSequenceClassification, TransfoXLLMHeadModel, @@ -82,7 +79,6 @@ pass else: from .modeling_tf_transfo_xl import ( - TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, TFAdaptiveEmbedding, TFTransfoXLForSequenceClassification, TFTransfoXLLMHeadModel, diff --git a/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py index f7d5f2f87fb1ad..c9dde2e8fd2709 100644 --- a/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py +++ b/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "transfo-xl/transfo-xl-wt103": "https://huggingface.co/transfo-xl/transfo-xl-wt103/resolve/main/config.json", -} - class TransfoXLConfig(PretrainedConfig): """ diff --git a/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py index ab2725df0c4dcf..e490eb8dba3b80 100644 --- a/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py +++ b/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py @@ -51,11 +51,6 @@ _CHECKPOINT_FOR_DOC = "transfo-xl/transfo-xl-wt103" _CONFIG_FOR_DOC = "TransfoXLConfig" -TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "transfo-xl/transfo-xl-wt103", - # See all Transformer XL models at https://huggingface.co/models?filter=transfo-xl -] - class TFPositionalEmbedding(keras.layers.Layer): def __init__(self, demb, **kwargs): diff --git a/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py index 1b8f222f508a35..52989cfd13eae6 100644 --- a/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py +++ b/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py @@ -42,11 +42,6 @@ _CHECKPOINT_FOR_DOC = "transfo-xl/transfo-xl-wt103" _CONFIG_FOR_DOC = "TransfoXLConfig" -TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "transfo-xl/transfo-xl-wt103", - # See all Transformer XL models at https://huggingface.co/models?filter=transfo-xl -] - def build_tf_to_pytorch_map(model, config): """ diff --git a/src/transformers/models/deprecated/transfo_xl/tokenization_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/tokenization_transfo_xl.py index 12d360076fba4f..7290a7a83b8566 100644 --- a/src/transformers/models/deprecated/transfo_xl/tokenization_transfo_xl.py +++ b/src/transformers/models/deprecated/transfo_xl/tokenization_transfo_xl.py @@ -55,15 +55,6 @@ "vocab_file": "vocab.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "pretrained_vocab_file": { - "transfo-xl/transfo-xl-wt103": "https://huggingface.co/transfo-xl/transfo-xl-wt103/resolve/main/vocab.pkl", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "transfo-xl/transfo-xl-wt103": None, -} PRETRAINED_CORPUS_ARCHIVE_MAP = { "transfo-xl/transfo-xl-wt103": "https://huggingface.co/transfo-xl/transfo-xl-wt103/resolve/main/corpus.bin", @@ -162,8 +153,6 @@ class TransfoXLTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids"] def __init__( diff --git a/src/transformers/models/deprecated/van/__init__.py b/src/transformers/models/deprecated/van/__init__.py index 2db730984ffa03..59522e4ed46786 100644 --- a/src/transformers/models/deprecated/van/__init__.py +++ b/src/transformers/models/deprecated/van/__init__.py @@ -16,7 +16,7 @@ from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_van": ["VAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "VanConfig"]} +_import_structure = {"configuration_van": ["VanConfig"]} try: @@ -26,14 +26,13 @@ pass else: _import_structure["modeling_van"] = [ - "VAN_PRETRAINED_MODEL_ARCHIVE_LIST", "VanForImageClassification", "VanModel", "VanPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig + from .configuration_van import VanConfig try: if not is_torch_available(): @@ -42,7 +41,6 @@ pass else: from .modeling_van import ( - VAN_PRETRAINED_MODEL_ARCHIVE_LIST, VanForImageClassification, VanModel, VanPreTrainedModel, diff --git a/src/transformers/models/deprecated/van/configuration_van.py b/src/transformers/models/deprecated/van/configuration_van.py index 85f228193c450e..68a139ffdfcebc 100644 --- a/src/transformers/models/deprecated/van/configuration_van.py +++ b/src/transformers/models/deprecated/van/configuration_van.py @@ -20,12 +20,6 @@ logger = logging.get_logger(__name__) -VAN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Visual-Attention-Network/van-base": ( - "https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json" - ), -} - class VanConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deprecated/van/modeling_van.py b/src/transformers/models/deprecated/van/modeling_van.py index e0f88467e1e75b..0f5940707c1152 100644 --- a/src/transformers/models/deprecated/van/modeling_van.py +++ b/src/transformers/models/deprecated/van/modeling_van.py @@ -47,11 +47,6 @@ _IMAGE_CLASS_CHECKPOINT = "Visual-Attention-Network/van-base" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -VAN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Visual-Attention-Network/van-base", - # See all VAN models at https://huggingface.co/models?filter=van -] - # Copied from transformers.models.convnext.modeling_convnext.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/src/transformers/models/depth_anything/__init__.py b/src/transformers/models/depth_anything/__init__.py index 0d0ea5a514a836..0640e211259f77 100644 --- a/src/transformers/models/depth_anything/__init__.py +++ b/src/transformers/models/depth_anything/__init__.py @@ -17,9 +17,7 @@ from ...utils import OptionalDependencyNotAvailable -_import_structure = { - "configuration_depth_anything": ["DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP", "DepthAnythingConfig"] -} +_import_structure = {"configuration_depth_anything": ["DepthAnythingConfig"]} try: if not is_torch_available(): @@ -28,14 +26,13 @@ pass else: _import_structure["modeling_depth_anything"] = [ - "DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST", "DepthAnythingForDepthEstimation", "DepthAnythingPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_depth_anything import DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP, DepthAnythingConfig + from .configuration_depth_anything import DepthAnythingConfig try: if not is_torch_available(): @@ -44,7 +41,6 @@ pass else: from .modeling_depth_anything import ( - DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST, DepthAnythingForDepthEstimation, DepthAnythingPreTrainedModel, ) diff --git a/src/transformers/models/depth_anything/configuration_depth_anything.py b/src/transformers/models/depth_anything/configuration_depth_anything.py index 7fa7745c32d3fd..b6d6f388b0910d 100644 --- a/src/transformers/models/depth_anything/configuration_depth_anything.py +++ b/src/transformers/models/depth_anything/configuration_depth_anything.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "LiheYoung/depth-anything-small-hf": "https://huggingface.co/LiheYoung/depth-anything-small-hf/resolve/main/config.json", -} - class DepthAnythingConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/depth_anything/modeling_depth_anything.py b/src/transformers/models/depth_anything/modeling_depth_anything.py index 6497759f17825e..efa55adbdcd469 100644 --- a/src/transformers/models/depth_anything/modeling_depth_anything.py +++ b/src/transformers/models/depth_anything/modeling_depth_anything.py @@ -38,11 +38,6 @@ # General docstring _CONFIG_FOR_DOC = "DepthAnythingConfig" -DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "LiheYoung/depth-anything-small-hf", - # See all Depth Anything models at https://huggingface.co/models?filter=depth_anything -] - DEPTH_ANYTHING_START_DOCSTRING = r""" This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it diff --git a/src/transformers/models/deta/__init__.py b/src/transformers/models/deta/__init__.py index 2d25a6a71602b3..843a4dc4d803d9 100644 --- a/src/transformers/models/deta/__init__.py +++ b/src/transformers/models/deta/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_deta": ["DETA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetaConfig"], + "configuration_deta": ["DetaConfig"], } try: @@ -36,7 +36,6 @@ pass else: _import_structure["modeling_deta"] = [ - "DETA_PRETRAINED_MODEL_ARCHIVE_LIST", "DetaForObjectDetection", "DetaModel", "DetaPreTrainedModel", @@ -44,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig + from .configuration_deta import DetaConfig try: if not is_vision_available(): @@ -61,7 +60,6 @@ pass else: from .modeling_deta import ( - DETA_PRETRAINED_MODEL_ARCHIVE_LIST, DetaForObjectDetection, DetaModel, DetaPreTrainedModel, diff --git a/src/transformers/models/deta/configuration_deta.py b/src/transformers/models/deta/configuration_deta.py index d5a3709b91e372..b876e843c0f14c 100644 --- a/src/transformers/models/deta/configuration_deta.py +++ b/src/transformers/models/deta/configuration_deta.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -DETA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "ut/deta": "https://huggingface.co/ut/deta/resolve/main/config.json", -} - class DetaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deta/modeling_deta.py b/src/transformers/models/deta/modeling_deta.py index 0c2dfdf3b0a24c..62773b47abbfe2 100644 --- a/src/transformers/models/deta/modeling_deta.py +++ b/src/transformers/models/deta/modeling_deta.py @@ -151,11 +151,6 @@ def backward(context, grad_output): _CONFIG_FOR_DOC = "DetaConfig" _CHECKPOINT_FOR_DOC = "jozhang97/deta-swin-large-o365" -DETA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "jozhang97/deta-swin-large-o365", - # See all DETA models at https://huggingface.co/models?filter=deta -] - @dataclass # Copied from transformers.models.deformable_detr.modeling_deformable_detr.DeformableDetrDecoderOutput with DeformableDetr->Deta diff --git a/src/transformers/models/detr/__init__.py b/src/transformers/models/detr/__init__.py index 9cbaca9a54581f..422fe98230be45 100644 --- a/src/transformers/models/detr/__init__.py +++ b/src/transformers/models/detr/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_detr": ["DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetrConfig", "DetrOnnxConfig"]} +_import_structure = {"configuration_detr": ["DetrConfig", "DetrOnnxConfig"]} try: if not is_vision_available(): @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_detr"] = [ - "DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DetrForObjectDetection", "DetrForSegmentation", "DetrModel", @@ -44,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_detr import DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DetrConfig, DetrOnnxConfig + from .configuration_detr import DetrConfig, DetrOnnxConfig try: if not is_vision_available(): @@ -62,7 +61,6 @@ pass else: from .modeling_detr import ( - DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DetrForObjectDetection, DetrForSegmentation, DetrModel, diff --git a/src/transformers/models/detr/configuration_detr.py b/src/transformers/models/detr/configuration_detr.py index f13c1ef09a0c5c..acecf8aa915f62 100644 --- a/src/transformers/models/detr/configuration_detr.py +++ b/src/transformers/models/detr/configuration_detr.py @@ -27,11 +27,6 @@ logger = logging.get_logger(__name__) -DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/detr-resnet-50": "https://huggingface.co/facebook/detr-resnet-50/resolve/main/config.json", - # See all DETR models at https://huggingface.co/models?filter=detr -} - class DetrConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/detr/modeling_detr.py b/src/transformers/models/detr/modeling_detr.py index 1e548b61d3a7d2..b10d4ce02c93ca 100644 --- a/src/transformers/models/detr/modeling_detr.py +++ b/src/transformers/models/detr/modeling_detr.py @@ -60,11 +60,6 @@ _CONFIG_FOR_DOC = "DetrConfig" _CHECKPOINT_FOR_DOC = "facebook/detr-resnet-50" -DETR_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/detr-resnet-50", - # See all DETR models at https://huggingface.co/models?filter=detr -] - @dataclass class DetrDecoderOutput(BaseModelOutputWithCrossAttentions): diff --git a/src/transformers/models/dinat/__init__.py b/src/transformers/models/dinat/__init__.py index 88470f1ca9f9bd..207ebfdaa8693f 100644 --- a/src/transformers/models/dinat/__init__.py +++ b/src/transformers/models/dinat/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_dinat": ["DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DinatConfig"]} +_import_structure = {"configuration_dinat": ["DinatConfig"]} try: @@ -26,7 +26,6 @@ pass else: _import_structure["modeling_dinat"] = [ - "DINAT_PRETRAINED_MODEL_ARCHIVE_LIST", "DinatForImageClassification", "DinatModel", "DinatPreTrainedModel", @@ -34,7 +33,7 @@ ] if TYPE_CHECKING: - from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig + from .configuration_dinat import DinatConfig try: if not is_torch_available(): @@ -43,7 +42,6 @@ pass else: from .modeling_dinat import ( - DINAT_PRETRAINED_MODEL_ARCHIVE_LIST, DinatBackbone, DinatForImageClassification, DinatModel, diff --git a/src/transformers/models/dinat/configuration_dinat.py b/src/transformers/models/dinat/configuration_dinat.py index 83c3227f66b247..6138e8072b671a 100644 --- a/src/transformers/models/dinat/configuration_dinat.py +++ b/src/transformers/models/dinat/configuration_dinat.py @@ -21,11 +21,6 @@ logger = logging.get_logger(__name__) -DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "shi-labs/dinat-mini-in1k-224": "https://huggingface.co/shi-labs/dinat-mini-in1k-224/resolve/main/config.json", - # See all Dinat models at https://huggingface.co/models?filter=dinat -} - class DinatConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/dinat/modeling_dinat.py b/src/transformers/models/dinat/modeling_dinat.py index 71470efece28c1..03c0fe33a2838b 100644 --- a/src/transformers/models/dinat/modeling_dinat.py +++ b/src/transformers/models/dinat/modeling_dinat.py @@ -68,11 +68,6 @@ def natten2dav(*args, **kwargs): _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -DINAT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "shi-labs/dinat-mini-in1k-224", - # See all Dinat models at https://huggingface.co/models?filter=dinat -] - # drop_path and DinatDropPath are from the timm library. diff --git a/src/transformers/models/dinov2/__init__.py b/src/transformers/models/dinov2/__init__.py index 01d02a9e65fda0..25cf73b315bf2d 100644 --- a/src/transformers/models/dinov2/__init__.py +++ b/src/transformers/models/dinov2/__init__.py @@ -20,9 +20,7 @@ ) -_import_structure = { - "configuration_dinov2": ["DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Dinov2Config", "Dinov2OnnxConfig"] -} +_import_structure = {"configuration_dinov2": ["Dinov2Config", "Dinov2OnnxConfig"]} try: if not is_torch_available(): @@ -31,7 +29,6 @@ pass else: _import_structure["modeling_dinov2"] = [ - "DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Dinov2ForImageClassification", "Dinov2Model", "Dinov2PreTrainedModel", @@ -39,7 +36,7 @@ ] if TYPE_CHECKING: - from .configuration_dinov2 import DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Dinov2Config, Dinov2OnnxConfig + from .configuration_dinov2 import Dinov2Config, Dinov2OnnxConfig try: if not is_torch_available(): @@ -48,7 +45,6 @@ pass else: from .modeling_dinov2 import ( - DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST, Dinov2Backbone, Dinov2ForImageClassification, Dinov2Model, diff --git a/src/transformers/models/dinov2/configuration_dinov2.py b/src/transformers/models/dinov2/configuration_dinov2.py index 037f889ebf2a8c..48feba23b118e3 100644 --- a/src/transformers/models/dinov2/configuration_dinov2.py +++ b/src/transformers/models/dinov2/configuration_dinov2.py @@ -27,10 +27,6 @@ logger = logging.get_logger(__name__) -DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/dinov2-base": "https://huggingface.co/facebook/dinov2-base/resolve/main/config.json", -} - class Dinov2Config(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/dinov2/modeling_dinov2.py b/src/transformers/models/dinov2/modeling_dinov2.py index accdf0a9b23bee..806608afb184a1 100644 --- a/src/transformers/models/dinov2/modeling_dinov2.py +++ b/src/transformers/models/dinov2/modeling_dinov2.py @@ -58,12 +58,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/dinov2-base", - # See all DINOv2 models at https://huggingface.co/models?filter=dinov2 -] - - class Dinov2Embeddings(nn.Module): """ Construct the CLS token, mask token, position and patch embeddings. diff --git a/src/transformers/models/distilbert/__init__.py b/src/transformers/models/distilbert/__init__.py index 6a2756eb9d1c26..7d6586bfa50809 100644 --- a/src/transformers/models/distilbert/__init__.py +++ b/src/transformers/models/distilbert/__init__.py @@ -26,7 +26,6 @@ _import_structure = { "configuration_distilbert": [ - "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DistilBertConfig", "DistilBertOnnxConfig", ], @@ -48,7 +47,6 @@ pass else: _import_structure["modeling_distilbert"] = [ - "DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "DistilBertForMaskedLM", "DistilBertForMultipleChoice", "DistilBertForQuestionAnswering", @@ -65,7 +63,6 @@ pass else: _import_structure["modeling_tf_distilbert"] = [ - "TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDistilBertForMaskedLM", "TFDistilBertForMultipleChoice", "TFDistilBertForQuestionAnswering", @@ -95,7 +92,6 @@ if TYPE_CHECKING: from .configuration_distilbert import ( - DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, DistilBertConfig, DistilBertOnnxConfig, ) @@ -116,7 +112,6 @@ pass else: from .modeling_distilbert import ( - DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, DistilBertForMaskedLM, DistilBertForMultipleChoice, DistilBertForQuestionAnswering, @@ -133,7 +128,6 @@ pass else: from .modeling_tf_distilbert import ( - TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDistilBertForMaskedLM, TFDistilBertForMultipleChoice, TFDistilBertForQuestionAnswering, diff --git a/src/transformers/models/distilbert/configuration_distilbert.py b/src/transformers/models/distilbert/configuration_distilbert.py index 97b5b7c869064b..45e2d3b3f060d2 100644 --- a/src/transformers/models/distilbert/configuration_distilbert.py +++ b/src/transformers/models/distilbert/configuration_distilbert.py @@ -23,24 +23,6 @@ logger = logging.get_logger(__name__) -DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/config.json", - "distilbert-base-uncased-distilled-squad": ( - "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json" - ), - "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/config.json", - "distilbert-base-cased-distilled-squad": ( - "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json" - ), - "distilbert-base-german-cased": "https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json", - "distilbert-base-multilingual-cased": ( - "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json" - ), - "distilbert-base-uncased-finetuned-sst-2-english": ( - "https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json" - ), -} - class DistilBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/distilbert/modeling_distilbert.py b/src/transformers/models/distilbert/modeling_distilbert.py index 023b4dc13ade1c..bd2d745055a3de 100755 --- a/src/transformers/models/distilbert/modeling_distilbert.py +++ b/src/transformers/models/distilbert/modeling_distilbert.py @@ -62,17 +62,6 @@ _CHECKPOINT_FOR_DOC = "distilbert-base-uncased" _CONFIG_FOR_DOC = "DistilBertConfig" -DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "distilbert-base-uncased", - "distilbert-base-uncased-distilled-squad", - "distilbert-base-cased", - "distilbert-base-cased-distilled-squad", - "distilbert-base-german-cased", - "distilbert-base-multilingual-cased", - "distilbert-base-uncased-finetuned-sst-2-english", - # See all DistilBERT models at https://huggingface.co/models?filter=distilbert -] - # UTILS AND BUILDING BLOCKS OF THE ARCHITECTURE # diff --git a/src/transformers/models/distilbert/modeling_tf_distilbert.py b/src/transformers/models/distilbert/modeling_tf_distilbert.py index 39fd470597fa87..1e663c92293c78 100644 --- a/src/transformers/models/distilbert/modeling_tf_distilbert.py +++ b/src/transformers/models/distilbert/modeling_tf_distilbert.py @@ -62,16 +62,6 @@ _CHECKPOINT_FOR_DOC = "distilbert-base-uncased" _CONFIG_FOR_DOC = "DistilBertConfig" -TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "distilbert-base-uncased", - "distilbert-base-uncased-distilled-squad", - "distilbert-base-cased", - "distilbert-base-cased-distilled-squad", - "distilbert-base-multilingual-cased", - "distilbert-base-uncased-finetuned-sst-2-english", - # See all DistilBERT models at https://huggingface.co/models?filter=distilbert -] - class TFEmbeddings(keras.layers.Layer): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/distilbert/tokenization_distilbert.py b/src/transformers/models/distilbert/tokenization_distilbert.py index 014c41d1243b6f..ff8854ba3dcf89 100644 --- a/src/transformers/models/distilbert/tokenization_distilbert.py +++ b/src/transformers/models/distilbert/tokenization_distilbert.py @@ -27,42 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/vocab.txt", - "distilbert-base-uncased-distilled-squad": ( - "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/vocab.txt" - ), - "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/vocab.txt", - "distilbert-base-cased-distilled-squad": ( - "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/vocab.txt" - ), - "distilbert-base-german-cased": "https://huggingface.co/distilbert-base-german-cased/resolve/main/vocab.txt", - "distilbert-base-multilingual-cased": ( - "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "distilbert-base-uncased": 512, - "distilbert-base-uncased-distilled-squad": 512, - "distilbert-base-cased": 512, - "distilbert-base-cased-distilled-squad": 512, - "distilbert-base-german-cased": 512, - "distilbert-base-multilingual-cased": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "distilbert-base-uncased": {"do_lower_case": True}, - "distilbert-base-uncased-distilled-squad": {"do_lower_case": True}, - "distilbert-base-cased": {"do_lower_case": False}, - "distilbert-base-cased-distilled-squad": {"do_lower_case": False}, - "distilbert-base-german-cased": {"do_lower_case": False}, - "distilbert-base-multilingual-cased": {"do_lower_case": False}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -129,9 +93,6 @@ class DistilBertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/distilbert/tokenization_distilbert_fast.py b/src/transformers/models/distilbert/tokenization_distilbert_fast.py index adb90f857d75fe..f1d69a27d67c08 100644 --- a/src/transformers/models/distilbert/tokenization_distilbert_fast.py +++ b/src/transformers/models/distilbert/tokenization_distilbert_fast.py @@ -28,58 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/vocab.txt", - "distilbert-base-uncased-distilled-squad": ( - "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/vocab.txt" - ), - "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/vocab.txt", - "distilbert-base-cased-distilled-squad": ( - "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/vocab.txt" - ), - "distilbert-base-german-cased": "https://huggingface.co/distilbert-base-german-cased/resolve/main/vocab.txt", - "distilbert-base-multilingual-cased": ( - "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/tokenizer.json", - "distilbert-base-uncased-distilled-squad": ( - "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/tokenizer.json" - ), - "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/tokenizer.json", - "distilbert-base-cased-distilled-squad": ( - "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/tokenizer.json" - ), - "distilbert-base-german-cased": ( - "https://huggingface.co/distilbert-base-german-cased/resolve/main/tokenizer.json" - ), - "distilbert-base-multilingual-cased": ( - "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "distilbert-base-uncased": 512, - "distilbert-base-uncased-distilled-squad": 512, - "distilbert-base-cased": 512, - "distilbert-base-cased-distilled-squad": 512, - "distilbert-base-german-cased": 512, - "distilbert-base-multilingual-cased": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "distilbert-base-uncased": {"do_lower_case": True}, - "distilbert-base-uncased-distilled-squad": {"do_lower_case": True}, - "distilbert-base-cased": {"do_lower_case": False}, - "distilbert-base-cased-distilled-squad": {"do_lower_case": False}, - "distilbert-base-german-cased": {"do_lower_case": False}, - "distilbert-base-multilingual-cased": {"do_lower_case": False}, -} - class DistilBertTokenizerFast(PreTrainedTokenizerFast): r""" @@ -122,9 +70,6 @@ class DistilBertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = DistilBertTokenizer diff --git a/src/transformers/models/donut/__init__.py b/src/transformers/models/donut/__init__.py index c548a181a3bf30..f6f38609e6ff54 100644 --- a/src/transformers/models/donut/__init__.py +++ b/src/transformers/models/donut/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_donut_swin": ["DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "DonutSwinConfig"], + "configuration_donut_swin": ["DonutSwinConfig"], "processing_donut": ["DonutProcessor"], } @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_donut_swin"] = [ - "DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "DonutSwinModel", "DonutSwinPreTrainedModel", ] @@ -44,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig + from .configuration_donut_swin import DonutSwinConfig from .processing_donut import DonutProcessor try: @@ -54,7 +53,6 @@ pass else: from .modeling_donut_swin import ( - DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, DonutSwinModel, DonutSwinPreTrainedModel, ) diff --git a/src/transformers/models/donut/configuration_donut_swin.py b/src/transformers/models/donut/configuration_donut_swin.py index 9de3181b55bc3a..80418e71442f6c 100644 --- a/src/transformers/models/donut/configuration_donut_swin.py +++ b/src/transformers/models/donut/configuration_donut_swin.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "naver-clova-ix/donut-base": "https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json", - # See all Donut models at https://huggingface.co/models?filter=donut-swin -} - class DonutSwinConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/donut/modeling_donut_swin.py b/src/transformers/models/donut/modeling_donut_swin.py index ed79b8ef8ec85a..6e71e0841b7a94 100644 --- a/src/transformers/models/donut/modeling_donut_swin.py +++ b/src/transformers/models/donut/modeling_donut_swin.py @@ -48,11 +48,6 @@ _CHECKPOINT_FOR_DOC = "https://huggingface.co/naver-clova-ix/donut-base" _EXPECTED_OUTPUT_SHAPE = [1, 49, 768] -DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "naver-clova-ix/donut-base", - # See all Donut Swin models at https://huggingface.co/models?filter=donut -] - @dataclass # Copied from transformers.models.swin.modeling_swin.SwinEncoderOutput with Swin->DonutSwin diff --git a/src/transformers/models/dpr/__init__.py b/src/transformers/models/dpr/__init__.py index 6ea8b78e503739..ef4bccee54d296 100644 --- a/src/transformers/models/dpr/__init__.py +++ b/src/transformers/models/dpr/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_dpr": ["DPR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPRConfig"], + "configuration_dpr": ["DPRConfig"], "tokenization_dpr": [ "DPRContextEncoderTokenizer", "DPRQuestionEncoderTokenizer", @@ -53,9 +53,6 @@ pass else: _import_structure["modeling_dpr"] = [ - "DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "DPRContextEncoder", "DPRPretrainedContextEncoder", "DPRPreTrainedModel", @@ -72,9 +69,6 @@ pass else: _import_structure["modeling_tf_dpr"] = [ - "TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", - "TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDPRContextEncoder", "TFDPRPretrainedContextEncoder", "TFDPRPretrainedQuestionEncoder", @@ -85,7 +79,7 @@ if TYPE_CHECKING: - from .configuration_dpr import DPR_PRETRAINED_CONFIG_ARCHIVE_MAP, DPRConfig + from .configuration_dpr import DPRConfig from .tokenization_dpr import ( DPRContextEncoderTokenizer, DPRQuestionEncoderTokenizer, @@ -112,9 +106,6 @@ pass else: from .modeling_dpr import ( - DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, DPRContextEncoder, DPRPretrainedContextEncoder, DPRPreTrainedModel, @@ -131,9 +122,6 @@ pass else: from .modeling_tf_dpr import ( - TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, TFDPRContextEncoder, TFDPRPretrainedContextEncoder, TFDPRPretrainedQuestionEncoder, diff --git a/src/transformers/models/dpr/configuration_dpr.py b/src/transformers/models/dpr/configuration_dpr.py index 3b6785c6b540f5..3d7abec3ebed25 100644 --- a/src/transformers/models/dpr/configuration_dpr.py +++ b/src/transformers/models/dpr/configuration_dpr.py @@ -20,27 +20,6 @@ logger = logging.get_logger(__name__) -DPR_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/dpr-ctx_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json" - ), - "facebook/dpr-question_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json" - ), - "facebook/dpr-reader-single-nq-base": ( - "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json" - ), - "facebook/dpr-ctx_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json" - ), - "facebook/dpr-question_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json" - ), - "facebook/dpr-reader-multiset-base": ( - "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json" - ), -} - class DPRConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/dpr/modeling_dpr.py b/src/transformers/models/dpr/modeling_dpr.py index 1071a42d810076..b228b0a9b76a41 100644 --- a/src/transformers/models/dpr/modeling_dpr.py +++ b/src/transformers/models/dpr/modeling_dpr.py @@ -39,19 +39,6 @@ _CONFIG_FOR_DOC = "DPRConfig" _CHECKPOINT_FOR_DOC = "facebook/dpr-ctx_encoder-single-nq-base" -DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/dpr-ctx_encoder-single-nq-base", - "facebook/dpr-ctx_encoder-multiset-base", -] -DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/dpr-question_encoder-single-nq-base", - "facebook/dpr-question_encoder-multiset-base", -] -DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/dpr-reader-single-nq-base", - "facebook/dpr-reader-multiset-base", -] - ########## # Outputs diff --git a/src/transformers/models/dpr/modeling_tf_dpr.py b/src/transformers/models/dpr/modeling_tf_dpr.py index 0a6aa47640d03c..a2e539f73fc26c 100644 --- a/src/transformers/models/dpr/modeling_tf_dpr.py +++ b/src/transformers/models/dpr/modeling_tf_dpr.py @@ -39,19 +39,6 @@ _CONFIG_FOR_DOC = "DPRConfig" -TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/dpr-ctx_encoder-single-nq-base", - "facebook/dpr-ctx_encoder-multiset-base", -] -TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/dpr-question_encoder-single-nq-base", - "facebook/dpr-question_encoder-multiset-base", -] -TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/dpr-reader-single-nq-base", - "facebook/dpr-reader-multiset-base", -] - ########## # Outputs diff --git a/src/transformers/models/dpr/tokenization_dpr.py b/src/transformers/models/dpr/tokenization_dpr.py index b2ae84addc75ef..1362047ce283e2 100644 --- a/src/transformers/models/dpr/tokenization_dpr.py +++ b/src/transformers/models/dpr/tokenization_dpr.py @@ -27,88 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -CONTEXT_ENCODER_PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/dpr-ctx_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/vocab.txt" - ), - "facebook/dpr-ctx_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "facebook/dpr-ctx_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/tokenizer.json" - ), - "facebook/dpr-ctx_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/tokenizer.json" - ), - }, -} -QUESTION_ENCODER_PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/dpr-question_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/vocab.txt" - ), - "facebook/dpr-question_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "facebook/dpr-question_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/tokenizer.json" - ), - "facebook/dpr-question_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/tokenizer.json" - ), - }, -} -READER_PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/dpr-reader-single-nq-base": ( - "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/vocab.txt" - ), - "facebook/dpr-reader-multiset-base": ( - "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "facebook/dpr-reader-single-nq-base": ( - "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/tokenizer.json" - ), - "facebook/dpr-reader-multiset-base": ( - "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/tokenizer.json" - ), - }, -} - -CONTEXT_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/dpr-ctx_encoder-single-nq-base": 512, - "facebook/dpr-ctx_encoder-multiset-base": 512, -} -QUESTION_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/dpr-question_encoder-single-nq-base": 512, - "facebook/dpr-question_encoder-multiset-base": 512, -} -READER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/dpr-reader-single-nq-base": 512, - "facebook/dpr-reader-multiset-base": 512, -} - - -CONTEXT_ENCODER_PRETRAINED_INIT_CONFIGURATION = { - "facebook/dpr-ctx_encoder-single-nq-base": {"do_lower_case": True}, - "facebook/dpr-ctx_encoder-multiset-base": {"do_lower_case": True}, -} -QUESTION_ENCODER_PRETRAINED_INIT_CONFIGURATION = { - "facebook/dpr-question_encoder-single-nq-base": {"do_lower_case": True}, - "facebook/dpr-question_encoder-multiset-base": {"do_lower_case": True}, -} -READER_PRETRAINED_INIT_CONFIGURATION = { - "facebook/dpr-reader-single-nq-base": {"do_lower_case": True}, - "facebook/dpr-reader-multiset-base": {"do_lower_case": True}, -} - class DPRContextEncoderTokenizer(BertTokenizer): r""" @@ -121,9 +39,6 @@ class DPRContextEncoderTokenizer(BertTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = CONTEXT_ENCODER_PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = CONTEXT_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = CONTEXT_ENCODER_PRETRAINED_INIT_CONFIGURATION class DPRQuestionEncoderTokenizer(BertTokenizer): @@ -137,9 +52,6 @@ class DPRQuestionEncoderTokenizer(BertTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = QUESTION_ENCODER_PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = QUESTION_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = QUESTION_ENCODER_PRETRAINED_INIT_CONFIGURATION DPRSpanPrediction = collections.namedtuple( @@ -404,7 +316,4 @@ class DPRReaderTokenizer(CustomDPRReaderTokenizerMixin, BertTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = READER_PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = READER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = READER_PRETRAINED_INIT_CONFIGURATION model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/dpr/tokenization_dpr_fast.py b/src/transformers/models/dpr/tokenization_dpr_fast.py index 784ed1344cf6f4..730f200a6876f1 100644 --- a/src/transformers/models/dpr/tokenization_dpr_fast.py +++ b/src/transformers/models/dpr/tokenization_dpr_fast.py @@ -28,88 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -CONTEXT_ENCODER_PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/dpr-ctx_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/vocab.txt" - ), - "facebook/dpr-ctx_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "facebook/dpr-ctx_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/tokenizer.json" - ), - "facebook/dpr-ctx_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/tokenizer.json" - ), - }, -} -QUESTION_ENCODER_PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/dpr-question_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/vocab.txt" - ), - "facebook/dpr-question_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "facebook/dpr-question_encoder-single-nq-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/tokenizer.json" - ), - "facebook/dpr-question_encoder-multiset-base": ( - "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/tokenizer.json" - ), - }, -} -READER_PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/dpr-reader-single-nq-base": ( - "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/vocab.txt" - ), - "facebook/dpr-reader-multiset-base": ( - "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "facebook/dpr-reader-single-nq-base": ( - "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/tokenizer.json" - ), - "facebook/dpr-reader-multiset-base": ( - "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/tokenizer.json" - ), - }, -} - -CONTEXT_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/dpr-ctx_encoder-single-nq-base": 512, - "facebook/dpr-ctx_encoder-multiset-base": 512, -} -QUESTION_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/dpr-question_encoder-single-nq-base": 512, - "facebook/dpr-question_encoder-multiset-base": 512, -} -READER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/dpr-reader-single-nq-base": 512, - "facebook/dpr-reader-multiset-base": 512, -} - - -CONTEXT_ENCODER_PRETRAINED_INIT_CONFIGURATION = { - "facebook/dpr-ctx_encoder-single-nq-base": {"do_lower_case": True}, - "facebook/dpr-ctx_encoder-multiset-base": {"do_lower_case": True}, -} -QUESTION_ENCODER_PRETRAINED_INIT_CONFIGURATION = { - "facebook/dpr-question_encoder-single-nq-base": {"do_lower_case": True}, - "facebook/dpr-question_encoder-multiset-base": {"do_lower_case": True}, -} -READER_PRETRAINED_INIT_CONFIGURATION = { - "facebook/dpr-reader-single-nq-base": {"do_lower_case": True}, - "facebook/dpr-reader-multiset-base": {"do_lower_case": True}, -} - class DPRContextEncoderTokenizerFast(BertTokenizerFast): r""" @@ -122,9 +40,6 @@ class DPRContextEncoderTokenizerFast(BertTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = CONTEXT_ENCODER_PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = CONTEXT_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = CONTEXT_ENCODER_PRETRAINED_INIT_CONFIGURATION slow_tokenizer_class = DPRContextEncoderTokenizer @@ -139,9 +54,6 @@ class DPRQuestionEncoderTokenizerFast(BertTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = QUESTION_ENCODER_PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = QUESTION_ENCODER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = QUESTION_ENCODER_PRETRAINED_INIT_CONFIGURATION slow_tokenizer_class = DPRQuestionEncoderTokenizer @@ -403,8 +315,5 @@ class DPRReaderTokenizerFast(CustomDPRReaderTokenizerMixin, BertTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = READER_PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = READER_PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = READER_PRETRAINED_INIT_CONFIGURATION model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = DPRReaderTokenizer diff --git a/src/transformers/models/dpt/__init__.py b/src/transformers/models/dpt/__init__.py index da53011b87b318..ef8999d5efba78 100644 --- a/src/transformers/models/dpt/__init__.py +++ b/src/transformers/models/dpt/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable -_import_structure = {"configuration_dpt": ["DPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPTConfig"]} +_import_structure = {"configuration_dpt": ["DPTConfig"]} try: if not is_vision_available(): @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_dpt"] = [ - "DPT_PRETRAINED_MODEL_ARCHIVE_LIST", "DPTForDepthEstimation", "DPTForSemanticSegmentation", "DPTModel", @@ -44,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig + from .configuration_dpt import DPTConfig try: if not is_vision_available(): @@ -62,7 +61,6 @@ pass else: from .modeling_dpt import ( - DPT_PRETRAINED_MODEL_ARCHIVE_LIST, DPTForDepthEstimation, DPTForSemanticSegmentation, DPTModel, diff --git a/src/transformers/models/dpt/configuration_dpt.py b/src/transformers/models/dpt/configuration_dpt.py index 97b9e2e9a834e0..b21864e9b0bd22 100644 --- a/src/transformers/models/dpt/configuration_dpt.py +++ b/src/transformers/models/dpt/configuration_dpt.py @@ -24,11 +24,6 @@ logger = logging.get_logger(__name__) -DPT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Intel/dpt-large": "https://huggingface.co/Intel/dpt-large/resolve/main/config.json", - # See all DPT models at https://huggingface.co/models?filter=dpt -} - class DPTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/dpt/modeling_dpt.py b/src/transformers/models/dpt/modeling_dpt.py index e986e71d4851da..74990b1684bc13 100755 --- a/src/transformers/models/dpt/modeling_dpt.py +++ b/src/transformers/models/dpt/modeling_dpt.py @@ -55,13 +55,6 @@ _EXPECTED_OUTPUT_SHAPE = [1, 577, 1024] -DPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Intel/dpt-large", - "Intel/dpt-hybrid-midas", - # See all DPT models at https://huggingface.co/models?filter=dpt -] - - @dataclass class BaseModelOutputWithIntermediateActivations(ModelOutput): """ diff --git a/src/transformers/models/efficientformer/__init__.py b/src/transformers/models/efficientformer/__init__.py index 25d60d1ee765ef..9b36518587cf44 100644 --- a/src/transformers/models/efficientformer/__init__.py +++ b/src/transformers/models/efficientformer/__init__.py @@ -22,12 +22,7 @@ ) -_import_structure = { - "configuration_efficientformer": [ - "EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "EfficientFormerConfig", - ] -} +_import_structure = {"configuration_efficientformer": ["EfficientFormerConfig"]} try: if not is_vision_available(): @@ -44,7 +39,6 @@ pass else: _import_structure["modeling_efficientformer"] = [ - "EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientFormerForImageClassification", "EfficientFormerForImageClassificationWithTeacher", "EfficientFormerModel", @@ -58,7 +52,6 @@ pass else: _import_structure["modeling_tf_efficientformer"] = [ - "TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEfficientFormerForImageClassification", "TFEfficientFormerForImageClassificationWithTeacher", "TFEfficientFormerModel", @@ -66,7 +59,7 @@ ] if TYPE_CHECKING: - from .configuration_efficientformer import EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientFormerConfig + from .configuration_efficientformer import EfficientFormerConfig try: if not is_vision_available(): @@ -83,7 +76,6 @@ pass else: from .modeling_efficientformer import ( - EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientFormerForImageClassification, EfficientFormerForImageClassificationWithTeacher, EfficientFormerModel, @@ -96,7 +88,6 @@ pass else: from .modeling_tf_efficientformer import ( - TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFEfficientFormerForImageClassification, TFEfficientFormerForImageClassificationWithTeacher, TFEfficientFormerModel, diff --git a/src/transformers/models/efficientformer/configuration_efficientformer.py b/src/transformers/models/efficientformer/configuration_efficientformer.py index fecb90a886e8eb..0cc7635ea0cde6 100644 --- a/src/transformers/models/efficientformer/configuration_efficientformer.py +++ b/src/transformers/models/efficientformer/configuration_efficientformer.py @@ -22,12 +22,6 @@ logger = logging.get_logger(__name__) -EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "snap-research/efficientformer-l1-300": ( - "https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json" - ), -} - class EfficientFormerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/efficientformer/modeling_efficientformer.py b/src/transformers/models/efficientformer/modeling_efficientformer.py index 5f03a5ab747235..c077edc17dc8b6 100644 --- a/src/transformers/models/efficientformer/modeling_efficientformer.py +++ b/src/transformers/models/efficientformer/modeling_efficientformer.py @@ -50,12 +50,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "Egyptian cat" -EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "snap-research/efficientformer-l1-300", - # See all EfficientFormer models at https://huggingface.co/models?filter=efficientformer -] - - class EfficientFormerPatchEmbeddings(nn.Module): """ This class performs downsampling between two stages. For the input tensor with the shape [batch_size, num_channels, diff --git a/src/transformers/models/efficientformer/modeling_tf_efficientformer.py b/src/transformers/models/efficientformer/modeling_tf_efficientformer.py index 113eafb88d8493..605487e6feccdf 100644 --- a/src/transformers/models/efficientformer/modeling_tf_efficientformer.py +++ b/src/transformers/models/efficientformer/modeling_tf_efficientformer.py @@ -59,12 +59,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "LABEL_281" -TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "snap-research/efficientformer-l1-300", - # See all EfficientFormer models at https://huggingface.co/models?filter=efficientformer -] - - class TFEfficientFormerPatchEmbeddings(keras.layers.Layer): """ This class performs downsampling between two stages. For the input tensor with the shape [batch_size, num_channels, diff --git a/src/transformers/models/efficientnet/__init__.py b/src/transformers/models/efficientnet/__init__.py index 6df523721aefc5..28cb70490d9675 100644 --- a/src/transformers/models/efficientnet/__init__.py +++ b/src/transformers/models/efficientnet/__init__.py @@ -23,7 +23,6 @@ _import_structure = { "configuration_efficientnet": [ - "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "EfficientNetConfig", "EfficientNetOnnxConfig", ] @@ -44,7 +43,6 @@ pass else: _import_structure["modeling_efficientnet"] = [ - "EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientNetForImageClassification", "EfficientNetModel", "EfficientNetPreTrainedModel", @@ -52,7 +50,6 @@ if TYPE_CHECKING: from .configuration_efficientnet import ( - EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientNetConfig, EfficientNetOnnxConfig, ) @@ -72,7 +69,6 @@ pass else: from .modeling_efficientnet import ( - EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientNetForImageClassification, EfficientNetModel, EfficientNetPreTrainedModel, diff --git a/src/transformers/models/efficientnet/configuration_efficientnet.py b/src/transformers/models/efficientnet/configuration_efficientnet.py index 49e50a45e11537..63480a9a6dd7e7 100644 --- a/src/transformers/models/efficientnet/configuration_efficientnet.py +++ b/src/transformers/models/efficientnet/configuration_efficientnet.py @@ -26,10 +26,6 @@ logger = logging.get_logger(__name__) -EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/efficientnet-b7": "https://huggingface.co/google/efficientnet-b7/resolve/main/config.json", -} - class EfficientNetConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/efficientnet/modeling_efficientnet.py b/src/transformers/models/efficientnet/modeling_efficientnet.py index 2513f9b2fde142..cfa2a593183848 100644 --- a/src/transformers/models/efficientnet/modeling_efficientnet.py +++ b/src/transformers/models/efficientnet/modeling_efficientnet.py @@ -52,11 +52,6 @@ _IMAGE_CLASS_CHECKPOINT = "google/efficientnet-b7" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/efficientnet-b7", - # See all EfficientNet models at https://huggingface.co/models?filter=efficientnet -] - EFFICIENTNET_START_DOCSTRING = r""" This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it diff --git a/src/transformers/models/electra/__init__.py b/src/transformers/models/electra/__init__.py index 09ce039d25fd05..b79f2410bf354e 100644 --- a/src/transformers/models/electra/__init__.py +++ b/src/transformers/models/electra/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_electra": ["ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "ElectraConfig", "ElectraOnnxConfig"], + "configuration_electra": ["ElectraConfig", "ElectraOnnxConfig"], "tokenization_electra": ["ElectraTokenizer"], } @@ -44,7 +44,6 @@ pass else: _import_structure["modeling_electra"] = [ - "ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "ElectraForCausalLM", "ElectraForMaskedLM", "ElectraForMultipleChoice", @@ -64,7 +63,6 @@ pass else: _import_structure["modeling_tf_electra"] = [ - "TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFElectraForMaskedLM", "TFElectraForMultipleChoice", "TFElectraForPreTraining", @@ -95,7 +93,7 @@ if TYPE_CHECKING: - from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig + from .configuration_electra import ElectraConfig, ElectraOnnxConfig from .tokenization_electra import ElectraTokenizer try: @@ -113,7 +111,6 @@ pass else: from .modeling_electra import ( - ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, ElectraForCausalLM, ElectraForMaskedLM, ElectraForMultipleChoice, @@ -133,7 +130,6 @@ pass else: from .modeling_tf_electra import ( - TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, TFElectraForMaskedLM, TFElectraForMultipleChoice, TFElectraForPreTraining, diff --git a/src/transformers/models/electra/configuration_electra.py b/src/transformers/models/electra/configuration_electra.py index d45f62930212ec..f4ca3049837996 100644 --- a/src/transformers/models/electra/configuration_electra.py +++ b/src/transformers/models/electra/configuration_electra.py @@ -25,21 +25,6 @@ logger = logging.get_logger(__name__) -ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/electra-small-generator": "https://huggingface.co/google/electra-small-generator/resolve/main/config.json", - "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/config.json", - "google/electra-large-generator": "https://huggingface.co/google/electra-large-generator/resolve/main/config.json", - "google/electra-small-discriminator": ( - "https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json" - ), - "google/electra-base-discriminator": ( - "https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json" - ), - "google/electra-large-discriminator": ( - "https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json" - ), -} - class ElectraConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/electra/modeling_electra.py b/src/transformers/models/electra/modeling_electra.py index 3aaa6141004fb3..3b05f982c8700c 100644 --- a/src/transformers/models/electra/modeling_electra.py +++ b/src/transformers/models/electra/modeling_electra.py @@ -53,16 +53,6 @@ _CHECKPOINT_FOR_DOC = "google/electra-small-discriminator" _CONFIG_FOR_DOC = "ElectraConfig" -ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/electra-small-generator", - "google/electra-base-generator", - "google/electra-large-generator", - "google/electra-small-discriminator", - "google/electra-base-discriminator", - "google/electra-large-discriminator", - # See all ELECTRA models at https://huggingface.co/models?filter=electra -] - def load_tf_weights_in_electra(model, config, tf_checkpoint_path, discriminator_or_generator="discriminator"): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/electra/modeling_tf_electra.py b/src/transformers/models/electra/modeling_tf_electra.py index b0c8b4fa285d54..b903e7f082c6a1 100644 --- a/src/transformers/models/electra/modeling_tf_electra.py +++ b/src/transformers/models/electra/modeling_tf_electra.py @@ -65,16 +65,6 @@ _CHECKPOINT_FOR_DOC = "google/electra-small-discriminator" _CONFIG_FOR_DOC = "ElectraConfig" -TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/electra-small-generator", - "google/electra-base-generator", - "google/electra-large-generator", - "google/electra-small-discriminator", - "google/electra-base-discriminator", - "google/electra-large-discriminator", - # See all ELECTRA models at https://huggingface.co/models?filter=electra -] - # Copied from transformers.models.bert.modeling_tf_bert.TFBertSelfAttention with Bert->Electra class TFElectraSelfAttention(keras.layers.Layer): diff --git a/src/transformers/models/electra/tokenization_electra.py b/src/transformers/models/electra/tokenization_electra.py index 6ea9a600a6e957..ceb3e7560215c2 100644 --- a/src/transformers/models/electra/tokenization_electra.py +++ b/src/transformers/models/electra/tokenization_electra.py @@ -26,46 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/electra-small-generator": ( - "https://huggingface.co/google/electra-small-generator/resolve/main/vocab.txt" - ), - "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/vocab.txt", - "google/electra-large-generator": ( - "https://huggingface.co/google/electra-large-generator/resolve/main/vocab.txt" - ), - "google/electra-small-discriminator": ( - "https://huggingface.co/google/electra-small-discriminator/resolve/main/vocab.txt" - ), - "google/electra-base-discriminator": ( - "https://huggingface.co/google/electra-base-discriminator/resolve/main/vocab.txt" - ), - "google/electra-large-discriminator": ( - "https://huggingface.co/google/electra-large-discriminator/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/electra-small-generator": 512, - "google/electra-base-generator": 512, - "google/electra-large-generator": 512, - "google/electra-small-discriminator": 512, - "google/electra-base-discriminator": 512, - "google/electra-large-discriminator": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "google/electra-small-generator": {"do_lower_case": True}, - "google/electra-base-generator": {"do_lower_case": True}, - "google/electra-large-generator": {"do_lower_case": True}, - "google/electra-small-discriminator": {"do_lower_case": True}, - "google/electra-base-discriminator": {"do_lower_case": True}, - "google/electra-large-discriminator": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -133,9 +93,6 @@ class ElectraTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/electra/tokenization_electra_fast.py b/src/transformers/models/electra/tokenization_electra_fast.py index e76082de174dee..7b9d6a36cb9210 100644 --- a/src/transformers/models/electra/tokenization_electra_fast.py +++ b/src/transformers/models/electra/tokenization_electra_fast.py @@ -24,65 +24,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/electra-small-generator": ( - "https://huggingface.co/google/electra-small-generator/resolve/main/vocab.txt" - ), - "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/vocab.txt", - "google/electra-large-generator": ( - "https://huggingface.co/google/electra-large-generator/resolve/main/vocab.txt" - ), - "google/electra-small-discriminator": ( - "https://huggingface.co/google/electra-small-discriminator/resolve/main/vocab.txt" - ), - "google/electra-base-discriminator": ( - "https://huggingface.co/google/electra-base-discriminator/resolve/main/vocab.txt" - ), - "google/electra-large-discriminator": ( - "https://huggingface.co/google/electra-large-discriminator/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "google/electra-small-generator": ( - "https://huggingface.co/google/electra-small-generator/resolve/main/tokenizer.json" - ), - "google/electra-base-generator": ( - "https://huggingface.co/google/electra-base-generator/resolve/main/tokenizer.json" - ), - "google/electra-large-generator": ( - "https://huggingface.co/google/electra-large-generator/resolve/main/tokenizer.json" - ), - "google/electra-small-discriminator": ( - "https://huggingface.co/google/electra-small-discriminator/resolve/main/tokenizer.json" - ), - "google/electra-base-discriminator": ( - "https://huggingface.co/google/electra-base-discriminator/resolve/main/tokenizer.json" - ), - "google/electra-large-discriminator": ( - "https://huggingface.co/google/electra-large-discriminator/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/electra-small-generator": 512, - "google/electra-base-generator": 512, - "google/electra-large-generator": 512, - "google/electra-small-discriminator": 512, - "google/electra-base-discriminator": 512, - "google/electra-large-discriminator": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "google/electra-small-generator": {"do_lower_case": True}, - "google/electra-base-generator": {"do_lower_case": True}, - "google/electra-large-generator": {"do_lower_case": True}, - "google/electra-small-discriminator": {"do_lower_case": True}, - "google/electra-base-discriminator": {"do_lower_case": True}, - "google/electra-large-discriminator": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert_fast.BertTokenizerFast with Bert->Electra , BERT->ELECTRA class ElectraTokenizerFast(PreTrainedTokenizerFast): @@ -126,9 +67,6 @@ class ElectraTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = ElectraTokenizer def __init__( diff --git a/src/transformers/models/encodec/__init__.py b/src/transformers/models/encodec/__init__.py index d3d9488968bf2c..d67075e5560c75 100644 --- a/src/transformers/models/encodec/__init__.py +++ b/src/transformers/models/encodec/__init__.py @@ -21,10 +21,7 @@ _import_structure = { - "configuration_encodec": [ - "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", - "EncodecConfig", - ], + "configuration_encodec": ["EncodecConfig"], "feature_extraction_encodec": ["EncodecFeatureExtractor"], } @@ -35,14 +32,12 @@ pass else: _import_structure["modeling_encodec"] = [ - "ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST", "EncodecModel", "EncodecPreTrainedModel", ] if TYPE_CHECKING: from .configuration_encodec import ( - ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP, EncodecConfig, ) from .feature_extraction_encodec import EncodecFeatureExtractor @@ -54,7 +49,6 @@ pass else: from .modeling_encodec import ( - ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST, EncodecModel, EncodecPreTrainedModel, ) diff --git a/src/transformers/models/encodec/configuration_encodec.py b/src/transformers/models/encodec/configuration_encodec.py index af493c325bece5..4d8611a1788c0d 100644 --- a/src/transformers/models/encodec/configuration_encodec.py +++ b/src/transformers/models/encodec/configuration_encodec.py @@ -26,11 +26,6 @@ logger = logging.get_logger(__name__) -ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/encodec_24khz": "https://huggingface.co/facebook/encodec_24khz/resolve/main/config.json", - "facebook/encodec_48khz": "https://huggingface.co/facebook/encodec_48khz/resolve/main/config.json", -} - class EncodecConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/encodec/modeling_encodec.py b/src/transformers/models/encodec/modeling_encodec.py index bf7503efb459c1..762999cdf504c5 100644 --- a/src/transformers/models/encodec/modeling_encodec.py +++ b/src/transformers/models/encodec/modeling_encodec.py @@ -40,13 +40,6 @@ _CONFIG_FOR_DOC = "EncodecConfig" -ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/encodec_24khz", - "facebook/encodec_48khz", - # See all EnCodec models at https://huggingface.co/models?filter=encodec -] - - @dataclass class EncodecOutput(ModelOutput): """ diff --git a/src/transformers/models/ernie/__init__.py b/src/transformers/models/ernie/__init__.py index ea7f077f928d39..ddd3b30365d80a 100644 --- a/src/transformers/models/ernie/__init__.py +++ b/src/transformers/models/ernie/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_ernie": ["ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieConfig", "ErnieOnnxConfig"], + "configuration_ernie": ["ErnieConfig", "ErnieOnnxConfig"], } try: @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_ernie"] = [ - "ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieForCausalLM", "ErnieForMaskedLM", "ErnieForMultipleChoice", @@ -42,7 +41,7 @@ ] if TYPE_CHECKING: - from .configuration_ernie import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieConfig, ErnieOnnxConfig + from .configuration_ernie import ErnieConfig, ErnieOnnxConfig try: if not is_torch_available(): @@ -51,7 +50,6 @@ pass else: from .modeling_ernie import ( - ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieForCausalLM, ErnieForMaskedLM, ErnieForMultipleChoice, diff --git a/src/transformers/models/ernie/configuration_ernie.py b/src/transformers/models/ernie/configuration_ernie.py index 7278a74eced517..16f14489903fde 100644 --- a/src/transformers/models/ernie/configuration_ernie.py +++ b/src/transformers/models/ernie/configuration_ernie.py @@ -24,19 +24,6 @@ logger = logging.get_logger(__name__) -ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "nghuyong/ernie-1.0-base-zh": "https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json", - "nghuyong/ernie-2.0-base-en": "https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json", - "nghuyong/ernie-2.0-large-en": "https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json", - "nghuyong/ernie-3.0-base-zh": "https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-medium-zh": "https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-mini-zh": "https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-micro-zh": "https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-nano-zh": "https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json", - "nghuyong/ernie-gram-zh": "https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json", - "nghuyong/ernie-health-zh": "https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json", -} - class ErnieConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/ernie/modeling_ernie.py b/src/transformers/models/ernie/modeling_ernie.py index 291ab6c54d1e50..c91032d376b9c2 100644 --- a/src/transformers/models/ernie/modeling_ernie.py +++ b/src/transformers/models/ernie/modeling_ernie.py @@ -56,21 +56,6 @@ _CONFIG_FOR_DOC = "ErnieConfig" -ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "nghuyong/ernie-1.0-base-zh", - "nghuyong/ernie-2.0-base-en", - "nghuyong/ernie-2.0-large-en", - "nghuyong/ernie-3.0-base-zh", - "nghuyong/ernie-3.0-medium-zh", - "nghuyong/ernie-3.0-mini-zh", - "nghuyong/ernie-3.0-micro-zh", - "nghuyong/ernie-3.0-nano-zh", - "nghuyong/ernie-gram-zh", - "nghuyong/ernie-health-zh", - # See all ERNIE models at https://huggingface.co/models?filter=ernie -] - - class ErnieEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/ernie_m/__init__.py b/src/transformers/models/ernie_m/__init__.py index b7cd3bdd0681c1..fc7076e4394552 100644 --- a/src/transformers/models/ernie_m/__init__.py +++ b/src/transformers/models/ernie_m/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_ernie_m": ["ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieMConfig"], + "configuration_ernie_m": ["ErnieMConfig"], } try: @@ -36,7 +36,6 @@ pass else: _import_structure["modeling_ernie_m"] = [ - "ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieMForMultipleChoice", "ErnieMForQuestionAnswering", "ErnieMForSequenceClassification", @@ -48,7 +47,7 @@ if TYPE_CHECKING: - from .configuration_ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig + from .configuration_ernie_m import ErnieMConfig try: if not is_sentencepiece_available(): @@ -65,7 +64,6 @@ pass else: from .modeling_ernie_m import ( - ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieMForInformationExtraction, ErnieMForMultipleChoice, ErnieMForQuestionAnswering, diff --git a/src/transformers/models/ernie_m/configuration_ernie_m.py b/src/transformers/models/ernie_m/configuration_ernie_m.py index 85917dc8288deb..9c67a8642131f9 100644 --- a/src/transformers/models/ernie_m/configuration_ernie_m.py +++ b/src/transformers/models/ernie_m/configuration_ernie_m.py @@ -22,12 +22,6 @@ from ...configuration_utils import PretrainedConfig -ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "susnato/ernie-m-base_pytorch": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json", - "susnato/ernie-m-large_pytorch": "https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json", -} - - class ErnieMConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ErnieMModel`]. It is used to instantiate a diff --git a/src/transformers/models/ernie_m/modeling_ernie_m.py b/src/transformers/models/ernie_m/modeling_ernie_m.py index c1be3cfba142a1..b8f7e87c850248 100755 --- a/src/transformers/models/ernie_m/modeling_ernie_m.py +++ b/src/transformers/models/ernie_m/modeling_ernie_m.py @@ -44,12 +44,6 @@ _CONFIG_FOR_DOC = "ErnieMConfig" _TOKENIZER_FOR_DOC = "ErnieMTokenizer" -ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "susnato/ernie-m-base_pytorch", - "susnato/ernie-m-large_pytorch", - # See all ErnieM models at https://huggingface.co/models?filter=ernie_m -] - # Adapted from paddlenlp.transformers.ernie_m.modeling.ErnieEmbeddings class ErnieMEmbeddings(nn.Module): diff --git a/src/transformers/models/ernie_m/tokenization_ernie_m.py b/src/transformers/models/ernie_m/tokenization_ernie_m.py index b1b8cc845024c8..0bd7edea1cab3a 100644 --- a/src/transformers/models/ernie_m/tokenization_ernie_m.py +++ b/src/transformers/models/ernie_m/tokenization_ernie_m.py @@ -36,27 +36,6 @@ "vocab_file": "vocab.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "ernie-m-base": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/vocab.txt", - "ernie-m-large": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/vocab.txt", - }, - "sentencepiece_model_file": { - "ernie-m-base": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/sentencepiece.bpe.model", - "ernie-m-large": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/sentencepiece.bpe.model", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "ernie-m-base": 514, - "ernie-m-large": 514, -} - -PRETRAINED_INIT_CONFIGURATION = { - "ernie-m-base": {"do_lower_case": False}, - "ernie-m-large": {"do_lower_case": False}, -} - # Adapted from paddlenlp.transformers.ernie_m.tokenizer.ErnieMTokenizer class ErnieMTokenizer(PreTrainedTokenizer): @@ -89,9 +68,6 @@ class ErnieMTokenizer(PreTrainedTokenizer): model_input_names: List[str] = ["input_ids"] vocab_files_names = VOCAB_FILES_NAMES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP resource_files_names = RESOURCE_FILES_NAMES def __init__( diff --git a/src/transformers/models/esm/__init__.py b/src/transformers/models/esm/__init__.py index 1b07db5a5eea64..a764bedc3fadfd 100644 --- a/src/transformers/models/esm/__init__.py +++ b/src/transformers/models/esm/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_esm": ["ESM_PRETRAINED_CONFIG_ARCHIVE_MAP", "EsmConfig"], + "configuration_esm": ["EsmConfig"], "tokenization_esm": ["EsmTokenizer"], } @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_esm"] = [ - "ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "EsmForMaskedLM", "EsmForSequenceClassification", "EsmForTokenClassification", @@ -44,7 +43,6 @@ pass else: _import_structure["modeling_tf_esm"] = [ - "TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEsmForMaskedLM", "TFEsmForSequenceClassification", "TFEsmForTokenClassification", @@ -53,7 +51,7 @@ ] if TYPE_CHECKING: - from .configuration_esm import ESM_PRETRAINED_CONFIG_ARCHIVE_MAP, EsmConfig + from .configuration_esm import EsmConfig from .tokenization_esm import EsmTokenizer try: @@ -63,7 +61,6 @@ pass else: from .modeling_esm import ( - ESM_PRETRAINED_MODEL_ARCHIVE_LIST, EsmForMaskedLM, EsmForSequenceClassification, EsmForTokenClassification, @@ -79,7 +76,6 @@ pass else: from .modeling_tf_esm import ( - TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST, TFEsmForMaskedLM, TFEsmForSequenceClassification, TFEsmForTokenClassification, diff --git a/src/transformers/models/esm/configuration_esm.py b/src/transformers/models/esm/configuration_esm.py index 75f8609ab0ffbd..feb06031e5afcf 100644 --- a/src/transformers/models/esm/configuration_esm.py +++ b/src/transformers/models/esm/configuration_esm.py @@ -24,10 +24,6 @@ logger = logging.get_logger(__name__) # TODO Update this -ESM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/esm-1b": "https://huggingface.co/facebook/esm-1b/resolve/main/config.json", - # See all ESM models at https://huggingface.co/models?filter=esm -} class EsmConfig(PretrainedConfig): diff --git a/src/transformers/models/esm/modeling_esm.py b/src/transformers/models/esm/modeling_esm.py index 2349ce580023d4..e5683a3c99c264 100755 --- a/src/transformers/models/esm/modeling_esm.py +++ b/src/transformers/models/esm/modeling_esm.py @@ -40,13 +40,6 @@ _CHECKPOINT_FOR_DOC = "facebook/esm2_t6_8M_UR50D" _CONFIG_FOR_DOC = "EsmConfig" -ESM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/esm2_t6_8M_UR50D", - "facebook/esm2_t12_35M_UR50D", - # This is not a complete list of all ESM models! - # See all ESM models at https://huggingface.co/models?filter=esm -] - def rotate_half(x): x1, x2 = x.chunk(2, dim=-1) diff --git a/src/transformers/models/esm/modeling_tf_esm.py b/src/transformers/models/esm/modeling_tf_esm.py index 2c780b4bdd60c3..2688c207b0adac 100644 --- a/src/transformers/models/esm/modeling_tf_esm.py +++ b/src/transformers/models/esm/modeling_tf_esm.py @@ -52,13 +52,6 @@ _CHECKPOINT_FOR_DOC = "facebook/esm2_t6_8M_UR50D" _CONFIG_FOR_DOC = "EsmConfig" -TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/esm2_t6_8M_UR50D", - "facebook/esm2_t12_35M_UR50D", - # This is not a complete list of all ESM models! - # See all ESM models at https://huggingface.co/models?filter=esm -] - def rotate_half(x): x1, x2 = tf.split(x, 2, axis=-1) diff --git a/src/transformers/models/esm/tokenization_esm.py b/src/transformers/models/esm/tokenization_esm.py index 478527c0ecd17f..27a889c87ea0b4 100644 --- a/src/transformers/models/esm/tokenization_esm.py +++ b/src/transformers/models/esm/tokenization_esm.py @@ -24,18 +24,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/esm2_t6_8M_UR50D": "https://huggingface.co/facebook/esm2_t6_8M_UR50D/resolve/main/vocab.txt", - "facebook/esm2_t12_35M_UR50D": "https://huggingface.co/facebook/esm2_t12_35M_UR50D/resolve/main/vocab.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/esm2_t6_8M_UR50D": 1024, - "facebook/esm2_t12_35M_UR50D": 1024, -} - def load_vocab_file(vocab_file): with open(vocab_file, "r") as f: @@ -49,8 +37,6 @@ class EsmTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/falcon/__init__.py b/src/transformers/models/falcon/__init__.py index 070e0cc033fbf6..62c1c9262b70fc 100644 --- a/src/transformers/models/falcon/__init__.py +++ b/src/transformers/models/falcon/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_falcon": ["FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP", "FalconConfig"], + "configuration_falcon": ["FalconConfig"], } try: @@ -32,7 +32,6 @@ pass else: _import_structure["modeling_falcon"] = [ - "FALCON_PRETRAINED_MODEL_ARCHIVE_LIST", "FalconForCausalLM", "FalconModel", "FalconPreTrainedModel", @@ -43,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_falcon import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP, FalconConfig + from .configuration_falcon import FalconConfig try: if not is_torch_available(): @@ -52,7 +51,6 @@ pass else: from .modeling_falcon import ( - FALCON_PRETRAINED_MODEL_ARCHIVE_LIST, FalconForCausalLM, FalconForQuestionAnswering, FalconForSequenceClassification, diff --git a/src/transformers/models/falcon/configuration_falcon.py b/src/transformers/models/falcon/configuration_falcon.py index fe0a450a24eb0c..48fcefc502464a 100644 --- a/src/transformers/models/falcon/configuration_falcon.py +++ b/src/transformers/models/falcon/configuration_falcon.py @@ -19,11 +19,6 @@ logger = logging.get_logger(__name__) -FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "tiiuae/falcon-40b": "https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json", - "tiiuae/falcon-7b": "https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json", -} - class FalconConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/falcon/modeling_falcon.py b/src/transformers/models/falcon/modeling_falcon.py index d2c9125ddcffde..1caaa785e09dc9 100644 --- a/src/transformers/models/falcon/modeling_falcon.py +++ b/src/transformers/models/falcon/modeling_falcon.py @@ -58,14 +58,6 @@ logger = logging.get_logger(__name__) -FALCON_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "tiiuae/falcon-40b", - "tiiuae/falcon-40b-instruct", - "tiiuae/falcon-7b", - "tiiuae/falcon-7b-instruct", - "tiiuae/falcon-rw-7b", - "tiiuae/falcon-rw-1b", -] _CHECKPOINT_FOR_DOC = "Rocketknight1/falcon-rw-1b" _CONFIG_FOR_DOC = "FalconConfig" diff --git a/src/transformers/models/fastspeech2_conformer/__init__.py b/src/transformers/models/fastspeech2_conformer/__init__.py index 1fd5cbf1dc272e..2014f74be1f772 100644 --- a/src/transformers/models/fastspeech2_conformer/__init__.py +++ b/src/transformers/models/fastspeech2_conformer/__init__.py @@ -22,9 +22,6 @@ _import_structure = { "configuration_fastspeech2_conformer": [ - "FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", - "FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "FastSpeech2ConformerConfig", "FastSpeech2ConformerHifiGanConfig", "FastSpeech2ConformerWithHifiGanConfig", @@ -39,7 +36,6 @@ pass else: _import_structure["modeling_fastspeech2_conformer"] = [ - "FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "FastSpeech2ConformerWithHifiGan", "FastSpeech2ConformerHifiGan", "FastSpeech2ConformerModel", @@ -48,9 +44,6 @@ if TYPE_CHECKING: from .configuration_fastspeech2_conformer import ( - FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, - FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, - FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, FastSpeech2ConformerConfig, FastSpeech2ConformerHifiGanConfig, FastSpeech2ConformerWithHifiGanConfig, @@ -64,7 +57,6 @@ pass else: from .modeling_fastspeech2_conformer import ( - FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, FastSpeech2ConformerHifiGan, FastSpeech2ConformerModel, FastSpeech2ConformerPreTrainedModel, diff --git a/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py b/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py index 46dc10adb2900e..b8e1ae851232ce 100644 --- a/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py +++ b/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py @@ -23,19 +23,6 @@ logger = logging.get_logger(__name__) -FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "espnet/fastspeech2_conformer": "https://huggingface.co/espnet/fastspeech2_conformer/raw/main/config.json", -} - -FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "espnet/fastspeech2_conformer_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_hifigan/raw/main/config.json", -} - -FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "espnet/fastspeech2_conformer_with_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_with_hifigan/raw/main/config.json", -} - - class FastSpeech2ConformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FastSpeech2ConformerModel`]. It is used to diff --git a/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py b/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py index cc57747c59a4be..01c2cece550adf 100644 --- a/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py +++ b/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py @@ -33,11 +33,6 @@ logger = logging.get_logger(__name__) -FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "espnet/fastspeech2_conformer", - # See all FastSpeech2Conformer models at https://huggingface.co/models?filter=fastspeech2_conformer -] - @dataclass class FastSpeech2ConformerModelOutput(ModelOutput): diff --git a/src/transformers/models/fastspeech2_conformer/tokenization_fastspeech2_conformer.py b/src/transformers/models/fastspeech2_conformer/tokenization_fastspeech2_conformer.py index c4fd208cef3b40..bc52006ad66579 100644 --- a/src/transformers/models/fastspeech2_conformer/tokenization_fastspeech2_conformer.py +++ b/src/transformers/models/fastspeech2_conformer/tokenization_fastspeech2_conformer.py @@ -27,18 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "espnet/fastspeech2_conformer": "https://huggingface.co/espnet/fastspeech2_conformer/raw/main/vocab.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - # Set to somewhat arbitrary large number as the model input - # isn't constrained by the relative positional encoding - "espnet/fastspeech2_conformer": 4096, -} - class FastSpeech2ConformerTokenizer(PreTrainedTokenizer): """ @@ -61,9 +49,7 @@ class FastSpeech2ConformerTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/flaubert/__init__.py b/src/transformers/models/flaubert/__init__.py index 210d80b00f9ea2..94cf7b66139643 100644 --- a/src/transformers/models/flaubert/__init__.py +++ b/src/transformers/models/flaubert/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_flaubert": ["FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlaubertConfig", "FlaubertOnnxConfig"], + "configuration_flaubert": ["FlaubertConfig", "FlaubertOnnxConfig"], "tokenization_flaubert": ["FlaubertTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_flaubert"] = [ - "FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaubertForMultipleChoice", "FlaubertForQuestionAnswering", "FlaubertForQuestionAnsweringSimple", @@ -47,7 +46,6 @@ pass else: _import_structure["modeling_tf_flaubert"] = [ - "TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFlaubertForMultipleChoice", "TFFlaubertForQuestionAnsweringSimple", "TFFlaubertForSequenceClassification", @@ -59,7 +57,7 @@ if TYPE_CHECKING: - from .configuration_flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertOnnxConfig + from .configuration_flaubert import FlaubertConfig, FlaubertOnnxConfig from .tokenization_flaubert import FlaubertTokenizer try: @@ -69,7 +67,6 @@ pass else: from .modeling_flaubert import ( - FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, FlaubertForMultipleChoice, FlaubertForQuestionAnswering, FlaubertForQuestionAnsweringSimple, @@ -87,7 +84,6 @@ pass else: from .modeling_tf_flaubert import ( - TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFFlaubertForMultipleChoice, TFFlaubertForQuestionAnsweringSimple, TFFlaubertForSequenceClassification, diff --git a/src/transformers/models/flaubert/configuration_flaubert.py b/src/transformers/models/flaubert/configuration_flaubert.py index ba6d79891fa90d..98939e7091f5a4 100644 --- a/src/transformers/models/flaubert/configuration_flaubert.py +++ b/src/transformers/models/flaubert/configuration_flaubert.py @@ -23,13 +23,6 @@ logger = logging.get_logger(__name__) -FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "flaubert/flaubert_small_cased": "https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/config.json", - "flaubert/flaubert_base_uncased": "https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/config.json", - "flaubert/flaubert_base_cased": "https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/config.json", - "flaubert/flaubert_large_cased": "https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/config.json", -} - class FlaubertConfig(PretrainedConfig): """ diff --git a/src/transformers/models/flaubert/modeling_flaubert.py b/src/transformers/models/flaubert/modeling_flaubert.py index 4786fc6d5781a7..17600c96d91324 100644 --- a/src/transformers/models/flaubert/modeling_flaubert.py +++ b/src/transformers/models/flaubert/modeling_flaubert.py @@ -51,14 +51,6 @@ _CHECKPOINT_FOR_DOC = "flaubert/flaubert_base_cased" _CONFIG_FOR_DOC = "FlaubertConfig" -FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "flaubert/flaubert_small_cased", - "flaubert/flaubert_base_uncased", - "flaubert/flaubert_base_cased", - "flaubert/flaubert_large_cased", - # See all Flaubert models at https://huggingface.co/models?filter=flaubert -] - # Copied from transformers.models.xlm.modeling_xlm.create_sinusoidal_embeddings def create_sinusoidal_embeddings(n_pos, dim, out): diff --git a/src/transformers/models/flaubert/modeling_tf_flaubert.py b/src/transformers/models/flaubert/modeling_tf_flaubert.py index 23f66e56a98a99..0538fa061c4023 100644 --- a/src/transformers/models/flaubert/modeling_tf_flaubert.py +++ b/src/transformers/models/flaubert/modeling_tf_flaubert.py @@ -67,9 +67,6 @@ _CHECKPOINT_FOR_DOC = "flaubert/flaubert_base_cased" _CONFIG_FOR_DOC = "FlaubertConfig" -TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - # See all Flaubert models at https://huggingface.co/models?filter=flaubert -] FLAUBERT_START_DOCSTRING = r""" diff --git a/src/transformers/models/flaubert/tokenization_flaubert.py b/src/transformers/models/flaubert/tokenization_flaubert.py index b1b34cc0f78da7..20f9926422064d 100644 --- a/src/transformers/models/flaubert/tokenization_flaubert.py +++ b/src/transformers/models/flaubert/tokenization_flaubert.py @@ -32,47 +32,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "flaubert/flaubert_small_cased": ( - "https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/vocab.json" - ), - "flaubert/flaubert_base_uncased": ( - "https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/vocab.json" - ), - "flaubert/flaubert_base_cased": "https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/vocab.json", - "flaubert/flaubert_large_cased": ( - "https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/vocab.json" - ), - }, - "merges_file": { - "flaubert/flaubert_small_cased": ( - "https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/merges.txt" - ), - "flaubert/flaubert_base_uncased": ( - "https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/merges.txt" - ), - "flaubert/flaubert_base_cased": "https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/merges.txt", - "flaubert/flaubert_large_cased": ( - "https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/merges.txt" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "flaubert/flaubert_small_cased": 512, - "flaubert/flaubert_base_uncased": 512, - "flaubert/flaubert_base_cased": 512, - "flaubert/flaubert_large_cased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "flaubert/flaubert_small_cased": {"do_lowercase": False}, - "flaubert/flaubert_base_uncased": {"do_lowercase": True}, - "flaubert/flaubert_base_cased": {"do_lowercase": False}, - "flaubert/flaubert_large_cased": {"do_lowercase": False}, -} - def convert_to_unicode(text): """ @@ -216,9 +175,6 @@ class FlaubertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/flava/__init__.py b/src/transformers/models/flava/__init__.py index 8d026a9443271c..9fbe54524a6dea 100644 --- a/src/transformers/models/flava/__init__.py +++ b/src/transformers/models/flava/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_flava": [ - "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlavaConfig", "FlavaImageCodebookConfig", "FlavaImageConfig", @@ -44,7 +43,6 @@ pass else: _import_structure["modeling_flava"] = [ - "FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlavaForPreTraining", "FlavaImageCodebook", "FlavaImageModel", @@ -56,7 +54,6 @@ if TYPE_CHECKING: from .configuration_flava import ( - FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, FlavaConfig, FlavaImageCodebookConfig, FlavaImageConfig, @@ -81,7 +78,6 @@ pass else: from .modeling_flava import ( - FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, FlavaForPreTraining, FlavaImageCodebook, FlavaImageModel, diff --git a/src/transformers/models/flava/configuration_flava.py b/src/transformers/models/flava/configuration_flava.py index 6ea4403e0fb555..b78b5fdeac79ef 100644 --- a/src/transformers/models/flava/configuration_flava.py +++ b/src/transformers/models/flava/configuration_flava.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/flava-full": "https://huggingface.co/facebook/flava-full/resolve/main/config.json", -} - class FlavaImageConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/flava/modeling_flava.py b/src/transformers/models/flava/modeling_flava.py index 0e5cfe1b68c441..2edec2777b64bc 100644 --- a/src/transformers/models/flava/modeling_flava.py +++ b/src/transformers/models/flava/modeling_flava.py @@ -55,11 +55,6 @@ _CONFIG_CLASS_FOR_MULTIMODAL_MODEL_DOC = "FlavaMultimodalConfig" _EXPECTED_IMAGE_OUTPUT_SHAPE = [1, 197, 768] -FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/flava-full", - # See all flava models at https://huggingface.co/models?filter=flava -] -FLAVA_CODEBOOK_PRETRAINED_MODEL_ARCHIVE_LIST = ["facebook/flava-image-codebook"] LOGIT_SCALE_CLAMP_MIN = 0 LOGIT_SCALE_CLAMP_MAX = 4.6052 diff --git a/src/transformers/models/fnet/__init__.py b/src/transformers/models/fnet/__init__.py index 485160d1ccaa69..08b6ddf864e15f 100644 --- a/src/transformers/models/fnet/__init__.py +++ b/src/transformers/models/fnet/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_fnet": ["FNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FNetConfig"]} +_import_structure = {"configuration_fnet": ["FNetConfig"]} try: if not is_sentencepiece_available(): @@ -47,7 +47,6 @@ pass else: _import_structure["modeling_fnet"] = [ - "FNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FNetForMaskedLM", "FNetForMultipleChoice", "FNetForNextSentencePrediction", @@ -62,7 +61,7 @@ if TYPE_CHECKING: - from .configuration_fnet import FNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FNetConfig + from .configuration_fnet import FNetConfig try: if not is_sentencepiece_available(): @@ -87,7 +86,6 @@ pass else: from .modeling_fnet import ( - FNET_PRETRAINED_MODEL_ARCHIVE_LIST, FNetForMaskedLM, FNetForMultipleChoice, FNetForNextSentencePrediction, diff --git a/src/transformers/models/fnet/configuration_fnet.py b/src/transformers/models/fnet/configuration_fnet.py index 993feb676dac80..18ad6187998003 100644 --- a/src/transformers/models/fnet/configuration_fnet.py +++ b/src/transformers/models/fnet/configuration_fnet.py @@ -20,12 +20,6 @@ logger = logging.get_logger(__name__) -FNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/config.json", - "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/config.json", - # See all FNet models at https://huggingface.co/models?filter=fnet -} - class FNetConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/fnet/modeling_fnet.py b/src/transformers/models/fnet/modeling_fnet.py index dac75178d5f4e6..f1cd0e3f3ded28 100755 --- a/src/transformers/models/fnet/modeling_fnet.py +++ b/src/transformers/models/fnet/modeling_fnet.py @@ -59,12 +59,6 @@ _CHECKPOINT_FOR_DOC = "google/fnet-base" _CONFIG_FOR_DOC = "FNetConfig" -FNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/fnet-base", - "google/fnet-large", - # See all FNet models at https://huggingface.co/models?filter=fnet -] - # Adapted from https://github.com/google-research/google-research/blob/master/f_net/fourier.py def _two_dim_matmul(x, matrix_dim_one, matrix_dim_two): diff --git a/src/transformers/models/fnet/tokenization_fnet.py b/src/transformers/models/fnet/tokenization_fnet.py index 919d60531a3536..a38114eb6d01ae 100644 --- a/src/transformers/models/fnet/tokenization_fnet.py +++ b/src/transformers/models/fnet/tokenization_fnet.py @@ -28,17 +28,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/spiece.model", - "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/spiece.model", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/fnet-base": 512, - "google/fnet-large": 512, -} SPIECE_UNDERLINE = "▁" @@ -96,8 +85,6 @@ class FNetTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "token_type_ids"] def __init__( diff --git a/src/transformers/models/fnet/tokenization_fnet_fast.py b/src/transformers/models/fnet/tokenization_fnet_fast.py index 2179751e558e60..f279ad9ca7d0e2 100644 --- a/src/transformers/models/fnet/tokenization_fnet_fast.py +++ b/src/transformers/models/fnet/tokenization_fnet_fast.py @@ -32,21 +32,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/spiece.model", - "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/spiece.model", - }, - "tokenizer_file": { - "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/tokenizer.json", - "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/fnet-base": 512, - "google/fnet-large": 512, -} SPIECE_UNDERLINE = "▁" @@ -87,8 +72,6 @@ class FNetTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "token_type_ids"] slow_tokenizer_class = FNetTokenizer diff --git a/src/transformers/models/focalnet/__init__.py b/src/transformers/models/focalnet/__init__.py index b043a006f93766..ceacb8a52a170b 100644 --- a/src/transformers/models/focalnet/__init__.py +++ b/src/transformers/models/focalnet/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_focalnet": ["FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FocalNetConfig"]} +_import_structure = {"configuration_focalnet": ["FocalNetConfig"]} try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_focalnet"] = [ - "FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FocalNetForImageClassification", "FocalNetForMaskedImageModeling", "FocalNetBackbone", @@ -36,7 +35,7 @@ ] if TYPE_CHECKING: - from .configuration_focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig + from .configuration_focalnet import FocalNetConfig try: if not is_torch_available(): @@ -45,7 +44,6 @@ pass else: from .modeling_focalnet import ( - FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST, FocalNetBackbone, FocalNetForImageClassification, FocalNetForMaskedImageModeling, diff --git a/src/transformers/models/focalnet/configuration_focalnet.py b/src/transformers/models/focalnet/configuration_focalnet.py index c1d4e2e86cb1f2..1b2cca8b48367b 100644 --- a/src/transformers/models/focalnet/configuration_focalnet.py +++ b/src/transformers/models/focalnet/configuration_focalnet.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json", -} - class FocalNetConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/focalnet/modeling_focalnet.py b/src/transformers/models/focalnet/modeling_focalnet.py index b0033c855985e7..2b8b6158dd12a0 100644 --- a/src/transformers/models/focalnet/modeling_focalnet.py +++ b/src/transformers/models/focalnet/modeling_focalnet.py @@ -54,12 +54,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/focalnet-tiny", - # See all FocalNet models at https://huggingface.co/models?filter=focalnet -] - - @dataclass class FocalNetEncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/fsmt/__init__.py b/src/transformers/models/fsmt/__init__.py index 65aba047469da1..db960e4a5ce9c3 100644 --- a/src/transformers/models/fsmt/__init__.py +++ b/src/transformers/models/fsmt/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_fsmt": ["FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FSMTConfig"], + "configuration_fsmt": ["FSMTConfig"], "tokenization_fsmt": ["FSMTTokenizer"], } @@ -32,7 +32,7 @@ if TYPE_CHECKING: - from .configuration_fsmt import FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP, FSMTConfig + from .configuration_fsmt import FSMTConfig from .tokenization_fsmt import FSMTTokenizer try: diff --git a/src/transformers/models/fsmt/configuration_fsmt.py b/src/transformers/models/fsmt/configuration_fsmt.py index 493e6b6bf5d67d..7ed34a679273cd 100644 --- a/src/transformers/models/fsmt/configuration_fsmt.py +++ b/src/transformers/models/fsmt/configuration_fsmt.py @@ -21,8 +21,6 @@ logger = logging.get_logger(__name__) -FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP = {} - class DecoderConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/fsmt/tokenization_fsmt.py b/src/transformers/models/fsmt/tokenization_fsmt.py index a631f0747648cb..8b0be1f8be2498 100644 --- a/src/transformers/models/fsmt/tokenization_fsmt.py +++ b/src/transformers/models/fsmt/tokenization_fsmt.py @@ -33,26 +33,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "src_vocab_file": { - "stas/tiny-wmt19-en-de": "https://huggingface.co/stas/tiny-wmt19-en-de/resolve/main/vocab-src.json" - }, - "tgt_vocab_file": { - "stas/tiny-wmt19-en-de": "https://huggingface.co/stas/tiny-wmt19-en-de/resolve/main/vocab-tgt.json" - }, - "merges_file": {"stas/tiny-wmt19-en-de": "https://huggingface.co/stas/tiny-wmt19-en-de/resolve/main/merges.txt"}, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"stas/tiny-wmt19-en-de": 1024} -PRETRAINED_INIT_CONFIGURATION = { - "stas/tiny-wmt19-en-de": { - "langs": ["en", "de"], - "model_max_length": 1024, - "special_tokens_map_file": None, - "full_tokenizer_file": None, - } -} - def get_pairs(word): """ @@ -179,9 +159,6 @@ class FSMTTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/funnel/__init__.py b/src/transformers/models/funnel/__init__.py index 28b9a34290c826..aa620540dc3fd6 100644 --- a/src/transformers/models/funnel/__init__.py +++ b/src/transformers/models/funnel/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_funnel": ["FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig"], + "configuration_funnel": ["FunnelConfig"], "convert_funnel_original_tf_checkpoint_to_pytorch": [], "tokenization_funnel": ["FunnelTokenizer"], } @@ -44,7 +44,6 @@ pass else: _import_structure["modeling_funnel"] = [ - "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "FunnelBaseModel", "FunnelForMaskedLM", "FunnelForMultipleChoice", @@ -64,7 +63,6 @@ pass else: _import_structure["modeling_tf_funnel"] = [ - "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFunnelBaseModel", "TFFunnelForMaskedLM", "TFFunnelForMultipleChoice", @@ -78,7 +76,7 @@ if TYPE_CHECKING: - from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig + from .configuration_funnel import FunnelConfig from .tokenization_funnel import FunnelTokenizer try: @@ -96,7 +94,6 @@ pass else: from .modeling_funnel import ( - FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, FunnelBaseModel, FunnelForMaskedLM, FunnelForMultipleChoice, @@ -116,7 +113,6 @@ pass else: from .modeling_tf_funnel import ( - TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, TFFunnelBaseModel, TFFunnelForMaskedLM, TFFunnelForMultipleChoice, diff --git a/src/transformers/models/funnel/configuration_funnel.py b/src/transformers/models/funnel/configuration_funnel.py index 228216163b246c..c3d6ff9ee49eb9 100644 --- a/src/transformers/models/funnel/configuration_funnel.py +++ b/src/transformers/models/funnel/configuration_funnel.py @@ -20,23 +20,6 @@ logger = logging.get_logger(__name__) -FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/config.json", - "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json", - "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/config.json", - "funnel-transformer/medium-base": "https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json", - "funnel-transformer/intermediate": ( - "https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json" - ), - "funnel-transformer/intermediate-base": ( - "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json" - ), - "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/config.json", - "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json", - "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json", - "funnel-transformer/xlarge-base": "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json", -} - class FunnelConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/funnel/modeling_funnel.py b/src/transformers/models/funnel/modeling_funnel.py index 50f8df3743a82b..1e7c95ab721e4e 100644 --- a/src/transformers/models/funnel/modeling_funnel.py +++ b/src/transformers/models/funnel/modeling_funnel.py @@ -49,18 +49,6 @@ _CONFIG_FOR_DOC = "FunnelConfig" _CHECKPOINT_FOR_DOC = "funnel-transformer/small" -FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "funnel-transformer/small", # B4-4-4H768 - "funnel-transformer/small-base", # B4-4-4H768, no decoder - "funnel-transformer/medium", # B6-3x2-3x2H768 - "funnel-transformer/medium-base", # B6-3x2-3x2H768, no decoder - "funnel-transformer/intermediate", # B6-6-6H768 - "funnel-transformer/intermediate-base", # B6-6-6H768, no decoder - "funnel-transformer/large", # B8-8-8H1024 - "funnel-transformer/large-base", # B8-8-8H1024, no decoder - "funnel-transformer/xlarge-base", # B10-10-10H1024 - "funnel-transformer/xlarge", # B10-10-10H1024, no decoder -] INF = 1e6 diff --git a/src/transformers/models/funnel/modeling_tf_funnel.py b/src/transformers/models/funnel/modeling_tf_funnel.py index 4e4a544523f6e8..dea3ad550c5db9 100644 --- a/src/transformers/models/funnel/modeling_tf_funnel.py +++ b/src/transformers/models/funnel/modeling_tf_funnel.py @@ -62,18 +62,6 @@ _CONFIG_FOR_DOC = "FunnelConfig" -TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "funnel-transformer/small", # B4-4-4H768 - "funnel-transformer/small-base", # B4-4-4H768, no decoder - "funnel-transformer/medium", # B6-3x2-3x2H768 - "funnel-transformer/medium-base", # B6-3x2-3x2H768, no decoder - "funnel-transformer/intermediate", # B6-6-6H768 - "funnel-transformer/intermediate-base", # B6-6-6H768, no decoder - "funnel-transformer/large", # B8-8-8H1024 - "funnel-transformer/large-base", # B8-8-8H1024, no decoder - "funnel-transformer/xlarge-base", # B10-10-10H1024 - "funnel-transformer/xlarge", # B10-10-10H1024, no decoder -] INF = 1e6 diff --git a/src/transformers/models/funnel/tokenization_funnel.py b/src/transformers/models/funnel/tokenization_funnel.py index 9b0d3c1b6c5221..a1580deccfb3f7 100644 --- a/src/transformers/models/funnel/tokenization_funnel.py +++ b/src/transformers/models/funnel/tokenization_funnel.py @@ -40,31 +40,6 @@ "xlarge-base", ] -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/vocab.txt", - "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/vocab.txt", - "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/vocab.txt", - "funnel-transformer/medium-base": ( - "https://huggingface.co/funnel-transformer/medium-base/resolve/main/vocab.txt" - ), - "funnel-transformer/intermediate": ( - "https://huggingface.co/funnel-transformer/intermediate/resolve/main/vocab.txt" - ), - "funnel-transformer/intermediate-base": ( - "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/vocab.txt" - ), - "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/vocab.txt", - "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/vocab.txt", - "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/vocab.txt", - "funnel-transformer/xlarge-base": ( - "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/vocab.txt" - ), - } -} -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {f"funnel-transformer/{name}": 512 for name in _model_names} -PRETRAINED_INIT_CONFIGURATION = {f"funnel-transformer/{name}": {"do_lower_case": True} for name in _model_names} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -135,9 +110,6 @@ class FunnelTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES cls_token_type_id: int = 2 def __init__( diff --git a/src/transformers/models/funnel/tokenization_funnel_fast.py b/src/transformers/models/funnel/tokenization_funnel_fast.py index 17946eb74b5839..9ff2a3bfefc57e 100644 --- a/src/transformers/models/funnel/tokenization_funnel_fast.py +++ b/src/transformers/models/funnel/tokenization_funnel_fast.py @@ -41,55 +41,6 @@ "xlarge-base", ] -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/vocab.txt", - "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/vocab.txt", - "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/vocab.txt", - "funnel-transformer/medium-base": ( - "https://huggingface.co/funnel-transformer/medium-base/resolve/main/vocab.txt" - ), - "funnel-transformer/intermediate": ( - "https://huggingface.co/funnel-transformer/intermediate/resolve/main/vocab.txt" - ), - "funnel-transformer/intermediate-base": ( - "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/vocab.txt" - ), - "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/vocab.txt", - "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/vocab.txt", - "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/vocab.txt", - "funnel-transformer/xlarge-base": ( - "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/tokenizer.json", - "funnel-transformer/small-base": ( - "https://huggingface.co/funnel-transformer/small-base/resolve/main/tokenizer.json" - ), - "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/tokenizer.json", - "funnel-transformer/medium-base": ( - "https://huggingface.co/funnel-transformer/medium-base/resolve/main/tokenizer.json" - ), - "funnel-transformer/intermediate": ( - "https://huggingface.co/funnel-transformer/intermediate/resolve/main/tokenizer.json" - ), - "funnel-transformer/intermediate-base": ( - "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/tokenizer.json" - ), - "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/tokenizer.json", - "funnel-transformer/large-base": ( - "https://huggingface.co/funnel-transformer/large-base/resolve/main/tokenizer.json" - ), - "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/tokenizer.json", - "funnel-transformer/xlarge-base": ( - "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/tokenizer.json" - ), - }, -} -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {f"funnel-transformer/{name}": 512 for name in _model_names} -PRETRAINED_INIT_CONFIGURATION = {f"funnel-transformer/{name}": {"do_lower_case": True} for name in _model_names} - class FunnelTokenizerFast(PreTrainedTokenizerFast): r""" @@ -136,10 +87,7 @@ class FunnelTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION slow_tokenizer_class = FunnelTokenizer - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES cls_token_type_id: int = 2 def __init__( diff --git a/src/transformers/models/fuyu/__init__.py b/src/transformers/models/fuyu/__init__.py index 51a72a53661403..403acb1964c1ed 100644 --- a/src/transformers/models/fuyu/__init__.py +++ b/src/transformers/models/fuyu/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_fuyu": ["FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP", "FuyuConfig"], + "configuration_fuyu": ["FuyuConfig"], } @@ -44,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_fuyu import FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP, FuyuConfig + from .configuration_fuyu import FuyuConfig try: if not is_vision_available(): diff --git a/src/transformers/models/fuyu/configuration_fuyu.py b/src/transformers/models/fuyu/configuration_fuyu.py index 9376ccb5ef4ee4..8ca7302566a82a 100644 --- a/src/transformers/models/fuyu/configuration_fuyu.py +++ b/src/transformers/models/fuyu/configuration_fuyu.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "adept/fuyu-8b": "https://huggingface.co/adept/fuyu-8b/resolve/main/config.json", -} - class FuyuConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/gemma/__init__.py b/src/transformers/models/gemma/__init__.py index 64ff3445382816..1c832e9051b38c 100644 --- a/src/transformers/models/gemma/__init__.py +++ b/src/transformers/models/gemma/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_gemma": ["GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "GemmaConfig"], + "configuration_gemma": ["GemmaConfig"], } try: @@ -71,7 +71,7 @@ if TYPE_CHECKING: - from .configuration_gemma import GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP, GemmaConfig + from .configuration_gemma import GemmaConfig try: if not is_sentencepiece_available(): diff --git a/src/transformers/models/gemma/configuration_gemma.py b/src/transformers/models/gemma/configuration_gemma.py index cf7be344e82bc1..c8a55045166751 100644 --- a/src/transformers/models/gemma/configuration_gemma.py +++ b/src/transformers/models/gemma/configuration_gemma.py @@ -20,8 +20,6 @@ logger = logging.get_logger(__name__) -GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP = {} - class GemmaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/git/__init__.py b/src/transformers/models/git/__init__.py index e234a4b01db188..02f5f6d88a1194 100644 --- a/src/transformers/models/git/__init__.py +++ b/src/transformers/models/git/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_git": ["GIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GitConfig", "GitVisionConfig"], + "configuration_git": ["GitConfig", "GitVisionConfig"], "processing_git": ["GitProcessor"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_git"] = [ - "GIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GitForCausalLM", "GitModel", "GitPreTrainedModel", @@ -37,7 +36,7 @@ ] if TYPE_CHECKING: - from .configuration_git import GIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GitConfig, GitVisionConfig + from .configuration_git import GitConfig, GitVisionConfig from .processing_git import GitProcessor try: @@ -47,7 +46,6 @@ pass else: from .modeling_git import ( - GIT_PRETRAINED_MODEL_ARCHIVE_LIST, GitForCausalLM, GitModel, GitPreTrainedModel, diff --git a/src/transformers/models/git/configuration_git.py b/src/transformers/models/git/configuration_git.py index bfc2b4bf745bc7..21091445bc85ff 100644 --- a/src/transformers/models/git/configuration_git.py +++ b/src/transformers/models/git/configuration_git.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -GIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/git-base": "https://huggingface.co/microsoft/git-base/resolve/main/config.json", -} - class GitVisionConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/git/modeling_git.py b/src/transformers/models/git/modeling_git.py index c4baed9e0bc98c..090c85b2856d1a 100644 --- a/src/transformers/models/git/modeling_git.py +++ b/src/transformers/models/git/modeling_git.py @@ -45,11 +45,6 @@ _CHECKPOINT_FOR_DOC = "microsoft/git-base" _CONFIG_FOR_DOC = "GitConfig" -GIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/git-base", - # See all GIT models at https://huggingface.co/models?filter=git -] - @dataclass # Copied from transformers.models.clip.modeling_clip.CLIPVisionModelOutput with CLIP->Git diff --git a/src/transformers/models/glpn/__init__.py b/src/transformers/models/glpn/__init__.py index 94788dcb85e76f..9896e801c93ae7 100644 --- a/src/transformers/models/glpn/__init__.py +++ b/src/transformers/models/glpn/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_glpn": ["GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP", "GLPNConfig"]} +_import_structure = {"configuration_glpn": ["GLPNConfig"]} try: if not is_vision_available(): @@ -34,7 +34,6 @@ pass else: _import_structure["modeling_glpn"] = [ - "GLPN_PRETRAINED_MODEL_ARCHIVE_LIST", "GLPNForDepthEstimation", "GLPNLayer", "GLPNModel", @@ -43,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_glpn import GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP, GLPNConfig + from .configuration_glpn import GLPNConfig try: if not is_vision_available(): @@ -61,7 +60,6 @@ pass else: from .modeling_glpn import ( - GLPN_PRETRAINED_MODEL_ARCHIVE_LIST, GLPNForDepthEstimation, GLPNLayer, GLPNModel, diff --git a/src/transformers/models/glpn/configuration_glpn.py b/src/transformers/models/glpn/configuration_glpn.py index 5408ee94a8ade4..e1e4b535050ca4 100644 --- a/src/transformers/models/glpn/configuration_glpn.py +++ b/src/transformers/models/glpn/configuration_glpn.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "vinvino02/glpn-kitti": "https://huggingface.co/vinvino02/glpn-kitti/resolve/main/config.json", - # See all GLPN models at https://huggingface.co/models?filter=glpn -} - class GLPNConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/glpn/modeling_glpn.py b/src/transformers/models/glpn/modeling_glpn.py index d2ddef5c41e1e5..2160e977c091cd 100755 --- a/src/transformers/models/glpn/modeling_glpn.py +++ b/src/transformers/models/glpn/modeling_glpn.py @@ -46,11 +46,6 @@ _CHECKPOINT_FOR_DOC = "vinvino02/glpn-kitti" _EXPECTED_OUTPUT_SHAPE = [1, 512, 15, 20] -GLPN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "vinvino02/glpn-kitti", - # See all GLPN models at https://huggingface.co/models?filter=glpn -] - # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/src/transformers/models/gpt2/__init__.py b/src/transformers/models/gpt2/__init__.py index e99658ac1e885e..8c77c68445a830 100644 --- a/src/transformers/models/gpt2/__init__.py +++ b/src/transformers/models/gpt2/__init__.py @@ -27,7 +27,7 @@ _import_structure = { - "configuration_gpt2": ["GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2OnnxConfig"], + "configuration_gpt2": ["GPT2Config", "GPT2OnnxConfig"], "tokenization_gpt2": ["GPT2Tokenizer"], } @@ -46,7 +46,6 @@ pass else: _import_structure["modeling_gpt2"] = [ - "GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "GPT2DoubleHeadsModel", "GPT2ForQuestionAnswering", "GPT2ForSequenceClassification", @@ -64,7 +63,6 @@ pass else: _import_structure["modeling_tf_gpt2"] = [ - "TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGPT2DoubleHeadsModel", "TFGPT2ForSequenceClassification", "TFGPT2LMHeadModel", @@ -90,7 +88,7 @@ _import_structure["modeling_flax_gpt2"] = ["FlaxGPT2LMHeadModel", "FlaxGPT2Model", "FlaxGPT2PreTrainedModel"] if TYPE_CHECKING: - from .configuration_gpt2 import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2OnnxConfig + from .configuration_gpt2 import GPT2Config, GPT2OnnxConfig from .tokenization_gpt2 import GPT2Tokenizer try: @@ -108,7 +106,6 @@ pass else: from .modeling_gpt2 import ( - GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, GPT2DoubleHeadsModel, GPT2ForQuestionAnswering, GPT2ForSequenceClassification, @@ -126,7 +123,6 @@ pass else: from .modeling_tf_gpt2 import ( - TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, TFGPT2DoubleHeadsModel, TFGPT2ForSequenceClassification, TFGPT2LMHeadModel, diff --git a/src/transformers/models/gpt2/configuration_gpt2.py b/src/transformers/models/gpt2/configuration_gpt2.py index 395e2b4873fec8..249decbbaa7659 100644 --- a/src/transformers/models/gpt2/configuration_gpt2.py +++ b/src/transformers/models/gpt2/configuration_gpt2.py @@ -25,14 +25,6 @@ logger = logging.get_logger(__name__) -GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/config.json", - "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/config.json", - "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/config.json", - "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/config.json", - "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/config.json", -} - class GPT2Config(PretrainedConfig): """ diff --git a/src/transformers/models/gpt2/modeling_gpt2.py b/src/transformers/models/gpt2/modeling_gpt2.py index e1b357cefb649c..f29ebee9065334 100644 --- a/src/transformers/models/gpt2/modeling_gpt2.py +++ b/src/transformers/models/gpt2/modeling_gpt2.py @@ -54,15 +54,6 @@ _CHECKPOINT_FOR_DOC = "openai-community/gpt2" _CONFIG_FOR_DOC = "GPT2Config" -GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai-community/gpt2", - "openai-community/gpt2-medium", - "openai-community/gpt2-large", - "openai-community/gpt2-xl", - "distilbert/distilgpt2", - # See all GPT-2 models at https://huggingface.co/models?filter=gpt2 -] - def load_tf_weights_in_gpt2(model, config, gpt2_checkpoint_path): """Load tf checkpoints in a pytorch model""" diff --git a/src/transformers/models/gpt2/modeling_tf_gpt2.py b/src/transformers/models/gpt2/modeling_tf_gpt2.py index 2c17593e26808c..c6f5883e228ea6 100644 --- a/src/transformers/models/gpt2/modeling_tf_gpt2.py +++ b/src/transformers/models/gpt2/modeling_tf_gpt2.py @@ -58,15 +58,6 @@ _CHECKPOINT_FOR_DOC = "openai-community/gpt2" _CONFIG_FOR_DOC = "GPT2Config" -TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai-community/gpt2", - "openai-community/gpt2-medium", - "openai-community/gpt2-large", - "openai-community/gpt2-xl", - "distilbert/distilgpt2", - # See all GPT-2 models at https://huggingface.co/models?filter=openai-community/gpt2 -] - class TFAttention(keras.layers.Layer): def __init__(self, nx, config, scale=False, is_cross_attention=False, **kwargs): diff --git a/src/transformers/models/gpt2/tokenization_gpt2.py b/src/transformers/models/gpt2/tokenization_gpt2.py index 801e997344a194..36f3ca8fadb527 100644 --- a/src/transformers/models/gpt2/tokenization_gpt2.py +++ b/src/transformers/models/gpt2/tokenization_gpt2.py @@ -33,31 +33,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/vocab.json", - "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/vocab.json", - "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/vocab.json", - "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/vocab.json", - "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/vocab.json", - }, - "merges_file": { - "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/merges.txt", - "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/merges.txt", - "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/merges.txt", - "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/merges.txt", - "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openai-community/gpt2": 1024, - "openai-community/gpt2-medium": 1024, - "openai-community/gpt2-large": 1024, - "openai-community/gpt2-xl": 1024, - "distilbert/distilgpt2": 1024, -} - @lru_cache() def bytes_to_unicode(): @@ -154,8 +129,6 @@ class GPT2Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/gpt2/tokenization_gpt2_fast.py b/src/transformers/models/gpt2/tokenization_gpt2_fast.py index c4e49d23d146e4..fb3a5d4a0ce3f2 100644 --- a/src/transformers/models/gpt2/tokenization_gpt2_fast.py +++ b/src/transformers/models/gpt2/tokenization_gpt2_fast.py @@ -30,38 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/vocab.json", - "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/vocab.json", - "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/vocab.json", - "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/vocab.json", - "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/vocab.json", - }, - "merges_file": { - "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/merges.txt", - "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/merges.txt", - "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/merges.txt", - "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/merges.txt", - "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/merges.txt", - }, - "tokenizer_file": { - "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/tokenizer.json", - "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/tokenizer.json", - "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/tokenizer.json", - "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/tokenizer.json", - "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openai-community/gpt2": 1024, - "openai-community/gpt2-medium": 1024, - "openai-community/gpt2-large": 1024, - "openai-community/gpt2-xl": 1024, - "distilbert/distilgpt2": 1024, -} - class GPT2TokenizerFast(PreTrainedTokenizerFast): """ @@ -115,8 +83,6 @@ class GPT2TokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = GPT2Tokenizer diff --git a/src/transformers/models/gpt_bigcode/__init__.py b/src/transformers/models/gpt_bigcode/__init__.py index 33660eb81e4fae..60eec86ca541d7 100644 --- a/src/transformers/models/gpt_bigcode/__init__.py +++ b/src/transformers/models/gpt_bigcode/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_gpt_bigcode": ["GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTBigCodeConfig"], + "configuration_gpt_bigcode": ["GPTBigCodeConfig"], } try: @@ -32,7 +32,6 @@ pass else: _import_structure["modeling_gpt_bigcode"] = [ - "GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTBigCodeForSequenceClassification", "GPTBigCodeForTokenClassification", "GPTBigCodeForCausalLM", @@ -41,7 +40,7 @@ ] if TYPE_CHECKING: - from .configuration_gpt_bigcode import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig + from .configuration_gpt_bigcode import GPTBigCodeConfig try: if not is_torch_available(): @@ -50,7 +49,6 @@ pass else: from .modeling_gpt_bigcode import ( - GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTBigCodeForCausalLM, GPTBigCodeForSequenceClassification, GPTBigCodeForTokenClassification, diff --git a/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py b/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py index 9cbaf3e18485f5..0c295e17a12cec 100644 --- a/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py +++ b/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json", -} - class GPTBigCodeConfig(PretrainedConfig): """ diff --git a/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py b/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py index 25938342c2efb2..012cf436719aa3 100644 --- a/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py +++ b/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py @@ -52,11 +52,6 @@ _CHECKPOINT_FOR_DOC = "bigcode/gpt_bigcode-santacoder" _CONFIG_FOR_DOC = "GPTBigCodeConfig" -GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "bigcode/gpt_bigcode-santacoder", - # See all GPTBigCode models at https://huggingface.co/models?filter=gpt_bigcode -] - # Fused kernels # Use separate functions for each case because conditionals prevent kernel fusion. diff --git a/src/transformers/models/gpt_neo/__init__.py b/src/transformers/models/gpt_neo/__init__.py index 02ca0a11949b73..6c314c89f713a4 100644 --- a/src/transformers/models/gpt_neo/__init__.py +++ b/src/transformers/models/gpt_neo/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_gpt_neo": ["GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoConfig", "GPTNeoOnnxConfig"], + "configuration_gpt_neo": ["GPTNeoConfig", "GPTNeoOnnxConfig"], } try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_gpt_neo"] = [ - "GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoForCausalLM", "GPTNeoForQuestionAnswering", "GPTNeoForSequenceClassification", @@ -51,7 +50,7 @@ if TYPE_CHECKING: - from .configuration_gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig, GPTNeoOnnxConfig + from .configuration_gpt_neo import GPTNeoConfig, GPTNeoOnnxConfig try: if not is_torch_available(): @@ -60,7 +59,6 @@ pass else: from .modeling_gpt_neo import ( - GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoForCausalLM, GPTNeoForQuestionAnswering, GPTNeoForSequenceClassification, diff --git a/src/transformers/models/gpt_neo/configuration_gpt_neo.py b/src/transformers/models/gpt_neo/configuration_gpt_neo.py index 842614b280c574..66c3b6812d1a47 100644 --- a/src/transformers/models/gpt_neo/configuration_gpt_neo.py +++ b/src/transformers/models/gpt_neo/configuration_gpt_neo.py @@ -25,11 +25,6 @@ logger = logging.get_logger(__name__) -GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "EleutherAI/gpt-neo-1.3B": "https://huggingface.co/EleutherAI/gpt-neo-1.3B/resolve/main/config.json", - # See all GPTNeo models at https://huggingface.co/models?filter=gpt_neo -} - class GPTNeoConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/gpt_neo/modeling_gpt_neo.py b/src/transformers/models/gpt_neo/modeling_gpt_neo.py index 5e1ca2f1915fd9..b2891526b3ddef 100755 --- a/src/transformers/models/gpt_neo/modeling_gpt_neo.py +++ b/src/transformers/models/gpt_neo/modeling_gpt_neo.py @@ -67,10 +67,6 @@ _CONFIG_FOR_DOC = "GPTNeoConfig" -GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "EleutherAI/gpt-neo-1.3B", - # See all GPTNeo models at https://huggingface.co/models?filter=gpt_neo -] _CHECKPOINT_FOR_DOC = "EleutherAI/gpt-neo-1.3B" diff --git a/src/transformers/models/gpt_neox/__init__.py b/src/transformers/models/gpt_neox/__init__.py index 46f06b1991afe7..05a6982acb0b08 100644 --- a/src/transformers/models/gpt_neox/__init__.py +++ b/src/transformers/models/gpt_neox/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable -_import_structure = {"configuration_gpt_neox": ["GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXConfig"]} +_import_structure = {"configuration_gpt_neox": ["GPTNeoXConfig"]} try: if not is_tokenizers_available(): @@ -34,7 +34,6 @@ pass else: _import_structure["modeling_gpt_neox"] = [ - "GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXForCausalLM", "GPTNeoXForQuestionAnswering", "GPTNeoXForSequenceClassification", @@ -46,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_gpt_neox import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXConfig + from .configuration_gpt_neox import GPTNeoXConfig try: if not is_tokenizers_available(): @@ -63,7 +62,6 @@ pass else: from .modeling_gpt_neox import ( - GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXForCausalLM, GPTNeoXForQuestionAnswering, GPTNeoXForSequenceClassification, diff --git a/src/transformers/models/gpt_neox/configuration_gpt_neox.py b/src/transformers/models/gpt_neox/configuration_gpt_neox.py index 99fbb2f7be7998..2e0683722db154 100644 --- a/src/transformers/models/gpt_neox/configuration_gpt_neox.py +++ b/src/transformers/models/gpt_neox/configuration_gpt_neox.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "EleutherAI/gpt-neox-20b": "https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/config.json", - # See all GPTNeoX models at https://huggingface.co/models?filter=gpt_neox -} - class GPTNeoXConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/gpt_neox/modeling_gpt_neox.py b/src/transformers/models/gpt_neox/modeling_gpt_neox.py index 2ab552f118c120..3dafda8bd06d6e 100755 --- a/src/transformers/models/gpt_neox/modeling_gpt_neox.py +++ b/src/transformers/models/gpt_neox/modeling_gpt_neox.py @@ -52,11 +52,6 @@ _REAL_CHECKPOINT_FOR_DOC = "EleutherAI/gpt-neox-20b" _CONFIG_FOR_DOC = "GPTNeoXConfig" -GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "EleutherAI/gpt-neox-20b", - # See all GPTNeoX models at https://huggingface.co/models?filter=gpt_neox -] - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): diff --git a/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py b/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py index 16ed6b1e753e54..dceb512e8fc106 100644 --- a/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py +++ b/src/transformers/models/gpt_neox/tokenization_gpt_neox_fast.py @@ -26,16 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "tokenizer_file": { - "EleutherAI/gpt-neox-20b": "https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "gpt-neox-20b": 2048, -} - class GPTNeoXTokenizerFast(PreTrainedTokenizerFast): """ @@ -91,8 +81,6 @@ class GPTNeoXTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/gpt_neox_japanese/__init__.py b/src/transformers/models/gpt_neox_japanese/__init__.py index bf04db7676c8b6..c43391c04958d4 100644 --- a/src/transformers/models/gpt_neox_japanese/__init__.py +++ b/src/transformers/models/gpt_neox_japanese/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_gpt_neox_japanese": ["GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXJapaneseConfig"], + "configuration_gpt_neox_japanese": ["GPTNeoXJapaneseConfig"], "tokenization_gpt_neox_japanese": ["GPTNeoXJapaneseTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_gpt_neox_japanese"] = [ - "GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXJapaneseForCausalLM", "GPTNeoXJapaneseLayer", "GPTNeoXJapaneseModel", @@ -38,7 +37,7 @@ if TYPE_CHECKING: - from .configuration_gpt_neox_japanese import GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig + from .configuration_gpt_neox_japanese import GPTNeoXJapaneseConfig from .tokenization_gpt_neox_japanese import GPTNeoXJapaneseTokenizer try: @@ -48,7 +47,6 @@ pass else: from .modeling_gpt_neox_japanese import ( - GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseLayer, GPTNeoXJapaneseModel, diff --git a/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py b/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py index ddf3d4dec8b9d0..bde828790d9828 100644 --- a/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py +++ b/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "abeja/gpt-neox-japanese-2.7b": "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json", -} - class GPTNeoXJapaneseConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py b/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py index 4ac7c4d4e0025f..ea934581aa4f21 100755 --- a/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py +++ b/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py @@ -34,11 +34,6 @@ _CHECKPOINT_FOR_DOC = "abeja/gpt-neox-japanese-2.7b" _CONFIG_FOR_DOC = "GPTNeoXJapaneseConfig" -GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = { - "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json", - # See all GPTNeoXJapanese models at https://huggingface.co/models?filter=gpt_neox_japanese -} - class GPTNeoXJapanesePreTrainedModel(PreTrainedModel): """ diff --git a/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py b/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py index fae50aa8ffdbb0..fd0fe796dcab02 100644 --- a/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py +++ b/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py @@ -29,19 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "emoji_file": "emoji.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "abeja/gpt-neox-japanese-2.7b": "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/vocab.txt", - }, - "emoji_file": { - "abeja/gpt-neox-japanese-2.7b": "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/emoji.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "abeja/gpt-neox-japanese-2.7b": 2048, -} - def load_vocab_and_emoji(vocab_file, emoji_file): """Loads a vocabulary file and emoji file into a dictionary.""" @@ -112,8 +99,6 @@ class GPTNeoXJapaneseTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/gpt_sw3/tokenization_gpt_sw3.py b/src/transformers/models/gpt_sw3/tokenization_gpt_sw3.py index d740c13d3594a2..7bb2e51f04a078 100644 --- a/src/transformers/models/gpt_sw3/tokenization_gpt_sw3.py +++ b/src/transformers/models/gpt_sw3/tokenization_gpt_sw3.py @@ -19,28 +19,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "AI-Sweden-Models/gpt-sw3-126m": "https://huggingface.co/AI-Sweden-Models/gpt-sw3-126m/resolve/main/spiece.model", - "AI-Sweden-Models/gpt-sw3-356m": "https://huggingface.co/AI-Sweden-Models/gpt-sw3-356m/resolve/main/spiece.model", - "AI-Sweden-Models/gpt-sw3-1.3b": "https://huggingface.co/AI-Sweden-Models/gpt-sw3-1.3b/resolve/main/spiece.model", - "AI-Sweden-Models/gpt-sw3-6.7b": "https://huggingface.co/AI-Sweden-Models/gpt-sw3-6.7b/resolve/main/spiece.model", - "AI-Sweden-Models/gpt-sw3-6.7b-v2": "https://huggingface.co/AI-Sweden-Models/gpt-sw3-6.7b-v2/resolve/main/spiece.model", - "AI-Sweden-Models/gpt-sw3-20b": "https://huggingface.co/AI-Sweden-Models/gpt-sw3-20b/resolve/main/spiece.model", - "AI-Sweden-Models/gpt-sw3-40b": "https://huggingface.co/AI-Sweden-Models/gpt-sw3-20b/resolve/main/spiece.model", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "AI-Sweden-Models/gpt-sw3-126m": 2048, - "AI-Sweden-Models/gpt-sw3-356m": 2048, - "AI-Sweden-Models/gpt-sw3-1.3b": 2048, - "AI-Sweden-Models/gpt-sw3-6.7b": 2048, - "AI-Sweden-Models/gpt-sw3-6.7b-v2": 2048, - "AI-Sweden-Models/gpt-sw3-20b": 2048, - "AI-Sweden-Models/gpt-sw3-40b": 2048, -} - class GPTSw3Tokenizer(PreTrainedTokenizer): """ @@ -105,8 +83,6 @@ class GPTSw3Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/gptj/__init__.py b/src/transformers/models/gptj/__init__.py index 4e59ed47062048..51520484529f85 100644 --- a/src/transformers/models/gptj/__init__.py +++ b/src/transformers/models/gptj/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_gptj": ["GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTJConfig", "GPTJOnnxConfig"]} +_import_structure = {"configuration_gptj": ["GPTJConfig", "GPTJOnnxConfig"]} try: if not is_torch_available(): @@ -31,7 +31,6 @@ pass else: _import_structure["modeling_gptj"] = [ - "GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTJForCausalLM", "GPTJForQuestionAnswering", "GPTJForSequenceClassification", @@ -67,7 +66,7 @@ if TYPE_CHECKING: - from .configuration_gptj import GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTJConfig, GPTJOnnxConfig + from .configuration_gptj import GPTJConfig, GPTJOnnxConfig try: if not is_torch_available(): @@ -76,7 +75,6 @@ pass else: from .modeling_gptj import ( - GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST, GPTJForCausalLM, GPTJForQuestionAnswering, GPTJForSequenceClassification, diff --git a/src/transformers/models/gptj/configuration_gptj.py b/src/transformers/models/gptj/configuration_gptj.py index 47b12242793213..c9c6c4a1c50e91 100644 --- a/src/transformers/models/gptj/configuration_gptj.py +++ b/src/transformers/models/gptj/configuration_gptj.py @@ -24,11 +24,6 @@ logger = logging.get_logger(__name__) -GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "EleutherAI/gpt-j-6B": "https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json", - # See all GPT-J models at https://huggingface.co/models?filter=gpt_j -} - class GPTJConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/gptj/modeling_gptj.py b/src/transformers/models/gptj/modeling_gptj.py index 144dbba0552745..5f1e1d6612999d 100644 --- a/src/transformers/models/gptj/modeling_gptj.py +++ b/src/transformers/models/gptj/modeling_gptj.py @@ -57,12 +57,6 @@ _CONFIG_FOR_DOC = "GPTJConfig" -GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "EleutherAI/gpt-j-6B", - # See all GPT-J models at https://huggingface.co/models?filter=gptj -] - - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/gptj/modeling_tf_gptj.py b/src/transformers/models/gptj/modeling_tf_gptj.py index d948fc63c09ad4..5c315b5b66f049 100644 --- a/src/transformers/models/gptj/modeling_tf_gptj.py +++ b/src/transformers/models/gptj/modeling_tf_gptj.py @@ -55,11 +55,6 @@ _CHECKPOINT_FOR_DOC = "EleutherAI/gpt-j-6B" _CONFIG_FOR_DOC = "GPTJConfig" -GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "EleutherAI/gpt-j-6B", - # See all GPT-J models at https://huggingface.co/models?filter=gptj -] - def create_sinusoidal_positions(num_pos: int, dim: int) -> tf.Tensor: inv_freq = tf.cast(1.0 / (10000 ** (tf.range(0, dim, 2) / dim)), tf.float32) diff --git a/src/transformers/models/gptsan_japanese/__init__.py b/src/transformers/models/gptsan_japanese/__init__.py index b3635ace911635..9ae8af34667e34 100644 --- a/src/transformers/models/gptsan_japanese/__init__.py +++ b/src/transformers/models/gptsan_japanese/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_gptsan_japanese": ["GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTSanJapaneseConfig"], + "configuration_gptsan_japanese": ["GPTSanJapaneseConfig"], "tokenization_gptsan_japanese": ["GPTSanJapaneseTokenizer"], } @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_gptsan_japanese"] = [ - "GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTSanJapaneseForConditionalGeneration", "GPTSanJapaneseModel", "GPTSanJapanesePreTrainedModel", @@ -46,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_gptsan_japanese import GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTSanJapaneseConfig + from .configuration_gptsan_japanese import GPTSanJapaneseConfig from .tokenization_gptsan_japanese import GPTSanJapaneseTokenizer try: @@ -56,7 +55,6 @@ pass else: from .modeling_gptsan_japanese import ( - GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTSanJapaneseForConditionalGeneration, GPTSanJapaneseModel, GPTSanJapanesePreTrainedModel, diff --git a/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py b/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py index c25e4b0e1ea2a9..7630d67bff2165 100644 --- a/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py +++ b/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py @@ -19,12 +19,6 @@ logger = logging.get_logger(__name__) -GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "tanreinama/GPTSAN-2.8B-spout_is_uniform": ( - "https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json" - ), -} - class GPTSanJapaneseConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py b/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py index d9b7003050b11a..1b4f5c72270144 100644 --- a/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py +++ b/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py @@ -44,10 +44,6 @@ # This dict contains ids and associated url # for the pretrained weights provided with the models #################################################### -GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Tanrei/GPTSAN-japanese", - # See all GPTSAN-japanese models at https://huggingface.co/models?filter=gptsan-japanese -] # Copied from transformers.models.switch_transformers.modeling_switch_transformers.router_z_loss_func diff --git a/src/transformers/models/gptsan_japanese/tokenization_gptsan_japanese.py b/src/transformers/models/gptsan_japanese/tokenization_gptsan_japanese.py index df3f94dc1e8965..2a2b465d8c4909 100644 --- a/src/transformers/models/gptsan_japanese/tokenization_gptsan_japanese.py +++ b/src/transformers/models/gptsan_japanese/tokenization_gptsan_japanese.py @@ -37,19 +37,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "emoji_file": "emoji.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "Tanrei/GPTSAN-japanese": "https://huggingface.co/Tanrei/GPTSAN-japanese/blob/main/vocab.txt", - }, - "emoji_file": { - "Tanrei/GPTSAN-japanese": "https://huggingface.co/Tanrei/GPTSAN-japanese/blob/main/emoji.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "Tanrei/GPTSAN-japanese": 1280, -} - def load_vocab_and_emoji(vocab_file, emoji_file): """Loads a vocabulary file and emoji file into a dictionary.""" @@ -150,8 +137,6 @@ class GPTSanJapaneseTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask", "token_type_ids"] def __init__( diff --git a/src/transformers/models/graphormer/__init__.py b/src/transformers/models/graphormer/__init__.py index 4263525682147f..f8140c81c1bb9b 100644 --- a/src/transformers/models/graphormer/__init__.py +++ b/src/transformers/models/graphormer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_graphormer": ["GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "GraphormerConfig"], + "configuration_graphormer": ["GraphormerConfig"], } try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_graphormer"] = [ - "GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "GraphormerForGraphClassification", "GraphormerModel", "GraphormerPreTrainedModel", @@ -35,7 +34,7 @@ if TYPE_CHECKING: - from .configuration_graphormer import GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, GraphormerConfig + from .configuration_graphormer import GraphormerConfig try: if not is_torch_available(): @@ -44,7 +43,6 @@ pass else: from .modeling_graphormer import ( - GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST, GraphormerForGraphClassification, GraphormerModel, GraphormerPreTrainedModel, diff --git a/src/transformers/models/graphormer/configuration_graphormer.py b/src/transformers/models/graphormer/configuration_graphormer.py index 9d49fbea29448d..7aaba3aa76a64f 100644 --- a/src/transformers/models/graphormer/configuration_graphormer.py +++ b/src/transformers/models/graphormer/configuration_graphormer.py @@ -20,12 +20,6 @@ logger = logging.get_logger(__name__) -GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - # pcqm4mv1 now deprecated - "graphormer-base": "https://huggingface.co/clefourrier/graphormer-base-pcqm4mv2/resolve/main/config.json", - # See all Graphormer models at https://huggingface.co/models?filter=graphormer -} - class GraphormerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/graphormer/modeling_graphormer.py b/src/transformers/models/graphormer/modeling_graphormer.py index ec56d8eda0d877..45ffb91a916f0a 100755 --- a/src/transformers/models/graphormer/modeling_graphormer.py +++ b/src/transformers/models/graphormer/modeling_graphormer.py @@ -37,13 +37,6 @@ _CONFIG_FOR_DOC = "GraphormerConfig" -GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "clefourrier/graphormer-base-pcqm4mv1", - "clefourrier/graphormer-base-pcqm4mv2", - # See all Graphormer models at https://huggingface.co/models?filter=graphormer -] - - def quant_noise(module: nn.Module, p: float, block_size: int): """ From: diff --git a/src/transformers/models/groupvit/__init__.py b/src/transformers/models/groupvit/__init__.py index d0de4a00bd1500..98fc6f4eccef08 100644 --- a/src/transformers/models/groupvit/__init__.py +++ b/src/transformers/models/groupvit/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_groupvit": [ - "GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GroupViTConfig", "GroupViTOnnxConfig", "GroupViTTextConfig", @@ -33,7 +32,6 @@ pass else: _import_structure["modeling_groupvit"] = [ - "GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GroupViTModel", "GroupViTPreTrainedModel", "GroupViTTextModel", @@ -47,7 +45,6 @@ pass else: _import_structure["modeling_tf_groupvit"] = [ - "TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGroupViTModel", "TFGroupViTPreTrainedModel", "TFGroupViTTextModel", @@ -56,7 +53,6 @@ if TYPE_CHECKING: from .configuration_groupvit import ( - GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GroupViTConfig, GroupViTOnnxConfig, GroupViTTextConfig, @@ -70,7 +66,6 @@ pass else: from .modeling_groupvit import ( - GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, GroupViTModel, GroupViTPreTrainedModel, GroupViTTextModel, @@ -84,7 +79,6 @@ pass else: from .modeling_tf_groupvit import ( - TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFGroupViTModel, TFGroupViTPreTrainedModel, TFGroupViTTextModel, diff --git a/src/transformers/models/groupvit/configuration_groupvit.py b/src/transformers/models/groupvit/configuration_groupvit.py index bfec885244948c..1f17a0a7e60ad9 100644 --- a/src/transformers/models/groupvit/configuration_groupvit.py +++ b/src/transformers/models/groupvit/configuration_groupvit.py @@ -30,10 +30,6 @@ logger = logging.get_logger(__name__) -GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "nvidia/groupvit-gcc-yfcc": "https://huggingface.co/nvidia/groupvit-gcc-yfcc/resolve/main/config.json", -} - class GroupViTTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/groupvit/modeling_groupvit.py b/src/transformers/models/groupvit/modeling_groupvit.py index c99c96ec87f89d..72eedf52bd0e44 100644 --- a/src/transformers/models/groupvit/modeling_groupvit.py +++ b/src/transformers/models/groupvit/modeling_groupvit.py @@ -43,11 +43,6 @@ _CHECKPOINT_FOR_DOC = "nvidia/groupvit-gcc-yfcc" -GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "nvidia/groupvit-gcc-yfcc", - # See all GroupViT models at https://huggingface.co/models?filter=groupvit -] - # contrastive loss function, adapted from # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html diff --git a/src/transformers/models/groupvit/modeling_tf_groupvit.py b/src/transformers/models/groupvit/modeling_tf_groupvit.py index d04f9afb7d3599..4efb2f38bc4cea 100644 --- a/src/transformers/models/groupvit/modeling_tf_groupvit.py +++ b/src/transformers/models/groupvit/modeling_tf_groupvit.py @@ -66,11 +66,6 @@ _CHECKPOINT_FOR_DOC = "nvidia/groupvit-gcc-yfcc" -TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "nvidia/groupvit-gcc-yfcc", - # See all GroupViT models at https://huggingface.co/models?filter=groupvit -] - LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/herbert/tokenization_herbert.py b/src/transformers/models/herbert/tokenization_herbert.py index 1747a59c6fc2fa..6e37922028e7be 100644 --- a/src/transformers/models/herbert/tokenization_herbert.py +++ b/src/transformers/models/herbert/tokenization_herbert.py @@ -29,18 +29,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "allegro/herbert-base-cased": "https://huggingface.co/allegro/herbert-base-cased/resolve/main/vocab.json" - }, - "merges_file": { - "allegro/herbert-base-cased": "https://huggingface.co/allegro/herbert-base-cased/resolve/main/merges.txt" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"allegro/herbert-base-cased": 514} -PRETRAINED_INIT_CONFIGURATION = {} - # Copied from transformers.models.xlm.tokenization_xlm.get_pairs def get_pairs(word): @@ -302,9 +290,6 @@ class HerbertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/herbert/tokenization_herbert_fast.py b/src/transformers/models/herbert/tokenization_herbert_fast.py index 67e38c1c5ee7bd..4cd5db58f1b93a 100644 --- a/src/transformers/models/herbert/tokenization_herbert_fast.py +++ b/src/transformers/models/herbert/tokenization_herbert_fast.py @@ -24,18 +24,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "allegro/herbert-base-cased": "https://huggingface.co/allegro/herbert-base-cased/resolve/main/vocab.json" - }, - "merges_file": { - "allegro/herbert-base-cased": "https://huggingface.co/allegro/herbert-base-cased/resolve/main/merges.txt" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"allegro/herbert-base-cased": 514} -PRETRAINED_INIT_CONFIGURATION = {} - class HerbertTokenizerFast(PreTrainedTokenizerFast): """ @@ -57,9 +45,6 @@ class HerbertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = HerbertTokenizer def __init__( diff --git a/src/transformers/models/hubert/__init__.py b/src/transformers/models/hubert/__init__.py index f0b72a1f297bf8..30331ed0d146a4 100644 --- a/src/transformers/models/hubert/__init__.py +++ b/src/transformers/models/hubert/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available -_import_structure = {"configuration_hubert": ["HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "HubertConfig"]} +_import_structure = {"configuration_hubert": ["HubertConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_hubert"] = [ - "HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "HubertForCTC", "HubertForSequenceClassification", "HubertModel", @@ -40,14 +39,13 @@ pass else: _import_structure["modeling_tf_hubert"] = [ - "TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFHubertForCTC", "TFHubertModel", "TFHubertPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig + from .configuration_hubert import HubertConfig try: if not is_torch_available(): @@ -56,7 +54,6 @@ pass else: from .modeling_hubert import ( - HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, HubertForCTC, HubertForSequenceClassification, HubertModel, @@ -70,7 +67,6 @@ pass else: from .modeling_tf_hubert import ( - TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFHubertForCTC, TFHubertModel, TFHubertPreTrainedModel, diff --git a/src/transformers/models/hubert/configuration_hubert.py b/src/transformers/models/hubert/configuration_hubert.py index 3067c6efb185fb..293b9f76f2cfce 100644 --- a/src/transformers/models/hubert/configuration_hubert.py +++ b/src/transformers/models/hubert/configuration_hubert.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/hubert-base-ls960": "https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json", - # See all Hubert models at https://huggingface.co/models?filter=hubert -} - class HubertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/hubert/modeling_hubert.py b/src/transformers/models/hubert/modeling_hubert.py index a45dcb2d11fe1f..289f1825b6ca1f 100755 --- a/src/transformers/models/hubert/modeling_hubert.py +++ b/src/transformers/models/hubert/modeling_hubert.py @@ -58,12 +58,6 @@ _SEQ_CLASS_EXPECTED_LOSS = 8.53 -HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/hubert-base-ls960", - # See all Hubert models at https://huggingface.co/models?filter=hubert -] - - # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( shape: Tuple[int, int], diff --git a/src/transformers/models/hubert/modeling_tf_hubert.py b/src/transformers/models/hubert/modeling_tf_hubert.py index 258763beb13208..142ab0961dd5cb 100644 --- a/src/transformers/models/hubert/modeling_tf_hubert.py +++ b/src/transformers/models/hubert/modeling_tf_hubert.py @@ -45,10 +45,6 @@ _CONFIG_FOR_DOC = "HubertConfig" -TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/hubert-base-ls960", - # See all Hubert models at https://huggingface.co/models?filter=hubert -] LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/ibert/__init__.py b/src/transformers/models/ibert/__init__.py index 637eb08eaf412d..3b147e414c2edf 100644 --- a/src/transformers/models/ibert/__init__.py +++ b/src/transformers/models/ibert/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig", "IBertOnnxConfig"]} +_import_structure = {"configuration_ibert": ["IBertConfig", "IBertOnnxConfig"]} try: if not is_torch_available(): @@ -26,7 +26,6 @@ pass else: _import_structure["modeling_ibert"] = [ - "IBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "IBertForMaskedLM", "IBertForMultipleChoice", "IBertForQuestionAnswering", @@ -37,7 +36,7 @@ ] if TYPE_CHECKING: - from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig + from .configuration_ibert import IBertConfig, IBertOnnxConfig try: if not is_torch_available(): @@ -46,7 +45,6 @@ pass else: from .modeling_ibert import ( - IBERT_PRETRAINED_MODEL_ARCHIVE_LIST, IBertForMaskedLM, IBertForMultipleChoice, IBertForQuestionAnswering, diff --git a/src/transformers/models/ibert/configuration_ibert.py b/src/transformers/models/ibert/configuration_ibert.py index 249061ceae3273..afa67d6d6acab4 100644 --- a/src/transformers/models/ibert/configuration_ibert.py +++ b/src/transformers/models/ibert/configuration_ibert.py @@ -25,14 +25,6 @@ logger = logging.get_logger(__name__) -IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "kssteven/ibert-roberta-base": "https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json", - "kssteven/ibert-roberta-large": "https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json", - "kssteven/ibert-roberta-large-mnli": ( - "https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json" - ), -} - class IBertConfig(PretrainedConfig): """ diff --git a/src/transformers/models/ibert/modeling_ibert.py b/src/transformers/models/ibert/modeling_ibert.py index 0dcdaaf6998fd2..f3975f18e942bc 100644 --- a/src/transformers/models/ibert/modeling_ibert.py +++ b/src/transformers/models/ibert/modeling_ibert.py @@ -47,12 +47,6 @@ _CHECKPOINT_FOR_DOC = "kssteven/ibert-roberta-base" _CONFIG_FOR_DOC = "IBertConfig" -IBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "kssteven/ibert-roberta-base", - "kssteven/ibert-roberta-large", - "kssteven/ibert-roberta-large-mnli", -] - class IBertEmbeddings(nn.Module): """ diff --git a/src/transformers/models/idefics/__init__.py b/src/transformers/models/idefics/__init__.py index 68ff40fc18dc24..7a4e8056f540d5 100644 --- a/src/transformers/models/idefics/__init__.py +++ b/src/transformers/models/idefics/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_idefics": ["IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP", "IdeficsConfig"]} +_import_structure = {"configuration_idefics": ["IdeficsConfig"]} try: if not is_vision_available(): @@ -33,7 +33,6 @@ pass else: _import_structure["modeling_idefics"] = [ - "IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST", "IdeficsForVisionText2Text", "IdeficsModel", "IdeficsPreTrainedModel", @@ -42,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_idefics import IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP, IdeficsConfig + from .configuration_idefics import IdeficsConfig try: if not is_vision_available(): @@ -59,7 +58,6 @@ pass else: from .modeling_idefics import ( - IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST, IdeficsForVisionText2Text, IdeficsModel, IdeficsPreTrainedModel, diff --git a/src/transformers/models/idefics/configuration_idefics.py b/src/transformers/models/idefics/configuration_idefics.py index a61c96e0a418c0..8b61238ed90fb8 100644 --- a/src/transformers/models/idefics/configuration_idefics.py +++ b/src/transformers/models/idefics/configuration_idefics.py @@ -25,11 +25,6 @@ logger = logging.get_logger(__name__) -IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "HuggingFaceM4/idefics-9b": "https://huggingface.co/HuggingFaceM4/idefics-9b/blob/main/config.json", - "HuggingFaceM4/idefics-80b": "https://huggingface.co/HuggingFaceM4/idefics-80b/blob/main/config.json", -} - class IdeficsVisionConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/idefics/modeling_idefics.py b/src/transformers/models/idefics/modeling_idefics.py index 0023fd2014940d..1ca40e56ecad7c 100644 --- a/src/transformers/models/idefics/modeling_idefics.py +++ b/src/transformers/models/idefics/modeling_idefics.py @@ -48,12 +48,6 @@ _CONFIG_FOR_DOC = "IdeficsConfig" -IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "HuggingFaceM4/idefics-9b", - "HuggingFaceM4/idefics-80b", - # See all Idefics models at https://huggingface.co/models?filter=idefics -] - @dataclass class IdeficsBaseModelOutputWithPast(ModelOutput): diff --git a/src/transformers/models/imagegpt/__init__.py b/src/transformers/models/imagegpt/__init__.py index 7d3e1440da942e..a64dd9affdbe35 100644 --- a/src/transformers/models/imagegpt/__init__.py +++ b/src/transformers/models/imagegpt/__init__.py @@ -17,9 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = { - "configuration_imagegpt": ["IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ImageGPTConfig", "ImageGPTOnnxConfig"] -} +_import_structure = {"configuration_imagegpt": ["ImageGPTConfig", "ImageGPTOnnxConfig"]} try: if not is_vision_available(): @@ -37,7 +35,6 @@ pass else: _import_structure["modeling_imagegpt"] = [ - "IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "ImageGPTForCausalImageModeling", "ImageGPTForImageClassification", "ImageGPTModel", @@ -47,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig, ImageGPTOnnxConfig + from .configuration_imagegpt import ImageGPTConfig, ImageGPTOnnxConfig try: if not is_vision_available(): @@ -65,7 +62,6 @@ pass else: from .modeling_imagegpt import ( - IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST, ImageGPTForCausalImageModeling, ImageGPTForImageClassification, ImageGPTModel, diff --git a/src/transformers/models/imagegpt/configuration_imagegpt.py b/src/transformers/models/imagegpt/configuration_imagegpt.py index 85f44a4e344d2a..906e61eeef5c24 100644 --- a/src/transformers/models/imagegpt/configuration_imagegpt.py +++ b/src/transformers/models/imagegpt/configuration_imagegpt.py @@ -27,12 +27,6 @@ logger = logging.get_logger(__name__) -IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "openai/imagegpt-small": "", - "openai/imagegpt-medium": "", - "openai/imagegpt-large": "", -} - class ImageGPTConfig(PretrainedConfig): """ diff --git a/src/transformers/models/imagegpt/modeling_imagegpt.py b/src/transformers/models/imagegpt/modeling_imagegpt.py index 33f7ee99c4f692..c6fee91445d13a 100755 --- a/src/transformers/models/imagegpt/modeling_imagegpt.py +++ b/src/transformers/models/imagegpt/modeling_imagegpt.py @@ -42,13 +42,6 @@ _CHECKPOINT_FOR_DOC = "openai/imagegpt-small" _CONFIG_FOR_DOC = "ImageGPTConfig" -IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai/imagegpt-small", - "openai/imagegpt-medium", - "openai/imagegpt-large", - # See all Image GPT models at https://huggingface.co/models?filter=imagegpt -] - def load_tf_weights_in_imagegpt(model, config, imagegpt_checkpoint_path): """ diff --git a/src/transformers/models/informer/__init__.py b/src/transformers/models/informer/__init__.py index 478ad56a72ba3c..fba309ee2b52b1 100644 --- a/src/transformers/models/informer/__init__.py +++ b/src/transformers/models/informer/__init__.py @@ -18,10 +18,7 @@ _import_structure = { - "configuration_informer": [ - "INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "InformerConfig", - ], + "configuration_informer": ["InformerConfig"], } try: @@ -31,7 +28,6 @@ pass else: _import_structure["modeling_informer"] = [ - "INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "InformerForPrediction", "InformerModel", "InformerPreTrainedModel", @@ -39,7 +35,7 @@ if TYPE_CHECKING: - from .configuration_informer import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, InformerConfig + from .configuration_informer import InformerConfig try: if not is_torch_available(): @@ -48,7 +44,6 @@ pass else: from .modeling_informer import ( - INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, InformerForPrediction, InformerModel, InformerPreTrainedModel, diff --git a/src/transformers/models/informer/configuration_informer.py b/src/transformers/models/informer/configuration_informer.py index dedf09bb2bbbb9..d933ac6fd530fe 100644 --- a/src/transformers/models/informer/configuration_informer.py +++ b/src/transformers/models/informer/configuration_informer.py @@ -22,13 +22,6 @@ logger = logging.get_logger(__name__) -INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "huggingface/informer-tourism-monthly": ( - "https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json" - ), - # See all Informer models at https://huggingface.co/models?filter=informer -} - class InformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/informer/modeling_informer.py b/src/transformers/models/informer/modeling_informer.py index 0fe108a6402425..6a05583bbea224 100644 --- a/src/transformers/models/informer/modeling_informer.py +++ b/src/transformers/models/informer/modeling_informer.py @@ -40,12 +40,6 @@ _CONFIG_FOR_DOC = "InformerConfig" -INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "huggingface/informer-tourism-monthly", - # See all Informer models at https://huggingface.co/models?filter=informer -] - - # Copied from transformers.models.time_series_transformer.modeling_time_series_transformer.TimeSeriesFeatureEmbedder with TimeSeries->Informer class InformerFeatureEmbedder(nn.Module): """ diff --git a/src/transformers/models/instructblip/__init__.py b/src/transformers/models/instructblip/__init__.py index 201db4d272d4b7..093b9f00f6fc4d 100644 --- a/src/transformers/models/instructblip/__init__.py +++ b/src/transformers/models/instructblip/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_instructblip": [ - "INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "InstructBlipConfig", "InstructBlipQFormerConfig", "InstructBlipVisionConfig", @@ -33,7 +32,6 @@ pass else: _import_structure["modeling_instructblip"] = [ - "INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "InstructBlipQFormerModel", "InstructBlipPreTrainedModel", "InstructBlipForConditionalGeneration", @@ -42,7 +40,6 @@ if TYPE_CHECKING: from .configuration_instructblip import ( - INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, InstructBlipConfig, InstructBlipQFormerConfig, InstructBlipVisionConfig, @@ -56,7 +53,6 @@ pass else: from .modeling_instructblip import ( - INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST, InstructBlipForConditionalGeneration, InstructBlipPreTrainedModel, InstructBlipQFormerModel, diff --git a/src/transformers/models/instructblip/configuration_instructblip.py b/src/transformers/models/instructblip/configuration_instructblip.py index 98c06d2fe899c4..23b743ecb52d91 100644 --- a/src/transformers/models/instructblip/configuration_instructblip.py +++ b/src/transformers/models/instructblip/configuration_instructblip.py @@ -25,10 +25,6 @@ logger = logging.get_logger(__name__) -INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Salesforce/instruct-blip-flan-t5": "https://huggingface.co/Salesforce/instruct-blip-flan-t5/resolve/main/config.json", -} - class InstructBlipVisionConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/instructblip/modeling_instructblip.py b/src/transformers/models/instructblip/modeling_instructblip.py index ba78b9143d343f..4234c7de24d808 100644 --- a/src/transformers/models/instructblip/modeling_instructblip.py +++ b/src/transformers/models/instructblip/modeling_instructblip.py @@ -47,11 +47,6 @@ _CHECKPOINT_FOR_DOC = "Salesforce/instructblip-flan-t5-xl" -INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Salesforce/instructblip-flan-t5-xl", - # See all InstructBLIP models at https://huggingface.co/models?filter=instructblip -] - @dataclass # Copied from transformers.models.blip_2.modeling_blip_2.Blip2ForConditionalGenerationModelOutput with Blip2->InstructBlip diff --git a/src/transformers/models/jukebox/__init__.py b/src/transformers/models/jukebox/__init__.py index d96fba4d47b5e7..441b11329cf8ff 100644 --- a/src/transformers/models/jukebox/__init__.py +++ b/src/transformers/models/jukebox/__init__.py @@ -19,7 +19,6 @@ _import_structure = { "configuration_jukebox": [ - "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "JukeboxConfig", "JukeboxPriorConfig", "JukeboxVQVAEConfig", @@ -34,7 +33,6 @@ pass else: _import_structure["modeling_jukebox"] = [ - "JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST", "JukeboxModel", "JukeboxPreTrainedModel", "JukeboxVQVAE", @@ -43,7 +41,6 @@ if TYPE_CHECKING: from .configuration_jukebox import ( - JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP, JukeboxConfig, JukeboxPriorConfig, JukeboxVQVAEConfig, @@ -57,7 +54,6 @@ pass else: from .modeling_jukebox import ( - JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST, JukeboxModel, JukeboxPreTrainedModel, JukeboxPrior, diff --git a/src/transformers/models/jukebox/configuration_jukebox.py b/src/transformers/models/jukebox/configuration_jukebox.py index d4a8f0a0072cfc..19203732a9e782 100644 --- a/src/transformers/models/jukebox/configuration_jukebox.py +++ b/src/transformers/models/jukebox/configuration_jukebox.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "openai/jukebox-5b-lyrics": "https://huggingface.co/openai/jukebox-5b-lyrics/blob/main/config.json", - "openai/jukebox-1b-lyrics": "https://huggingface.co/openai/jukebox-1b-lyrics/blob/main/config.json", -} _LARGE_ATTENTION = [ "block_attn", diff --git a/src/transformers/models/jukebox/modeling_jukebox.py b/src/transformers/models/jukebox/modeling_jukebox.py index 236d1f4ff37bca..9af8dbd6847170 100755 --- a/src/transformers/models/jukebox/modeling_jukebox.py +++ b/src/transformers/models/jukebox/modeling_jukebox.py @@ -33,12 +33,6 @@ logger = logging.get_logger(__name__) -JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai/jukebox-1b-lyrics", - "openai/jukebox-5b-lyrics", - # See all Jukebox models at https://huggingface.co/models?filter=jukebox -] - def filter_logits(logits, top_k=0, top_p=0.0, filter_value=-float("Inf")): """ diff --git a/src/transformers/models/jukebox/tokenization_jukebox.py b/src/transformers/models/jukebox/tokenization_jukebox.py index 0eb4b0961f9daa..cd478d6f6bb140 100644 --- a/src/transformers/models/jukebox/tokenization_jukebox.py +++ b/src/transformers/models/jukebox/tokenization_jukebox.py @@ -39,22 +39,6 @@ "genres_file": "genres.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "artists_file": { - "jukebox": "https://huggingface.co/ArthurZ/jukebox/blob/main/artists.json", - }, - "genres_file": { - "jukebox": "https://huggingface.co/ArthurZ/jukebox/blob/main/genres.json", - }, - "lyrics_file": { - "jukebox": "https://huggingface.co/ArthurZ/jukebox/blob/main/lyrics.json", - }, -} - -PRETRAINED_LYRIC_TOKENS_SIZES = { - "jukebox": 512, -} - class JukeboxTokenizer(PreTrainedTokenizer): """ @@ -112,8 +96,6 @@ class JukeboxTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_lyric_input_size = PRETRAINED_LYRIC_TOKENS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/kosmos2/__init__.py b/src/transformers/models/kosmos2/__init__.py index 8d26304c72e199..171a5cc7071e53 100644 --- a/src/transformers/models/kosmos2/__init__.py +++ b/src/transformers/models/kosmos2/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_kosmos2": ["KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Kosmos2Config"], + "configuration_kosmos2": ["Kosmos2Config"], "processing_kosmos2": ["Kosmos2Processor"], } @@ -34,7 +34,6 @@ pass else: _import_structure["modeling_kosmos2"] = [ - "KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST", "Kosmos2ForConditionalGeneration", "Kosmos2Model", "Kosmos2PreTrainedModel", @@ -42,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_kosmos2 import KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP, Kosmos2Config + from .configuration_kosmos2 import Kosmos2Config from .processing_kosmos2 import Kosmos2Processor try: @@ -52,7 +51,6 @@ pass else: from .modeling_kosmos2 import ( - KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST, Kosmos2ForConditionalGeneration, Kosmos2Model, Kosmos2PreTrainedModel, diff --git a/src/transformers/models/kosmos2/configuration_kosmos2.py b/src/transformers/models/kosmos2/configuration_kosmos2.py index 198016a92871cc..f922b6093406b4 100644 --- a/src/transformers/models/kosmos2/configuration_kosmos2.py +++ b/src/transformers/models/kosmos2/configuration_kosmos2.py @@ -23,13 +23,6 @@ logger = logging.get_logger(__name__) -KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/kosmos-2-patch14-224": ( - "https://huggingface.co/microsoft/kosmos-2-patch14-224/resolve/main/config.json" - ), - # See all KOSMOS-2 models at https://huggingface.co/models?filter=kosmos-2 -} - class Kosmos2TextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/kosmos2/modeling_kosmos2.py b/src/transformers/models/kosmos2/modeling_kosmos2.py index 7bbbbe8d765c23..161ebbf95c1fd6 100644 --- a/src/transformers/models/kosmos2/modeling_kosmos2.py +++ b/src/transformers/models/kosmos2/modeling_kosmos2.py @@ -46,11 +46,6 @@ _CONFIG_FOR_DOC = Kosmos2Config -KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/kosmos-2-patch14-224", - # See all KOSMOS-2 models at https://huggingface.co/models?filter=kosmos-2 -] - def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None): """ diff --git a/src/transformers/models/layoutlm/__init__.py b/src/transformers/models/layoutlm/__init__.py index e172dd1dc79101..070b42368ef958 100644 --- a/src/transformers/models/layoutlm/__init__.py +++ b/src/transformers/models/layoutlm/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_layoutlm": ["LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMConfig", "LayoutLMOnnxConfig"], + "configuration_layoutlm": ["LayoutLMConfig", "LayoutLMOnnxConfig"], "tokenization_layoutlm": ["LayoutLMTokenizer"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_layoutlm"] = [ - "LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMForMaskedLM", "LayoutLMForSequenceClassification", "LayoutLMForTokenClassification", @@ -59,7 +58,6 @@ pass else: _import_structure["modeling_tf_layoutlm"] = [ - "TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMForMaskedLM", "TFLayoutLMForSequenceClassification", "TFLayoutLMForTokenClassification", @@ -71,7 +69,7 @@ if TYPE_CHECKING: - from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig, LayoutLMOnnxConfig + from .configuration_layoutlm import LayoutLMConfig, LayoutLMOnnxConfig from .tokenization_layoutlm import LayoutLMTokenizer try: @@ -89,7 +87,6 @@ pass else: from .modeling_layoutlm import ( - LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMForMaskedLM, LayoutLMForQuestionAnswering, LayoutLMForSequenceClassification, @@ -104,7 +101,6 @@ pass else: from .modeling_tf_layoutlm import ( - TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMForMaskedLM, TFLayoutLMForQuestionAnswering, TFLayoutLMForSequenceClassification, diff --git a/src/transformers/models/layoutlm/configuration_layoutlm.py b/src/transformers/models/layoutlm/configuration_layoutlm.py index 77d62ded403b92..88081831bc5166 100644 --- a/src/transformers/models/layoutlm/configuration_layoutlm.py +++ b/src/transformers/models/layoutlm/configuration_layoutlm.py @@ -23,15 +23,6 @@ logger = logging.get_logger(__name__) -LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/layoutlm-base-uncased": ( - "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/config.json" - ), - "microsoft/layoutlm-large-uncased": ( - "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/config.json" - ), -} - class LayoutLMConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/layoutlm/modeling_layoutlm.py b/src/transformers/models/layoutlm/modeling_layoutlm.py index c2ecede73d3955..519bce91257b9b 100644 --- a/src/transformers/models/layoutlm/modeling_layoutlm.py +++ b/src/transformers/models/layoutlm/modeling_layoutlm.py @@ -43,11 +43,6 @@ _CONFIG_FOR_DOC = "LayoutLMConfig" _CHECKPOINT_FOR_DOC = "microsoft/layoutlm-base-uncased" -LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "layoutlm-base-uncased", - "layoutlm-large-uncased", -] - LayoutLMLayerNorm = nn.LayerNorm @@ -613,7 +608,6 @@ class LayoutLMPreTrainedModel(PreTrainedModel): """ config_class = LayoutLMConfig - pretrained_model_archive_map = LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST base_model_prefix = "layoutlm" supports_gradient_checkpointing = True diff --git a/src/transformers/models/layoutlm/modeling_tf_layoutlm.py b/src/transformers/models/layoutlm/modeling_tf_layoutlm.py index 21e7c64069d9a0..42bcbe00d94d08 100644 --- a/src/transformers/models/layoutlm/modeling_tf_layoutlm.py +++ b/src/transformers/models/layoutlm/modeling_tf_layoutlm.py @@ -54,11 +54,6 @@ _CONFIG_FOR_DOC = "LayoutLMConfig" -TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/layoutlm-base-uncased", - "microsoft/layoutlm-large-uncased", -] - class TFLayoutLMEmbeddings(keras.layers.Layer): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/layoutlm/tokenization_layoutlm.py b/src/transformers/models/layoutlm/tokenization_layoutlm.py index 6105d5d77c15dd..836b1aab8800a9 100644 --- a/src/transformers/models/layoutlm/tokenization_layoutlm.py +++ b/src/transformers/models/layoutlm/tokenization_layoutlm.py @@ -27,27 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/layoutlm-base-uncased": ( - "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/vocab.txt" - ), - "microsoft/layoutlm-large-uncased": ( - "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/layoutlm-base-uncased": 512, - "microsoft/layoutlm-large-uncased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/layoutlm-base-uncased": {"do_lower_case": True}, - "microsoft/layoutlm-large-uncased": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -115,9 +94,6 @@ class LayoutLMTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/layoutlm/tokenization_layoutlm_fast.py b/src/transformers/models/layoutlm/tokenization_layoutlm_fast.py index c0bc1072f7f5f1..fa3d95132b0eff 100644 --- a/src/transformers/models/layoutlm/tokenization_layoutlm_fast.py +++ b/src/transformers/models/layoutlm/tokenization_layoutlm_fast.py @@ -28,35 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/layoutlm-base-uncased": ( - "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/vocab.txt" - ), - "microsoft/layoutlm-large-uncased": ( - "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "microsoft/layoutlm-base-uncased": ( - "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/tokenizer.json" - ), - "microsoft/layoutlm-large-uncased": ( - "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/layoutlm-base-uncased": 512, - "microsoft/layoutlm-large-uncased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/layoutlm-base-uncased": {"do_lower_case": True}, - "microsoft/layoutlm-large-uncased": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert_fast.BertTokenizerFast with Bert->LayoutLM,BERT->LayoutLM class LayoutLMTokenizerFast(PreTrainedTokenizerFast): @@ -100,9 +71,6 @@ class LayoutLMTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = LayoutLMTokenizer def __init__( diff --git a/src/transformers/models/layoutlmv2/__init__.py b/src/transformers/models/layoutlmv2/__init__.py index 9eccb238780f7e..1c45a9f76abb3a 100644 --- a/src/transformers/models/layoutlmv2/__init__.py +++ b/src/transformers/models/layoutlmv2/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_layoutlmv2": ["LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv2Config"], + "configuration_layoutlmv2": ["LayoutLMv2Config"], "processing_layoutlmv2": ["LayoutLMv2Processor"], "tokenization_layoutlmv2": ["LayoutLMv2Tokenizer"], } @@ -53,7 +53,6 @@ pass else: _import_structure["modeling_layoutlmv2"] = [ - "LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv2ForQuestionAnswering", "LayoutLMv2ForSequenceClassification", "LayoutLMv2ForTokenClassification", @@ -63,7 +62,7 @@ ] if TYPE_CHECKING: - from .configuration_layoutlmv2 import LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv2Config + from .configuration_layoutlmv2 import LayoutLMv2Config from .processing_layoutlmv2 import LayoutLMv2Processor from .tokenization_layoutlmv2 import LayoutLMv2Tokenizer @@ -90,7 +89,6 @@ pass else: from .modeling_layoutlmv2 import ( - LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv2ForQuestionAnswering, LayoutLMv2ForSequenceClassification, LayoutLMv2ForTokenClassification, diff --git a/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py b/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py index 839cfd18ed8d75..6a2eb9ff39d762 100644 --- a/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py +++ b/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "layoutlmv2-base-uncased": "https://huggingface.co/microsoft/layoutlmv2-base-uncased/resolve/main/config.json", - "layoutlmv2-large-uncased": "https://huggingface.co/microsoft/layoutlmv2-large-uncased/resolve/main/config.json", - # See all LayoutLMv2 models at https://huggingface.co/models?filter=layoutlmv2 -} # soft dependency if is_detectron2_available(): diff --git a/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py b/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py index 4a85923cb9b811..817bf1f8cc0da8 100755 --- a/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py +++ b/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py @@ -53,12 +53,6 @@ _CHECKPOINT_FOR_DOC = "microsoft/layoutlmv2-base-uncased" _CONFIG_FOR_DOC = "LayoutLMv2Config" -LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/layoutlmv2-base-uncased", - "microsoft/layoutlmv2-large-uncased", - # See all LayoutLMv2 models at https://huggingface.co/models?filter=layoutlmv2 -] - class LayoutLMv2Embeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" @@ -489,7 +483,6 @@ class LayoutLMv2PreTrainedModel(PreTrainedModel): """ config_class = LayoutLMv2Config - pretrained_model_archive_map = LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST base_model_prefix = "layoutlmv2" def _init_weights(self, module): diff --git a/src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py b/src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py index b09bd08715ff5c..c9a138391e0f25 100644 --- a/src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py +++ b/src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py @@ -36,29 +36,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/layoutlmv2-base-uncased": ( - "https://huggingface.co/microsoft/layoutlmv2-base-uncased/resolve/main/vocab.txt" - ), - "microsoft/layoutlmv2-large-uncased": ( - "https://huggingface.co/microsoft/layoutlmv2-large-uncased/resolve/main/vocab.txt" - ), - } -} - - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/layoutlmv2-base-uncased": 512, - "microsoft/layoutlmv2-large-uncased": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/layoutlmv2-base-uncased": {"do_lower_case": True}, - "microsoft/layoutlmv2-large-uncased": {"do_lower_case": True}, -} - LAYOUTLMV2_ENCODE_KWARGS_DOCSTRING = r""" add_special_tokens (`bool`, *optional*, defaults to `True`): @@ -218,9 +195,6 @@ class LayoutLMv2Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION def __init__( self, diff --git a/src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py b/src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py index bed4e133aa3c5c..aa2bf6b3226b18 100644 --- a/src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py +++ b/src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py @@ -45,27 +45,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/layoutlmv2-base-uncased": ( - "https://huggingface.co/microsoft/layoutlmv2-base-uncased/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "microsoft/layoutlmv2-base-uncased": ( - "https://huggingface.co/microsoft/layoutlmv2-base-uncased/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/layoutlmv2-base-uncased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/layoutlmv2-base-uncased": {"do_lower_case": True}, -} - class LayoutLMv2TokenizerFast(PreTrainedTokenizerFast): r""" @@ -114,9 +93,6 @@ class LayoutLMv2TokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = LayoutLMv2Tokenizer def __init__( diff --git a/src/transformers/models/layoutlmv3/__init__.py b/src/transformers/models/layoutlmv3/__init__.py index ca1c31091e8b6e..a8ef90906e7a5b 100644 --- a/src/transformers/models/layoutlmv3/__init__.py +++ b/src/transformers/models/layoutlmv3/__init__.py @@ -26,7 +26,6 @@ _import_structure = { "configuration_layoutlmv3": [ - "LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv3Config", "LayoutLMv3OnnxConfig", ], @@ -49,7 +48,6 @@ pass else: _import_structure["modeling_layoutlmv3"] = [ - "LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv3ForQuestionAnswering", "LayoutLMv3ForSequenceClassification", "LayoutLMv3ForTokenClassification", @@ -64,7 +62,6 @@ pass else: _import_structure["modeling_tf_layoutlmv3"] = [ - "TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMv3ForQuestionAnswering", "TFLayoutLMv3ForSequenceClassification", "TFLayoutLMv3ForTokenClassification", @@ -84,7 +81,6 @@ if TYPE_CHECKING: from .configuration_layoutlmv3 import ( - LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv3Config, LayoutLMv3OnnxConfig, ) @@ -106,7 +102,6 @@ pass else: from .modeling_layoutlmv3 import ( - LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv3ForQuestionAnswering, LayoutLMv3ForSequenceClassification, LayoutLMv3ForTokenClassification, @@ -121,7 +116,6 @@ pass else: from .modeling_tf_layoutlmv3 import ( - TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMv3ForQuestionAnswering, TFLayoutLMv3ForSequenceClassification, TFLayoutLMv3ForTokenClassification, diff --git a/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py b/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py index d7cddb6002f3e8..592adaa2f57ecf 100644 --- a/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py +++ b/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py @@ -32,10 +32,6 @@ logger = logging.get_logger(__name__) -LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/resolve/main/config.json", -} - class LayoutLMv3Config(PretrainedConfig): r""" diff --git a/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py b/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py index 3148155a435047..43ba0f522ff604 100644 --- a/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py +++ b/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py @@ -41,11 +41,6 @@ _CONFIG_FOR_DOC = "LayoutLMv3Config" -LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/layoutlmv3-base", - "microsoft/layoutlmv3-large", - # See all LayoutLMv3 models at https://huggingface.co/models?filter=layoutlmv3 -] LAYOUTLMV3_START_DOCSTRING = r""" This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use diff --git a/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py b/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py index b52cfba54c0a7a..7479754f0f833c 100644 --- a/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py +++ b/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py @@ -57,11 +57,6 @@ [[13, 14, 15, 16], [17, 18, 19, 20], [21, 22, 23, 24]], ] -TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/layoutlmv3-base", - "microsoft/layoutlmv3-large", - # See all LayoutLMv3 models at https://huggingface.co/models?filter=layoutlmv3 -] LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py b/src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py index 351e811b814f6d..89f899f22f4ecc 100644 --- a/src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py +++ b/src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py @@ -40,22 +40,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/raw/main/vocab.json", - "microsoft/layoutlmv3-large": "https://huggingface.co/microsoft/layoutlmv3-large/raw/main/vocab.json", - }, - "merges_file": { - "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/raw/main/merges.txt", - "microsoft/layoutlmv3-large": "https://huggingface.co/microsoft/layoutlmv3-large/raw/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/layoutlmv3-base": 512, - "microsoft/layoutlmv3-large": 512, -} - LAYOUTLMV3_ENCODE_KWARGS_DOCSTRING = r""" add_special_tokens (`bool`, *optional*, defaults to `True`): @@ -270,8 +254,6 @@ class LayoutLMv3Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask", "bbox"] def __init__( diff --git a/src/transformers/models/layoutlmv3/tokenization_layoutlmv3_fast.py b/src/transformers/models/layoutlmv3/tokenization_layoutlmv3_fast.py index 3d7445e4493117..07bedf36133ad8 100644 --- a/src/transformers/models/layoutlmv3/tokenization_layoutlmv3_fast.py +++ b/src/transformers/models/layoutlmv3/tokenization_layoutlmv3_fast.py @@ -45,22 +45,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/raw/main/vocab.json", - "microsoft/layoutlmv3-large": "https://huggingface.co/microsoft/layoutlmv3-large/raw/main/vocab.json", - }, - "merges_file": { - "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/raw/main/merges.txt", - "microsoft/layoutlmv3-large": "https://huggingface.co/microsoft/layoutlmv3-large/raw/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/layoutlmv3-base": 512, - "microsoft/layoutlmv3-large": 512, -} - class LayoutLMv3TokenizerFast(PreTrainedTokenizerFast): r""" @@ -131,8 +115,6 @@ class LayoutLMv3TokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = LayoutLMv3Tokenizer diff --git a/src/transformers/models/layoutxlm/tokenization_layoutxlm.py b/src/transformers/models/layoutxlm/tokenization_layoutxlm.py index 44a31f8580b226..bbfdf44a1e6020 100644 --- a/src/transformers/models/layoutxlm/tokenization_layoutxlm.py +++ b/src/transformers/models/layoutxlm/tokenization_layoutxlm.py @@ -32,8 +32,6 @@ ) from ...utils import PaddingStrategy, TensorType, add_end_docstrings, logging from ..xlm_roberta.tokenization_xlm_roberta import ( - PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES, - PRETRAINED_VOCAB_FILES_MAP, SPIECE_UNDERLINE, VOCAB_FILES_NAMES, ) @@ -225,8 +223,6 @@ class LayoutXLMTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/layoutxlm/tokenization_layoutxlm_fast.py b/src/transformers/models/layoutxlm/tokenization_layoutxlm_fast.py index 31c4579d4766c0..e899d8b22e4df6 100644 --- a/src/transformers/models/layoutxlm/tokenization_layoutxlm_fast.py +++ b/src/transformers/models/layoutxlm/tokenization_layoutxlm_fast.py @@ -31,8 +31,6 @@ from ...tokenization_utils_fast import PreTrainedTokenizerFast from ...utils import PaddingStrategy, TensorType, add_end_docstrings, is_sentencepiece_available, logging from ..xlm_roberta.tokenization_xlm_roberta_fast import ( - PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES, - PRETRAINED_VOCAB_FILES_MAP, VOCAB_FILES_NAMES, ) @@ -212,8 +210,6 @@ class LayoutXLMTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = LayoutXLMTokenizer diff --git a/src/transformers/models/led/__init__.py b/src/transformers/models/led/__init__.py index dd1c53b886eb37..2dbd59dcc34705 100644 --- a/src/transformers/models/led/__init__.py +++ b/src/transformers/models/led/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_led": ["LED_PRETRAINED_CONFIG_ARCHIVE_MAP", "LEDConfig"], + "configuration_led": ["LEDConfig"], "tokenization_led": ["LEDTokenizer"], } @@ -42,7 +42,6 @@ pass else: _import_structure["modeling_led"] = [ - "LED_PRETRAINED_MODEL_ARCHIVE_LIST", "LEDForConditionalGeneration", "LEDForQuestionAnswering", "LEDForSequenceClassification", @@ -61,7 +60,7 @@ if TYPE_CHECKING: - from .configuration_led import LED_PRETRAINED_CONFIG_ARCHIVE_MAP, LEDConfig + from .configuration_led import LEDConfig from .tokenization_led import LEDTokenizer try: @@ -79,7 +78,6 @@ pass else: from .modeling_led import ( - LED_PRETRAINED_MODEL_ARCHIVE_LIST, LEDForConditionalGeneration, LEDForQuestionAnswering, LEDForSequenceClassification, diff --git a/src/transformers/models/led/configuration_led.py b/src/transformers/models/led/configuration_led.py index d9efc308fec319..9933ef225367e2 100644 --- a/src/transformers/models/led/configuration_led.py +++ b/src/transformers/models/led/configuration_led.py @@ -22,11 +22,6 @@ logger = logging.get_logger(__name__) -LED_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/config.json", - # See all LED models at https://huggingface.co/models?filter=led -} - class LEDConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/led/modeling_led.py b/src/transformers/models/led/modeling_led.py index c10a8de11584d2..982de403c25c23 100755 --- a/src/transformers/models/led/modeling_led.py +++ b/src/transformers/models/led/modeling_led.py @@ -53,12 +53,6 @@ _CONFIG_FOR_DOC = "LEDConfig" -LED_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "allenai/led-base-16384", - # See all LED models at https://huggingface.co/models?filter=led -] - - def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ Shift input ids one token to the right. diff --git a/src/transformers/models/led/tokenization_led.py b/src/transformers/models/led/tokenization_led.py index e82739b4964ef5..aaf09e6d149eb1 100644 --- a/src/transformers/models/led/tokenization_led.py +++ b/src/transformers/models/led/tokenization_led.py @@ -32,21 +32,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt"} # See all LED models at https://huggingface.co/models?filter=LED -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/vocab.json", - }, - "merges_file": { - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/merges.txt", - }, - "tokenizer_file": { - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "allenai/led-base-16384": 16384, -} @lru_cache() @@ -169,8 +154,6 @@ class LEDTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] # Copied from transformers.models.bart.tokenization_bart.BartTokenizer.__init__ diff --git a/src/transformers/models/led/tokenization_led_fast.py b/src/transformers/models/led/tokenization_led_fast.py index 5c80491a84bf5b..ca15eb997bed5b 100644 --- a/src/transformers/models/led/tokenization_led_fast.py +++ b/src/transformers/models/led/tokenization_led_fast.py @@ -30,22 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/vocab.json", - }, - "merges_file": { - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/merges.txt", - }, - "tokenizer_file": { - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "allenai/led-base-16384": 16384, -} - class LEDTokenizerFast(PreTrainedTokenizerFast): r""" @@ -129,8 +113,6 @@ class LEDTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = LEDTokenizer model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/levit/__init__.py b/src/transformers/models/levit/__init__.py index 84adf04084e61d..266889963c90f2 100644 --- a/src/transformers/models/levit/__init__.py +++ b/src/transformers/models/levit/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_levit": ["LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LevitConfig", "LevitOnnxConfig"]} +_import_structure = {"configuration_levit": ["LevitConfig", "LevitOnnxConfig"]} try: if not is_vision_available(): @@ -34,7 +34,6 @@ pass else: _import_structure["modeling_levit"] = [ - "LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "LevitForImageClassification", "LevitForImageClassificationWithTeacher", "LevitModel", @@ -43,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_levit import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, LevitConfig, LevitOnnxConfig + from .configuration_levit import LevitConfig, LevitOnnxConfig try: if not is_vision_available(): @@ -61,7 +60,6 @@ pass else: from .modeling_levit import ( - LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, LevitForImageClassification, LevitForImageClassificationWithTeacher, LevitModel, diff --git a/src/transformers/models/levit/configuration_levit.py b/src/transformers/models/levit/configuration_levit.py index 3a9546a652e692..197e5fe5ec2c0d 100644 --- a/src/transformers/models/levit/configuration_levit.py +++ b/src/transformers/models/levit/configuration_levit.py @@ -26,11 +26,6 @@ logger = logging.get_logger(__name__) -LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/levit-128S": "https://huggingface.co/facebook/levit-128S/resolve/main/config.json", - # See all LeViT models at https://huggingface.co/models?filter=levit -} - class LevitConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/levit/modeling_levit.py b/src/transformers/models/levit/modeling_levit.py index 38a9ee1abc5c06..8f9d7a8be738c7 100644 --- a/src/transformers/models/levit/modeling_levit.py +++ b/src/transformers/models/levit/modeling_levit.py @@ -47,11 +47,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/levit-128S" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/levit-128S", - # See all LeViT models at https://huggingface.co/models?filter=levit -] - @dataclass class LevitForImageClassificationWithTeacherOutput(ModelOutput): diff --git a/src/transformers/models/lilt/__init__.py b/src/transformers/models/lilt/__init__.py index 50c493e352bc75..5b73f3aebd9c2f 100644 --- a/src/transformers/models/lilt/__init__.py +++ b/src/transformers/models/lilt/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_lilt": ["LILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LiltConfig"], + "configuration_lilt": ["LiltConfig"], } try: @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_lilt"] = [ - "LILT_PRETRAINED_MODEL_ARCHIVE_LIST", "LiltForQuestionAnswering", "LiltForSequenceClassification", "LiltForTokenClassification", @@ -37,7 +36,7 @@ ] if TYPE_CHECKING: - from .configuration_lilt import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP, LiltConfig + from .configuration_lilt import LiltConfig try: if not is_torch_available(): @@ -46,7 +45,6 @@ pass else: from .modeling_lilt import ( - LILT_PRETRAINED_MODEL_ARCHIVE_LIST, LiltForQuestionAnswering, LiltForSequenceClassification, LiltForTokenClassification, diff --git a/src/transformers/models/lilt/configuration_lilt.py b/src/transformers/models/lilt/configuration_lilt.py index 3db595e86e1795..fdfa2192a143ff 100644 --- a/src/transformers/models/lilt/configuration_lilt.py +++ b/src/transformers/models/lilt/configuration_lilt.py @@ -20,12 +20,6 @@ logger = logging.get_logger(__name__) -LILT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "SCUT-DLVCLab/lilt-roberta-en-base": ( - "https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base/resolve/main/config.json" - ), -} - class LiltConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/lilt/modeling_lilt.py b/src/transformers/models/lilt/modeling_lilt.py index e21f8ab2ce6044..4e4ee12c3dec1c 100644 --- a/src/transformers/models/lilt/modeling_lilt.py +++ b/src/transformers/models/lilt/modeling_lilt.py @@ -40,11 +40,6 @@ _CONFIG_FOR_DOC = "LiltConfig" -LILT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "SCUT-DLVCLab/lilt-roberta-en-base", - # See all LiLT models at https://huggingface.co/models?filter=lilt -] - class LiltTextEmbeddings(nn.Module): def __init__(self, config): diff --git a/src/transformers/models/llama/__init__.py b/src/transformers/models/llama/__init__.py index b5262941cb0e5c..4b8a33118ccc8e 100644 --- a/src/transformers/models/llama/__init__.py +++ b/src/transformers/models/llama/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_llama": ["LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlamaConfig"], + "configuration_llama": ["LlamaConfig"], } try: @@ -67,7 +67,7 @@ if TYPE_CHECKING: - from .configuration_llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig + from .configuration_llama import LlamaConfig try: if not is_sentencepiece_available(): diff --git a/src/transformers/models/llama/configuration_llama.py b/src/transformers/models/llama/configuration_llama.py index b62a1053094b91..24b77ccf57f359 100644 --- a/src/transformers/models/llama/configuration_llama.py +++ b/src/transformers/models/llama/configuration_llama.py @@ -25,8 +25,6 @@ logger = logging.get_logger(__name__) -LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = {} - class LlamaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/llama/tokenization_llama.py b/src/transformers/models/llama/tokenization_llama.py index 2f8997274ce758..2f68d6c1e95121 100644 --- a/src/transformers/models/llama/tokenization_llama.py +++ b/src/transformers/models/llama/tokenization_llama.py @@ -37,17 +37,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "tokenizer.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "hf-internal-testing/llama-tokenizer": "https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer.model", - }, - "tokenizer_file": { - "hf-internal-testing/llama-tokenizer": "https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer_config.json", - }, -} -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "hf-internal-testing/llama-tokenizer": 2048, -} SPIECE_UNDERLINE = "▁" B_INST, E_INST = "[INST]", "[/INST]" @@ -137,8 +126,6 @@ class LlamaTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/llama/tokenization_llama_fast.py b/src/transformers/models/llama/tokenization_llama_fast.py index fee77119870585..4a7e98c78855bf 100644 --- a/src/transformers/models/llama/tokenization_llama_fast.py +++ b/src/transformers/models/llama/tokenization_llama_fast.py @@ -33,16 +33,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "tokenizer.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "hf-internal-testing/llama-tokenizer": "https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer.model", - }, - "tokenizer_file": { - "hf-internal-testing/llama-tokenizer": "https://huggingface.co/hf-internal-testing/llama-tokenizer/resolve/main/tokenizer_config.json", - }, -} -B_INST, E_INST = "[INST]", "[/INST]" -B_SYS, E_SYS = "<>\n", "\n<>\n\n" # fmt: off DEFAULT_SYSTEM_PROMPT = """You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your \ @@ -105,7 +95,6 @@ class LlamaTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP slow_tokenizer_class = LlamaTokenizer padding_side = "left" model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/llava/__init__.py b/src/transformers/models/llava/__init__.py index 79f7b3ea309559..cfb4ac3e9e92af 100644 --- a/src/transformers/models/llava/__init__.py +++ b/src/transformers/models/llava/__init__.py @@ -16,10 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = { - "configuration_llava": ["LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlavaConfig"], - "processing_llava": ["LlavaProcessor"], -} +_import_structure = {"configuration_llava": ["LlavaConfig"]} try: @@ -29,15 +26,13 @@ pass else: _import_structure["modeling_llava"] = [ - "LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "LlavaForConditionalGeneration", "LlavaPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_llava import LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlavaConfig - from .processing_llava import LlavaProcessor + from .configuration_llava import LlavaConfig try: if not is_torch_available(): @@ -46,7 +41,6 @@ pass else: from .modeling_llava import ( - LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, LlavaForConditionalGeneration, LlavaPreTrainedModel, ) diff --git a/src/transformers/models/llava/configuration_llava.py b/src/transformers/models/llava/configuration_llava.py index 56b7974db0ada6..f14601450578f8 100644 --- a/src/transformers/models/llava/configuration_llava.py +++ b/src/transformers/models/llava/configuration_llava.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "llava-hf/llava-v1.5-7b": "https://huggingface.co/llava-hf/llava-v1.5-7b/resolve/main/config.json", -} - class LlavaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/llava/modeling_llava.py b/src/transformers/models/llava/modeling_llava.py index d3fc58eb3642c9..b7fdf318b0f8b7 100644 --- a/src/transformers/models/llava/modeling_llava.py +++ b/src/transformers/models/llava/modeling_llava.py @@ -38,13 +38,6 @@ _CONFIG_FOR_DOC = "LlavaConfig" -LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "llava-hf/llava-1.5-7b-hf", - "llava-hf/llava-1.5-13b-hf", - "llava-hf/bakLlava-v1-hf", - # See all Llava models at https://huggingface.co/models?filter=llava -] - @dataclass # Copied from transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast with Idefics->Llava diff --git a/src/transformers/models/longformer/__init__.py b/src/transformers/models/longformer/__init__.py index 66ef7c953cff43..ddbd8a68ecc6dc 100644 --- a/src/transformers/models/longformer/__init__.py +++ b/src/transformers/models/longformer/__init__.py @@ -25,7 +25,6 @@ _import_structure = { "configuration_longformer": [ - "LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongformerConfig", "LongformerOnnxConfig", ], @@ -47,7 +46,6 @@ pass else: _import_structure["modeling_longformer"] = [ - "LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "LongformerForMaskedLM", "LongformerForMultipleChoice", "LongformerForQuestionAnswering", @@ -65,7 +63,6 @@ pass else: _import_structure["modeling_tf_longformer"] = [ - "TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLongformerForMaskedLM", "TFLongformerForMultipleChoice", "TFLongformerForQuestionAnswering", @@ -79,7 +76,6 @@ if TYPE_CHECKING: from .configuration_longformer import ( - LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, LongformerConfig, LongformerOnnxConfig, ) @@ -100,7 +96,6 @@ pass else: from .modeling_longformer import ( - LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, LongformerForMaskedLM, LongformerForMultipleChoice, LongformerForQuestionAnswering, @@ -118,7 +113,6 @@ pass else: from .modeling_tf_longformer import ( - TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFLongformerForMaskedLM, TFLongformerForMultipleChoice, TFLongformerForQuestionAnswering, diff --git a/src/transformers/models/longformer/configuration_longformer.py b/src/transformers/models/longformer/configuration_longformer.py index 2935dd4aaaae25..0cafbf5d6936cc 100644 --- a/src/transformers/models/longformer/configuration_longformer.py +++ b/src/transformers/models/longformer/configuration_longformer.py @@ -28,20 +28,6 @@ logger = logging.get_logger(__name__) -LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/config.json", - "allenai/longformer-large-4096": "https://huggingface.co/allenai/longformer-large-4096/resolve/main/config.json", - "allenai/longformer-large-4096-finetuned-triviaqa": ( - "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/config.json" - ), - "allenai/longformer-base-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/config.json" - ), - "allenai/longformer-large-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/config.json" - ), -} - class LongformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/longformer/modeling_longformer.py b/src/transformers/models/longformer/modeling_longformer.py index aefd225869ca8e..78ad8a5eb5fdea 100755 --- a/src/transformers/models/longformer/modeling_longformer.py +++ b/src/transformers/models/longformer/modeling_longformer.py @@ -42,15 +42,6 @@ _CHECKPOINT_FOR_DOC = "allenai/longformer-base-4096" _CONFIG_FOR_DOC = "LongformerConfig" -LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "allenai/longformer-base-4096", - "allenai/longformer-large-4096", - "allenai/longformer-large-4096-finetuned-triviaqa", - "allenai/longformer-base-4096-extra.pos.embd.only", - "allenai/longformer-large-4096-extra.pos.embd.only", - # See all Longformer models at https://huggingface.co/models?filter=longformer -] - @dataclass class LongformerBaseModelOutput(ModelOutput): diff --git a/src/transformers/models/longformer/modeling_tf_longformer.py b/src/transformers/models/longformer/modeling_tf_longformer.py index 1cbfb286955585..be3ccf761b2e21 100644 --- a/src/transformers/models/longformer/modeling_tf_longformer.py +++ b/src/transformers/models/longformer/modeling_tf_longformer.py @@ -56,15 +56,6 @@ LARGE_NEGATIVE = -1e8 -TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "allenai/longformer-base-4096", - "allenai/longformer-large-4096", - "allenai/longformer-large-4096-finetuned-triviaqa", - "allenai/longformer-base-4096-extra.pos.embd.only", - "allenai/longformer-large-4096-extra.pos.embd.only", - # See all Longformer models at https://huggingface.co/models?filter=longformer -] - @dataclass class TFLongformerBaseModelOutput(ModelOutput): diff --git a/src/transformers/models/longformer/tokenization_longformer.py b/src/transformers/models/longformer/tokenization_longformer.py index cf0477bac1056f..51728d77808158 100644 --- a/src/transformers/models/longformer/tokenization_longformer.py +++ b/src/transformers/models/longformer/tokenization_longformer.py @@ -29,47 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/vocab.json", - "allenai/longformer-large-4096": ( - "https://huggingface.co/allenai/longformer-large-4096/resolve/main/vocab.json" - ), - "allenai/longformer-large-4096-finetuned-triviaqa": ( - "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/vocab.json" - ), - "allenai/longformer-base-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/vocab.json" - ), - "allenai/longformer-large-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/vocab.json" - ), - }, - "merges_file": { - "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/merges.txt", - "allenai/longformer-large-4096": ( - "https://huggingface.co/allenai/longformer-large-4096/resolve/main/merges.txt" - ), - "allenai/longformer-large-4096-finetuned-triviaqa": ( - "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/merges.txt" - ), - "allenai/longformer-base-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/merges.txt" - ), - "allenai/longformer-large-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/merges.txt" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "allenai/longformer-base-4096": 4096, - "allenai/longformer-large-4096": 4096, - "allenai/longformer-large-4096-finetuned-triviaqa": 4096, - "allenai/longformer-base-4096-extra.pos.embd.only": 4096, - "allenai/longformer-large-4096-extra.pos.embd.only": 4096, -} - @lru_cache() # Copied from transformers.models.roberta.tokenization_roberta.bytes_to_unicode @@ -192,8 +151,6 @@ class LongformerTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/longformer/tokenization_longformer_fast.py b/src/transformers/models/longformer/tokenization_longformer_fast.py index e40ebff3b65c13..02b74818a23ef8 100644 --- a/src/transformers/models/longformer/tokenization_longformer_fast.py +++ b/src/transformers/models/longformer/tokenization_longformer_fast.py @@ -28,64 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/vocab.json", - "allenai/longformer-large-4096": ( - "https://huggingface.co/allenai/longformer-large-4096/resolve/main/vocab.json" - ), - "allenai/longformer-large-4096-finetuned-triviaqa": ( - "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/vocab.json" - ), - "allenai/longformer-base-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/vocab.json" - ), - "allenai/longformer-large-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/vocab.json" - ), - }, - "merges_file": { - "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/merges.txt", - "allenai/longformer-large-4096": ( - "https://huggingface.co/allenai/longformer-large-4096/resolve/main/merges.txt" - ), - "allenai/longformer-large-4096-finetuned-triviaqa": ( - "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/merges.txt" - ), - "allenai/longformer-base-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/merges.txt" - ), - "allenai/longformer-large-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/merges.txt" - ), - }, - "tokenizer_file": { - "allenai/longformer-base-4096": ( - "https://huggingface.co/allenai/longformer-base-4096/resolve/main/tokenizer.json" - ), - "allenai/longformer-large-4096": ( - "https://huggingface.co/allenai/longformer-large-4096/resolve/main/tokenizer.json" - ), - "allenai/longformer-large-4096-finetuned-triviaqa": ( - "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/tokenizer.json" - ), - "allenai/longformer-base-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/tokenizer.json" - ), - "allenai/longformer-large-4096-extra.pos.embd.only": ( - "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "allenai/longformer-base-4096": 4096, - "allenai/longformer-large-4096": 4096, - "allenai/longformer-large-4096-finetuned-triviaqa": 4096, - "allenai/longformer-base-4096-extra.pos.embd.only": 4096, - "allenai/longformer-large-4096-extra.pos.embd.only": 4096, -} - # Copied from transformers.models.roberta.tokenization_roberta_fast.RobertaTokenizerFast with FacebookAI/roberta-base->allenai/longformer-base-4096, RoBERTa->Longformer all-casing, Roberta->Longformer class LongformerTokenizerFast(PreTrainedTokenizerFast): @@ -170,8 +112,6 @@ class LongformerTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = LongformerTokenizer diff --git a/src/transformers/models/longt5/__init__.py b/src/transformers/models/longt5/__init__.py index 93b9121c33f393..97d2bbe8ccd330 100644 --- a/src/transformers/models/longt5/__init__.py +++ b/src/transformers/models/longt5/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_longt5": ["LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongT5Config", "LongT5OnnxConfig"], + "configuration_longt5": ["LongT5Config", "LongT5OnnxConfig"], } try: @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_longt5"] = [ - "LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST", "LongT5EncoderModel", "LongT5ForConditionalGeneration", "LongT5Model", @@ -49,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_longt5 import LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP, LongT5Config, LongT5OnnxConfig + from .configuration_longt5 import LongT5Config, LongT5OnnxConfig try: if not is_torch_available(): @@ -58,7 +57,6 @@ pass else: from .modeling_longt5 import ( - LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST, LongT5EncoderModel, LongT5ForConditionalGeneration, LongT5Model, diff --git a/src/transformers/models/longt5/configuration_longt5.py b/src/transformers/models/longt5/configuration_longt5.py index 0095af0e246cce..839428f27ef682 100644 --- a/src/transformers/models/longt5/configuration_longt5.py +++ b/src/transformers/models/longt5/configuration_longt5.py @@ -22,13 +22,6 @@ logger = logging.get_logger(__name__) -LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/long-t5-local-base": "https://huggingface.co/google/long-t5-local-base/blob/main/config.json", - "google/long-t5-local-large": "https://huggingface.co/google/long-t5-local-large/blob/main/config.json", - "google/long-t5-tglobal-base": "https://huggingface.co/google/long-t5-tglobal-base/blob/main/config.json", - "google/long-t5-tglobal-large": "https://huggingface.co/google/long-t5-tglobal-large/blob/main/config.json", -} - class LongT5Config(PretrainedConfig): r""" diff --git a/src/transformers/models/longt5/modeling_longt5.py b/src/transformers/models/longt5/modeling_longt5.py index 5189db98a158cb..314785b82c193e 100644 --- a/src/transformers/models/longt5/modeling_longt5.py +++ b/src/transformers/models/longt5/modeling_longt5.py @@ -51,12 +51,6 @@ _CHECKPOINT_FOR_DOC = "google/long-t5-local-base" # TODO: Update before the merge -LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/long-t5-local-base", - "google/long-t5-local-large", - "google/long-t5-tglobal-base", - "google/long-t5-tglobal-large", -] def _pad_to_multiple(x: torch.Tensor, block_len: int, dim: int, pad_value: int = 0) -> torch.Tensor: diff --git a/src/transformers/models/luke/__init__.py b/src/transformers/models/luke/__init__.py index 91ef5f22221856..5ae6f488116ff4 100644 --- a/src/transformers/models/luke/__init__.py +++ b/src/transformers/models/luke/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_luke": ["LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP", "LukeConfig"], + "configuration_luke": ["LukeConfig"], "tokenization_luke": ["LukeTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_luke"] = [ - "LUKE_PRETRAINED_MODEL_ARCHIVE_LIST", "LukeForEntityClassification", "LukeForEntityPairClassification", "LukeForEntitySpanClassification", @@ -44,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_luke import LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig + from .configuration_luke import LukeConfig from .tokenization_luke import LukeTokenizer try: @@ -54,7 +53,6 @@ pass else: from .modeling_luke import ( - LUKE_PRETRAINED_MODEL_ARCHIVE_LIST, LukeForEntityClassification, LukeForEntityPairClassification, LukeForEntitySpanClassification, diff --git a/src/transformers/models/luke/configuration_luke.py b/src/transformers/models/luke/configuration_luke.py index 53ab1a352803bc..d3f14decac9664 100644 --- a/src/transformers/models/luke/configuration_luke.py +++ b/src/transformers/models/luke/configuration_luke.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/config.json", - "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/config.json", -} - class LukeConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/luke/modeling_luke.py b/src/transformers/models/luke/modeling_luke.py index 1742283ef685d4..803f4396a2b6a1 100644 --- a/src/transformers/models/luke/modeling_luke.py +++ b/src/transformers/models/luke/modeling_luke.py @@ -43,12 +43,6 @@ _CONFIG_FOR_DOC = "LukeConfig" _CHECKPOINT_FOR_DOC = "studio-ousia/luke-base" -LUKE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "studio-ousia/luke-base", - "studio-ousia/luke-large", - # See all LUKE models at https://huggingface.co/models?filter=luke -] - @dataclass class BaseLukeModelOutputWithPooling(BaseModelOutputWithPooling): diff --git a/src/transformers/models/luke/tokenization_luke.py b/src/transformers/models/luke/tokenization_luke.py index e8ad725d050b1c..d37258f2a40012 100644 --- a/src/transformers/models/luke/tokenization_luke.py +++ b/src/transformers/models/luke/tokenization_luke.py @@ -53,25 +53,6 @@ "entity_vocab_file": "entity_vocab.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/vocab.json", - "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/vocab.json", - }, - "merges_file": { - "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/merges.txt", - "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/merges.txt", - }, - "entity_vocab_file": { - "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/entity_vocab.json", - "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/entity_vocab.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "studio-ousia/luke-base": 512, - "studio-ousia/luke-large": 512, -} ENCODE_PLUS_ADDITIONAL_KWARGS_DOCSTRING = r""" return_token_type_ids (`bool`, *optional*): @@ -287,8 +268,6 @@ class LukeTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/lxmert/__init__.py b/src/transformers/models/lxmert/__init__.py index 4f7e775431dd0a..007beb4ecd2dcf 100644 --- a/src/transformers/models/lxmert/__init__.py +++ b/src/transformers/models/lxmert/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_lxmert": ["LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LxmertConfig"], + "configuration_lxmert": ["LxmertConfig"], "tokenization_lxmert": ["LxmertTokenizer"], } @@ -59,7 +59,6 @@ pass else: _import_structure["modeling_tf_lxmert"] = [ - "TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLxmertForPreTraining", "TFLxmertMainLayer", "TFLxmertModel", @@ -69,7 +68,7 @@ if TYPE_CHECKING: - from .configuration_lxmert import LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, LxmertConfig + from .configuration_lxmert import LxmertConfig from .tokenization_lxmert import LxmertTokenizer try: @@ -103,7 +102,6 @@ pass else: from .modeling_tf_lxmert import ( - TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFLxmertForPreTraining, TFLxmertMainLayer, TFLxmertModel, diff --git a/src/transformers/models/lxmert/configuration_lxmert.py b/src/transformers/models/lxmert/configuration_lxmert.py index 6ced7d2acadf4e..ec3a7c1864becc 100644 --- a/src/transformers/models/lxmert/configuration_lxmert.py +++ b/src/transformers/models/lxmert/configuration_lxmert.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json", -} - class LxmertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/lxmert/modeling_lxmert.py b/src/transformers/models/lxmert/modeling_lxmert.py index 226e2e7197a7ee..6e2ae7d22e7cac 100644 --- a/src/transformers/models/lxmert/modeling_lxmert.py +++ b/src/transformers/models/lxmert/modeling_lxmert.py @@ -43,10 +43,6 @@ _CHECKPOINT_FOR_DOC = "unc-nlp/lxmert-base-uncased" _CONFIG_FOR_DOC = "LxmertConfig" -LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "unc-nlp/lxmert-base-uncased", -] - class GeLU(nn.Module): def __init__(self): diff --git a/src/transformers/models/lxmert/modeling_tf_lxmert.py b/src/transformers/models/lxmert/modeling_tf_lxmert.py index 22ce04a0011bf2..2b51fb7510308d 100644 --- a/src/transformers/models/lxmert/modeling_tf_lxmert.py +++ b/src/transformers/models/lxmert/modeling_tf_lxmert.py @@ -53,10 +53,6 @@ _CHECKPOINT_FOR_DOC = "unc-nlp/lxmert-base-uncased" _CONFIG_FOR_DOC = "LxmertConfig" -TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "unc-nlp/lxmert-base-uncased", -] - @dataclass class TFLxmertModelOutput(ModelOutput): diff --git a/src/transformers/models/lxmert/tokenization_lxmert.py b/src/transformers/models/lxmert/tokenization_lxmert.py index 1557be1add6864..8d2fca9328ddc4 100644 --- a/src/transformers/models/lxmert/tokenization_lxmert.py +++ b/src/transformers/models/lxmert/tokenization_lxmert.py @@ -26,20 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/vocab.txt", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "unc-nlp/lxmert-base-uncased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "unc-nlp/lxmert-base-uncased": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -107,9 +93,6 @@ class LxmertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/lxmert/tokenization_lxmert_fast.py b/src/transformers/models/lxmert/tokenization_lxmert_fast.py index 7d9758a601b49c..e31fdbcf761d50 100644 --- a/src/transformers/models/lxmert/tokenization_lxmert_fast.py +++ b/src/transformers/models/lxmert/tokenization_lxmert_fast.py @@ -24,25 +24,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/vocab.txt", - }, - "tokenizer_file": { - "unc-nlp/lxmert-base-uncased": ( - "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "unc-nlp/lxmert-base-uncased": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "unc-nlp/lxmert-base-uncased": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert_fast.BertTokenizerFast with bert-base-cased->unc-nlp/lxmert-base-uncased, BERT->Lxmert, Bert->Lxmert class LxmertTokenizerFast(PreTrainedTokenizerFast): @@ -86,9 +67,6 @@ class LxmertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = LxmertTokenizer def __init__( diff --git a/src/transformers/models/m2m_100/__init__.py b/src/transformers/models/m2m_100/__init__.py index db2f0223bf04d6..45232f1390a53b 100644 --- a/src/transformers/models/m2m_100/__init__.py +++ b/src/transformers/models/m2m_100/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_m2m_100": ["M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP", "M2M100Config", "M2M100OnnxConfig"], + "configuration_m2m_100": ["M2M100Config", "M2M100OnnxConfig"], "tokenization_m2m_100": ["M2M100Tokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_m2m_100"] = [ - "M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST", "M2M100ForConditionalGeneration", "M2M100Model", "M2M100PreTrainedModel", @@ -37,7 +36,7 @@ if TYPE_CHECKING: - from .configuration_m2m_100 import M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP, M2M100Config, M2M100OnnxConfig + from .configuration_m2m_100 import M2M100Config, M2M100OnnxConfig from .tokenization_m2m_100 import M2M100Tokenizer try: @@ -47,7 +46,6 @@ pass else: from .modeling_m2m_100 import ( - M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST, M2M100ForConditionalGeneration, M2M100Model, M2M100PreTrainedModel, diff --git a/src/transformers/models/m2m_100/configuration_m2m_100.py b/src/transformers/models/m2m_100/configuration_m2m_100.py index 1b15658c03d714..73840e5132d348 100644 --- a/src/transformers/models/m2m_100/configuration_m2m_100.py +++ b/src/transformers/models/m2m_100/configuration_m2m_100.py @@ -25,11 +25,6 @@ logger = logging.get_logger(__name__) -M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/m2m100_418M": "https://huggingface.co/facebook/m2m100_418M/resolve/main/config.json", - # See all M2M100 models at https://huggingface.co/models?filter=m2m_100 -} - class M2M100Config(PretrainedConfig): r""" diff --git a/src/transformers/models/m2m_100/modeling_m2m_100.py b/src/transformers/models/m2m_100/modeling_m2m_100.py index 1aad2bde81c8c7..0cb6a969cc6839 100755 --- a/src/transformers/models/m2m_100/modeling_m2m_100.py +++ b/src/transformers/models/m2m_100/modeling_m2m_100.py @@ -49,12 +49,6 @@ _CHECKPOINT_FOR_DOC = "facebook/m2m100_418M" -M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/m2m100_418M", - # See all M2M100 models at https://huggingface.co/models?filter=m2m_100 -] - - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/m2m_100/tokenization_m2m_100.py b/src/transformers/models/m2m_100/tokenization_m2m_100.py index 1346af81412add..96f79ee4e725ef 100644 --- a/src/transformers/models/m2m_100/tokenization_m2m_100.py +++ b/src/transformers/models/m2m_100/tokenization_m2m_100.py @@ -34,24 +34,6 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/m2m100_418M": "https://huggingface.co/facebook/m2m100_418M/resolve/main/vocab.json", - "facebook/m2m100_1.2B": "https://huggingface.co/facebook/m2m100_1.2B/resolve/main/vocab.json", - }, - "spm_file": { - "facebook/m2m100_418M": "https://huggingface.co/facebook/m2m100_418M/resolve/main/sentencepiece.bpe.model", - "facebook/m2m100_1.2B": "https://huggingface.co/facebook/m2m100_1.2B/resolve/main/sentencepiece.bpe.model", - }, - "tokenizer_config_file": { - "facebook/m2m100_418M": "https://huggingface.co/facebook/m2m100_418M/resolve/main/tokenizer_config.json", - "facebook/m2m100_1.2B": "https://huggingface.co/facebook/m2m100_1.2B/resolve/main/tokenizer_config.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/m2m100_418M": 1024, -} # fmt: off FAIRSEQ_LANGUAGE_CODES = { @@ -121,8 +103,6 @@ class M2M100Tokenizer(PreTrainedTokenizer): ```""" vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/mamba/__init__.py b/src/transformers/models/mamba/__init__.py index 7a1c142e05d51e..80cb8e1c68a21d 100644 --- a/src/transformers/models/mamba/__init__.py +++ b/src/transformers/models/mamba/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_mamba": ["MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MambaConfig", "MambaOnnxConfig"], + "configuration_mamba": ["MambaConfig", "MambaOnnxConfig"], } try: @@ -32,7 +32,6 @@ pass else: _import_structure["modeling_mamba"] = [ - "MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST", "MambaForCausalLM", "MambaModel", "MambaPreTrainedModel", @@ -40,7 +39,7 @@ if TYPE_CHECKING: - from .configuration_mamba import MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP, MambaConfig, MambaOnnxConfig + from .configuration_mamba import MambaConfig, MambaOnnxConfig try: if not is_torch_available(): @@ -49,7 +48,6 @@ pass else: from .modeling_mamba import ( - MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST, MambaForCausalLM, MambaModel, MambaPreTrainedModel, diff --git a/src/transformers/models/mamba/configuration_mamba.py b/src/transformers/models/mamba/configuration_mamba.py index ec5e615c0bfa70..871a793d66d238 100644 --- a/src/transformers/models/mamba/configuration_mamba.py +++ b/src/transformers/models/mamba/configuration_mamba.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "state-spaces/mamba-2.8b": "https://huggingface.co/state-spaces/mamba-2.8b/resolve/main/config.json", -} - class MambaConfig(PretrainedConfig): """ diff --git a/src/transformers/models/mamba/modeling_mamba.py b/src/transformers/models/mamba/modeling_mamba.py index a3325b3af87c95..4459ec05a123f1 100644 --- a/src/transformers/models/mamba/modeling_mamba.py +++ b/src/transformers/models/mamba/modeling_mamba.py @@ -56,8 +56,6 @@ _CHECKPOINT_FOR_DOC = "state-spaces/mamba-130m-hf" _CONFIG_FOR_DOC = "MambaConfig" -MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST = [] # See all Mamba models at https://huggingface.co/models?filter=mamba - class MambaCache: def __init__(self, config, batch_size, dtype=torch.float16, device=None): diff --git a/src/transformers/models/marian/__init__.py b/src/transformers/models/marian/__init__.py index 56f0a4e86afba2..e3a8c473aeeedf 100644 --- a/src/transformers/models/marian/__init__.py +++ b/src/transformers/models/marian/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_marian": ["MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "MarianConfig", "MarianOnnxConfig"], + "configuration_marian": ["MarianConfig", "MarianOnnxConfig"], } try: @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_marian"] = [ - "MARIAN_PRETRAINED_MODEL_ARCHIVE_LIST", "MarianForCausalLM", "MarianModel", "MarianMTModel", @@ -67,7 +66,7 @@ _import_structure["modeling_flax_marian"] = ["FlaxMarianModel", "FlaxMarianMTModel", "FlaxMarianPreTrainedModel"] if TYPE_CHECKING: - from .configuration_marian import MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP, MarianConfig, MarianOnnxConfig + from .configuration_marian import MarianConfig, MarianOnnxConfig try: if not is_sentencepiece_available(): @@ -84,7 +83,6 @@ pass else: from .modeling_marian import ( - MARIAN_PRETRAINED_MODEL_ARCHIVE_LIST, MarianForCausalLM, MarianModel, MarianMTModel, diff --git a/src/transformers/models/marian/configuration_marian.py b/src/transformers/models/marian/configuration_marian.py index 201788673e6c21..5921fde981be26 100644 --- a/src/transformers/models/marian/configuration_marian.py +++ b/src/transformers/models/marian/configuration_marian.py @@ -25,11 +25,6 @@ logger = logging.get_logger(__name__) -MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Helsinki-NLP/opus-mt-en-de": "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/config.json", - # See all Marian models at https://huggingface.co/models?filter=marian -} - class MarianConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/marian/modeling_marian.py b/src/transformers/models/marian/modeling_marian.py index d52a060d4723c8..7c39acbcd43613 100755 --- a/src/transformers/models/marian/modeling_marian.py +++ b/src/transformers/models/marian/modeling_marian.py @@ -51,12 +51,6 @@ _CHECKPOINT_FOR_DOC = "Helsinki-NLP/opus-mt-en-de" -MARIAN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Helsinki-NLP/opus-mt-en-de", - # See all Marian models at https://huggingface.co/models?filter=marian -] - - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/marian/tokenization_marian.py b/src/transformers/models/marian/tokenization_marian.py index ead3ddd70e30fe..4f0d90b6f0dffe 100644 --- a/src/transformers/models/marian/tokenization_marian.py +++ b/src/transformers/models/marian/tokenization_marian.py @@ -35,25 +35,6 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "source_spm": { - "Helsinki-NLP/opus-mt-en-de": "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/source.spm" - }, - "target_spm": { - "Helsinki-NLP/opus-mt-en-de": "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/target.spm" - }, - "vocab": { - "Helsinki-NLP/opus-mt-en-de": "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/vocab.json" - }, - "tokenizer_config_file": { - "Helsinki-NLP/opus-mt-en-de": ( - "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/tokenizer_config.json" - ) - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"Helsinki-NLP/opus-mt-en-de": 512} -PRETRAINED_INIT_CONFIGURATION = {} SPIECE_UNDERLINE = "▁" @@ -120,9 +101,6 @@ class MarianTokenizer(PreTrainedTokenizer): ```""" vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] language_code_re = re.compile(">>.+<<") # type: re.Pattern diff --git a/src/transformers/models/markuplm/__init__.py b/src/transformers/models/markuplm/__init__.py index f8df88ce16f683..368834f13e98f8 100644 --- a/src/transformers/models/markuplm/__init__.py +++ b/src/transformers/models/markuplm/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_markuplm": ["MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "MarkupLMConfig"], + "configuration_markuplm": ["MarkupLMConfig"], "feature_extraction_markuplm": ["MarkupLMFeatureExtractor"], "processing_markuplm": ["MarkupLMProcessor"], "tokenization_markuplm": ["MarkupLMTokenizer"], @@ -38,7 +38,6 @@ pass else: _import_structure["modeling_markuplm"] = [ - "MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST", "MarkupLMForQuestionAnswering", "MarkupLMForSequenceClassification", "MarkupLMForTokenClassification", @@ -48,7 +47,7 @@ if TYPE_CHECKING: - from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig + from .configuration_markuplm import MarkupLMConfig from .feature_extraction_markuplm import MarkupLMFeatureExtractor from .processing_markuplm import MarkupLMProcessor from .tokenization_markuplm import MarkupLMTokenizer @@ -68,7 +67,6 @@ pass else: from .modeling_markuplm import ( - MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST, MarkupLMForQuestionAnswering, MarkupLMForSequenceClassification, MarkupLMForTokenClassification, diff --git a/src/transformers/models/markuplm/configuration_markuplm.py b/src/transformers/models/markuplm/configuration_markuplm.py index ff0ab96919834e..581cc0f349c3e7 100644 --- a/src/transformers/models/markuplm/configuration_markuplm.py +++ b/src/transformers/models/markuplm/configuration_markuplm.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/config.json", - "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/config.json", -} - class MarkupLMConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/markuplm/modeling_markuplm.py b/src/transformers/models/markuplm/modeling_markuplm.py index 24ca0c4972aaa0..ef27256ac2d973 100755 --- a/src/transformers/models/markuplm/modeling_markuplm.py +++ b/src/transformers/models/markuplm/modeling_markuplm.py @@ -52,11 +52,6 @@ _CHECKPOINT_FOR_DOC = "microsoft/markuplm-base" _CONFIG_FOR_DOC = "MarkupLMConfig" -MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/markuplm-base", - "microsoft/markuplm-large", -] - class XPathEmbeddings(nn.Module): """Construct the embeddings from xpath tags and subscripts. @@ -708,7 +703,6 @@ class MarkupLMPreTrainedModel(PreTrainedModel): """ config_class = MarkupLMConfig - pretrained_model_archive_map = MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST base_model_prefix = "markuplm" # Copied from transformers.models.bert.modeling_bert.BertPreTrainedModel._init_weights with Bert->MarkupLM diff --git a/src/transformers/models/markuplm/tokenization_markuplm.py b/src/transformers/models/markuplm/tokenization_markuplm.py index 24fa4b7763a9e1..c77865abc934c9 100644 --- a/src/transformers/models/markuplm/tokenization_markuplm.py +++ b/src/transformers/models/markuplm/tokenization_markuplm.py @@ -39,23 +39,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/vocab.json", - "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/vocab.json", - }, - "merges_file": { - "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/merges.txt", - "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/merges.txt", - }, -} - - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/markuplm-base": 512, - "microsoft/markuplm-large": 512, -} - MARKUPLM_ENCODE_PLUS_ADDITIONAL_KWARGS_DOCSTRING = r""" add_special_tokens (`bool`, *optional*, defaults to `True`): @@ -198,8 +181,6 @@ class MarkupLMTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/markuplm/tokenization_markuplm_fast.py b/src/transformers/models/markuplm/tokenization_markuplm_fast.py index a0933631b65b7a..ff0e4ffeb56e9f 100644 --- a/src/transformers/models/markuplm/tokenization_markuplm_fast.py +++ b/src/transformers/models/markuplm/tokenization_markuplm_fast.py @@ -43,23 +43,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/vocab.json", - "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/vocab.json", - }, - "merges_file": { - "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/merges.txt", - "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/merges.txt", - }, -} - - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/markuplm-base": 512, - "microsoft/markuplm-large": 512, -} - @lru_cache() def bytes_to_unicode(): @@ -156,8 +139,6 @@ class MarkupLMTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = MarkupLMTokenizer def __init__( diff --git a/src/transformers/models/mask2former/__init__.py b/src/transformers/models/mask2former/__init__.py index d6db4a478ac1d8..7ede863452bc72 100644 --- a/src/transformers/models/mask2former/__init__.py +++ b/src/transformers/models/mask2former/__init__.py @@ -17,10 +17,7 @@ _import_structure = { - "configuration_mask2former": [ - "MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "Mask2FormerConfig", - ], + "configuration_mask2former": ["Mask2FormerConfig"], } try: @@ -38,14 +35,13 @@ pass else: _import_structure["modeling_mask2former"] = [ - "MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Mask2FormerForUniversalSegmentation", "Mask2FormerModel", "Mask2FormerPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_mask2former import MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Mask2FormerConfig + from .configuration_mask2former import Mask2FormerConfig try: if not is_vision_available(): @@ -62,7 +58,6 @@ pass else: from .modeling_mask2former import ( - MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Mask2FormerForUniversalSegmentation, Mask2FormerModel, Mask2FormerPreTrainedModel, diff --git a/src/transformers/models/mask2former/configuration_mask2former.py b/src/transformers/models/mask2former/configuration_mask2former.py index 0b5aa9aa0c71f6..ed97ed24582363 100644 --- a/src/transformers/models/mask2former/configuration_mask2former.py +++ b/src/transformers/models/mask2former/configuration_mask2former.py @@ -20,13 +20,6 @@ from ..auto import CONFIG_MAPPING -MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/mask2former-swin-small-coco-instance": ( - "https://huggingface.co/facebook/mask2former-swin-small-coco-instance/blob/main/config.json" - ) - # See all Mask2Former models at https://huggingface.co/models?filter=mask2former -} - logger = logging.get_logger(__name__) diff --git a/src/transformers/models/mask2former/modeling_mask2former.py b/src/transformers/models/mask2former/modeling_mask2former.py index 628b50e448ee71..f37b5b14fcaab0 100644 --- a/src/transformers/models/mask2former/modeling_mask2former.py +++ b/src/transformers/models/mask2former/modeling_mask2former.py @@ -54,11 +54,6 @@ _CHECKPOINT_FOR_DOC = "facebook/mask2former-swin-small-coco-instance" _IMAGE_PROCESSOR_FOR_DOC = "Mask2FormerImageProcessor" -MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/mask2former-swin-small-coco-instance", - # See all mask2former models at https://huggingface.co/models?filter=mask2former -] - @dataclass class Mask2FormerPixelDecoderOutput(ModelOutput): diff --git a/src/transformers/models/maskformer/__init__.py b/src/transformers/models/maskformer/__init__.py index efb2290f2c9ceb..78aa54a4656150 100644 --- a/src/transformers/models/maskformer/__init__.py +++ b/src/transformers/models/maskformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_maskformer": ["MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "MaskFormerConfig"], + "configuration_maskformer": ["MaskFormerConfig"], "configuration_maskformer_swin": ["MaskFormerSwinConfig"], } @@ -38,7 +38,6 @@ pass else: _import_structure["modeling_maskformer"] = [ - "MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "MaskFormerForInstanceSegmentation", "MaskFormerModel", "MaskFormerPreTrainedModel", @@ -50,7 +49,7 @@ ] if TYPE_CHECKING: - from .configuration_maskformer import MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, MaskFormerConfig + from .configuration_maskformer import MaskFormerConfig from .configuration_maskformer_swin import MaskFormerSwinConfig try: @@ -68,7 +67,6 @@ pass else: from .modeling_maskformer import ( - MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, MaskFormerForInstanceSegmentation, MaskFormerModel, MaskFormerPreTrainedModel, diff --git a/src/transformers/models/maskformer/configuration_maskformer.py b/src/transformers/models/maskformer/configuration_maskformer.py index 758ac4eb20bfc5..f82fe199b7bc34 100644 --- a/src/transformers/models/maskformer/configuration_maskformer.py +++ b/src/transformers/models/maskformer/configuration_maskformer.py @@ -22,13 +22,6 @@ from ..swin import SwinConfig -MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/maskformer-swin-base-ade": ( - "https://huggingface.co/facebook/maskformer-swin-base-ade/blob/main/config.json" - ) - # See all MaskFormer models at https://huggingface.co/models?filter=maskformer -} - logger = logging.get_logger(__name__) diff --git a/src/transformers/models/maskformer/modeling_maskformer.py b/src/transformers/models/maskformer/modeling_maskformer.py index e61146e9c4326a..74cc6cc4c9e9e3 100644 --- a/src/transformers/models/maskformer/modeling_maskformer.py +++ b/src/transformers/models/maskformer/modeling_maskformer.py @@ -57,11 +57,6 @@ _CONFIG_FOR_DOC = "MaskFormerConfig" _CHECKPOINT_FOR_DOC = "facebook/maskformer-swin-base-ade" -MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/maskformer-swin-base-ade", - # See all MaskFormer models at https://huggingface.co/models?filter=maskformer -] - @dataclass # Copied from transformers.models.detr.modeling_detr.DetrDecoderOutput diff --git a/src/transformers/models/mbart/__init__.py b/src/transformers/models/mbart/__init__.py index bae4593c87d89c..12575fcab74036 100644 --- a/src/transformers/models/mbart/__init__.py +++ b/src/transformers/models/mbart/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_mbart": ["MBART_PRETRAINED_CONFIG_ARCHIVE_MAP", "MBartConfig", "MBartOnnxConfig"]} +_import_structure = {"configuration_mbart": ["MBartConfig", "MBartOnnxConfig"]} try: if not is_sentencepiece_available(): @@ -49,7 +49,6 @@ pass else: _import_structure["modeling_mbart"] = [ - "MBART_PRETRAINED_MODEL_ARCHIVE_LIST", "MBartForCausalLM", "MBartForConditionalGeneration", "MBartForQuestionAnswering", @@ -86,7 +85,7 @@ if TYPE_CHECKING: - from .configuration_mbart import MBART_PRETRAINED_CONFIG_ARCHIVE_MAP, MBartConfig, MBartOnnxConfig + from .configuration_mbart import MBartConfig, MBartOnnxConfig try: if not is_sentencepiece_available(): @@ -111,7 +110,6 @@ pass else: from .modeling_mbart import ( - MBART_PRETRAINED_MODEL_ARCHIVE_LIST, MBartForCausalLM, MBartForConditionalGeneration, MBartForQuestionAnswering, diff --git a/src/transformers/models/mbart/configuration_mbart.py b/src/transformers/models/mbart/configuration_mbart.py index 176ce52dbfab97..4823047dcf3151 100644 --- a/src/transformers/models/mbart/configuration_mbart.py +++ b/src/transformers/models/mbart/configuration_mbart.py @@ -25,11 +25,6 @@ logger = logging.get_logger(__name__) -MBART_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/mbart-large-cc25": "https://huggingface.co/facebook/mbart-large-cc25/resolve/main/config.json", - # See all MBART models at https://huggingface.co/models?filter=mbart -} - class MBartConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mbart/modeling_mbart.py b/src/transformers/models/mbart/modeling_mbart.py index 2f1d031d1a6d9c..fc23e2c675dbf2 100755 --- a/src/transformers/models/mbart/modeling_mbart.py +++ b/src/transformers/models/mbart/modeling_mbart.py @@ -61,11 +61,6 @@ # Base model docstring _EXPECTED_OUTPUT_SHAPE = [1, 8, 1024] -MBART_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/mbart-large-cc25", - # See all MBART models at https://huggingface.co/models?filter=mbart -] - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): diff --git a/src/transformers/models/mbart/tokenization_mbart.py b/src/transformers/models/mbart/tokenization_mbart.py index 37f4c849ab9ddd..d9da6cb45cb388 100644 --- a/src/transformers/models/mbart/tokenization_mbart.py +++ b/src/transformers/models/mbart/tokenization_mbart.py @@ -29,21 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/mbart-large-en-ro": ( - "https://huggingface.co/facebook/mbart-large-en-ro/resolve/main/sentencepiece.bpe.model" - ), - "facebook/mbart-large-cc25": ( - "https://huggingface.co/facebook/mbart-large-cc25/resolve/main/sentencepiece.bpe.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/mbart-large-en-ro": 1024, - "facebook/mbart-large-cc25": 1024, -} FAIRSEQ_LANGUAGE_CODES = ["ar_AR", "cs_CZ", "de_DE", "en_XX", "es_XX", "et_EE", "fi_FI", "fr_XX", "gu_IN", "hi_IN", "it_IT", "ja_XX", "kk_KZ", "ko_KR", "lt_LT", "lv_LV", "my_MM", "ne_NP", "nl_XX", "ro_RO", "ru_RU", "si_LK", "tr_TR", "vi_VN", "zh_CN"] # fmt: skip @@ -70,8 +55,6 @@ class MBartTokenizer(PreTrainedTokenizer): ```""" vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/mbart/tokenization_mbart_fast.py b/src/transformers/models/mbart/tokenization_mbart_fast.py index 8638ab974e2ac7..71107bf0cdaf47 100644 --- a/src/transformers/models/mbart/tokenization_mbart_fast.py +++ b/src/transformers/models/mbart/tokenization_mbart_fast.py @@ -35,25 +35,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/mbart-large-en-ro": ( - "https://huggingface.co/facebook/mbart-large-en-ro/resolve/main/sentencepiece.bpe.model" - ), - "facebook/mbart-large-cc25": ( - "https://huggingface.co/facebook/mbart-large-cc25/resolve/main/sentencepiece.bpe.model" - ), - }, - "tokenizer_file": { - "facebook/mbart-large-en-ro": "https://huggingface.co/facebook/mbart-large-en-ro/resolve/main/tokenizer.json", - "facebook/mbart-large-cc25": "https://huggingface.co/facebook/mbart-large-cc25/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/mbart-large-en-ro": 1024, - "facebook/mbart-large-cc25": 1024, -} FAIRSEQ_LANGUAGE_CODES = ["ar_AR", "cs_CZ", "de_DE", "en_XX", "es_XX", "et_EE", "fi_FI", "fr_XX", "gu_IN", "hi_IN", "it_IT", "ja_XX", "kk_KZ", "ko_KR", "lt_LT", "lv_LV", "my_MM", "ne_NP", "nl_XX", "ro_RO", "ru_RU", "si_LK", "tr_TR", "vi_VN", "zh_CN"] # fmt: skip @@ -83,8 +64,6 @@ class MBartTokenizerFast(PreTrainedTokenizerFast): ```""" vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = MBartTokenizer diff --git a/src/transformers/models/mbart50/tokenization_mbart50.py b/src/transformers/models/mbart50/tokenization_mbart50.py index cd4e52f42efabc..7acc6ecbf36bbd 100644 --- a/src/transformers/models/mbart50/tokenization_mbart50.py +++ b/src/transformers/models/mbart50/tokenization_mbart50.py @@ -29,17 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/mbart-large-50-one-to-many-mmt": ( - "https://huggingface.co/facebook/mbart-large-50-one-to-many-mmt/resolve/main/sentencepiece.bpe.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/mbart-large-50-one-to-many-mmt": 1024, -} FAIRSEQ_LANGUAGE_CODES = ["ar_AR", "cs_CZ", "de_DE", "en_XX", "es_XX", "et_EE", "fi_FI", "fr_XX", "gu_IN", "hi_IN", "it_IT", "ja_XX", "kk_KZ", "ko_KR", "lt_LT", "lv_LV", "my_MM", "ne_NP", "nl_XX", "ro_RO", "ru_RU", "si_LK", "tr_TR", "vi_VN", "zh_CN", "af_ZA", "az_AZ", "bn_IN", "fa_IR", "he_IL", "hr_HR", "id_ID", "ka_GE", "km_KH", "mk_MK", "ml_IN", "mn_MN", "mr_IN", "pl_PL", "ps_AF", "pt_XX", "sv_SE", "sw_KE", "ta_IN", "te_IN", "th_TH", "tl_XX", "uk_UA", "ur_PK", "xh_ZA", "gl_ES", "sl_SI"] # fmt: skip @@ -104,8 +93,6 @@ class MBart50Tokenizer(PreTrainedTokenizer): ```""" vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/mbart50/tokenization_mbart50_fast.py b/src/transformers/models/mbart50/tokenization_mbart50_fast.py index 701e30d916d955..cc4678f5f53cce 100644 --- a/src/transformers/models/mbart50/tokenization_mbart50_fast.py +++ b/src/transformers/models/mbart50/tokenization_mbart50_fast.py @@ -34,22 +34,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/mbart-large-50-one-to-many-mmt": ( - "https://huggingface.co/facebook/mbart-large-50-one-to-many-mmt/resolve/main/sentencepiece.bpe.model" - ), - }, - "tokenizer_file": { - "facebook/mbart-large-50-one-to-many-mmt": ( - "https://huggingface.co/facebook/mbart-large-50-one-to-many-mmt/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/mbart-large-50-one-to-many-mmt": 1024, -} FAIRSEQ_LANGUAGE_CODES = ["ar_AR", "cs_CZ", "de_DE", "en_XX", "es_XX", "et_EE", "fi_FI", "fr_XX", "gu_IN", "hi_IN", "it_IT", "ja_XX", "kk_KZ", "ko_KR", "lt_LT", "lv_LV", "my_MM", "ne_NP", "nl_XX", "ro_RO", "ru_RU", "si_LK", "tr_TR", "vi_VN", "zh_CN", "af_ZA", "az_AZ", "bn_IN", "fa_IR", "he_IL", "hr_HR", "id_ID", "ka_GE", "km_KH", "mk_MK", "ml_IN", "mn_MN", "mr_IN", "pl_PL", "ps_AF", "pt_XX", "sv_SE", "sw_KE", "ta_IN", "te_IN", "th_TH", "tl_XX", "uk_UA", "ur_PK", "xh_ZA", "gl_ES", "sl_SI"] # fmt: skip @@ -100,8 +84,6 @@ class MBart50TokenizerFast(PreTrainedTokenizerFast): ```""" vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = MBart50Tokenizer diff --git a/src/transformers/models/mega/__init__.py b/src/transformers/models/mega/__init__.py index 728499ef2d385f..3e3b204d8b1727 100644 --- a/src/transformers/models/mega/__init__.py +++ b/src/transformers/models/mega/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig", "MegaOnnxConfig"], + "configuration_mega": ["MegaConfig", "MegaOnnxConfig"], } try: @@ -32,7 +32,6 @@ pass else: _import_structure["modeling_mega"] = [ - "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST", "MegaForCausalLM", "MegaForMaskedLM", "MegaForMultipleChoice", @@ -44,7 +43,7 @@ ] if TYPE_CHECKING: - from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig + from .configuration_mega import MegaConfig, MegaOnnxConfig try: if not is_torch_available(): @@ -53,7 +52,6 @@ pass else: from .modeling_mega import ( - MEGA_PRETRAINED_MODEL_ARCHIVE_LIST, MegaForCausalLM, MegaForMaskedLM, MegaForMultipleChoice, diff --git a/src/transformers/models/mega/configuration_mega.py b/src/transformers/models/mega/configuration_mega.py index 34f858569cd558..8287a3938e2445 100644 --- a/src/transformers/models/mega/configuration_mega.py +++ b/src/transformers/models/mega/configuration_mega.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "mnaylor/mega-base-wikitext": "https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json", -} - class MegaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mega/modeling_mega.py b/src/transformers/models/mega/modeling_mega.py index dda31f5d949ea4..65fff1cd49735a 100644 --- a/src/transformers/models/mega/modeling_mega.py +++ b/src/transformers/models/mega/modeling_mega.py @@ -50,11 +50,6 @@ _CHECKPOINT_FOR_DOC = "mnaylor/mega-base-wikitext" _CONFIG_FOR_DOC = "MegaConfig" -MEGA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "mnaylor/mega-base-wikitext", - # See all Mega models at https://huggingface.co/models?filter=mega -] - class MegaEmbeddings(nn.Module): """ diff --git a/src/transformers/models/megatron_bert/__init__.py b/src/transformers/models/megatron_bert/__init__.py index 477802fdc0098d..259e56c25b59a4 100644 --- a/src/transformers/models/megatron_bert/__init__.py +++ b/src/transformers/models/megatron_bert/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_megatron_bert": ["MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegatronBertConfig"], + "configuration_megatron_bert": ["MegatronBertConfig"], } try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_megatron_bert"] = [ - "MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MegatronBertForCausalLM", "MegatronBertForMaskedLM", "MegatronBertForMultipleChoice", @@ -41,7 +40,7 @@ ] if TYPE_CHECKING: - from .configuration_megatron_bert import MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig + from .configuration_megatron_bert import MegatronBertConfig try: if not is_torch_available(): @@ -50,7 +49,6 @@ pass else: from .modeling_megatron_bert import ( - MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, MegatronBertForCausalLM, MegatronBertForMaskedLM, MegatronBertForMultipleChoice, diff --git a/src/transformers/models/megatron_bert/configuration_megatron_bert.py b/src/transformers/models/megatron_bert/configuration_megatron_bert.py index 02cdf289432b38..d3be4db99bcbb2 100644 --- a/src/transformers/models/megatron_bert/configuration_megatron_bert.py +++ b/src/transformers/models/megatron_bert/configuration_megatron_bert.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert -} - class MegatronBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/megatron_bert/modeling_megatron_bert.py b/src/transformers/models/megatron_bert/modeling_megatron_bert.py index 9111f937bc2a06..96f85a5d6c368b 100755 --- a/src/transformers/models/megatron_bert/modeling_megatron_bert.py +++ b/src/transformers/models/megatron_bert/modeling_megatron_bert.py @@ -57,11 +57,6 @@ _CONFIG_FOR_DOC = "MegatronBertConfig" _CHECKPOINT_FOR_DOC = "nvidia/megatron-bert-cased-345m" -MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "nvidia/megatron-bert-cased-345m", - # See all MegatronBERT models at https://huggingface.co/models?filter=megatron_bert -] - def load_tf_weights_in_megatron_bert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/mgp_str/__init__.py b/src/transformers/models/mgp_str/__init__.py index 1bb9ae50b291cf..901425ca45d61a 100644 --- a/src/transformers/models/mgp_str/__init__.py +++ b/src/transformers/models/mgp_str/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_mgp_str": ["MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP", "MgpstrConfig"], + "configuration_mgp_str": ["MgpstrConfig"], "processing_mgp_str": ["MgpstrProcessor"], "tokenization_mgp_str": ["MgpstrTokenizer"], } @@ -33,14 +33,13 @@ pass else: _import_structure["modeling_mgp_str"] = [ - "MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST", "MgpstrModel", "MgpstrPreTrainedModel", "MgpstrForSceneTextRecognition", ] if TYPE_CHECKING: - from .configuration_mgp_str import MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig + from .configuration_mgp_str import MgpstrConfig from .processing_mgp_str import MgpstrProcessor from .tokenization_mgp_str import MgpstrTokenizer @@ -51,7 +50,6 @@ pass else: from .modeling_mgp_str import ( - MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST, MgpstrForSceneTextRecognition, MgpstrModel, MgpstrPreTrainedModel, diff --git a/src/transformers/models/mgp_str/configuration_mgp_str.py b/src/transformers/models/mgp_str/configuration_mgp_str.py index 4644b4f0cc1769..2ce4ffd0c61b10 100644 --- a/src/transformers/models/mgp_str/configuration_mgp_str.py +++ b/src/transformers/models/mgp_str/configuration_mgp_str.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "alibaba-damo/mgp-str-base": "https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json", -} - class MgpstrConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mgp_str/modeling_mgp_str.py b/src/transformers/models/mgp_str/modeling_mgp_str.py index 8914e59a207001..bd2a4b1eaa1ed0 100644 --- a/src/transformers/models/mgp_str/modeling_mgp_str.py +++ b/src/transformers/models/mgp_str/modeling_mgp_str.py @@ -44,11 +44,6 @@ # Base docstring _CHECKPOINT_FOR_DOC = "alibaba-damo/mgp-str-base" -MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "alibaba-damo/mgp-str-base", - # See all MGP-STR models at https://huggingface.co/models?filter=mgp-str -] - # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/src/transformers/models/mgp_str/tokenization_mgp_str.py b/src/transformers/models/mgp_str/tokenization_mgp_str.py index 7fe11061154093..a34ba744c1960c 100644 --- a/src/transformers/models/mgp_str/tokenization_mgp_str.py +++ b/src/transformers/models/mgp_str/tokenization_mgp_str.py @@ -26,14 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "mgp-str": "https://huggingface.co/alibaba-damo/mgp-str-base/blob/main/vocab.json", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"mgp-str": 27} - class MgpstrTokenizer(PreTrainedTokenizer): """ @@ -58,8 +50,6 @@ class MgpstrTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__(self, vocab_file, unk_token="[GO]", bos_token="[GO]", eos_token="[s]", pad_token="[GO]", **kwargs): with open(vocab_file, encoding="utf-8") as vocab_handle: diff --git a/src/transformers/models/mistral/__init__.py b/src/transformers/models/mistral/__init__.py index 34727d98cf05af..dc0b85980ff600 100644 --- a/src/transformers/models/mistral/__init__.py +++ b/src/transformers/models/mistral/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_mistral": ["MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MistralConfig"], + "configuration_mistral": ["MistralConfig"], } @@ -48,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_mistral import MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MistralConfig + from .configuration_mistral import MistralConfig try: if not is_torch_available(): diff --git a/src/transformers/models/mistral/configuration_mistral.py b/src/transformers/models/mistral/configuration_mistral.py index a6c4634f611d1b..e281802792d325 100644 --- a/src/transformers/models/mistral/configuration_mistral.py +++ b/src/transformers/models/mistral/configuration_mistral.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "mistralai/Mistral-7B-v0.1": "https://huggingface.co/mistralai/Mistral-7B-v0.1/resolve/main/config.json", - "mistralai/Mistral-7B-Instruct-v0.1": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1/resolve/main/config.json", -} - class MistralConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mixtral/__init__.py b/src/transformers/models/mixtral/__init__.py index ebde04ea4ae81c..7b8f061dac8362 100644 --- a/src/transformers/models/mixtral/__init__.py +++ b/src/transformers/models/mixtral/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_mixtral": ["MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MixtralConfig"], + "configuration_mixtral": ["MixtralConfig"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_mixtral import MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MixtralConfig + from .configuration_mixtral import MixtralConfig try: if not is_torch_available(): diff --git a/src/transformers/models/mixtral/configuration_mixtral.py b/src/transformers/models/mixtral/configuration_mixtral.py index ac2dbed16e10cb..d1c501ab6cc5ac 100644 --- a/src/transformers/models/mixtral/configuration_mixtral.py +++ b/src/transformers/models/mixtral/configuration_mixtral.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "mistral-ai/Mixtral-8x7B": "https://huggingface.co/mistral-ai/Mixtral-8x7B/resolve/main/config.json", -} - class MixtralConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mluke/tokenization_mluke.py b/src/transformers/models/mluke/tokenization_mluke.py index 028de5d4f79c8c..3ef5e64ed2f6a7 100644 --- a/src/transformers/models/mluke/tokenization_mluke.py +++ b/src/transformers/models/mluke/tokenization_mluke.py @@ -52,21 +52,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "entity_vocab_file": "entity_vocab.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "studio-ousia/mluke-base": "https://huggingface.co/studio-ousia/mluke-base/resolve/main/vocab.json", - }, - "merges_file": { - "studio-ousia/mluke-base": "https://huggingface.co/studio-ousia/mluke-base/resolve/main/merges.txt", - }, - "entity_vocab_file": { - "studio-ousia/mluke-base": "https://huggingface.co/studio-ousia/mluke-base/resolve/main/entity_vocab.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "studio-ousia/mluke-base": 512, -} ENCODE_PLUS_ADDITIONAL_KWARGS_DOCSTRING = r""" return_token_type_ids (`bool`, *optional*): @@ -230,8 +215,6 @@ class MLukeTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/mobilebert/__init__.py b/src/transformers/models/mobilebert/__init__.py index 0d202eb4d4234f..c085c3d8636c1e 100644 --- a/src/transformers/models/mobilebert/__init__.py +++ b/src/transformers/models/mobilebert/__init__.py @@ -25,7 +25,6 @@ _import_structure = { "configuration_mobilebert": [ - "MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileBertConfig", "MobileBertOnnxConfig", ], @@ -47,7 +46,6 @@ pass else: _import_structure["modeling_mobilebert"] = [ - "MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileBertForMaskedLM", "MobileBertForMultipleChoice", "MobileBertForNextSentencePrediction", @@ -68,7 +66,6 @@ pass else: _import_structure["modeling_tf_mobilebert"] = [ - "TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileBertForMaskedLM", "TFMobileBertForMultipleChoice", "TFMobileBertForNextSentencePrediction", @@ -84,7 +81,6 @@ if TYPE_CHECKING: from .configuration_mobilebert import ( - MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileBertConfig, MobileBertOnnxConfig, ) @@ -105,7 +101,6 @@ pass else: from .modeling_mobilebert import ( - MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileBertForMaskedLM, MobileBertForMultipleChoice, MobileBertForNextSentencePrediction, @@ -126,7 +121,6 @@ pass else: from .modeling_tf_mobilebert import ( - TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileBertForMaskedLM, TFMobileBertForMultipleChoice, TFMobileBertForNextSentencePrediction, diff --git a/src/transformers/models/mobilebert/configuration_mobilebert.py b/src/transformers/models/mobilebert/configuration_mobilebert.py index b14d25ea9ed507..7d39186025fa8b 100644 --- a/src/transformers/models/mobilebert/configuration_mobilebert.py +++ b/src/transformers/models/mobilebert/configuration_mobilebert.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/config.json" -} - class MobileBertConfig(PretrainedConfig): r""" @@ -104,14 +100,8 @@ class MobileBertConfig(PretrainedConfig): >>> # Accessing the model configuration >>> configuration = model.config ``` - - Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained - checkpoints. """ - pretrained_config_archive_map = MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP - model_type = "mobilebert" - def __init__( self, vocab_size=30522, diff --git a/src/transformers/models/mobilebert/modeling_mobilebert.py b/src/transformers/models/mobilebert/modeling_mobilebert.py index 70f2ebc7bfd8f7..013131ea2d82ef 100644 --- a/src/transformers/models/mobilebert/modeling_mobilebert.py +++ b/src/transformers/models/mobilebert/modeling_mobilebert.py @@ -76,8 +76,6 @@ _SEQ_CLASS_EXPECTED_OUTPUT = "'others'" _SEQ_CLASS_EXPECTED_LOSS = "4.72" -MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = ["google/mobilebert-uncased"] - def load_tf_weights_in_mobilebert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" @@ -685,7 +683,6 @@ class MobileBertPreTrainedModel(PreTrainedModel): """ config_class = MobileBertConfig - pretrained_model_archive_map = MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST load_tf_weights = load_tf_weights_in_mobilebert base_model_prefix = "mobilebert" diff --git a/src/transformers/models/mobilebert/modeling_tf_mobilebert.py b/src/transformers/models/mobilebert/modeling_tf_mobilebert.py index 6ccc996557532b..bab2cbac8ed5fd 100644 --- a/src/transformers/models/mobilebert/modeling_tf_mobilebert.py +++ b/src/transformers/models/mobilebert/modeling_tf_mobilebert.py @@ -84,11 +84,6 @@ _SEQ_CLASS_EXPECTED_OUTPUT = "'others'" _SEQ_CLASS_EXPECTED_LOSS = "4.72" -TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/mobilebert-uncased", - # See all MobileBERT models at https://huggingface.co/models?filter=mobilebert -] - # Copied from transformers.models.bert.modeling_tf_bert.TFBertPreTrainingLoss class TFMobileBertPreTrainingLoss: diff --git a/src/transformers/models/mobilebert/tokenization_mobilebert.py b/src/transformers/models/mobilebert/tokenization_mobilebert.py index f27873e92fcfa9..ccfdcc31ff9be9 100644 --- a/src/transformers/models/mobilebert/tokenization_mobilebert.py +++ b/src/transformers/models/mobilebert/tokenization_mobilebert.py @@ -29,15 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/vocab.txt"} -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"mobilebert-uncased": 512} - - -PRETRAINED_INIT_CONFIGURATION = {} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -105,9 +96,6 @@ class MobileBertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/mobilebert/tokenization_mobilebert_fast.py b/src/transformers/models/mobilebert/tokenization_mobilebert_fast.py index 2b137d2ed60a35..21057924092e9c 100644 --- a/src/transformers/models/mobilebert/tokenization_mobilebert_fast.py +++ b/src/transformers/models/mobilebert/tokenization_mobilebert_fast.py @@ -29,18 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/vocab.txt"}, - "tokenizer_file": { - "mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/tokenizer.json" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"mobilebert-uncased": 512} - - -PRETRAINED_INIT_CONFIGURATION = {} - # Copied from transformers.models.bert.tokenization_bert_fast.BertTokenizerFast with BERT->MobileBERT,Bert->MobileBert class MobileBertTokenizerFast(PreTrainedTokenizerFast): @@ -84,9 +72,6 @@ class MobileBertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = MobileBertTokenizer def __init__( diff --git a/src/transformers/models/mobilenet_v1/__init__.py b/src/transformers/models/mobilenet_v1/__init__.py index dec8eeec2de566..6ff5725a21a8aa 100644 --- a/src/transformers/models/mobilenet_v1/__init__.py +++ b/src/transformers/models/mobilenet_v1/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_mobilenet_v1": [ - "MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileNetV1Config", "MobileNetV1OnnxConfig", ], @@ -40,7 +39,6 @@ pass else: _import_structure["modeling_mobilenet_v1"] = [ - "MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV1ForImageClassification", "MobileNetV1Model", "MobileNetV1PreTrainedModel", @@ -50,7 +48,6 @@ if TYPE_CHECKING: from .configuration_mobilenet_v1 import ( - MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV1Config, MobileNetV1OnnxConfig, ) @@ -71,7 +68,6 @@ pass else: from .modeling_mobilenet_v1 import ( - MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV1ForImageClassification, MobileNetV1Model, MobileNetV1PreTrainedModel, diff --git a/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py b/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py index 59f025c621d25d..70075bcc94e622 100644 --- a/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py +++ b/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py @@ -26,12 +26,6 @@ logger = logging.get_logger(__name__) -MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/mobilenet_v1_1.0_224": "https://huggingface.co/google/mobilenet_v1_1.0_224/resolve/main/config.json", - "google/mobilenet_v1_0.75_192": "https://huggingface.co/google/mobilenet_v1_0.75_192/resolve/main/config.json", - # See all MobileNetV1 models at https://huggingface.co/models?filter=mobilenet_v1 -} - class MobileNetV1Config(PretrainedConfig): r""" diff --git a/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py b/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py index 3963e60f3562bd..825c0f660a7f85 100755 --- a/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py +++ b/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py @@ -43,13 +43,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/mobilenet_v1_1.0_224", - "google/mobilenet_v1_0.75_192", - # See all MobileNetV1 models at https://huggingface.co/models?filter=mobilenet_v1 -] - - def _build_tf_to_pytorch_map(model, config, tf_weights=None): """ A map of modules from TF to PyTorch. diff --git a/src/transformers/models/mobilenet_v2/__init__.py b/src/transformers/models/mobilenet_v2/__init__.py index e3d89c8b59479a..5fcab8fe7c4e58 100644 --- a/src/transformers/models/mobilenet_v2/__init__.py +++ b/src/transformers/models/mobilenet_v2/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_mobilenet_v2": [ - "MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileNetV2Config", "MobileNetV2OnnxConfig", ], @@ -41,7 +40,6 @@ pass else: _import_structure["modeling_mobilenet_v2"] = [ - "MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV2ForImageClassification", "MobileNetV2ForSemanticSegmentation", "MobileNetV2Model", @@ -52,7 +50,6 @@ if TYPE_CHECKING: from .configuration_mobilenet_v2 import ( - MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV2Config, MobileNetV2OnnxConfig, ) @@ -73,7 +70,6 @@ pass else: from .modeling_mobilenet_v2 import ( - MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV2ForImageClassification, MobileNetV2ForSemanticSegmentation, MobileNetV2Model, diff --git a/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py b/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py index 161f0e6d8fff42..81e590d5a357f9 100644 --- a/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py +++ b/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py @@ -26,14 +26,6 @@ logger = logging.get_logger(__name__) -MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/mobilenet_v2_1.4_224": "https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json", - "google/mobilenet_v2_1.0_224": "https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json", - "google/mobilenet_v2_0.75_160": "https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json", - "google/mobilenet_v2_0.35_96": "https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json", - # See all MobileNetV2 models at https://huggingface.co/models?filter=mobilenet_v2 -} - class MobileNetV2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py b/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py index b76e68f9067ec7..0440487f227498 100755 --- a/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py +++ b/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py @@ -53,15 +53,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/mobilenet_v2_1.4_224", - "google/mobilenet_v2_1.0_224", - "google/mobilenet_v2_0.37_160", - "google/mobilenet_v2_0.35_96", - # See all MobileNetV2 models at https://huggingface.co/models?filter=mobilenet_v2 -] - - def _build_tf_to_pytorch_map(model, config, tf_weights=None): """ A map of modules from TF to PyTorch. diff --git a/src/transformers/models/mobilevit/__init__.py b/src/transformers/models/mobilevit/__init__.py index 5615c622186299..942a963227b955 100644 --- a/src/transformers/models/mobilevit/__init__.py +++ b/src/transformers/models/mobilevit/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTConfig", "MobileViTOnnxConfig"], + "configuration_mobilevit": ["MobileViTConfig", "MobileViTOnnxConfig"], } try: @@ -42,7 +42,6 @@ pass else: _import_structure["modeling_mobilevit"] = [ - "MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTForImageClassification", "MobileViTForSemanticSegmentation", "MobileViTModel", @@ -56,7 +55,6 @@ pass else: _import_structure["modeling_tf_mobilevit"] = [ - "TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileViTForImageClassification", "TFMobileViTForSemanticSegmentation", "TFMobileViTModel", @@ -64,7 +62,7 @@ ] if TYPE_CHECKING: - from .configuration_mobilevit import MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTConfig, MobileViTOnnxConfig + from .configuration_mobilevit import MobileViTConfig, MobileViTOnnxConfig try: if not is_vision_available(): @@ -82,7 +80,6 @@ pass else: from .modeling_mobilevit import ( - MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTForImageClassification, MobileViTForSemanticSegmentation, MobileViTModel, @@ -96,7 +93,6 @@ pass else: from .modeling_tf_mobilevit import ( - TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileViTForImageClassification, TFMobileViTForSemanticSegmentation, TFMobileViTModel, diff --git a/src/transformers/models/mobilevit/configuration_mobilevit.py b/src/transformers/models/mobilevit/configuration_mobilevit.py index 24429bbbcc58c7..5650002b3c55b0 100644 --- a/src/transformers/models/mobilevit/configuration_mobilevit.py +++ b/src/transformers/models/mobilevit/configuration_mobilevit.py @@ -26,22 +26,6 @@ logger = logging.get_logger(__name__) -MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "apple/mobilevit-small": "https://huggingface.co/apple/mobilevit-small/resolve/main/config.json", - "apple/mobilevit-x-small": "https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json", - "apple/mobilevit-xx-small": "https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json", - "apple/deeplabv3-mobilevit-small": ( - "https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json" - ), - "apple/deeplabv3-mobilevit-x-small": ( - "https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json" - ), - "apple/deeplabv3-mobilevit-xx-small": ( - "https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json" - ), - # See all MobileViT models at https://huggingface.co/models?filter=mobilevit -} - class MobileViTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mobilevit/modeling_mobilevit.py b/src/transformers/models/mobilevit/modeling_mobilevit.py index 1de0f6adbf0e54..2e493c810cc269 100755 --- a/src/transformers/models/mobilevit/modeling_mobilevit.py +++ b/src/transformers/models/mobilevit/modeling_mobilevit.py @@ -59,17 +59,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "apple/mobilevit-small", - "apple/mobilevit-x-small", - "apple/mobilevit-xx-small", - "apple/deeplabv3-mobilevit-small", - "apple/deeplabv3-mobilevit-x-small", - "apple/deeplabv3-mobilevit-xx-small", - # See all MobileViT models at https://huggingface.co/models?filter=mobilevit -] - - def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the diff --git a/src/transformers/models/mobilevit/modeling_tf_mobilevit.py b/src/transformers/models/mobilevit/modeling_tf_mobilevit.py index 20249799363347..179f209e871b8a 100644 --- a/src/transformers/models/mobilevit/modeling_tf_mobilevit.py +++ b/src/transformers/models/mobilevit/modeling_tf_mobilevit.py @@ -61,17 +61,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "apple/mobilevit-small", - "apple/mobilevit-x-small", - "apple/mobilevit-xx-small", - "apple/deeplabv3-mobilevit-small", - "apple/deeplabv3-mobilevit-x-small", - "apple/deeplabv3-mobilevit-xx-small", - # See all MobileViT models at https://huggingface.co/models?filter=mobilevit -] - - def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the diff --git a/src/transformers/models/mobilevitv2/__init__.py b/src/transformers/models/mobilevitv2/__init__.py index 043caf7b7526fc..770736c03df7ed 100644 --- a/src/transformers/models/mobilevitv2/__init__.py +++ b/src/transformers/models/mobilevitv2/__init__.py @@ -23,7 +23,6 @@ _import_structure = { "configuration_mobilevitv2": [ - "MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTV2Config", "MobileViTV2OnnxConfig", ], @@ -37,7 +36,6 @@ pass else: _import_structure["modeling_mobilevitv2"] = [ - "MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTV2ForImageClassification", "MobileViTV2ForSemanticSegmentation", "MobileViTV2Model", @@ -46,7 +44,6 @@ if TYPE_CHECKING: from .configuration_mobilevitv2 import ( - MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTV2Config, MobileViTV2OnnxConfig, ) @@ -58,7 +55,6 @@ pass else: from .modeling_mobilevitv2 import ( - MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTV2ForImageClassification, MobileViTV2ForSemanticSegmentation, MobileViTV2Model, diff --git a/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py b/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py index c3bc44f38e0420..957a43f770fc7e 100644 --- a/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py +++ b/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py @@ -26,10 +26,6 @@ logger = logging.get_logger(__name__) -MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "apple/mobilevitv2-1.0": "https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json", -} - class MobileViTV2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py b/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py index 842e78946e9df7..1ca0e143d8be26 100644 --- a/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py +++ b/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py @@ -57,12 +57,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "apple/mobilevitv2-1.0-imagenet1k-256" - # See all MobileViTV2 models at https://huggingface.co/models?filter=mobilevitv2 -] - - # Copied from transformers.models.mobilevit.modeling_mobilevit.make_divisible def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ diff --git a/src/transformers/models/mpnet/__init__.py b/src/transformers/models/mpnet/__init__.py index 993a99c0819bd6..54c20d9f1967dd 100644 --- a/src/transformers/models/mpnet/__init__.py +++ b/src/transformers/models/mpnet/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_mpnet": ["MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "MPNetConfig"], + "configuration_mpnet": ["MPNetConfig"], "tokenization_mpnet": ["MPNetTokenizer"], } @@ -44,7 +44,6 @@ pass else: _import_structure["modeling_mpnet"] = [ - "MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "MPNetForMaskedLM", "MPNetForMultipleChoice", "MPNetForQuestionAnswering", @@ -62,7 +61,6 @@ pass else: _import_structure["modeling_tf_mpnet"] = [ - "TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMPNetEmbeddings", "TFMPNetForMaskedLM", "TFMPNetForMultipleChoice", @@ -76,7 +74,7 @@ if TYPE_CHECKING: - from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig + from .configuration_mpnet import MPNetConfig from .tokenization_mpnet import MPNetTokenizer try: @@ -94,7 +92,6 @@ pass else: from .modeling_mpnet import ( - MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, MPNetForMaskedLM, MPNetForMultipleChoice, MPNetForQuestionAnswering, @@ -112,7 +109,6 @@ pass else: from .modeling_tf_mpnet import ( - TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFMPNetEmbeddings, TFMPNetForMaskedLM, TFMPNetForMultipleChoice, diff --git a/src/transformers/models/mpnet/configuration_mpnet.py b/src/transformers/models/mpnet/configuration_mpnet.py index fe492a963e5af2..9c53e45d98fce8 100644 --- a/src/transformers/models/mpnet/configuration_mpnet.py +++ b/src/transformers/models/mpnet/configuration_mpnet.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/config.json", -} - class MPNetConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mpnet/modeling_mpnet.py b/src/transformers/models/mpnet/modeling_mpnet.py index 86194607e21750..e220247144706d 100644 --- a/src/transformers/models/mpnet/modeling_mpnet.py +++ b/src/transformers/models/mpnet/modeling_mpnet.py @@ -45,14 +45,8 @@ _CONFIG_FOR_DOC = "MPNetConfig" -MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/mpnet-base", -] - - class MPNetPreTrainedModel(PreTrainedModel): config_class = MPNetConfig - pretrained_model_archive_map = MPNET_PRETRAINED_MODEL_ARCHIVE_LIST base_model_prefix = "mpnet" def _init_weights(self, module): diff --git a/src/transformers/models/mpnet/modeling_tf_mpnet.py b/src/transformers/models/mpnet/modeling_tf_mpnet.py index fe2825c76cee29..f0afba869b81d7 100644 --- a/src/transformers/models/mpnet/modeling_tf_mpnet.py +++ b/src/transformers/models/mpnet/modeling_tf_mpnet.py @@ -63,10 +63,6 @@ _CHECKPOINT_FOR_DOC = "microsoft/mpnet-base" _CONFIG_FOR_DOC = "MPNetConfig" -TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/mpnet-base", -] - class TFMPNetPreTrainedModel(TFPreTrainedModel): """ diff --git a/src/transformers/models/mpnet/tokenization_mpnet.py b/src/transformers/models/mpnet/tokenization_mpnet.py index 51b8d0ff15fd5a..003575300e8572 100644 --- a/src/transformers/models/mpnet/tokenization_mpnet.py +++ b/src/transformers/models/mpnet/tokenization_mpnet.py @@ -28,20 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/vocab.txt", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/mpnet-base": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/mpnet-base": {"do_lower_case": True}, -} - def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" @@ -125,9 +111,6 @@ class MPNetTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/mpnet/tokenization_mpnet_fast.py b/src/transformers/models/mpnet/tokenization_mpnet_fast.py index 1c9b1d5922278b..433c3028fc2093 100644 --- a/src/transformers/models/mpnet/tokenization_mpnet_fast.py +++ b/src/transformers/models/mpnet/tokenization_mpnet_fast.py @@ -30,23 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/vocab.txt", - }, - "tokenizer_file": { - "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/mpnet-base": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/mpnet-base": {"do_lower_case": True}, -} - class MPNetTokenizerFast(PreTrainedTokenizerFast): r""" @@ -104,9 +87,6 @@ class MPNetTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = MPNetTokenizer model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/mpt/__init__.py b/src/transformers/models/mpt/__init__.py index d24a5fad7b9d2c..49b3a0d61fcdb3 100644 --- a/src/transformers/models/mpt/__init__.py +++ b/src/transformers/models/mpt/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_mpt": ["MPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MptConfig", "MptOnnxConfig"], + "configuration_mpt": ["MptConfig", "MptOnnxConfig"], } try: @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_mpt"] = [ - "MPT_PRETRAINED_MODEL_ARCHIVE_LIST", "MptForCausalLM", "MptModel", "MptPreTrainedModel", @@ -38,7 +37,7 @@ ] if TYPE_CHECKING: - from .configuration_mpt import MPT_PRETRAINED_CONFIG_ARCHIVE_MAP, MptConfig, MptOnnxConfig + from .configuration_mpt import MptConfig, MptOnnxConfig try: if not is_torch_available(): @@ -47,7 +46,6 @@ pass else: from .modeling_mpt import ( - MPT_PRETRAINED_MODEL_ARCHIVE_LIST, MptForCausalLM, MptForQuestionAnswering, MptForSequenceClassification, diff --git a/src/transformers/models/mpt/configuration_mpt.py b/src/transformers/models/mpt/configuration_mpt.py index cc91966b6b0d01..5d18b1419e37b5 100644 --- a/src/transformers/models/mpt/configuration_mpt.py +++ b/src/transformers/models/mpt/configuration_mpt.py @@ -25,10 +25,6 @@ logger = logging.get_logger(__name__) -MPT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "mosaicml/mpt-7b": "https://huggingface.co/mosaicml/mpt-7b/resolve/main/config.json", -} - class MptAttentionConfig(PretrainedConfig): """ diff --git a/src/transformers/models/mpt/modeling_mpt.py b/src/transformers/models/mpt/modeling_mpt.py index fc4af29d8c696d..cffb4b7117e4aa 100644 --- a/src/transformers/models/mpt/modeling_mpt.py +++ b/src/transformers/models/mpt/modeling_mpt.py @@ -42,19 +42,6 @@ _CHECKPOINT_FOR_DOC = "mosaicml/mpt-7b" _CONFIG_FOR_DOC = "MptConfig" -MPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "mosaicml/mpt-7b", - "mosaicml/mpt-7b-storywriter", - "mosaicml/mpt-7b-instruct", - "mosaicml/mpt-7b-8k", - "mosaicml/mpt-7b-8k-instruct", - "mosaicml/mpt-7b-8k-chat", - "mosaicml/mpt-30b", - "mosaicml/mpt-30b-instruct", - "mosaicml/mpt-30b-chat", - # See all MPT models at https://huggingface.co/models?filter=mpt -] - def build_mpt_alibi_tensor(num_heads, sequence_length, alibi_bias_max=8, device=None): r""" diff --git a/src/transformers/models/mra/__init__.py b/src/transformers/models/mra/__init__.py index d27ee2f1719321..21d82eb3dabac1 100644 --- a/src/transformers/models/mra/__init__.py +++ b/src/transformers/models/mra/__init__.py @@ -21,7 +21,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available -_import_structure = {"configuration_mra": ["MRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MraConfig"]} +_import_structure = {"configuration_mra": ["MraConfig"]} try: if not is_torch_available(): @@ -30,7 +30,6 @@ pass else: _import_structure["modeling_mra"] = [ - "MRA_PRETRAINED_MODEL_ARCHIVE_LIST", "MraForMaskedLM", "MraForMultipleChoice", "MraForQuestionAnswering", @@ -43,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig + from .configuration_mra import MraConfig try: if not is_torch_available(): @@ -52,7 +51,6 @@ pass else: from .modeling_mra import ( - MRA_PRETRAINED_MODEL_ARCHIVE_LIST, MraForMaskedLM, MraForMultipleChoice, MraForQuestionAnswering, diff --git a/src/transformers/models/mra/configuration_mra.py b/src/transformers/models/mra/configuration_mra.py index 5ae2f5b13bc2e3..30c38795b57fc7 100644 --- a/src/transformers/models/mra/configuration_mra.py +++ b/src/transformers/models/mra/configuration_mra.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -MRA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "uw-madison/mra-base-512-4": "https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json", -} - class MraConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mra/modeling_mra.py b/src/transformers/models/mra/modeling_mra.py index 6e33753817027c..c7a3073714ec15 100644 --- a/src/transformers/models/mra/modeling_mra.py +++ b/src/transformers/models/mra/modeling_mra.py @@ -53,10 +53,6 @@ _CONFIG_FOR_DOC = "MraConfig" _TOKENIZER_FOR_DOC = "AutoTokenizer" -MRA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "uw-madison/mra-base-512-4", - # See all Mra models at https://huggingface.co/models?filter=mra -] mra_cuda_kernel = None diff --git a/src/transformers/models/mt5/modeling_mt5.py b/src/transformers/models/mt5/modeling_mt5.py index 100273a5ac5628..1c0351c9ea561f 100644 --- a/src/transformers/models/mt5/modeling_mt5.py +++ b/src/transformers/models/mt5/modeling_mt5.py @@ -59,14 +59,6 @@ # This dict contains ids and associated url # for the pretrained weights provided with the models #################################################### -MT5_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/mt5-small", - "google/mt5-base", - "google/mt5-large", - "google/mt5-xl", - "google/mt5-xxl", - # See all mT5 models at https://huggingface.co/models?filter=mt5 -] PARALLELIZE_DOCSTRING = r""" This is an experimental feature and is a subject to change at a moment's notice. diff --git a/src/transformers/models/musicgen/__init__.py b/src/transformers/models/musicgen/__init__.py index 7fa695eba80863..3b03adae12fc76 100644 --- a/src/transformers/models/musicgen/__init__.py +++ b/src/transformers/models/musicgen/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_musicgen": [ - "MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "MusicgenConfig", "MusicgenDecoderConfig", ], @@ -32,7 +31,6 @@ pass else: _import_structure["modeling_musicgen"] = [ - "MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "MusicgenForConditionalGeneration", "MusicgenForCausalLM", "MusicgenModel", @@ -41,7 +39,6 @@ if TYPE_CHECKING: from .configuration_musicgen import ( - MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, MusicgenConfig, MusicgenDecoderConfig, ) @@ -54,7 +51,6 @@ pass else: from .modeling_musicgen import ( - MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST, MusicgenForCausalLM, MusicgenForConditionalGeneration, MusicgenModel, diff --git a/src/transformers/models/musicgen/configuration_musicgen.py b/src/transformers/models/musicgen/configuration_musicgen.py index c0f56626409ba9..6f552d074974a9 100644 --- a/src/transformers/models/musicgen/configuration_musicgen.py +++ b/src/transformers/models/musicgen/configuration_musicgen.py @@ -21,11 +21,6 @@ logger = logging.get_logger(__name__) -MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/musicgen-small": "https://huggingface.co/facebook/musicgen-small/resolve/main/config.json", - # See all Musicgen models at https://huggingface.co/models?filter=musicgen -} - class MusicgenDecoderConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/musicgen/modeling_musicgen.py b/src/transformers/models/musicgen/modeling_musicgen.py index bb5a5277f362b1..7ca1cc1c561c22 100644 --- a/src/transformers/models/musicgen/modeling_musicgen.py +++ b/src/transformers/models/musicgen/modeling_musicgen.py @@ -56,11 +56,6 @@ _CONFIG_FOR_DOC = "MusicgenConfig" _CHECKPOINT_FOR_DOC = "facebook/musicgen-small" -MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/musicgen-small", - # See all Musicgen models at https://huggingface.co/models?filter=musicgen -] - @dataclass class MusicgenUnconditionalInput(ModelOutput): diff --git a/src/transformers/models/mvp/__init__.py b/src/transformers/models/mvp/__init__.py index 406dc531e96f78..e865b8827c5cd8 100644 --- a/src/transformers/models/mvp/__init__.py +++ b/src/transformers/models/mvp/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_mvp": ["MVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "MvpConfig", "MvpOnnxConfig"], + "configuration_mvp": ["MvpConfig", "MvpOnnxConfig"], "tokenization_mvp": ["MvpTokenizer"], } @@ -36,7 +36,6 @@ pass else: _import_structure["modeling_mvp"] = [ - "MVP_PRETRAINED_MODEL_ARCHIVE_LIST", "MvpForCausalLM", "MvpForConditionalGeneration", "MvpForQuestionAnswering", @@ -46,7 +45,7 @@ ] if TYPE_CHECKING: - from .configuration_mvp import MVP_PRETRAINED_CONFIG_ARCHIVE_MAP, MvpConfig, MvpOnnxConfig + from .configuration_mvp import MvpConfig, MvpOnnxConfig from .tokenization_mvp import MvpTokenizer try: @@ -64,7 +63,6 @@ pass else: from .modeling_mvp import ( - MVP_PRETRAINED_MODEL_ARCHIVE_LIST, MvpForCausalLM, MvpForConditionalGeneration, MvpForQuestionAnswering, diff --git a/src/transformers/models/mvp/configuration_mvp.py b/src/transformers/models/mvp/configuration_mvp.py index 9f60c79efa6d1f..00f6b142496921 100644 --- a/src/transformers/models/mvp/configuration_mvp.py +++ b/src/transformers/models/mvp/configuration_mvp.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -MVP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json", -} - class MvpConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/mvp/modeling_mvp.py b/src/transformers/models/mvp/modeling_mvp.py index 88106a07878c4c..7c0f47856778cd 100644 --- a/src/transformers/models/mvp/modeling_mvp.py +++ b/src/transformers/models/mvp/modeling_mvp.py @@ -53,25 +53,6 @@ # Base model docstring _EXPECTED_OUTPUT_SHAPE = [1, 8, 1024] -MVP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "RUCAIBox/mvp", - "RUCAIBox/mvp-data-to-text", - "RUCAIBox/mvp-open-dialog", - "RUCAIBox/mvp-question-answering", - "RUCAIBox/mvp-question-generation", - "RUCAIBox/mvp-story", - "RUCAIBox/mvp-summarization", - "RUCAIBox/mvp-task-dialog", - "RUCAIBox/mtl-data-to-text", - "RUCAIBox/mtl-multi-task", - "RUCAIBox/mtl-open-dialog", - "RUCAIBox/mtl-question-answering", - "RUCAIBox/mtl-question-generation", - "RUCAIBox/mtl-story", - "RUCAIBox/mtl-summarization", - # See all MVP models at https://huggingface.co/models?filter=mvp -] - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): diff --git a/src/transformers/models/mvp/tokenization_mvp.py b/src/transformers/models/mvp/tokenization_mvp.py index d6f5e980bbaeb6..5a159320b7a3e0 100644 --- a/src/transformers/models/mvp/tokenization_mvp.py +++ b/src/transformers/models/mvp/tokenization_mvp.py @@ -30,21 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt"} # See all MVP models at https://huggingface.co/models?filter=mvp -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/vocab.json", - }, - "added_tokens.json": { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/added_tokens.json", - }, - "merges_file": { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "RUCAIBox/mvp": 1024, -} @lru_cache() @@ -165,8 +150,6 @@ class MvpTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/mvp/tokenization_mvp_fast.py b/src/transformers/models/mvp/tokenization_mvp_fast.py index a6ff13c0898936..5901c2bece4097 100644 --- a/src/transformers/models/mvp/tokenization_mvp_fast.py +++ b/src/transformers/models/mvp/tokenization_mvp_fast.py @@ -30,24 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} # See all MVP models at https://huggingface.co/models?filter=mvp -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/vocab.json", - }, - "added_tokens.json": { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/added_tokens.json", - }, - "merges_file": { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/merges.txt", - }, - "tokenizer_file": { - "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "RUCAIBox/mvp": 1024, -} class MvpTokenizerFast(PreTrainedTokenizerFast): @@ -132,8 +114,6 @@ class MvpTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = MvpTokenizer diff --git a/src/transformers/models/nat/__init__.py b/src/transformers/models/nat/__init__.py index 19ddb46e8266fa..bcf05ddf41ed9b 100644 --- a/src/transformers/models/nat/__init__.py +++ b/src/transformers/models/nat/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_nat": ["NAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "NatConfig"]} +_import_structure = {"configuration_nat": ["NatConfig"]} try: @@ -26,7 +26,6 @@ pass else: _import_structure["modeling_nat"] = [ - "NAT_PRETRAINED_MODEL_ARCHIVE_LIST", "NatForImageClassification", "NatModel", "NatPreTrainedModel", @@ -34,7 +33,7 @@ ] if TYPE_CHECKING: - from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig + from .configuration_nat import NatConfig try: if not is_torch_available(): @@ -43,7 +42,6 @@ pass else: from .modeling_nat import ( - NAT_PRETRAINED_MODEL_ARCHIVE_LIST, NatBackbone, NatForImageClassification, NatModel, diff --git a/src/transformers/models/nat/configuration_nat.py b/src/transformers/models/nat/configuration_nat.py index 4dff9c84dad209..baf0ea13a5f902 100644 --- a/src/transformers/models/nat/configuration_nat.py +++ b/src/transformers/models/nat/configuration_nat.py @@ -21,11 +21,6 @@ logger = logging.get_logger(__name__) -NAT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "shi-labs/nat-mini-in1k-224": "https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json", - # See all Nat models at https://huggingface.co/models?filter=nat -} - class NatConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/nat/modeling_nat.py b/src/transformers/models/nat/modeling_nat.py index 7384e2ac4c1257..b9c332c894e775 100644 --- a/src/transformers/models/nat/modeling_nat.py +++ b/src/transformers/models/nat/modeling_nat.py @@ -68,11 +68,6 @@ def natten2dav(*args, **kwargs): _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" -NAT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "shi-labs/nat-mini-in1k-224", - # See all Nat models at https://huggingface.co/models?filter=nat -] - # drop_path and NatDropPath are from the timm library. diff --git a/src/transformers/models/nezha/__init__.py b/src/transformers/models/nezha/__init__.py index f9078fc4a5667a..5149adf3a0cdfa 100644 --- a/src/transformers/models/nezha/__init__.py +++ b/src/transformers/models/nezha/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_nezha": ["NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP", "NezhaConfig"], + "configuration_nezha": ["NezhaConfig"], } try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_nezha"] = [ - "NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST", "NezhaForNextSentencePrediction", "NezhaForMaskedLM", "NezhaForPreTraining", @@ -41,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig + from .configuration_nezha import NezhaConfig try: if not is_torch_available(): @@ -50,7 +49,6 @@ pass else: from .modeling_nezha import ( - NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST, NezhaForMaskedLM, NezhaForMultipleChoice, NezhaForNextSentencePrediction, diff --git a/src/transformers/models/nezha/configuration_nezha.py b/src/transformers/models/nezha/configuration_nezha.py index e47f6e721f615e..4e145e4b687529 100644 --- a/src/transformers/models/nezha/configuration_nezha.py +++ b/src/transformers/models/nezha/configuration_nezha.py @@ -1,11 +1,6 @@ from ... import PretrainedConfig -NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "sijunhe/nezha-cn-base": "https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json", -} - - class NezhaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`NezhaModel`]. It is used to instantiate an Nezha @@ -64,7 +59,6 @@ class NezhaConfig(PretrainedConfig): >>> configuration = model.config ```""" - pretrained_config_archive_map = NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP model_type = "nezha" def __init__( diff --git a/src/transformers/models/nezha/modeling_nezha.py b/src/transformers/models/nezha/modeling_nezha.py index 918a10b2759a2d..f42760d5b136bd 100644 --- a/src/transformers/models/nezha/modeling_nezha.py +++ b/src/transformers/models/nezha/modeling_nezha.py @@ -55,14 +55,6 @@ _CHECKPOINT_FOR_DOC = "sijunhe/nezha-cn-base" _CONFIG_FOR_DOC = "NezhaConfig" -NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "sijunhe/nezha-cn-base", - "sijunhe/nezha-cn-large", - "sijunhe/nezha-base-wwm", - "sijunhe/nezha-large-wwm", - # See all Nezha models at https://huggingface.co/models?filter=nezha -] - def load_tf_weights_in_nezha(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/nllb/tokenization_nllb.py b/src/transformers/models/nllb/tokenization_nllb.py index ee2285e8263acb..f517121157f5d3 100644 --- a/src/transformers/models/nllb/tokenization_nllb.py +++ b/src/transformers/models/nllb/tokenization_nllb.py @@ -29,17 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/nllb-200-distilled-600M": ( - "https://huggingface.co/facebook/nllb-200-distilled-600M/blob/main/sentencepiece.bpe.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/nllb-200-distilled-600M": 1024, -} FAIRSEQ_LANGUAGE_CODES = ['ace_Arab', 'ace_Latn', 'acm_Arab', 'acq_Arab', 'aeb_Arab', 'afr_Latn', 'ajp_Arab', 'aka_Latn', 'amh_Ethi', 'apc_Arab', 'arb_Arab', 'ars_Arab', 'ary_Arab', 'arz_Arab', 'asm_Beng', 'ast_Latn', 'awa_Deva', 'ayr_Latn', 'azb_Arab', 'azj_Latn', 'bak_Cyrl', 'bam_Latn', 'ban_Latn', 'bel_Cyrl', 'bem_Latn', 'ben_Beng', 'bho_Deva', 'bjn_Arab', 'bjn_Latn', 'bod_Tibt', 'bos_Latn', 'bug_Latn', 'bul_Cyrl', 'cat_Latn', 'ceb_Latn', 'ces_Latn', 'cjk_Latn', 'ckb_Arab', 'crh_Latn', 'cym_Latn', 'dan_Latn', 'deu_Latn', 'dik_Latn', 'dyu_Latn', 'dzo_Tibt', 'ell_Grek', 'eng_Latn', 'epo_Latn', 'est_Latn', 'eus_Latn', 'ewe_Latn', 'fao_Latn', 'pes_Arab', 'fij_Latn', 'fin_Latn', 'fon_Latn', 'fra_Latn', 'fur_Latn', 'fuv_Latn', 'gla_Latn', 'gle_Latn', 'glg_Latn', 'grn_Latn', 'guj_Gujr', 'hat_Latn', 'hau_Latn', 'heb_Hebr', 'hin_Deva', 'hne_Deva', 'hrv_Latn', 'hun_Latn', 'hye_Armn', 'ibo_Latn', 'ilo_Latn', 'ind_Latn', 'isl_Latn', 'ita_Latn', 'jav_Latn', 'jpn_Jpan', 'kab_Latn', 'kac_Latn', 'kam_Latn', 'kan_Knda', 'kas_Arab', 'kas_Deva', 'kat_Geor', 'knc_Arab', 'knc_Latn', 'kaz_Cyrl', 'kbp_Latn', 'kea_Latn', 'khm_Khmr', 'kik_Latn', 'kin_Latn', 'kir_Cyrl', 'kmb_Latn', 'kon_Latn', 'kor_Hang', 'kmr_Latn', 'lao_Laoo', 'lvs_Latn', 'lij_Latn', 'lim_Latn', 'lin_Latn', 'lit_Latn', 'lmo_Latn', 'ltg_Latn', 'ltz_Latn', 'lua_Latn', 'lug_Latn', 'luo_Latn', 'lus_Latn', 'mag_Deva', 'mai_Deva', 'mal_Mlym', 'mar_Deva', 'min_Latn', 'mkd_Cyrl', 'plt_Latn', 'mlt_Latn', 'mni_Beng', 'khk_Cyrl', 'mos_Latn', 'mri_Latn', 'zsm_Latn', 'mya_Mymr', 'nld_Latn', 'nno_Latn', 'nob_Latn', 'npi_Deva', 'nso_Latn', 'nus_Latn', 'nya_Latn', 'oci_Latn', 'gaz_Latn', 'ory_Orya', 'pag_Latn', 'pan_Guru', 'pap_Latn', 'pol_Latn', 'por_Latn', 'prs_Arab', 'pbt_Arab', 'quy_Latn', 'ron_Latn', 'run_Latn', 'rus_Cyrl', 'sag_Latn', 'san_Deva', 'sat_Beng', 'scn_Latn', 'shn_Mymr', 'sin_Sinh', 'slk_Latn', 'slv_Latn', 'smo_Latn', 'sna_Latn', 'snd_Arab', 'som_Latn', 'sot_Latn', 'spa_Latn', 'als_Latn', 'srd_Latn', 'srp_Cyrl', 'ssw_Latn', 'sun_Latn', 'swe_Latn', 'swh_Latn', 'szl_Latn', 'tam_Taml', 'tat_Cyrl', 'tel_Telu', 'tgk_Cyrl', 'tgl_Latn', 'tha_Thai', 'tir_Ethi', 'taq_Latn', 'taq_Tfng', 'tpi_Latn', 'tsn_Latn', 'tso_Latn', 'tuk_Latn', 'tum_Latn', 'tur_Latn', 'twi_Latn', 'tzm_Tfng', 'uig_Arab', 'ukr_Cyrl', 'umb_Latn', 'urd_Arab', 'uzn_Latn', 'vec_Latn', 'vie_Latn', 'war_Latn', 'wol_Latn', 'xho_Latn', 'ydd_Hebr', 'yor_Latn', 'yue_Hant', 'zho_Hans', 'zho_Hant', 'zul_Latn'] # fmt: skip @@ -116,8 +105,6 @@ class NllbTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/nllb/tokenization_nllb_fast.py b/src/transformers/models/nllb/tokenization_nllb_fast.py index d71de82d414202..2004580bf65c7f 100644 --- a/src/transformers/models/nllb/tokenization_nllb_fast.py +++ b/src/transformers/models/nllb/tokenization_nllb_fast.py @@ -35,23 +35,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/nllb-200-distilled-600M": ( - "https://huggingface.co/facebook/nllb-200-distilled-600M/resolve/main/sentencepiece.bpe.model" - ), - }, - "tokenizer_file": { - "facebook/nllb-200-distilled-600M": ( - "https://huggingface.co/facebook/nllb-200-distilled-600M/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/nllb-large-en-ro": 1024, - "facebook/nllb-200-distilled-600M": 1024, -} FAIRSEQ_LANGUAGE_CODES = ['ace_Arab', 'ace_Latn', 'acm_Arab', 'acq_Arab', 'aeb_Arab', 'afr_Latn', 'ajp_Arab', 'aka_Latn', 'amh_Ethi', 'apc_Arab', 'arb_Arab', 'ars_Arab', 'ary_Arab', 'arz_Arab', 'asm_Beng', 'ast_Latn', 'awa_Deva', 'ayr_Latn', 'azb_Arab', 'azj_Latn', 'bak_Cyrl', 'bam_Latn', 'ban_Latn', 'bel_Cyrl', 'bem_Latn', 'ben_Beng', 'bho_Deva', 'bjn_Arab', 'bjn_Latn', 'bod_Tibt', 'bos_Latn', 'bug_Latn', 'bul_Cyrl', 'cat_Latn', 'ceb_Latn', 'ces_Latn', 'cjk_Latn', 'ckb_Arab', 'crh_Latn', 'cym_Latn', 'dan_Latn', 'deu_Latn', 'dik_Latn', 'dyu_Latn', 'dzo_Tibt', 'ell_Grek', 'eng_Latn', 'epo_Latn', 'est_Latn', 'eus_Latn', 'ewe_Latn', 'fao_Latn', 'pes_Arab', 'fij_Latn', 'fin_Latn', 'fon_Latn', 'fra_Latn', 'fur_Latn', 'fuv_Latn', 'gla_Latn', 'gle_Latn', 'glg_Latn', 'grn_Latn', 'guj_Gujr', 'hat_Latn', 'hau_Latn', 'heb_Hebr', 'hin_Deva', 'hne_Deva', 'hrv_Latn', 'hun_Latn', 'hye_Armn', 'ibo_Latn', 'ilo_Latn', 'ind_Latn', 'isl_Latn', 'ita_Latn', 'jav_Latn', 'jpn_Jpan', 'kab_Latn', 'kac_Latn', 'kam_Latn', 'kan_Knda', 'kas_Arab', 'kas_Deva', 'kat_Geor', 'knc_Arab', 'knc_Latn', 'kaz_Cyrl', 'kbp_Latn', 'kea_Latn', 'khm_Khmr', 'kik_Latn', 'kin_Latn', 'kir_Cyrl', 'kmb_Latn', 'kon_Latn', 'kor_Hang', 'kmr_Latn', 'lao_Laoo', 'lvs_Latn', 'lij_Latn', 'lim_Latn', 'lin_Latn', 'lit_Latn', 'lmo_Latn', 'ltg_Latn', 'ltz_Latn', 'lua_Latn', 'lug_Latn', 'luo_Latn', 'lus_Latn', 'mag_Deva', 'mai_Deva', 'mal_Mlym', 'mar_Deva', 'min_Latn', 'mkd_Cyrl', 'plt_Latn', 'mlt_Latn', 'mni_Beng', 'khk_Cyrl', 'mos_Latn', 'mri_Latn', 'zsm_Latn', 'mya_Mymr', 'nld_Latn', 'nno_Latn', 'nob_Latn', 'npi_Deva', 'nso_Latn', 'nus_Latn', 'nya_Latn', 'oci_Latn', 'gaz_Latn', 'ory_Orya', 'pag_Latn', 'pan_Guru', 'pap_Latn', 'pol_Latn', 'por_Latn', 'prs_Arab', 'pbt_Arab', 'quy_Latn', 'ron_Latn', 'run_Latn', 'rus_Cyrl', 'sag_Latn', 'san_Deva', 'sat_Beng', 'scn_Latn', 'shn_Mymr', 'sin_Sinh', 'slk_Latn', 'slv_Latn', 'smo_Latn', 'sna_Latn', 'snd_Arab', 'som_Latn', 'sot_Latn', 'spa_Latn', 'als_Latn', 'srd_Latn', 'srp_Cyrl', 'ssw_Latn', 'sun_Latn', 'swe_Latn', 'swh_Latn', 'szl_Latn', 'tam_Taml', 'tat_Cyrl', 'tel_Telu', 'tgk_Cyrl', 'tgl_Latn', 'tha_Thai', 'tir_Ethi', 'taq_Latn', 'taq_Tfng', 'tpi_Latn', 'tsn_Latn', 'tso_Latn', 'tuk_Latn', 'tum_Latn', 'tur_Latn', 'twi_Latn', 'tzm_Tfng', 'uig_Arab', 'ukr_Cyrl', 'umb_Latn', 'urd_Arab', 'uzn_Latn', 'vec_Latn', 'vie_Latn', 'war_Latn', 'wol_Latn', 'xho_Latn', 'ydd_Hebr', 'yor_Latn', 'yue_Hant', 'zho_Hans', 'zho_Hant', 'zul_Latn'] # fmt: skip @@ -127,8 +110,6 @@ class NllbTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = NllbTokenizer diff --git a/src/transformers/models/nllb_moe/__init__.py b/src/transformers/models/nllb_moe/__init__.py index ea0f7752ed0cac..ccb961ba38e8c0 100644 --- a/src/transformers/models/nllb_moe/__init__.py +++ b/src/transformers/models/nllb_moe/__init__.py @@ -17,12 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = { - "configuration_nllb_moe": [ - "NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP", - "NllbMoeConfig", - ] -} +_import_structure = {"configuration_nllb_moe": ["NllbMoeConfig"]} try: if not is_torch_available(): @@ -31,7 +26,6 @@ pass else: _import_structure["modeling_nllb_moe"] = [ - "NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST", "NllbMoeForConditionalGeneration", "NllbMoeModel", "NllbMoePreTrainedModel", @@ -42,7 +36,6 @@ if TYPE_CHECKING: from .configuration_nllb_moe import ( - NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP, NllbMoeConfig, ) @@ -53,7 +46,6 @@ pass else: from .modeling_nllb_moe import ( - NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST, NllbMoeForConditionalGeneration, NllbMoeModel, NllbMoePreTrainedModel, diff --git a/src/transformers/models/nllb_moe/configuration_nllb_moe.py b/src/transformers/models/nllb_moe/configuration_nllb_moe.py index 435d7caa17c63e..98c8397c185b81 100644 --- a/src/transformers/models/nllb_moe/configuration_nllb_moe.py +++ b/src/transformers/models/nllb_moe/configuration_nllb_moe.py @@ -19,10 +19,6 @@ logger = logging.get_logger(__name__) -NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/nllb-moe-54B": "https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json", -} - class NllbMoeConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/nllb_moe/modeling_nllb_moe.py b/src/transformers/models/nllb_moe/modeling_nllb_moe.py index e02c0b0fd77506..d4a2135843417c 100644 --- a/src/transformers/models/nllb_moe/modeling_nllb_moe.py +++ b/src/transformers/models/nllb_moe/modeling_nllb_moe.py @@ -53,10 +53,6 @@ # This dict contains ids and associated url # for the pretrained weights provided with the models #################################################### -NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/nllb-moe-54b", - # See all NLLB-MOE models at https://huggingface.co/models?filter=nllb-moe -] # Copied from transformers.models.bart.modeling_bart.shift_tokens_right diff --git a/src/transformers/models/nougat/tokenization_nougat_fast.py b/src/transformers/models/nougat/tokenization_nougat_fast.py index d02aec75752123..ef6b613bba3888 100644 --- a/src/transformers/models/nougat/tokenization_nougat_fast.py +++ b/src/transformers/models/nougat/tokenization_nougat_fast.py @@ -49,14 +49,7 @@ """ -PRETRAINED_VOCAB_FILES_MAP = { - "tokenizer_file": { - "facebook/nougat-base": "https://huggingface.co/facebook/nougat-base/tokenizer/blob/main/tokenizer.json", - }, -} - VOCAB_FILES_NAMES = {"tokenizer_file": "tokenizer.json"} -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"facebook/nougat-base": 3584} def markdown_compatible(text: str) -> str: @@ -409,8 +402,6 @@ class NougatTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = None diff --git a/src/transformers/models/nystromformer/__init__.py b/src/transformers/models/nystromformer/__init__.py index 4e94fc8f263965..74f8a620204f3f 100644 --- a/src/transformers/models/nystromformer/__init__.py +++ b/src/transformers/models/nystromformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_nystromformer": ["NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "NystromformerConfig"], + "configuration_nystromformer": ["NystromformerConfig"], } try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_nystromformer"] = [ - "NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "NystromformerForMaskedLM", "NystromformerForMultipleChoice", "NystromformerForQuestionAnswering", @@ -40,7 +39,7 @@ if TYPE_CHECKING: - from .configuration_nystromformer import NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, NystromformerConfig + from .configuration_nystromformer import NystromformerConfig try: if not is_torch_available(): @@ -49,7 +48,6 @@ pass else: from .modeling_nystromformer import ( - NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, NystromformerForMaskedLM, NystromformerForMultipleChoice, NystromformerForQuestionAnswering, diff --git a/src/transformers/models/nystromformer/configuration_nystromformer.py b/src/transformers/models/nystromformer/configuration_nystromformer.py index e59b1ce8108b1a..ca277e266d5a16 100644 --- a/src/transformers/models/nystromformer/configuration_nystromformer.py +++ b/src/transformers/models/nystromformer/configuration_nystromformer.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "uw-madison/nystromformer-512": "https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json", - # See all Nystromformer models at https://huggingface.co/models?filter=nystromformer -} - class NystromformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/nystromformer/modeling_nystromformer.py b/src/transformers/models/nystromformer/modeling_nystromformer.py index 950f8d27fa8e5a..465164af1cd231 100755 --- a/src/transformers/models/nystromformer/modeling_nystromformer.py +++ b/src/transformers/models/nystromformer/modeling_nystromformer.py @@ -43,11 +43,6 @@ _CHECKPOINT_FOR_DOC = "uw-madison/nystromformer-512" _CONFIG_FOR_DOC = "NystromformerConfig" -NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "uw-madison/nystromformer-512", - # See all Nyströmformer models at https://huggingface.co/models?filter=nystromformer -] - class NystromformerEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/oneformer/__init__.py b/src/transformers/models/oneformer/__init__.py index 01bbaa1398142c..11ddde65d05991 100644 --- a/src/transformers/models/oneformer/__init__.py +++ b/src/transformers/models/oneformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_oneformer": ["ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "OneFormerConfig"], + "configuration_oneformer": ["OneFormerConfig"], "processing_oneformer": ["OneFormerProcessor"], } @@ -36,14 +36,13 @@ pass else: _import_structure["modeling_oneformer"] = [ - "ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "OneFormerForUniversalSegmentation", "OneFormerModel", "OneFormerPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_oneformer import ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, OneFormerConfig + from .configuration_oneformer import OneFormerConfig from .processing_oneformer import OneFormerProcessor try: @@ -60,7 +59,6 @@ pass else: from .modeling_oneformer import ( - ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, OneFormerForUniversalSegmentation, OneFormerModel, OneFormerPreTrainedModel, diff --git a/src/transformers/models/oneformer/configuration_oneformer.py b/src/transformers/models/oneformer/configuration_oneformer.py index c4c28519479054..f3c01191d98fb8 100644 --- a/src/transformers/models/oneformer/configuration_oneformer.py +++ b/src/transformers/models/oneformer/configuration_oneformer.py @@ -22,13 +22,6 @@ logger = logging.get_logger(__name__) -ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "shi-labs/oneformer_ade20k_swin_tiny": ( - "https://huggingface.co/shi-labs/oneformer_ade20k_swin_tiny/blob/main/config.json" - ), - # See all OneFormer models at https://huggingface.co/models?filter=oneformer -} - class OneFormerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/oneformer/modeling_oneformer.py b/src/transformers/models/oneformer/modeling_oneformer.py index 79ad21c39f88de..fff665b2ffbda5 100644 --- a/src/transformers/models/oneformer/modeling_oneformer.py +++ b/src/transformers/models/oneformer/modeling_oneformer.py @@ -51,11 +51,6 @@ _CONFIG_FOR_DOC = "OneFormerConfig" _CHECKPOINT_FOR_DOC = "shi-labs/oneformer_ade20k_swin_tiny" -ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "shi-labs/oneformer_ade20k_swin_tiny", - # See all OneFormer models at https://huggingface.co/models?filter=oneformer -] - if is_scipy_available(): from scipy.optimize import linear_sum_assignment diff --git a/src/transformers/models/openai/__init__.py b/src/transformers/models/openai/__init__.py index b7dba0b5dc0cf8..af4ebbfee6630b 100644 --- a/src/transformers/models/openai/__init__.py +++ b/src/transformers/models/openai/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_openai": ["OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenAIGPTConfig"], + "configuration_openai": ["OpenAIGPTConfig"], "tokenization_openai": ["OpenAIGPTTokenizer"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_openai"] = [ - "OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OpenAIGPTDoubleHeadsModel", "OpenAIGPTForSequenceClassification", "OpenAIGPTLMHeadModel", @@ -59,7 +58,6 @@ pass else: _import_structure["modeling_tf_openai"] = [ - "TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFOpenAIGPTDoubleHeadsModel", "TFOpenAIGPTForSequenceClassification", "TFOpenAIGPTLMHeadModel", @@ -70,7 +68,7 @@ if TYPE_CHECKING: - from .configuration_openai import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig + from .configuration_openai import OpenAIGPTConfig from .tokenization_openai import OpenAIGPTTokenizer try: @@ -88,7 +86,6 @@ pass else: from .modeling_openai import ( - OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, OpenAIGPTDoubleHeadsModel, OpenAIGPTForSequenceClassification, OpenAIGPTLMHeadModel, @@ -104,7 +101,6 @@ pass else: from .modeling_tf_openai import ( - TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, TFOpenAIGPTDoubleHeadsModel, TFOpenAIGPTForSequenceClassification, TFOpenAIGPTLMHeadModel, diff --git a/src/transformers/models/openai/configuration_openai.py b/src/transformers/models/openai/configuration_openai.py index 38e646b39342df..64411455eefd35 100644 --- a/src/transformers/models/openai/configuration_openai.py +++ b/src/transformers/models/openai/configuration_openai.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/config.json" -} - class OpenAIGPTConfig(PretrainedConfig): """ diff --git a/src/transformers/models/openai/modeling_openai.py b/src/transformers/models/openai/modeling_openai.py index 747118bd27f228..1c754daa0e317a 100644 --- a/src/transformers/models/openai/modeling_openai.py +++ b/src/transformers/models/openai/modeling_openai.py @@ -46,11 +46,6 @@ _CHECKPOINT_FOR_DOC = "openai-community/openai-gpt" _CONFIG_FOR_DOC = "OpenAIGPTConfig" -OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai-community/openai-gpt", - # See all OpenAI GPT models at https://huggingface.co/models?filter=openai-community/openai-gpt -] - def load_tf_weights_in_openai_gpt(model, config, openai_checkpoint_folder_path): """Load tf pre-trained weights in a pytorch model (from NumPy arrays here)""" diff --git a/src/transformers/models/openai/modeling_tf_openai.py b/src/transformers/models/openai/modeling_tf_openai.py index 34bc5aa522d20a..e2d0ae885cea52 100644 --- a/src/transformers/models/openai/modeling_tf_openai.py +++ b/src/transformers/models/openai/modeling_tf_openai.py @@ -55,11 +55,6 @@ _CHECKPOINT_FOR_DOC = "openai-community/openai-gpt" _CONFIG_FOR_DOC = "OpenAIGPTConfig" -TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai-community/openai-gpt", - # See all OpenAI GPT models at https://huggingface.co/models?filter=openai-community/openai-gpt -] - class TFAttention(keras.layers.Layer): def __init__(self, nx, config, scale=False, **kwargs): diff --git a/src/transformers/models/openai/tokenization_openai.py b/src/transformers/models/openai/tokenization_openai.py index e189b15035b8c0..4f2b27916092b2 100644 --- a/src/transformers/models/openai/tokenization_openai.py +++ b/src/transformers/models/openai/tokenization_openai.py @@ -32,19 +32,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/vocab.json" - }, - "merges_file": { - "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/merges.txt" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openai-community/openai-gpt": 512, -} - # Copied from transformers.models.bert.tokenization_bert.whitespace_tokenize def whitespace_tokenize(text): @@ -268,8 +255,6 @@ class OpenAIGPTTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__(self, vocab_file, merges_file, unk_token="", **kwargs): diff --git a/src/transformers/models/openai/tokenization_openai_fast.py b/src/transformers/models/openai/tokenization_openai_fast.py index e1f04722ee27e1..214db5385044eb 100644 --- a/src/transformers/models/openai/tokenization_openai_fast.py +++ b/src/transformers/models/openai/tokenization_openai_fast.py @@ -26,22 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/vocab.json" - }, - "merges_file": { - "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/merges.txt" - }, - "tokenizer_file": { - "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/tokenizer.json" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openai-community/openai-gpt": 512, -} - class OpenAIGPTTokenizerFast(PreTrainedTokenizerFast): """ @@ -65,8 +49,6 @@ class OpenAIGPTTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = OpenAIGPTTokenizer diff --git a/src/transformers/models/opt/__init__.py b/src/transformers/models/opt/__init__.py index db1c9300824b38..5ae39344b2ffce 100644 --- a/src/transformers/models/opt/__init__.py +++ b/src/transformers/models/opt/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_opt": ["OPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OPTConfig"]} +_import_structure = {"configuration_opt": ["OPTConfig"]} try: if not is_torch_available(): @@ -32,7 +32,6 @@ pass else: _import_structure["modeling_opt"] = [ - "OPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OPTForCausalLM", "OPTModel", "OPTPreTrainedModel", @@ -62,7 +61,7 @@ if TYPE_CHECKING: - from .configuration_opt import OPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OPTConfig + from .configuration_opt import OPTConfig try: if not is_torch_available(): @@ -71,7 +70,6 @@ pass else: from .modeling_opt import ( - OPT_PRETRAINED_MODEL_ARCHIVE_LIST, OPTForCausalLM, OPTForQuestionAnswering, OPTForSequenceClassification, diff --git a/src/transformers/models/opt/configuration_opt.py b/src/transformers/models/opt/configuration_opt.py index 2918ee269aebe4..a9802d2ef337c8 100644 --- a/src/transformers/models/opt/configuration_opt.py +++ b/src/transformers/models/opt/configuration_opt.py @@ -19,15 +19,6 @@ logger = logging.get_logger(__name__) -OPT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/opt-125m": "https://huggingface.co/facebook/opt-125m/blob/main/config.json", - "facebook/opt-350m": "https://huggingface.co/facebook/opt-350m/blob/main/config.json", - "facebook/opt-1.3b": "https://huggingface.co/facebook/opt-1.3b/blob/main/config.json", - "facebook/opt-2.7b": "https://huggingface.co/facebook/opt-2.7b/blob/main/config.json", - "facebook/opt-6.7b": "https://huggingface.co/facebook/opt-6.7b/blob/main/config.json", - "facebook/opt-13b": "https://huggingface.co/facebook/opt-13b/blob/main/config.json", -} - class OPTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/opt/modeling_opt.py b/src/transformers/models/opt/modeling_opt.py index a350c9019d7af0..f93c3866aeca58 100644 --- a/src/transformers/models/opt/modeling_opt.py +++ b/src/transformers/models/opt/modeling_opt.py @@ -60,17 +60,6 @@ _SEQ_CLASS_EXPECTED_LOSS = 1.71 _SEQ_CLASS_EXPECTED_OUTPUT = "'LABEL_0'" -OPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/opt-125m", - "facebook/opt-350m", - "facebook/opt-1.3b", - "facebook/opt-2.7b", - "facebook/opt-6.7b", - "facebook/opt-13b", - "facebook/opt-30b", - # See all OPT models at https://huggingface.co/models?filter=opt -] - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): diff --git a/src/transformers/models/owlv2/__init__.py b/src/transformers/models/owlv2/__init__.py index 895379db36309a..83d432766d6992 100644 --- a/src/transformers/models/owlv2/__init__.py +++ b/src/transformers/models/owlv2/__init__.py @@ -23,7 +23,6 @@ _import_structure = { "configuration_owlv2": [ - "OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Owlv2Config", "Owlv2TextConfig", "Owlv2VisionConfig", @@ -47,7 +46,6 @@ pass else: _import_structure["modeling_owlv2"] = [ - "OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Owlv2Model", "Owlv2PreTrainedModel", "Owlv2TextModel", @@ -57,7 +55,6 @@ if TYPE_CHECKING: from .configuration_owlv2 import ( - OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Owlv2Config, Owlv2TextConfig, Owlv2VisionConfig, @@ -79,7 +76,6 @@ pass else: from .modeling_owlv2 import ( - OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST, Owlv2ForObjectDetection, Owlv2Model, Owlv2PreTrainedModel, diff --git a/src/transformers/models/owlv2/configuration_owlv2.py b/src/transformers/models/owlv2/configuration_owlv2.py index fd15c0e7972fc5..4b09166b70c2bc 100644 --- a/src/transformers/models/owlv2/configuration_owlv2.py +++ b/src/transformers/models/owlv2/configuration_owlv2.py @@ -27,10 +27,6 @@ logger = logging.get_logger(__name__) -OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/owlv2-base-patch16": "https://huggingface.co/google/owlv2-base-patch16/resolve/main/config.json", -} - # Copied from transformers.models.owlvit.configuration_owlvit.OwlViTTextConfig with OwlViT->Owlv2, owlvit-base-patch32->owlv2-base-patch16, owlvit->owlv2, OWL-ViT->OWLv2 class Owlv2TextConfig(PretrainedConfig): diff --git a/src/transformers/models/owlv2/modeling_owlv2.py b/src/transformers/models/owlv2/modeling_owlv2.py index 3506ce0fec4e3a..bbeeb386d4afae 100644 --- a/src/transformers/models/owlv2/modeling_owlv2.py +++ b/src/transformers/models/owlv2/modeling_owlv2.py @@ -47,10 +47,6 @@ _CHECKPOINT_FOR_DOC = "google/owlv2-base-patch16-ensemble" # See all Owlv2 models at https://huggingface.co/models?filter=owlv2 -OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/owlv2-base-patch16-ensemble", - # See all OWLv2 models at https://huggingface.co/models?filter=owlv2 -] # Copied from transformers.models.clip.modeling_clip.contrastive_loss with clip->owlv2 diff --git a/src/transformers/models/owlvit/__init__.py b/src/transformers/models/owlvit/__init__.py index 599508e0e5cae7..a6da47da9a0fb7 100644 --- a/src/transformers/models/owlvit/__init__.py +++ b/src/transformers/models/owlvit/__init__.py @@ -26,7 +26,6 @@ _import_structure = { "configuration_owlvit": [ - "OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OwlViTConfig", "OwlViTOnnxConfig", "OwlViTTextConfig", @@ -52,7 +51,6 @@ pass else: _import_structure["modeling_owlvit"] = [ - "OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "OwlViTModel", "OwlViTPreTrainedModel", "OwlViTTextModel", @@ -62,7 +60,6 @@ if TYPE_CHECKING: from .configuration_owlvit import ( - OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, OwlViTConfig, OwlViTOnnxConfig, OwlViTTextConfig, @@ -86,7 +83,6 @@ pass else: from .modeling_owlvit import ( - OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST, OwlViTForObjectDetection, OwlViTModel, OwlViTPreTrainedModel, diff --git a/src/transformers/models/owlvit/configuration_owlvit.py b/src/transformers/models/owlvit/configuration_owlvit.py index 254619cccd153e..747f1c3ccbe78a 100644 --- a/src/transformers/models/owlvit/configuration_owlvit.py +++ b/src/transformers/models/owlvit/configuration_owlvit.py @@ -30,12 +30,6 @@ logger = logging.get_logger(__name__) -OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/owlvit-base-patch32": "https://huggingface.co/google/owlvit-base-patch32/resolve/main/config.json", - "google/owlvit-base-patch16": "https://huggingface.co/google/owlvit-base-patch16/resolve/main/config.json", - "google/owlvit-large-patch14": "https://huggingface.co/google/owlvit-large-patch14/resolve/main/config.json", -} - class OwlViTTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/owlvit/modeling_owlvit.py b/src/transformers/models/owlvit/modeling_owlvit.py index 64e99564308792..8d0673341c6f71 100644 --- a/src/transformers/models/owlvit/modeling_owlvit.py +++ b/src/transformers/models/owlvit/modeling_owlvit.py @@ -47,11 +47,6 @@ _CHECKPOINT_FOR_DOC = "google/owlvit-base-patch32" # See all OwlViT models at https://huggingface.co/models?filter=owlvit -OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/owlvit-base-patch32", - "google/owlvit-base-patch16", - "google/owlvit-large-patch14", -] # Copied from transformers.models.clip.modeling_clip.contrastive_loss with clip->owlvit diff --git a/src/transformers/models/patchtsmixer/__init__.py b/src/transformers/models/patchtsmixer/__init__.py index 63f433791e1fe8..b227ca1655c440 100644 --- a/src/transformers/models/patchtsmixer/__init__.py +++ b/src/transformers/models/patchtsmixer/__init__.py @@ -18,10 +18,7 @@ _import_structure = { - "configuration_patchtsmixer": [ - "PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "PatchTSMixerConfig", - ], + "configuration_patchtsmixer": ["PatchTSMixerConfig"], } try: @@ -31,7 +28,6 @@ pass else: _import_structure["modeling_patchtsmixer"] = [ - "PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSMixerPreTrainedModel", "PatchTSMixerModel", "PatchTSMixerForPretraining", @@ -43,7 +39,6 @@ if TYPE_CHECKING: from .configuration_patchtsmixer import ( - PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSMixerConfig, ) @@ -54,7 +49,6 @@ pass else: from .modeling_patchtsmixer import ( - PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSMixerForPrediction, PatchTSMixerForPretraining, PatchTSMixerForRegression, diff --git a/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py b/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py index 527b5a8327dcc4..c3766c33250cfc 100644 --- a/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py +++ b/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "ibm/patchtsmixer-etth1-pretrain": "https://huggingface.co/ibm/patchtsmixer-etth1-pretrain/resolve/main/config.json", -} - class PatchTSMixerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py b/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py index 5bccccb8132b27..a824faa0409456 100644 --- a/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py +++ b/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py @@ -39,12 +39,6 @@ _CONFIG_FOR_DOC = "PatchTSMixerConfig" -PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "ibm/patchtsmixer-etth1-pretrain", - # See all PatchTSMixer models at https://huggingface.co/models?filter=patchtsmixer -] - - PATCHTSMIXER_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/patchtst/__init__.py b/src/transformers/models/patchtst/__init__.py index 8c7db64c198406..5ba6316505afdf 100644 --- a/src/transformers/models/patchtst/__init__.py +++ b/src/transformers/models/patchtst/__init__.py @@ -18,10 +18,7 @@ _import_structure = { - "configuration_patchtst": [ - "PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP", - "PatchTSTConfig", - ], + "configuration_patchtst": ["PatchTSTConfig"], } try: @@ -31,7 +28,6 @@ pass else: _import_structure["modeling_patchtst"] = [ - "PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSTModel", "PatchTSTPreTrainedModel", "PatchTSTForPrediction", @@ -42,7 +38,7 @@ if TYPE_CHECKING: - from .configuration_patchtst import PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSTConfig + from .configuration_patchtst import PatchTSTConfig try: if not is_torch_available(): @@ -51,7 +47,6 @@ pass else: from .modeling_patchtst import ( - PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSTForClassification, PatchTSTForPrediction, PatchTSTForPretraining, diff --git a/src/transformers/models/patchtst/configuration_patchtst.py b/src/transformers/models/patchtst/configuration_patchtst.py index 5cf949304e91fe..acae3d0dc60d29 100644 --- a/src/transformers/models/patchtst/configuration_patchtst.py +++ b/src/transformers/models/patchtst/configuration_patchtst.py @@ -22,11 +22,6 @@ logger = logging.get_logger(__name__) -PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "ibm/patchtst-base": "https://huggingface.co/ibm/patchtst-base/resolve/main/config.json", - # See all PatchTST models at https://huggingface.co/ibm/models?filter=patchtst -} - class PatchTSTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/patchtst/modeling_patchtst.py b/src/transformers/models/patchtst/modeling_patchtst.py index 08ce54712612d6..884cd44c83e86b 100755 --- a/src/transformers/models/patchtst/modeling_patchtst.py +++ b/src/transformers/models/patchtst/modeling_patchtst.py @@ -33,11 +33,6 @@ _CONFIG_FOR_DOC = "PatchTSTConfig" -PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "ibm/patchtst-etth1-pretrain", - # See all PatchTST models at https://huggingface.co/models?filter=patchtst -] - # Copied from transformers.models.bart.modeling_bart.BartAttention with Bart->PatchTST class PatchTSTAttention(nn.Module): diff --git a/src/transformers/models/pegasus/__init__.py b/src/transformers/models/pegasus/__init__.py index 97d6ddb31ac00c..15ac3b56cff038 100644 --- a/src/transformers/models/pegasus/__init__.py +++ b/src/transformers/models/pegasus/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_pegasus": ["PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusConfig"]} +_import_structure = {"configuration_pegasus": ["PegasusConfig"]} try: if not is_sentencepiece_available(): @@ -49,7 +49,6 @@ pass else: _import_structure["modeling_pegasus"] = [ - "PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST", "PegasusForCausalLM", "PegasusForConditionalGeneration", "PegasusModel", @@ -82,7 +81,7 @@ if TYPE_CHECKING: - from .configuration_pegasus import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig + from .configuration_pegasus import PegasusConfig try: if not is_sentencepiece_available(): @@ -107,7 +106,6 @@ pass else: from .modeling_pegasus import ( - PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST, PegasusForCausalLM, PegasusForConditionalGeneration, PegasusModel, diff --git a/src/transformers/models/pegasus/configuration_pegasus.py b/src/transformers/models/pegasus/configuration_pegasus.py index 51b506c4e03938..7dff1a7f85a32c 100644 --- a/src/transformers/models/pegasus/configuration_pegasus.py +++ b/src/transformers/models/pegasus/configuration_pegasus.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/pegasus-large": "https://huggingface.co/google/pegasus-large/resolve/main/config.json", - # See all PEGASUS models at https://huggingface.co/models?filter=pegasus -} - class PegasusConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/pegasus/modeling_pegasus.py b/src/transformers/models/pegasus/modeling_pegasus.py index 91fdb9c1db5931..069c6aa6fe6316 100755 --- a/src/transformers/models/pegasus/modeling_pegasus.py +++ b/src/transformers/models/pegasus/modeling_pegasus.py @@ -50,12 +50,6 @@ _CONFIG_FOR_DOC = "PegasusConfig" -PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/pegasus-large", - # See all PEGASUS models at https://huggingface.co/models?filter=pegasus -] - - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/pegasus/tokenization_pegasus.py b/src/transformers/models/pegasus/tokenization_pegasus.py index e1c8f6933ffc87..2763b739a9644a 100644 --- a/src/transformers/models/pegasus/tokenization_pegasus.py +++ b/src/transformers/models/pegasus/tokenization_pegasus.py @@ -26,14 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"google/pegasus-xsum": "https://huggingface.co/google/pegasus-xsum/resolve/main/spiece.model"} -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/pegasus-xsum": 512, -} - logger = logging.get_logger(__name__) @@ -98,8 +90,6 @@ class PegasusTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/pegasus/tokenization_pegasus_fast.py b/src/transformers/models/pegasus/tokenization_pegasus_fast.py index 3bc1726876e819..f1252e959ebc24 100644 --- a/src/transformers/models/pegasus/tokenization_pegasus_fast.py +++ b/src/transformers/models/pegasus/tokenization_pegasus_fast.py @@ -36,17 +36,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"google/pegasus-xsum": "https://huggingface.co/google/pegasus-xsum/resolve/main/spiece.model"}, - "tokenizer_file": { - "google/pegasus-xsum": "https://huggingface.co/google/pegasus-xsum/resolve/main/tokenizer.json" - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/pegasus-xsum": 512, -} - class PegasusTokenizerFast(PreTrainedTokenizerFast): r""" @@ -93,8 +82,6 @@ class PegasusTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = PegasusTokenizer model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/pegasus_x/__init__.py b/src/transformers/models/pegasus_x/__init__.py index 32003120c6a0b1..ce26210d3bc6b9 100644 --- a/src/transformers/models/pegasus_x/__init__.py +++ b/src/transformers/models/pegasus_x/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_pegasus_x": ["PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusXConfig"], + "configuration_pegasus_x": ["PegasusXConfig"], } try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_pegasus_x"] = [ - "PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST", "PegasusXForConditionalGeneration", "PegasusXModel", "PegasusXPreTrainedModel", @@ -35,7 +34,7 @@ if TYPE_CHECKING: - from .configuration_pegasus_x import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig + from .configuration_pegasus_x import PegasusXConfig try: if not is_torch_available(): @@ -44,7 +43,6 @@ pass else: from .modeling_pegasus_x import ( - PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST, PegasusXForConditionalGeneration, PegasusXModel, PegasusXPreTrainedModel, diff --git a/src/transformers/models/pegasus_x/configuration_pegasus_x.py b/src/transformers/models/pegasus_x/configuration_pegasus_x.py index be092c018a427a..166f3b18ab0623 100644 --- a/src/transformers/models/pegasus_x/configuration_pegasus_x.py +++ b/src/transformers/models/pegasus_x/configuration_pegasus_x.py @@ -20,12 +20,6 @@ logger = logging.get_logger(__name__) -PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/pegasus-x-base": "https://huggingface.co/google/pegasus-x-base/resolve/main/config.json", - "google/pegasus-x-large": "https://huggingface.co/google/pegasus-x-large/resolve/main/config.json", - # See all PEGASUS-X models at https://huggingface.co/models?filter=pegasus-x -} - class PegasusXConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/pegasus_x/modeling_pegasus_x.py b/src/transformers/models/pegasus_x/modeling_pegasus_x.py index 49539514378a08..ff26cde4f5b80a 100755 --- a/src/transformers/models/pegasus_x/modeling_pegasus_x.py +++ b/src/transformers/models/pegasus_x/modeling_pegasus_x.py @@ -49,13 +49,6 @@ _CONFIG_FOR_DOC = "PegasusXConfig" -PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/pegasus-x-base", - "google/pegasus-x-large", - # See all PEGASUS models at https://huggingface.co/models?filter=pegasus-x -] - - @dataclasses.dataclass class DimensionInfo: """Wrapper for dimension info.""" diff --git a/src/transformers/models/perceiver/__init__.py b/src/transformers/models/perceiver/__init__.py index 997f88234fc2c8..5cc52d61977203 100644 --- a/src/transformers/models/perceiver/__init__.py +++ b/src/transformers/models/perceiver/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_perceiver": ["PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PerceiverConfig", "PerceiverOnnxConfig"], + "configuration_perceiver": ["PerceiverConfig", "PerceiverOnnxConfig"], "tokenization_perceiver": ["PerceiverTokenizer"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_perceiver"] = [ - "PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST", "PerceiverForImageClassificationConvProcessing", "PerceiverForImageClassificationFourier", "PerceiverForImageClassificationLearned", @@ -58,7 +57,7 @@ if TYPE_CHECKING: - from .configuration_perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverOnnxConfig + from .configuration_perceiver import PerceiverConfig, PerceiverOnnxConfig from .tokenization_perceiver import PerceiverTokenizer try: @@ -77,7 +76,6 @@ pass else: from .modeling_perceiver import ( - PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST, PerceiverForImageClassificationConvProcessing, PerceiverForImageClassificationFourier, PerceiverForImageClassificationLearned, diff --git a/src/transformers/models/perceiver/configuration_perceiver.py b/src/transformers/models/perceiver/configuration_perceiver.py index d741b287e5db7c..b4b996aef02a4b 100644 --- a/src/transformers/models/perceiver/configuration_perceiver.py +++ b/src/transformers/models/perceiver/configuration_perceiver.py @@ -27,11 +27,6 @@ logger = logging.get_logger(__name__) -PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "deepmind/language-perceiver": "https://huggingface.co/deepmind/language-perceiver/resolve/main/config.json", - # See all Perceiver models at https://huggingface.co/models?filter=perceiver -} - class PerceiverConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/perceiver/modeling_perceiver.py b/src/transformers/models/perceiver/modeling_perceiver.py index bb7ac2bc3139e1..f768df991b09c0 100755 --- a/src/transformers/models/perceiver/modeling_perceiver.py +++ b/src/transformers/models/perceiver/modeling_perceiver.py @@ -51,11 +51,6 @@ _CHECKPOINT_FOR_DOC = "deepmind/language-perceiver" _CONFIG_FOR_DOC = "PerceiverConfig" -PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "deepmind/language-perceiver", - # See all Perceiver models at https://huggingface.co/models?filter=perceiver -] - @dataclass class PerceiverModelOutput(ModelOutput): diff --git a/src/transformers/models/persimmon/__init__.py b/src/transformers/models/persimmon/__init__.py index 4c88459362eb72..75bc218a2913c7 100644 --- a/src/transformers/models/persimmon/__init__.py +++ b/src/transformers/models/persimmon/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_persimmon": ["PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP", "PersimmonConfig"], + "configuration_persimmon": ["PersimmonConfig"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_persimmon import PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP, PersimmonConfig + from .configuration_persimmon import PersimmonConfig try: if not is_torch_available(): diff --git a/src/transformers/models/persimmon/configuration_persimmon.py b/src/transformers/models/persimmon/configuration_persimmon.py index 6997e159d522a3..88dca72106d642 100644 --- a/src/transformers/models/persimmon/configuration_persimmon.py +++ b/src/transformers/models/persimmon/configuration_persimmon.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "adept/persimmon-8b-base": "https://huggingface.co/adept/persimmon-8b-base/resolve/main/config.json", -} - class PersimmonConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/phi/__init__.py b/src/transformers/models/phi/__init__.py index ba79ac81a6b9e5..662c0a9bf3487d 100644 --- a/src/transformers/models/phi/__init__.py +++ b/src/transformers/models/phi/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_phi": ["PHI_PRETRAINED_CONFIG_ARCHIVE_MAP", "PhiConfig"], + "configuration_phi": ["PhiConfig"], } try: @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_phi"] = [ - "PHI_PRETRAINED_MODEL_ARCHIVE_LIST", "PhiPreTrainedModel", "PhiModel", "PhiForCausalLM", @@ -45,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_phi import PHI_PRETRAINED_CONFIG_ARCHIVE_MAP, PhiConfig + from .configuration_phi import PhiConfig try: if not is_torch_available(): @@ -54,7 +53,6 @@ pass else: from .modeling_phi import ( - PHI_PRETRAINED_MODEL_ARCHIVE_LIST, PhiForCausalLM, PhiForSequenceClassification, PhiForTokenClassification, diff --git a/src/transformers/models/phi/configuration_phi.py b/src/transformers/models/phi/configuration_phi.py index 1b495cc8e22063..e8aa2287cdf7d8 100644 --- a/src/transformers/models/phi/configuration_phi.py +++ b/src/transformers/models/phi/configuration_phi.py @@ -22,12 +22,6 @@ logger = logging.get_logger(__name__) -PHI_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/phi-1": "https://huggingface.co/microsoft/phi-1/resolve/main/config.json", - "microsoft/phi-1_5": "https://huggingface.co/microsoft/phi-1_5/resolve/main/config.json", - "microsoft/phi-2": "https://huggingface.co/microsoft/phi-2/resolve/main/config.json", -} - class PhiConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/phi/modeling_phi.py b/src/transformers/models/phi/modeling_phi.py index c3cb119f0aa043..df8ab2e91513a5 100644 --- a/src/transformers/models/phi/modeling_phi.py +++ b/src/transformers/models/phi/modeling_phi.py @@ -62,13 +62,6 @@ _CHECKPOINT_FOR_DOC = "microsoft/phi-1" _CONFIG_FOR_DOC = "PhiConfig" -PHI_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/phi-1", - "microsoft/phi-1_5", - "microsoft/phi-2", - # See all Phi models at https://huggingface.co/models?filter=phi -] - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): diff --git a/src/transformers/models/phobert/tokenization_phobert.py b/src/transformers/models/phobert/tokenization_phobert.py index 1275947776d463..f312f495015012 100644 --- a/src/transformers/models/phobert/tokenization_phobert.py +++ b/src/transformers/models/phobert/tokenization_phobert.py @@ -32,22 +32,6 @@ "merges_file": "bpe.codes", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "vinai/phobert-base": "https://huggingface.co/vinai/phobert-base/resolve/main/vocab.txt", - "vinai/phobert-large": "https://huggingface.co/vinai/phobert-large/resolve/main/vocab.txt", - }, - "merges_file": { - "vinai/phobert-base": "https://huggingface.co/vinai/phobert-base/resolve/main/bpe.codes", - "vinai/phobert-large": "https://huggingface.co/vinai/phobert-large/resolve/main/bpe.codes", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "vinai/phobert-base": 256, - "vinai/phobert-large": 256, -} - def get_pairs(word): """ @@ -115,8 +99,6 @@ class PhobertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/pix2struct/__init__.py b/src/transformers/models/pix2struct/__init__.py index 8b395b31d8be19..581d5d7240c664 100644 --- a/src/transformers/models/pix2struct/__init__.py +++ b/src/transformers/models/pix2struct/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_pix2struct": [ - "PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Pix2StructConfig", "Pix2StructTextConfig", "Pix2StructVisionConfig", @@ -42,7 +41,6 @@ pass else: _import_structure["modeling_pix2struct"] = [ - "PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST", "Pix2StructPreTrainedModel", "Pix2StructForConditionalGeneration", "Pix2StructVisionModel", @@ -51,7 +49,6 @@ if TYPE_CHECKING: from .configuration_pix2struct import ( - PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP, Pix2StructConfig, Pix2StructTextConfig, Pix2StructVisionConfig, @@ -73,7 +70,6 @@ pass else: from .modeling_pix2struct import ( - PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST, Pix2StructForConditionalGeneration, Pix2StructPreTrainedModel, Pix2StructTextModel, diff --git a/src/transformers/models/pix2struct/configuration_pix2struct.py b/src/transformers/models/pix2struct/configuration_pix2struct.py index 2449d496f286f2..2ad2509e441d25 100644 --- a/src/transformers/models/pix2struct/configuration_pix2struct.py +++ b/src/transformers/models/pix2struct/configuration_pix2struct.py @@ -23,12 +23,6 @@ logger = logging.get_logger(__name__) -PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/pix2struct-textcaps-base": ( - "https://huggingface.co/google/pix2struct-textcaps-base/resolve/main/config.json" - ), -} - class Pix2StructTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/pix2struct/modeling_pix2struct.py b/src/transformers/models/pix2struct/modeling_pix2struct.py index 42f3002ac632cf..86ccb1dd740786 100644 --- a/src/transformers/models/pix2struct/modeling_pix2struct.py +++ b/src/transformers/models/pix2struct/modeling_pix2struct.py @@ -49,28 +49,6 @@ _CONFIG_FOR_DOC = "Pix2StructConfig" -PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/pix2struct-textcaps-base", - "google/pix2struct-textcaps-large", - "google/pix2struct-base", - "google/pix2struct-large", - "google/pix2struct-ai2d-base", - "google/pix2struct-ai2d-large", - "google/pix2struct-widget-captioning-base", - "google/pix2struct-widget-captioning-large", - "google/pix2struct-screen2words-base", - "google/pix2struct-screen2words-large", - "google/pix2struct-docvqa-base", - "google/pix2struct-docvqa-large", - "google/pix2struct-ocrvqa-base", - "google/pix2struct-ocrvqa-large", - "google/pix2struct-chartqa-base", - "google/pix2struct-inforgraphics-vqa-base", - "google/pix2struct-inforgraphics-vqa-large", - # See all Pix2StructVision models at https://huggingface.co/models?filter=pix2struct -] - - # Adapted from transformers.models.t5.modeling_t5.T5LayerNorm with T5->Pix2Struct class Pix2StructLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-6): diff --git a/src/transformers/models/plbart/__init__.py b/src/transformers/models/plbart/__init__.py index ade03d8aa5cdf8..cd4c46fad3dd7d 100644 --- a/src/transformers/models/plbart/__init__.py +++ b/src/transformers/models/plbart/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_plbart": ["PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP", "PLBartConfig"]} +_import_structure = {"configuration_plbart": ["PLBartConfig"]} try: if not is_sentencepiece_available(): @@ -39,7 +39,6 @@ pass else: _import_structure["modeling_plbart"] = [ - "PLBART_PRETRAINED_MODEL_ARCHIVE_LIST", "PLBartForCausalLM", "PLBartForConditionalGeneration", "PLBartForSequenceClassification", @@ -49,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_plbart import PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP, PLBartConfig + from .configuration_plbart import PLBartConfig try: if not is_sentencepiece_available(): @@ -66,7 +65,6 @@ pass else: from .modeling_plbart import ( - PLBART_PRETRAINED_MODEL_ARCHIVE_LIST, PLBartForCausalLM, PLBartForConditionalGeneration, PLBartForSequenceClassification, diff --git a/src/transformers/models/plbart/configuration_plbart.py b/src/transformers/models/plbart/configuration_plbart.py index 836cf5900c8e09..b899847b04c73a 100644 --- a/src/transformers/models/plbart/configuration_plbart.py +++ b/src/transformers/models/plbart/configuration_plbart.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "uclanlp/plbart-base": "https://huggingface.co/uclanlp/plbart-base/resolve/main/config.json", - # See all PLBART models at https://huggingface.co/models?filter=plbart -} - class PLBartConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/plbart/modeling_plbart.py b/src/transformers/models/plbart/modeling_plbart.py index 3c17eceabbb223..28e9e6fefaff47 100644 --- a/src/transformers/models/plbart/modeling_plbart.py +++ b/src/transformers/models/plbart/modeling_plbart.py @@ -54,13 +54,6 @@ _CHECKPOINT_FOR_DOC = "uclanlp/plbart-base" _CONFIG_FOR_DOC = "PLBartConfig" -PLBART_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "uclanlp/plbart-base", - "uclanlp/plbart-cs-java", - "uclanlp/plbart-multi_task-all", - # See all PLBART models at https://huggingface.co/models?filter=plbart -] - # Copied from transformers.models.mbart.modeling_mbart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int): diff --git a/src/transformers/models/plbart/tokenization_plbart.py b/src/transformers/models/plbart/tokenization_plbart.py index e50849b51d2d59..9ab2e33f7f0dba 100644 --- a/src/transformers/models/plbart/tokenization_plbart.py +++ b/src/transformers/models/plbart/tokenization_plbart.py @@ -29,63 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "uclanlp/plbart-base": "https://huggingface.co/uclanlp/plbart-base/resolve/main/sentencepiece.bpe.model", - "uclanlp/plbart-c-cpp-defect-detection": ( - "https://huggingface.co/uclanlp/plbart-c-cpp-defect-detection/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-cs-java": "https://huggingface.co/uclanlp/plbart-cs-java/resolve/main/sentencepiece.bpe.model", - "uclanlp/plbart-en_XX-java": ( - "https://huggingface.co/uclanlp/plbart-en_XX-java/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-go-en_XX": ( - "https://huggingface.co/uclanlp/plbart-go-en_XX/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-java-clone-detection": ( - "https://huggingface.co/uclanlp/plbart-java-clone-detection/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-java-cs": "https://huggingface.co/uclanlp/plbart-java-cs/resolve/main/sentencepiece.bpe.model", - "uclanlp/plbart-java-en_XX": ( - "https://huggingface.co/uclanlp/plbart-java-en_XX/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-javascript-en_XX": ( - "https://huggingface.co/uclanlp/plbart-javascript-en_XX/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-php-en_XX": ( - "https://huggingface.co/uclanlp/plbart-php-en_XX/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-python-en_XX": ( - "https://huggingface.co/uclanlp/plbart-python-en_XX/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-refine-java-medium": ( - "https://huggingface.co/uclanlp/plbart-refine-java-medium/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-refine-java-small": ( - "https://huggingface.co/uclanlp/plbart-refine-java-small/resolve/main/sentencepiece.bpe.model" - ), - "uclanlp/plbart-ruby-en_XX": ( - "https://huggingface.co/uclanlp/plbart-ruby-en_XX/resolve/main/sentencepiece.bpe.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "uclanlp/plbart-base": 1024, - "uclanlp/plbart-c-cpp-defect-detection": 1024, - "uclanlp/plbart-cs-java": 1024, - "uclanlp/plbart-en_XX-java": 1024, - "uclanlp/plbart-go-en_XX": 1024, - "uclanlp/plbart-java-clone-detection": 1024, - "uclanlp/plbart-java-cs": 1024, - "uclanlp/plbart-java-en_XX": 1024, - "uclanlp/plbart-javascript-en_XX": 1024, - "uclanlp/plbart-php-en_XX": 1024, - "uclanlp/plbart-python-en_XX": 1024, - "uclanlp/plbart-refine-java-medium": 1024, - "uclanlp/plbart-refine-java-small": 1024, - "uclanlp/plbart-ruby-en_XX": 1024, -} FAIRSEQ_LANGUAGE_CODES = { "base": ["__java__", "__python__", "__en_XX__"], @@ -166,8 +109,6 @@ class PLBartTokenizer(PreTrainedTokenizer): ```""" vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/poolformer/__init__.py b/src/transformers/models/poolformer/__init__.py index 3a62183a23d6e2..00c345463697d4 100644 --- a/src/transformers/models/poolformer/__init__.py +++ b/src/transformers/models/poolformer/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_poolformer": [ - "POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PoolFormerConfig", "PoolFormerOnnxConfig", ] @@ -40,7 +39,6 @@ pass else: _import_structure["modeling_poolformer"] = [ - "POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "PoolFormerForImageClassification", "PoolFormerModel", "PoolFormerPreTrainedModel", @@ -49,7 +47,6 @@ if TYPE_CHECKING: from .configuration_poolformer import ( - POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, PoolFormerConfig, PoolFormerOnnxConfig, ) @@ -70,7 +67,6 @@ pass else: from .modeling_poolformer import ( - POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, PoolFormerForImageClassification, PoolFormerModel, PoolFormerPreTrainedModel, diff --git a/src/transformers/models/poolformer/configuration_poolformer.py b/src/transformers/models/poolformer/configuration_poolformer.py index d859cefc90efd7..1f297077fe166b 100644 --- a/src/transformers/models/poolformer/configuration_poolformer.py +++ b/src/transformers/models/poolformer/configuration_poolformer.py @@ -25,11 +25,6 @@ logger = logging.get_logger(__name__) -POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "sail/poolformer_s12": "https://huggingface.co/sail/poolformer_s12/resolve/main/config.json", - # See all PoolFormer models at https://huggingface.co/models?filter=poolformer -} - class PoolFormerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/poolformer/modeling_poolformer.py b/src/transformers/models/poolformer/modeling_poolformer.py index c5a8c7a0d27a85..5e620780f39290 100755 --- a/src/transformers/models/poolformer/modeling_poolformer.py +++ b/src/transformers/models/poolformer/modeling_poolformer.py @@ -43,11 +43,6 @@ _IMAGE_CLASS_CHECKPOINT = "sail/poolformer_s12" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "sail/poolformer_s12", - # See all PoolFormer models at https://huggingface.co/models?filter=poolformer -] - # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/src/transformers/models/pop2piano/__init__.py b/src/transformers/models/pop2piano/__init__.py index 08b1e732b7df89..cd664cb8a70ce5 100644 --- a/src/transformers/models/pop2piano/__init__.py +++ b/src/transformers/models/pop2piano/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_pop2piano": ["POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP", "Pop2PianoConfig"], + "configuration_pop2piano": ["Pop2PianoConfig"], } try: @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_pop2piano"] = [ - "POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST", "Pop2PianoForConditionalGeneration", "Pop2PianoPreTrainedModel", ] @@ -72,7 +71,7 @@ if TYPE_CHECKING: - from .configuration_pop2piano import POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP, Pop2PianoConfig + from .configuration_pop2piano import Pop2PianoConfig try: if not is_torch_available(): @@ -81,7 +80,6 @@ pass else: from .modeling_pop2piano import ( - POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST, Pop2PianoForConditionalGeneration, Pop2PianoPreTrainedModel, ) diff --git a/src/transformers/models/pop2piano/configuration_pop2piano.py b/src/transformers/models/pop2piano/configuration_pop2piano.py index 15bf1ac438dd43..8bb46b008d846b 100644 --- a/src/transformers/models/pop2piano/configuration_pop2piano.py +++ b/src/transformers/models/pop2piano/configuration_pop2piano.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "sweetcocoa/pop2piano": "https://huggingface.co/sweetcocoa/pop2piano/blob/main/config.json" -} - class Pop2PianoConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/pop2piano/modeling_pop2piano.py b/src/transformers/models/pop2piano/modeling_pop2piano.py index d3638d25b97a0d..5952c030012683 100644 --- a/src/transformers/models/pop2piano/modeling_pop2piano.py +++ b/src/transformers/models/pop2piano/modeling_pop2piano.py @@ -64,11 +64,6 @@ _CONFIG_FOR_DOC = "Pop2PianoConfig" _CHECKPOINT_FOR_DOC = "sweetcocoa/pop2piano" -POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "sweetcocoa/pop2piano", - # See all Pop2Piano models at https://huggingface.co/models?filter=pop2piano -] - POP2PIANO_INPUTS_DOCSTRING = r""" Args: diff --git a/src/transformers/models/pop2piano/tokenization_pop2piano.py b/src/transformers/models/pop2piano/tokenization_pop2piano.py index 0d25dcdfc7d57b..3c5844ae7c4115 100644 --- a/src/transformers/models/pop2piano/tokenization_pop2piano.py +++ b/src/transformers/models/pop2piano/tokenization_pop2piano.py @@ -35,12 +35,6 @@ "vocab": "vocab.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab": { - "sweetcocoa/pop2piano": "https://huggingface.co/sweetcocoa/pop2piano/blob/main/vocab.json", - }, -} - def token_time_to_note(number, cutoff_time_idx, current_idx): current_idx += number @@ -83,7 +77,6 @@ class Pop2PianoTokenizer(PreTrainedTokenizer): model_input_names = ["token_ids", "attention_mask"] vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP def __init__( self, diff --git a/src/transformers/models/prophetnet/__init__.py b/src/transformers/models/prophetnet/__init__.py index 083301cc20c677..2e1a1ac6101483 100644 --- a/src/transformers/models/prophetnet/__init__.py +++ b/src/transformers/models/prophetnet/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_prophetnet": ["PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ProphetNetConfig"], + "configuration_prophetnet": ["ProphetNetConfig"], "tokenization_prophetnet": ["ProphetNetTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_prophetnet"] = [ - "PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ProphetNetDecoder", "ProphetNetEncoder", "ProphetNetForCausalLM", @@ -40,7 +39,7 @@ if TYPE_CHECKING: - from .configuration_prophetnet import PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ProphetNetConfig + from .configuration_prophetnet import ProphetNetConfig from .tokenization_prophetnet import ProphetNetTokenizer try: @@ -50,7 +49,6 @@ pass else: from .modeling_prophetnet import ( - PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, ProphetNetDecoder, ProphetNetEncoder, ProphetNetForCausalLM, diff --git a/src/transformers/models/prophetnet/configuration_prophetnet.py b/src/transformers/models/prophetnet/configuration_prophetnet.py index 4072709af9615b..1b40c9a2c07cd8 100644 --- a/src/transformers/models/prophetnet/configuration_prophetnet.py +++ b/src/transformers/models/prophetnet/configuration_prophetnet.py @@ -22,12 +22,6 @@ logger = logging.get_logger(__name__) -PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/prophetnet-large-uncased": ( - "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json" - ), -} - class ProphetNetConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/prophetnet/modeling_prophetnet.py b/src/transformers/models/prophetnet/modeling_prophetnet.py index 81eb503ddbe944..b7eca9c2b3eacc 100644 --- a/src/transformers/models/prophetnet/modeling_prophetnet.py +++ b/src/transformers/models/prophetnet/modeling_prophetnet.py @@ -43,11 +43,6 @@ _CONFIG_FOR_DOC = "ProphenetConfig" _CHECKPOINT_FOR_DOC = "microsoft/prophetnet-large-uncased" -PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/prophetnet-large-uncased", - # See all ProphetNet models at https://huggingface.co/models?filter=prophetnet -] - PROPHETNET_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/prophetnet/tokenization_prophetnet.py b/src/transformers/models/prophetnet/tokenization_prophetnet.py index 483188ca55d0c3..cd387520af18ef 100644 --- a/src/transformers/models/prophetnet/tokenization_prophetnet.py +++ b/src/transformers/models/prophetnet/tokenization_prophetnet.py @@ -26,22 +26,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "prophetnet.tokenizer"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/prophetnet-large-uncased": ( - "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/prophetnet.tokenizer" - ), - } -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/prophetnet-large-uncased": {"do_lower_case": True}, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/prophetnet-large-uncased": 512, -} - # Copied from transformers.models.bert.tokenization_bert.whitespace_tokenize def whitespace_tokenize(text): @@ -327,9 +311,6 @@ class ProphetNetTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES # first name has to correspond to main model input name # to make sure `tokenizer.pad(...)` works correctly diff --git a/src/transformers/models/pvt/__init__.py b/src/transformers/models/pvt/__init__.py index cab5af9af7c997..1ee7092f0c460a 100644 --- a/src/transformers/models/pvt/__init__.py +++ b/src/transformers/models/pvt/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_pvt": ["PVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtConfig", "PvtOnnxConfig"], + "configuration_pvt": ["PvtConfig", "PvtOnnxConfig"], } try: @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_pvt"] = [ - "PVT_PRETRAINED_MODEL_ARCHIVE_LIST", "PvtForImageClassification", "PvtModel", "PvtPreTrainedModel", @@ -51,7 +50,7 @@ if TYPE_CHECKING: - from .configuration_pvt import PVT_PRETRAINED_CONFIG_ARCHIVE_MAP, PvtConfig, PvtOnnxConfig + from .configuration_pvt import PvtConfig, PvtOnnxConfig try: if not is_vision_available(): @@ -68,7 +67,6 @@ pass else: from .modeling_pvt import ( - PVT_PRETRAINED_MODEL_ARCHIVE_LIST, PvtForImageClassification, PvtModel, PvtPreTrainedModel, diff --git a/src/transformers/models/pvt/configuration_pvt.py b/src/transformers/models/pvt/configuration_pvt.py index ac7d5add7f5971..82b48224354038 100644 --- a/src/transformers/models/pvt/configuration_pvt.py +++ b/src/transformers/models/pvt/configuration_pvt.py @@ -28,11 +28,6 @@ logger = logging.get_logger(__name__) -PVT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "pvt-tiny-224": "https://huggingface.co/Zetatech/pvt-tiny-224", - # See all PVT models at https://huggingface.co/models?filter=pvt -} - class PvtConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/pvt/modeling_pvt.py b/src/transformers/models/pvt/modeling_pvt.py index 58ed0ae68fedd6..7480a71a569f63 100755 --- a/src/transformers/models/pvt/modeling_pvt.py +++ b/src/transformers/models/pvt/modeling_pvt.py @@ -49,11 +49,6 @@ _IMAGE_CLASS_CHECKPOINT = "Zetatech/pvt-tiny-224" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -PVT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Zetatech/pvt-tiny-224" - # See all PVT models at https://huggingface.co/models?filter=pvt -] - # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/src/transformers/models/qdqbert/__init__.py b/src/transformers/models/qdqbert/__init__.py index 3d161192d81b0d..d413aefe0c7c5a 100644 --- a/src/transformers/models/qdqbert/__init__.py +++ b/src/transformers/models/qdqbert/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_qdqbert": ["QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "QDQBertConfig"]} +_import_structure = {"configuration_qdqbert": ["QDQBertConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_qdqbert"] = [ - "QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "QDQBertForMaskedLM", "QDQBertForMultipleChoice", "QDQBertForNextSentencePrediction", @@ -41,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig + from .configuration_qdqbert import QDQBertConfig try: if not is_torch_available(): @@ -50,7 +49,6 @@ pass else: from .modeling_qdqbert import ( - QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST, QDQBertForMaskedLM, QDQBertForMultipleChoice, QDQBertForNextSentencePrediction, diff --git a/src/transformers/models/qdqbert/configuration_qdqbert.py b/src/transformers/models/qdqbert/configuration_qdqbert.py index 1efa2ef811ecbe..40ae3cc3108aa2 100644 --- a/src/transformers/models/qdqbert/configuration_qdqbert.py +++ b/src/transformers/models/qdqbert/configuration_qdqbert.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json", - # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert -} - class QDQBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/qdqbert/modeling_qdqbert.py b/src/transformers/models/qdqbert/modeling_qdqbert.py index 8c610ecaedbfc4..b99cb51964b83e 100755 --- a/src/transformers/models/qdqbert/modeling_qdqbert.py +++ b/src/transformers/models/qdqbert/modeling_qdqbert.py @@ -69,11 +69,6 @@ _CHECKPOINT_FOR_DOC = "google-bert/bert-base-uncased" _CONFIG_FOR_DOC = "QDQBertConfig" -QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google-bert/bert-base-uncased", - # See all BERT models at https://huggingface.co/models?filter=bert -] - def load_tf_weights_in_qdqbert(model, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/qwen2/__init__.py b/src/transformers/models/qwen2/__init__.py index 9fd51aaffee86c..3409f28214d1fd 100644 --- a/src/transformers/models/qwen2/__init__.py +++ b/src/transformers/models/qwen2/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_qwen2": ["QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Qwen2Config"], + "configuration_qwen2": ["Qwen2Config"], "tokenization_qwen2": ["Qwen2Tokenizer"], } @@ -49,7 +49,7 @@ if TYPE_CHECKING: - from .configuration_qwen2 import QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP, Qwen2Config + from .configuration_qwen2 import Qwen2Config from .tokenization_qwen2 import Qwen2Tokenizer try: diff --git a/src/transformers/models/qwen2/configuration_qwen2.py b/src/transformers/models/qwen2/configuration_qwen2.py index 0bbfd1cf1601ed..c2a99dfa8b2a49 100644 --- a/src/transformers/models/qwen2/configuration_qwen2.py +++ b/src/transformers/models/qwen2/configuration_qwen2.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Qwen/Qwen2-7B-beta": "https://huggingface.co/Qwen/Qwen2-7B-beta/resolve/main/config.json", -} - class Qwen2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/qwen2/modeling_qwen2.py b/src/transformers/models/qwen2/modeling_qwen2.py index bfba4a45324818..7ca32c37685c3c 100644 --- a/src/transformers/models/qwen2/modeling_qwen2.py +++ b/src/transformers/models/qwen2/modeling_qwen2.py @@ -58,11 +58,6 @@ _CHECKPOINT_FOR_DOC = "Qwen/Qwen2-7B-beta" _CONFIG_FOR_DOC = "Qwen2Config" -QWEN2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Qwen/Qwen2-7B-beta", - # See all Qwen2 models at https://huggingface.co/models?filter=qwen2 -] - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): diff --git a/src/transformers/models/qwen2/tokenization_qwen2.py b/src/transformers/models/qwen2/tokenization_qwen2.py index 9f8607c9ef6ca4..22cffcb608152f 100644 --- a/src/transformers/models/qwen2/tokenization_qwen2.py +++ b/src/transformers/models/qwen2/tokenization_qwen2.py @@ -33,10 +33,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"qwen/qwen-tokenizer": "https://huggingface.co/qwen/qwen-tokenizer/resolve/main/vocab.json"}, - "merges_file": {"qwen/qwen-tokenizer": "https://huggingface.co/qwen/qwen-tokenizer/resolve/main/merges.txt"}, -} MAX_MODEL_INPUT_SIZES = {"qwen/qwen-tokenizer": 32768} @@ -136,8 +132,6 @@ class Qwen2Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = MAX_MODEL_INPUT_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/qwen2/tokenization_qwen2_fast.py b/src/transformers/models/qwen2/tokenization_qwen2_fast.py index 467aa6d947e1f3..82e3073788679c 100644 --- a/src/transformers/models/qwen2/tokenization_qwen2_fast.py +++ b/src/transformers/models/qwen2/tokenization_qwen2_fast.py @@ -30,13 +30,6 @@ "tokenizer_file": "tokenizer.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": {"qwen/qwen-tokenizer": "https://huggingface.co/qwen/qwen-tokenizer/resolve/main/vocab.json"}, - "merges_file": {"qwen/qwen-tokenizer": "https://huggingface.co/qwen/qwen-tokenizer/resolve/main/merges.txt"}, - "tokenizer_file": { - "qwen/qwen-tokenizer": "https://huggingface.co/qwen/qwen-tokenizer/resolve/main/tokenizer.json" - }, -} MAX_MODEL_INPUT_SIZES = {"qwen/qwen-tokenizer": 32768} @@ -84,8 +77,6 @@ class Qwen2TokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = MAX_MODEL_INPUT_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = Qwen2Tokenizer diff --git a/src/transformers/models/realm/__init__.py b/src/transformers/models/realm/__init__.py index 594ce0c35e382f..eea7384673792a 100644 --- a/src/transformers/models/realm/__init__.py +++ b/src/transformers/models/realm/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_realm": ["REALM_PRETRAINED_CONFIG_ARCHIVE_MAP", "RealmConfig"], + "configuration_realm": ["RealmConfig"], "tokenization_realm": ["RealmTokenizer"], } @@ -36,7 +36,6 @@ pass else: _import_structure["modeling_realm"] = [ - "REALM_PRETRAINED_MODEL_ARCHIVE_LIST", "RealmEmbedder", "RealmForOpenQA", "RealmKnowledgeAugEncoder", @@ -49,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_realm import REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, RealmConfig + from .configuration_realm import RealmConfig from .tokenization_realm import RealmTokenizer try: @@ -67,7 +66,6 @@ pass else: from .modeling_realm import ( - REALM_PRETRAINED_MODEL_ARCHIVE_LIST, RealmEmbedder, RealmForOpenQA, RealmKnowledgeAugEncoder, diff --git a/src/transformers/models/realm/configuration_realm.py b/src/transformers/models/realm/configuration_realm.py index b7e25c8d15de72..fd21f44a558de8 100644 --- a/src/transformers/models/realm/configuration_realm.py +++ b/src/transformers/models/realm/configuration_realm.py @@ -20,26 +20,6 @@ logger = logging.get_logger(__name__) -REALM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/realm-cc-news-pretrained-embedder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json" - ), - "google/realm-cc-news-pretrained-encoder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json" - ), - "google/realm-cc-news-pretrained-scorer": ( - "https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json" - ), - "google/realm-cc-news-pretrained-openqa": ( - "https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json" - ), - "google/realm-orqa-nq-openqa": "https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json", - "google/realm-orqa-nq-reader": "https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json", - "google/realm-orqa-wq-openqa": "https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json", - "google/realm-orqa-wq-reader": "https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json", - # See all REALM models at https://huggingface.co/models?filter=realm -} - class RealmConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/realm/modeling_realm.py b/src/transformers/models/realm/modeling_realm.py index 1b202ffd09b1c9..7ae450552fcc4b 100644 --- a/src/transformers/models/realm/modeling_realm.py +++ b/src/transformers/models/realm/modeling_realm.py @@ -42,18 +42,6 @@ _SCORER_CHECKPOINT_FOR_DOC = "google/realm-cc-news-pretrained-scorer" _CONFIG_FOR_DOC = "RealmConfig" -REALM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/realm-cc-news-pretrained-embedder", - "google/realm-cc-news-pretrained-encoder", - "google/realm-cc-news-pretrained-scorer", - "google/realm-cc-news-pretrained-openqa", - "google/realm-orqa-nq-openqa", - "google/realm-orqa-nq-reader", - "google/realm-orqa-wq-openqa", - "google/realm-orqa-wq-reader", - # See all REALM models at https://huggingface.co/models?filter=realm -] - def load_tf_weights_in_realm(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/realm/tokenization_realm.py b/src/transformers/models/realm/tokenization_realm.py index bf6b63277488b9..c4ff7e38a3e552 100644 --- a/src/transformers/models/realm/tokenization_realm.py +++ b/src/transformers/models/realm/tokenization_realm.py @@ -28,49 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/realm-cc-news-pretrained-embedder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/vocab.txt" - ), - "google/realm-cc-news-pretrained-encoder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/vocab.txt" - ), - "google/realm-cc-news-pretrained-scorer": ( - "https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/vocab.txt" - ), - "google/realm-cc-news-pretrained-openqa": ( - "https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/vocab.txt" - ), - "google/realm-orqa-nq-openqa": "https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/vocab.txt", - "google/realm-orqa-nq-reader": "https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/vocab.txt", - "google/realm-orqa-wq-openqa": "https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/vocab.txt", - "google/realm-orqa-wq-reader": "https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/vocab.txt", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/realm-cc-news-pretrained-embedder": 512, - "google/realm-cc-news-pretrained-encoder": 512, - "google/realm-cc-news-pretrained-scorer": 512, - "google/realm-cc-news-pretrained-openqa": 512, - "google/realm-orqa-nq-openqa": 512, - "google/realm-orqa-nq-reader": 512, - "google/realm-orqa-wq-openqa": 512, - "google/realm-orqa-wq-reader": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "google/realm-cc-news-pretrained-embedder": {"do_lower_case": True}, - "google/realm-cc-news-pretrained-encoder": {"do_lower_case": True}, - "google/realm-cc-news-pretrained-scorer": {"do_lower_case": True}, - "google/realm-cc-news-pretrained-openqa": {"do_lower_case": True}, - "google/realm-orqa-nq-openqa": {"do_lower_case": True}, - "google/realm-orqa-nq-reader": {"do_lower_case": True}, - "google/realm-orqa-wq-openqa": {"do_lower_case": True}, - "google/realm-orqa-wq-reader": {"do_lower_case": True}, -} - def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" @@ -138,9 +95,6 @@ class RealmTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/realm/tokenization_realm_fast.py b/src/transformers/models/realm/tokenization_realm_fast.py index 59b23f45ee0b30..7315bf1c250182 100644 --- a/src/transformers/models/realm/tokenization_realm_fast.py +++ b/src/transformers/models/realm/tokenization_realm_fast.py @@ -29,75 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/realm-cc-news-pretrained-embedder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/vocab.txt" - ), - "google/realm-cc-news-pretrained-encoder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/vocab.txt" - ), - "google/realm-cc-news-pretrained-scorer": ( - "https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/vocab.txt" - ), - "google/realm-cc-news-pretrained-openqa": ( - "https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/vocab.txt" - ), - "google/realm-orqa-nq-openqa": "https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/vocab.txt", - "google/realm-orqa-nq-reader": "https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/vocab.txt", - "google/realm-orqa-wq-openqa": "https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/vocab.txt", - "google/realm-orqa-wq-reader": "https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/vocab.txt", - }, - "tokenizer_file": { - "google/realm-cc-news-pretrained-embedder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/tokenizer.jsont" - ), - "google/realm-cc-news-pretrained-encoder": ( - "https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/tokenizer.json" - ), - "google/realm-cc-news-pretrained-scorer": ( - "https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/tokenizer.json" - ), - "google/realm-cc-news-pretrained-openqa": ( - "https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/tokenizer.json" - ), - "google/realm-orqa-nq-openqa": ( - "https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/tokenizer.json" - ), - "google/realm-orqa-nq-reader": ( - "https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/tokenizer.json" - ), - "google/realm-orqa-wq-openqa": ( - "https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/tokenizer.json" - ), - "google/realm-orqa-wq-reader": ( - "https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/realm-cc-news-pretrained-embedder": 512, - "google/realm-cc-news-pretrained-encoder": 512, - "google/realm-cc-news-pretrained-scorer": 512, - "google/realm-cc-news-pretrained-openqa": 512, - "google/realm-orqa-nq-openqa": 512, - "google/realm-orqa-nq-reader": 512, - "google/realm-orqa-wq-openqa": 512, - "google/realm-orqa-wq-reader": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "google/realm-cc-news-pretrained-embedder": {"do_lower_case": True}, - "google/realm-cc-news-pretrained-encoder": {"do_lower_case": True}, - "google/realm-cc-news-pretrained-scorer": {"do_lower_case": True}, - "google/realm-cc-news-pretrained-openqa": {"do_lower_case": True}, - "google/realm-orqa-nq-openqa": {"do_lower_case": True}, - "google/realm-orqa-nq-reader": {"do_lower_case": True}, - "google/realm-orqa-wq-openqa": {"do_lower_case": True}, - "google/realm-orqa-wq-reader": {"do_lower_case": True}, -} - class RealmTokenizerFast(PreTrainedTokenizerFast): r""" @@ -143,9 +74,6 @@ class RealmTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = RealmTokenizer def __init__( diff --git a/src/transformers/models/reformer/__init__.py b/src/transformers/models/reformer/__init__.py index 37508ef808e083..ef13dd7c312dd0 100644 --- a/src/transformers/models/reformer/__init__.py +++ b/src/transformers/models/reformer/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_reformer": ["REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ReformerConfig"]} +_import_structure = {"configuration_reformer": ["ReformerConfig"]} try: if not is_sentencepiece_available(): @@ -48,7 +48,6 @@ pass else: _import_structure["modeling_reformer"] = [ - "REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ReformerAttention", "ReformerForMaskedLM", "ReformerForQuestionAnswering", @@ -61,7 +60,7 @@ if TYPE_CHECKING: - from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig + from .configuration_reformer import ReformerConfig try: if not is_sentencepiece_available(): @@ -86,7 +85,6 @@ pass else: from .modeling_reformer import ( - REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ReformerAttention, ReformerForMaskedLM, ReformerForQuestionAnswering, diff --git a/src/transformers/models/reformer/configuration_reformer.py b/src/transformers/models/reformer/configuration_reformer.py index e01f25a5fbfe8f..eecd67cc06ba08 100755 --- a/src/transformers/models/reformer/configuration_reformer.py +++ b/src/transformers/models/reformer/configuration_reformer.py @@ -21,13 +21,6 @@ logger = logging.get_logger(__name__) -REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/reformer-crime-and-punishment": ( - "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json" - ), - "google/reformer-enwik8": "https://huggingface.co/google/reformer-enwik8/resolve/main/config.json", -} - class ReformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/reformer/modeling_reformer.py b/src/transformers/models/reformer/modeling_reformer.py index 7096a57d0fa4ee..4db776e24c200e 100755 --- a/src/transformers/models/reformer/modeling_reformer.py +++ b/src/transformers/models/reformer/modeling_reformer.py @@ -50,12 +50,6 @@ _CHECKPOINT_FOR_DOC = "google/reformer-crime-and-punishment" _CONFIG_FOR_DOC = "ReformerConfig" -REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/reformer-crime-and-punishment", - "google/reformer-enwik8", - # See all Reformer models at https://huggingface.co/models?filter=reformer -] - # Define named tuples for nn.Modules here LSHSelfAttentionOutput = namedtuple("LSHSelfAttentionOutput", ["hidden_states", "attention_probs", "buckets"]) diff --git a/src/transformers/models/reformer/tokenization_reformer.py b/src/transformers/models/reformer/tokenization_reformer.py index 364a2d42edfff0..efc692185b71f3 100644 --- a/src/transformers/models/reformer/tokenization_reformer.py +++ b/src/transformers/models/reformer/tokenization_reformer.py @@ -32,18 +32,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/reformer-crime-and-punishment": ( - "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/spiece.model" - ) - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/reformer-crime-and-punishment": 524288, -} - class ReformerTokenizer(PreTrainedTokenizer): """ @@ -89,8 +77,6 @@ class ReformerTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/reformer/tokenization_reformer_fast.py b/src/transformers/models/reformer/tokenization_reformer_fast.py index eb8c86b3cd1221..fb0f2c8b8e94c0 100644 --- a/src/transformers/models/reformer/tokenization_reformer_fast.py +++ b/src/transformers/models/reformer/tokenization_reformer_fast.py @@ -36,23 +36,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/reformer-crime-and-punishment": ( - "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/spiece.model" - ) - }, - "tokenizer_file": { - "google/reformer-crime-and-punishment": ( - "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/tokenizer.json" - ) - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/reformer-crime-and-punishment": 524288, -} - class ReformerTokenizerFast(PreTrainedTokenizerFast): """ @@ -86,8 +69,6 @@ class ReformerTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = ReformerTokenizer diff --git a/src/transformers/models/regnet/__init__.py b/src/transformers/models/regnet/__init__.py index 5084c4486008d1..25507927affde7 100644 --- a/src/transformers/models/regnet/__init__.py +++ b/src/transformers/models/regnet/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_regnet": ["REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "RegNetConfig"]} +_import_structure = {"configuration_regnet": ["RegNetConfig"]} try: if not is_torch_available(): @@ -31,7 +31,6 @@ pass else: _import_structure["modeling_regnet"] = [ - "REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "RegNetForImageClassification", "RegNetModel", "RegNetPreTrainedModel", @@ -44,7 +43,6 @@ pass else: _import_structure["modeling_tf_regnet"] = [ - "TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRegNetForImageClassification", "TFRegNetModel", "TFRegNetPreTrainedModel", @@ -64,7 +62,7 @@ if TYPE_CHECKING: - from .configuration_regnet import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP, RegNetConfig + from .configuration_regnet import RegNetConfig try: if not is_torch_available(): @@ -73,7 +71,6 @@ pass else: from .modeling_regnet import ( - REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, RegNetForImageClassification, RegNetModel, RegNetPreTrainedModel, @@ -86,7 +83,6 @@ pass else: from .modeling_tf_regnet import ( - TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFRegNetForImageClassification, TFRegNetModel, TFRegNetPreTrainedModel, diff --git a/src/transformers/models/regnet/configuration_regnet.py b/src/transformers/models/regnet/configuration_regnet.py index 4969e426bcb3dd..e24bc70a891c77 100644 --- a/src/transformers/models/regnet/configuration_regnet.py +++ b/src/transformers/models/regnet/configuration_regnet.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/regnet-y-040": "https://huggingface.co/facebook/regnet-y-040/blob/main/config.json", -} - class RegNetConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/regnet/modeling_regnet.py b/src/transformers/models/regnet/modeling_regnet.py index 2295fbeeabfdfd..75d16e04c43934 100644 --- a/src/transformers/models/regnet/modeling_regnet.py +++ b/src/transformers/models/regnet/modeling_regnet.py @@ -46,11 +46,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/regnet-y-040" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/regnet-y-040", - # See all regnet models at https://huggingface.co/models?filter=regnet -] - class RegNetConvLayer(nn.Module): def __init__( diff --git a/src/transformers/models/regnet/modeling_tf_regnet.py b/src/transformers/models/regnet/modeling_tf_regnet.py index bca515fbf3355b..24ebb3f5caf5c9 100644 --- a/src/transformers/models/regnet/modeling_tf_regnet.py +++ b/src/transformers/models/regnet/modeling_tf_regnet.py @@ -50,11 +50,6 @@ _IMAGE_CLASS_CHECKPOINT = "facebook/regnet-y-040" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/regnet-y-040", - # See all regnet models at https://huggingface.co/models?filter=regnet -] - class TFRegNetConvLayer(keras.layers.Layer): def __init__( diff --git a/src/transformers/models/rembert/__init__.py b/src/transformers/models/rembert/__init__.py index 98e8e2254dcfa9..5ffaf3c8c04cf3 100644 --- a/src/transformers/models/rembert/__init__.py +++ b/src/transformers/models/rembert/__init__.py @@ -24,9 +24,7 @@ ) -_import_structure = { - "configuration_rembert": ["REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RemBertConfig", "RemBertOnnxConfig"] -} +_import_structure = {"configuration_rembert": ["RemBertConfig", "RemBertOnnxConfig"]} try: if not is_sentencepiece_available(): @@ -51,7 +49,6 @@ pass else: _import_structure["modeling_rembert"] = [ - "REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RemBertForCausalLM", "RemBertForMaskedLM", "RemBertForMultipleChoice", @@ -72,7 +69,6 @@ pass else: _import_structure["modeling_tf_rembert"] = [ - "TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRemBertForCausalLM", "TFRemBertForMaskedLM", "TFRemBertForMultipleChoice", @@ -86,7 +82,7 @@ if TYPE_CHECKING: - from .configuration_rembert import REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RemBertConfig, RemBertOnnxConfig + from .configuration_rembert import RemBertConfig, RemBertOnnxConfig try: if not is_sentencepiece_available(): @@ -111,7 +107,6 @@ pass else: from .modeling_rembert import ( - REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RemBertForCausalLM, RemBertForMaskedLM, RemBertForMultipleChoice, @@ -131,7 +126,6 @@ pass else: from .modeling_tf_rembert import ( - TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFRemBertForCausalLM, TFRemBertForMaskedLM, TFRemBertForMultipleChoice, diff --git a/src/transformers/models/rembert/configuration_rembert.py b/src/transformers/models/rembert/configuration_rembert.py index 0b5833c1c771de..471f2f75213a53 100644 --- a/src/transformers/models/rembert/configuration_rembert.py +++ b/src/transformers/models/rembert/configuration_rembert.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/rembert": "https://huggingface.co/google/rembert/resolve/main/config.json", - # See all RemBERT models at https://huggingface.co/models?filter=rembert -} - class RemBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/rembert/modeling_rembert.py b/src/transformers/models/rembert/modeling_rembert.py index b53464cdeca262..e92418fcffaaed 100755 --- a/src/transformers/models/rembert/modeling_rembert.py +++ b/src/transformers/models/rembert/modeling_rembert.py @@ -52,11 +52,6 @@ _CONFIG_FOR_DOC = "RemBertConfig" _CHECKPOINT_FOR_DOC = "google/rembert" -REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/rembert", - # See all RemBERT models at https://huggingface.co/models?filter=rembert -] - def load_tf_weights_in_rembert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" diff --git a/src/transformers/models/rembert/modeling_tf_rembert.py b/src/transformers/models/rembert/modeling_tf_rembert.py index 58b13bc35be382..daceef108076a0 100644 --- a/src/transformers/models/rembert/modeling_tf_rembert.py +++ b/src/transformers/models/rembert/modeling_tf_rembert.py @@ -62,11 +62,6 @@ _CONFIG_FOR_DOC = "RemBertConfig" -TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/rembert", - # See all RemBERT models at https://huggingface.co/models?filter=rembert -] - class TFRemBertEmbeddings(keras.layers.Layer): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/rembert/tokenization_rembert.py b/src/transformers/models/rembert/tokenization_rembert.py index 9403e911769184..a2b1f9abc2c989 100644 --- a/src/transformers/models/rembert/tokenization_rembert.py +++ b/src/transformers/models/rembert/tokenization_rembert.py @@ -29,16 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/rembert": "https://huggingface.co/google/rembert/resolve/main/sentencepiece.model", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/rembert": 256, -} - class RemBertTokenizer(PreTrainedTokenizer): """ @@ -93,8 +83,6 @@ class RemBertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/rembert/tokenization_rembert_fast.py b/src/transformers/models/rembert/tokenization_rembert_fast.py index 947cc4bc9601c4..b7165e362a4f7a 100644 --- a/src/transformers/models/rembert/tokenization_rembert_fast.py +++ b/src/transformers/models/rembert/tokenization_rembert_fast.py @@ -32,18 +32,6 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/rembert": "https://huggingface.co/google/rembert/resolve/main/sentencepiece.model", - }, - "tokenizer_file": { - "google/rembert": "https://huggingface.co/google/rembert/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/rembert": 256, -} SPIECE_UNDERLINE = "▁" @@ -96,8 +84,6 @@ class RemBertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = RemBertTokenizer def __init__( diff --git a/src/transformers/models/resnet/__init__.py b/src/transformers/models/resnet/__init__.py index 62e6b1c2ca1a68..50b71a4dd4cf4d 100644 --- a/src/transformers/models/resnet/__init__.py +++ b/src/transformers/models/resnet/__init__.py @@ -22,9 +22,7 @@ ) -_import_structure = { - "configuration_resnet": ["RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ResNetConfig", "ResNetOnnxConfig"] -} +_import_structure = {"configuration_resnet": ["ResNetConfig", "ResNetOnnxConfig"]} try: if not is_torch_available(): @@ -33,7 +31,6 @@ pass else: _import_structure["modeling_resnet"] = [ - "RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ResNetForImageClassification", "ResNetModel", "ResNetPreTrainedModel", @@ -47,7 +44,6 @@ pass else: _import_structure["modeling_tf_resnet"] = [ - "TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFResNetForImageClassification", "TFResNetModel", "TFResNetPreTrainedModel", @@ -66,7 +62,7 @@ ] if TYPE_CHECKING: - from .configuration_resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig, ResNetOnnxConfig + from .configuration_resnet import ResNetConfig, ResNetOnnxConfig try: if not is_torch_available(): @@ -75,7 +71,6 @@ pass else: from .modeling_resnet import ( - RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, ResNetBackbone, ResNetForImageClassification, ResNetModel, @@ -89,7 +84,6 @@ pass else: from .modeling_tf_resnet import ( - TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFResNetForImageClassification, TFResNetModel, TFResNetPreTrainedModel, diff --git a/src/transformers/models/resnet/configuration_resnet.py b/src/transformers/models/resnet/configuration_resnet.py index 250589c1de2cce..46ccd96cd9ccfc 100644 --- a/src/transformers/models/resnet/configuration_resnet.py +++ b/src/transformers/models/resnet/configuration_resnet.py @@ -27,10 +27,6 @@ logger = logging.get_logger(__name__) -RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/resnet-50": "https://huggingface.co/microsoft/resnet-50/blob/main/config.json", -} - class ResNetConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/resnet/modeling_resnet.py b/src/transformers/models/resnet/modeling_resnet.py index df460d58f042b5..a7e65f07ea4c8f 100644 --- a/src/transformers/models/resnet/modeling_resnet.py +++ b/src/transformers/models/resnet/modeling_resnet.py @@ -53,11 +53,6 @@ _IMAGE_CLASS_CHECKPOINT = "microsoft/resnet-50" _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" -RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/resnet-50", - # See all resnet models at https://huggingface.co/models?filter=resnet -] - class ResNetConvLayer(nn.Module): def __init__( diff --git a/src/transformers/models/resnet/modeling_tf_resnet.py b/src/transformers/models/resnet/modeling_tf_resnet.py index faf5c635ba8d9c..4d68775c922ae9 100644 --- a/src/transformers/models/resnet/modeling_tf_resnet.py +++ b/src/transformers/models/resnet/modeling_tf_resnet.py @@ -49,11 +49,6 @@ _IMAGE_CLASS_CHECKPOINT = "microsoft/resnet-50" _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" -TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/resnet-50", - # See all resnet models at https://huggingface.co/models?filter=resnet -] - class TFResNetConvLayer(keras.layers.Layer): def __init__( diff --git a/src/transformers/models/roberta/__init__.py b/src/transformers/models/roberta/__init__.py index 774179f5f6f445..4a97962f4f5704 100644 --- a/src/transformers/models/roberta/__init__.py +++ b/src/transformers/models/roberta/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_roberta": ["ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "RobertaConfig", "RobertaOnnxConfig"], + "configuration_roberta": ["RobertaConfig", "RobertaOnnxConfig"], "tokenization_roberta": ["RobertaTokenizer"], } @@ -44,7 +44,6 @@ pass else: _import_structure["modeling_roberta"] = [ - "ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaForCausalLM", "RobertaForMaskedLM", "RobertaForMultipleChoice", @@ -62,7 +61,6 @@ pass else: _import_structure["modeling_tf_roberta"] = [ - "TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaForCausalLM", "TFRobertaForMaskedLM", "TFRobertaForMultipleChoice", @@ -93,7 +91,7 @@ if TYPE_CHECKING: - from .configuration_roberta import ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaConfig, RobertaOnnxConfig + from .configuration_roberta import RobertaConfig, RobertaOnnxConfig from .tokenization_roberta import RobertaTokenizer try: @@ -111,7 +109,6 @@ pass else: from .modeling_roberta import ( - ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaForCausalLM, RobertaForMaskedLM, RobertaForMultipleChoice, @@ -129,7 +126,6 @@ pass else: from .modeling_tf_roberta import ( - TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaForCausalLM, TFRobertaForMaskedLM, TFRobertaForMultipleChoice, diff --git a/src/transformers/models/roberta/configuration_roberta.py b/src/transformers/models/roberta/configuration_roberta.py index 8cc35d6090ceeb..0ecd57b23a5ddf 100644 --- a/src/transformers/models/roberta/configuration_roberta.py +++ b/src/transformers/models/roberta/configuration_roberta.py @@ -24,15 +24,6 @@ logger = logging.get_logger(__name__) -ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/config.json", - "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/config.json", - "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/config.json", - "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/config.json", - "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/config.json", - "openai-community/roberta-large-openai-detector": "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/config.json", -} - class RobertaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/roberta/modeling_roberta.py b/src/transformers/models/roberta/modeling_roberta.py index f755bd9d566a92..5984529eb041d6 100644 --- a/src/transformers/models/roberta/modeling_roberta.py +++ b/src/transformers/models/roberta/modeling_roberta.py @@ -51,16 +51,6 @@ _CHECKPOINT_FOR_DOC = "FacebookAI/roberta-base" _CONFIG_FOR_DOC = "RobertaConfig" -ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "FacebookAI/roberta-base", - "FacebookAI/roberta-large", - "FacebookAI/roberta-large-mnli", - "distilbert/distilroberta-base", - "openai-community/roberta-base-openai-detector", - "openai-community/roberta-large-openai-detector", - # See all RoBERTa models at https://huggingface.co/models?filter=roberta -] - class RobertaEmbeddings(nn.Module): """ diff --git a/src/transformers/models/roberta/modeling_tf_roberta.py b/src/transformers/models/roberta/modeling_tf_roberta.py index 0bc5e85e808a56..84448a168defdb 100644 --- a/src/transformers/models/roberta/modeling_tf_roberta.py +++ b/src/transformers/models/roberta/modeling_tf_roberta.py @@ -65,14 +65,6 @@ _CHECKPOINT_FOR_DOC = "FacebookAI/roberta-base" _CONFIG_FOR_DOC = "RobertaConfig" -TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "FacebookAI/roberta-base", - "FacebookAI/roberta-large", - "FacebookAI/roberta-large-mnli", - "distilbert/distilroberta-base", - # See all RoBERTa models at https://huggingface.co/models?filter=roberta -] - class TFRobertaEmbeddings(keras.layers.Layer): """ diff --git a/src/transformers/models/roberta/tokenization_roberta.py b/src/transformers/models/roberta/tokenization_roberta.py index c7dc51b972944c..072c44ac4dd359 100644 --- a/src/transformers/models/roberta/tokenization_roberta.py +++ b/src/transformers/models/roberta/tokenization_roberta.py @@ -32,38 +32,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/vocab.json", - "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/vocab.json", - "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/vocab.json", - "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/vocab.json", - "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/vocab.json", - "openai-community/roberta-large-openai-detector": ( - "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/vocab.json" - ), - }, - "merges_file": { - "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/merges.txt", - "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/merges.txt", - "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/merges.txt", - "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/merges.txt", - "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/merges.txt", - "openai-community/roberta-large-openai-detector": ( - "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/merges.txt" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "FacebookAI/roberta-base": 512, - "FacebookAI/roberta-large": 512, - "FacebookAI/roberta-large-mnli": 512, - "distilbert/distilroberta-base": 512, - "openai-community/roberta-base-openai-detector": 512, - "openai-community/roberta-large-openai-detector": 512, -} - @lru_cache() def bytes_to_unicode(): @@ -183,8 +151,6 @@ class RobertaTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/roberta/tokenization_roberta_fast.py b/src/transformers/models/roberta/tokenization_roberta_fast.py index 00341e870f8bc8..702af8a33e1b94 100644 --- a/src/transformers/models/roberta/tokenization_roberta_fast.py +++ b/src/transformers/models/roberta/tokenization_roberta_fast.py @@ -28,50 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/vocab.json", - "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/vocab.json", - "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/vocab.json", - "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/vocab.json", - "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/vocab.json", - "openai-community/roberta-large-openai-detector": ( - "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/vocab.json" - ), - }, - "merges_file": { - "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/merges.txt", - "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/merges.txt", - "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/merges.txt", - "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/merges.txt", - "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/merges.txt", - "openai-community/roberta-large-openai-detector": ( - "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/merges.txt" - ), - }, - "tokenizer_file": { - "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/tokenizer.json", - "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/tokenizer.json", - "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/tokenizer.json", - "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/tokenizer.json", - "openai-community/roberta-base-openai-detector": ( - "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/tokenizer.json" - ), - "openai-community/roberta-large-openai-detector": ( - "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "FacebookAI/roberta-base": 512, - "FacebookAI/roberta-large": 512, - "FacebookAI/roberta-large-mnli": 512, - "distilbert/distilroberta-base": 512, - "openai-community/roberta-base-openai-detector": 512, - "openai-community/roberta-large-openai-detector": 512, -} - class RobertaTokenizerFast(PreTrainedTokenizerFast): """ @@ -155,8 +111,6 @@ class RobertaTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = RobertaTokenizer diff --git a/src/transformers/models/roberta_prelayernorm/__init__.py b/src/transformers/models/roberta_prelayernorm/__init__.py index e2dcaa71be54da..9f55eed11c4224 100644 --- a/src/transformers/models/roberta_prelayernorm/__init__.py +++ b/src/transformers/models/roberta_prelayernorm/__init__.py @@ -25,7 +25,6 @@ _import_structure = { "configuration_roberta_prelayernorm": [ - "ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP", "RobertaPreLayerNormConfig", "RobertaPreLayerNormOnnxConfig", ], @@ -38,7 +37,6 @@ pass else: _import_structure["modeling_roberta_prelayernorm"] = [ - "ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaPreLayerNormForCausalLM", "RobertaPreLayerNormForMaskedLM", "RobertaPreLayerNormForMultipleChoice", @@ -56,7 +54,6 @@ pass else: _import_structure["modeling_tf_roberta_prelayernorm"] = [ - "TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaPreLayerNormForCausalLM", "TFRobertaPreLayerNormForMaskedLM", "TFRobertaPreLayerNormForMultipleChoice", @@ -88,7 +85,6 @@ if TYPE_CHECKING: from .configuration_roberta_prelayernorm import ( - ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaPreLayerNormConfig, RobertaPreLayerNormOnnxConfig, ) @@ -100,7 +96,6 @@ pass else: from .modeling_roberta_prelayernorm import ( - ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaPreLayerNormForCausalLM, RobertaPreLayerNormForMaskedLM, RobertaPreLayerNormForMultipleChoice, @@ -118,7 +113,6 @@ pass else: from .modeling_tf_roberta_prelayernorm import ( - TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaPreLayerNormForCausalLM, TFRobertaPreLayerNormForMaskedLM, TFRobertaPreLayerNormForMultipleChoice, diff --git a/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py b/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py index f9325138165a7c..e7e74b0cdf24d1 100644 --- a/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py +++ b/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py @@ -24,12 +24,6 @@ logger = logging.get_logger(__name__) -ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "andreasmadsen/efficient_mlm_m0.40": ( - "https://huggingface.co/andreasmadsen/efficient_mlm_m0.40/resolve/main/config.json" - ), -} - # Copied from transformers.models.roberta.configuration_roberta.RobertaConfig with FacebookAI/roberta-base->andreasmadsen/efficient_mlm_m0.40,RoBERTa->RoBERTa-PreLayerNorm,Roberta->RobertaPreLayerNorm,roberta->roberta-prelayernorm class RobertaPreLayerNormConfig(PretrainedConfig): diff --git a/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py b/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py index 7c37950e478b6f..cfbf5e11aa233d 100644 --- a/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py +++ b/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py @@ -51,18 +51,6 @@ _CHECKPOINT_FOR_DOC = "andreasmadsen/efficient_mlm_m0.40" _CONFIG_FOR_DOC = "RobertaPreLayerNormConfig" -ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "andreasmadsen/efficient_mlm_m0.15", - "andreasmadsen/efficient_mlm_m0.20", - "andreasmadsen/efficient_mlm_m0.30", - "andreasmadsen/efficient_mlm_m0.40", - "andreasmadsen/efficient_mlm_m0.50", - "andreasmadsen/efficient_mlm_m0.60", - "andreasmadsen/efficient_mlm_m0.70", - "andreasmadsen/efficient_mlm_m0.80", - # See all RoBERTaWithPreLayerNorm models at https://huggingface.co/models?filter=roberta_with_prelayernorm -] - # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->RobertaPreLayerNorm class RobertaPreLayerNormEmbeddings(nn.Module): diff --git a/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py b/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py index 6d111deaaba5cd..beb9c383e1d4ff 100644 --- a/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py +++ b/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py @@ -65,18 +65,6 @@ _CHECKPOINT_FOR_DOC = "andreasmadsen/efficient_mlm_m0.40" _CONFIG_FOR_DOC = "RobertaPreLayerNormConfig" -TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "andreasmadsen/efficient_mlm_m0.15", - "andreasmadsen/efficient_mlm_m0.20", - "andreasmadsen/efficient_mlm_m0.30", - "andreasmadsen/efficient_mlm_m0.40", - "andreasmadsen/efficient_mlm_m0.50", - "andreasmadsen/efficient_mlm_m0.60", - "andreasmadsen/efficient_mlm_m0.70", - "andreasmadsen/efficient_mlm_m0.80", - # See all RoBERTaWithPreLayerNorm models at https://huggingface.co/models?filter=roberta_with_prelayernorm -] - # Copied from transformers.models.roberta.modeling_tf_roberta.TFRobertaEmbeddings with Roberta->RobertaPreLayerNorm class TFRobertaPreLayerNormEmbeddings(keras.layers.Layer): diff --git a/src/transformers/models/roc_bert/__init__.py b/src/transformers/models/roc_bert/__init__.py index 344bcfa41654d1..9971c53975d49a 100644 --- a/src/transformers/models/roc_bert/__init__.py +++ b/src/transformers/models/roc_bert/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_roc_bert": ["ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoCBertConfig"], + "configuration_roc_bert": ["RoCBertConfig"], "tokenization_roc_bert": ["RoCBertTokenizer"], } @@ -36,7 +36,6 @@ pass else: _import_structure["modeling_roc_bert"] = [ - "ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RoCBertForCausalLM", "RoCBertForMaskedLM", "RoCBertForMultipleChoice", @@ -51,7 +50,7 @@ ] if TYPE_CHECKING: - from .configuration_roc_bert import ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RoCBertConfig + from .configuration_roc_bert import RoCBertConfig from .tokenization_roc_bert import RoCBertTokenizer try: @@ -69,7 +68,6 @@ pass else: from .modeling_roc_bert import ( - ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, RoCBertForCausalLM, RoCBertForMaskedLM, RoCBertForMultipleChoice, diff --git a/src/transformers/models/roc_bert/configuration_roc_bert.py b/src/transformers/models/roc_bert/configuration_roc_bert.py index 6a8dfd9e835b98..752c791cf91f7a 100644 --- a/src/transformers/models/roc_bert/configuration_roc_bert.py +++ b/src/transformers/models/roc_bert/configuration_roc_bert.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "weiweishi/roc-bert-base-zh": "https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json", -} - class RoCBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/roc_bert/modeling_roc_bert.py b/src/transformers/models/roc_bert/modeling_roc_bert.py index f3de92fed38941..6a060b412f5d50 100644 --- a/src/transformers/models/roc_bert/modeling_roc_bert.py +++ b/src/transformers/models/roc_bert/modeling_roc_bert.py @@ -72,10 +72,6 @@ _QA_TARGET_END_INDEX = 15 # Maske language modeling -ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "weiweishi/roc-bert-base-zh", - # See all RoCBert models at https://huggingface.co/models?filter=roc_bert -] # Copied from transformers.models.bert.modeling_bert.load_tf_weights_in_bert with bert->roc_bert diff --git a/src/transformers/models/roc_bert/tokenization_roc_bert.py b/src/transformers/models/roc_bert/tokenization_roc_bert.py index 0bbdc04e536ec4..85e1cd1d3228af 100644 --- a/src/transformers/models/roc_bert/tokenization_roc_bert.py +++ b/src/transformers/models/roc_bert/tokenization_roc_bert.py @@ -47,28 +47,6 @@ "word_pronunciation_file": "word_pronunciation.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "weiweishi/roc-bert-base-zh": "https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/vocab.txt" - }, - "word_shape_file": { - "weiweishi/roc-bert-base-zh": "https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/word_shape.json" - }, - "word_pronunciation_file": { - "weiweishi/roc-bert-base-zh": ( - "https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/word_pronunciation.json" - ) - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "weiweishi/roc-bert-base-zh": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "weiweishi/roc-bert-base-zh": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -135,9 +113,6 @@ class RoCBertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/roformer/__init__.py b/src/transformers/models/roformer/__init__.py index 93c86eb081fa03..d9642eba59fe26 100644 --- a/src/transformers/models/roformer/__init__.py +++ b/src/transformers/models/roformer/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_roformer": ["ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoFormerConfig", "RoFormerOnnxConfig"], + "configuration_roformer": ["RoFormerConfig", "RoFormerOnnxConfig"], "tokenization_roformer": ["RoFormerTokenizer"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_roformer"] = [ - "ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "RoFormerForCausalLM", "RoFormerForMaskedLM", "RoFormerForMultipleChoice", @@ -64,7 +63,6 @@ pass else: _import_structure["modeling_tf_roformer"] = [ - "TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRoFormerForCausalLM", "TFRoFormerForMaskedLM", "TFRoFormerForMultipleChoice", @@ -84,7 +82,6 @@ pass else: _import_structure["modeling_flax_roformer"] = [ - "FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaxRoFormerForMaskedLM", "FlaxRoFormerForMultipleChoice", "FlaxRoFormerForQuestionAnswering", @@ -96,7 +93,7 @@ if TYPE_CHECKING: - from .configuration_roformer import ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, RoFormerConfig, RoFormerOnnxConfig + from .configuration_roformer import RoFormerConfig, RoFormerOnnxConfig from .tokenization_roformer import RoFormerTokenizer try: @@ -114,7 +111,6 @@ pass else: from .modeling_roformer import ( - ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, RoFormerForCausalLM, RoFormerForMaskedLM, RoFormerForMultipleChoice, @@ -134,7 +130,6 @@ pass else: from .modeling_tf_roformer import ( - TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFRoFormerForCausalLM, TFRoFormerForMaskedLM, TFRoFormerForMultipleChoice, @@ -153,7 +148,6 @@ pass else: from .modeling_flax_roformer import ( - FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, FlaxRoFormerForMaskedLM, FlaxRoFormerForMultipleChoice, FlaxRoFormerForQuestionAnswering, diff --git a/src/transformers/models/roformer/configuration_roformer.py b/src/transformers/models/roformer/configuration_roformer.py index 89875db7702e47..0732c3a9e09061 100644 --- a/src/transformers/models/roformer/configuration_roformer.py +++ b/src/transformers/models/roformer/configuration_roformer.py @@ -24,24 +24,6 @@ logger = logging.get_logger(__name__) -ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/config.json", - "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/config.json", - "junnyu/roformer_chinese_char_small": ( - "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/config.json" - ), - "junnyu/roformer_chinese_char_base": ( - "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/config.json" - ), - "junnyu/roformer_small_discriminator": ( - "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/config.json" - ), - "junnyu/roformer_small_generator": ( - "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/config.json" - ), - # See all RoFormer models at https://huggingface.co/models?filter=roformer -} - class RoFormerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/roformer/modeling_flax_roformer.py b/src/transformers/models/roformer/modeling_flax_roformer.py index 10a9bdece68cdb..6e154b311d4d46 100644 --- a/src/transformers/models/roformer/modeling_flax_roformer.py +++ b/src/transformers/models/roformer/modeling_flax_roformer.py @@ -43,16 +43,6 @@ _CHECKPOINT_FOR_DOC = "junnyu/roformer_chinese_base" _CONFIG_FOR_DOC = "RoFormerConfig" -FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "junnyu/roformer_chinese_small", - "junnyu/roformer_chinese_base", - "junnyu/roformer_chinese_char_small", - "junnyu/roformer_chinese_char_base", - "junnyu/roformer_small_discriminator", - "junnyu/roformer_small_generator", - # See all RoFormer models at https://huggingface.co/models?filter=roformer -] - ROFORMER_START_DOCSTRING = r""" diff --git a/src/transformers/models/roformer/modeling_roformer.py b/src/transformers/models/roformer/modeling_roformer.py index 7aa9a0b12d7d30..0a6335c6d06649 100644 --- a/src/transformers/models/roformer/modeling_roformer.py +++ b/src/transformers/models/roformer/modeling_roformer.py @@ -52,16 +52,6 @@ _CHECKPOINT_FOR_DOC = "junnyu/roformer_chinese_base" _CONFIG_FOR_DOC = "RoFormerConfig" -ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "junnyu/roformer_chinese_small", - "junnyu/roformer_chinese_base", - "junnyu/roformer_chinese_char_small", - "junnyu/roformer_chinese_char_base", - "junnyu/roformer_small_discriminator", - "junnyu/roformer_small_generator", - # See all RoFormer models at https://huggingface.co/models?filter=roformer -] - # Copied from transformers.models.marian.modeling_marian.MarianSinusoidalPositionalEmbedding with Marian->RoFormer class RoFormerSinusoidalPositionalEmbedding(nn.Embedding): diff --git a/src/transformers/models/roformer/modeling_tf_roformer.py b/src/transformers/models/roformer/modeling_tf_roformer.py index eb52a0993444e6..e3f84cc78aa23a 100644 --- a/src/transformers/models/roformer/modeling_tf_roformer.py +++ b/src/transformers/models/roformer/modeling_tf_roformer.py @@ -64,16 +64,6 @@ _CHECKPOINT_FOR_DOC = "junnyu/roformer_chinese_base" _CONFIG_FOR_DOC = "RoFormerConfig" -TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "junnyu/roformer_chinese_small", - "junnyu/roformer_chinese_base", - "junnyu/roformer_chinese_char_small", - "junnyu/roformer_chinese_char_base", - "junnyu/roformer_small_discriminator", - "junnyu/roformer_small_generator", - # See all RoFormer models at https://huggingface.co/models?filter=roformer -] - class TFRoFormerSinusoidalPositionalEmbedding(keras.layers.Layer): """This module produces sinusoidal positional embeddings of any length.""" diff --git a/src/transformers/models/roformer/tokenization_roformer.py b/src/transformers/models/roformer/tokenization_roformer.py index 27a7281600a328..ebaf8e56b1f519 100644 --- a/src/transformers/models/roformer/tokenization_roformer.py +++ b/src/transformers/models/roformer/tokenization_roformer.py @@ -27,44 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/vocab.txt", - "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/vocab.txt", - "junnyu/roformer_chinese_char_small": ( - "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/vocab.txt" - ), - "junnyu/roformer_chinese_char_base": ( - "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/vocab.txt" - ), - "junnyu/roformer_small_discriminator": ( - "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/vocab.txt" - ), - "junnyu/roformer_small_generator": ( - "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "junnyu/roformer_chinese_small": 1536, - "junnyu/roformer_chinese_base": 1536, - "junnyu/roformer_chinese_char_small": 512, - "junnyu/roformer_chinese_char_base": 512, - "junnyu/roformer_small_discriminator": 128, - "junnyu/roformer_small_generator": 128, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "junnyu/roformer_chinese_small": {"do_lower_case": True}, - "junnyu/roformer_chinese_base": {"do_lower_case": True}, - "junnyu/roformer_chinese_char_small": {"do_lower_case": True}, - "junnyu/roformer_chinese_char_base": {"do_lower_case": True}, - "junnyu/roformer_small_discriminator": {"do_lower_case": True}, - "junnyu/roformer_small_generator": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -360,9 +322,6 @@ class RoFormerTokenizer(PreTrainedTokenizer): ```""" vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION def __init__( self, diff --git a/src/transformers/models/roformer/tokenization_roformer_fast.py b/src/transformers/models/roformer/tokenization_roformer_fast.py index bed5935e90f308..1f073c03a545a8 100644 --- a/src/transformers/models/roformer/tokenization_roformer_fast.py +++ b/src/transformers/models/roformer/tokenization_roformer_fast.py @@ -29,44 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/vocab.txt", - "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/vocab.txt", - "junnyu/roformer_chinese_char_small": ( - "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/vocab.txt" - ), - "junnyu/roformer_chinese_char_base": ( - "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/vocab.txt" - ), - "junnyu/roformer_small_discriminator": ( - "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/vocab.txt" - ), - "junnyu/roformer_small_generator": ( - "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "junnyu/roformer_chinese_small": 1536, - "junnyu/roformer_chinese_base": 1536, - "junnyu/roformer_chinese_char_small": 512, - "junnyu/roformer_chinese_char_base": 512, - "junnyu/roformer_small_discriminator": 128, - "junnyu/roformer_small_generator": 128, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "junnyu/roformer_chinese_small": {"do_lower_case": True}, - "junnyu/roformer_chinese_base": {"do_lower_case": True}, - "junnyu/roformer_chinese_char_small": {"do_lower_case": True}, - "junnyu/roformer_chinese_char_base": {"do_lower_case": True}, - "junnyu/roformer_small_discriminator": {"do_lower_case": True}, - "junnyu/roformer_small_generator": {"do_lower_case": True}, -} - class RoFormerTokenizerFast(PreTrainedTokenizerFast): r""" @@ -89,9 +51,6 @@ class RoFormerTokenizerFast(PreTrainedTokenizerFast): ```""" vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION slow_tokenizer_class = RoFormerTokenizer def __init__( diff --git a/src/transformers/models/rwkv/__init__.py b/src/transformers/models/rwkv/__init__.py index e68eefe9f8aaa5..2cbfd94bac7bb1 100644 --- a/src/transformers/models/rwkv/__init__.py +++ b/src/transformers/models/rwkv/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_rwkv": ["RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP", "RwkvConfig", "RwkvOnnxConfig"], + "configuration_rwkv": ["RwkvConfig", "RwkvOnnxConfig"], } try: @@ -32,7 +32,6 @@ pass else: _import_structure["modeling_rwkv"] = [ - "RWKV_PRETRAINED_MODEL_ARCHIVE_LIST", "RwkvForCausalLM", "RwkvModel", "RwkvPreTrainedModel", @@ -40,7 +39,7 @@ if TYPE_CHECKING: - from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig + from .configuration_rwkv import RwkvConfig, RwkvOnnxConfig try: if not is_torch_available(): @@ -49,7 +48,6 @@ pass else: from .modeling_rwkv import ( - RWKV_PRETRAINED_MODEL_ARCHIVE_LIST, RwkvForCausalLM, RwkvModel, RwkvPreTrainedModel, diff --git a/src/transformers/models/rwkv/configuration_rwkv.py b/src/transformers/models/rwkv/configuration_rwkv.py index 6e82a59935dcef..c163751d503f8f 100644 --- a/src/transformers/models/rwkv/configuration_rwkv.py +++ b/src/transformers/models/rwkv/configuration_rwkv.py @@ -21,19 +21,6 @@ logger = logging.get_logger(__name__) -RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "RWKV/rwkv-4-169m-pile": "https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json", - "RWKV/rwkv-4-430m-pile": "https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json", - "RWKV/rwkv-4-1b5-pile": "https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json", - "RWKV/rwkv-4-3b-pile": "https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json", - "RWKV/rwkv-4-7b-pile": "https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json", - "RWKV/rwkv-4-14b-pile": "https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json", - "RWKV/rwkv-raven-1b5": "https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json", - "RWKV/rwkv-raven-3b": "https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json", - "RWKV/rwkv-raven-7b": "https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json", - "RWKV/rwkv-raven-14b": "https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json", -} - class RwkvConfig(PretrainedConfig): """ diff --git a/src/transformers/models/rwkv/modeling_rwkv.py b/src/transformers/models/rwkv/modeling_rwkv.py index e6dfa46f2a0539..d9e4bfadf32013 100644 --- a/src/transformers/models/rwkv/modeling_rwkv.py +++ b/src/transformers/models/rwkv/modeling_rwkv.py @@ -44,20 +44,6 @@ _CHECKPOINT_FOR_DOC = "RWKV/rwkv-4-169m-pile" _CONFIG_FOR_DOC = "RwkvConfig" -RWKV_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "RWKV/rwkv-4-169m-pile", - "RWKV/rwkv-4-430m-pile", - "RWKV/rwkv-4-1b5-pile", - "RWKV/rwkv-4-3b-pile", - "RWKV/rwkv-4-7b-pile", - "RWKV/rwkv-4-14b-pile", - "RWKV/rwkv-raven-1b5", - "RWKV/rwkv-raven-3b", - "RWKV/rwkv-raven-7b", - "RWKV/rwkv-raven-14b", - # See all RWKV models at https://huggingface.co/models?filter=rwkv -] - rwkv_cuda_kernel = None diff --git a/src/transformers/models/sam/__init__.py b/src/transformers/models/sam/__init__.py index e8006e89e0f11d..672281440c1ae9 100644 --- a/src/transformers/models/sam/__init__.py +++ b/src/transformers/models/sam/__init__.py @@ -24,7 +24,6 @@ _import_structure = { "configuration_sam": [ - "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP", "SamConfig", "SamMaskDecoderConfig", "SamPromptEncoderConfig", @@ -41,7 +40,6 @@ pass else: _import_structure["modeling_sam"] = [ - "SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "SamModel", "SamPreTrainedModel", ] @@ -52,7 +50,6 @@ pass else: _import_structure["modeling_tf_sam"] = [ - "TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSamModel", "TFSamPreTrainedModel", ] @@ -67,7 +64,6 @@ if TYPE_CHECKING: from .configuration_sam import ( - SAM_PRETRAINED_CONFIG_ARCHIVE_MAP, SamConfig, SamMaskDecoderConfig, SamPromptEncoderConfig, @@ -81,7 +77,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel + from .modeling_sam import SamModel, SamPreTrainedModel try: if not is_tf_available(): @@ -89,7 +85,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel + from .modeling_tf_sam import TFSamModel, TFSamPreTrainedModel try: if not is_vision_available(): diff --git a/src/transformers/models/sam/configuration_sam.py b/src/transformers/models/sam/configuration_sam.py index 2eb75e122e64e9..63dc5ff6307941 100644 --- a/src/transformers/models/sam/configuration_sam.py +++ b/src/transformers/models/sam/configuration_sam.py @@ -21,12 +21,6 @@ logger = logging.get_logger(__name__) -SAM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/sam-vit-huge": "https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json", - "facebook/sam-vit-large": "https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json", - "facebook/sam-vit-base": "https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json", -} - class SamPromptEncoderConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/sam/modeling_sam.py b/src/transformers/models/sam/modeling_sam.py index 7fc9e670ce9b29..32774733911f93 100644 --- a/src/transformers/models/sam/modeling_sam.py +++ b/src/transformers/models/sam/modeling_sam.py @@ -37,13 +37,6 @@ _CONFIG_FOR_DOC = "SamConfig" _CHECKPOINT_FOR_DOC = "facebook/sam-vit-huge" -SAM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/sam-vit-huge", - "facebook/sam-vit-large", - "facebook/sam-vit-base", - # See all SAM models at https://huggingface.co/models?filter=sam -] - @dataclass class SamVisionEncoderOutput(ModelOutput): diff --git a/src/transformers/models/sam/modeling_tf_sam.py b/src/transformers/models/sam/modeling_tf_sam.py index db7b9d32cdfdbc..5da1293e0f4d74 100644 --- a/src/transformers/models/sam/modeling_tf_sam.py +++ b/src/transformers/models/sam/modeling_tf_sam.py @@ -40,13 +40,6 @@ _CONFIG_FOR_DOC = "SamConfig" _CHECKPOINT_FOR_DOC = "facebook/sam-vit-huge" -TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/sam-vit-huge", - "facebook/sam-vit-large", - "facebook/sam-vit-base", - # See all SAM models at https://huggingface.co/models?filter=sam -] - @dataclass class TFSamVisionEncoderOutput(ModelOutput): diff --git a/src/transformers/models/seamless_m4t/__init__.py b/src/transformers/models/seamless_m4t/__init__.py index 3167311a5a6ef7..56b04e76b62ca6 100644 --- a/src/transformers/models/seamless_m4t/__init__.py +++ b/src/transformers/models/seamless_m4t/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_seamless_m4t": ["SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP", "SeamlessM4TConfig"], + "configuration_seamless_m4t": ["SeamlessM4TConfig"], "feature_extraction_seamless_m4t": ["SeamlessM4TFeatureExtractor"], "processing_seamless_m4t": ["SeamlessM4TProcessor"], } @@ -51,7 +51,6 @@ pass else: _import_structure["modeling_seamless_m4t"] = [ - "SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4TForTextToSpeech", "SeamlessM4TForSpeechToSpeech", "SeamlessM4TForTextToText", @@ -65,7 +64,7 @@ ] if TYPE_CHECKING: - from .configuration_seamless_m4t import SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4TConfig + from .configuration_seamless_m4t import SeamlessM4TConfig from .feature_extraction_seamless_m4t import SeamlessM4TFeatureExtractor from .processing_seamless_m4t import SeamlessM4TProcessor @@ -92,7 +91,6 @@ pass else: from .modeling_seamless_m4t import ( - SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4TCodeHifiGan, SeamlessM4TForSpeechToSpeech, SeamlessM4TForSpeechToText, diff --git a/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py b/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py index b4407ed74112f1..2075c65fa89abe 100644 --- a/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py +++ b/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/hf-seamless-m4t-medium": "https://huggingface.co/facebook/hf-seamless-m4t-medium/resolve/main/config.json", - # See all SeamlessM4T models at https://huggingface.co/models?filter=seamless_m4t -} - class SeamlessM4TConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py b/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py index 6b00754930b333..6d0c7b1a5d39f6 100755 --- a/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py +++ b/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py @@ -50,15 +50,6 @@ _CHECKPOINT_FOR_DOC = "facebook/hf-seamless-m4t-medium" _CONFIG_FOR_DOC = "SeamlessM4TConfig" -SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/hf-seamless-m4t-medium", - # See all SeamlessM4T models at https://huggingface.co/models?filter=seamless_m4t -] - -SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = { - "microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json", -} - @dataclass class SeamlessM4TGenerationOutput(ModelOutput): diff --git a/src/transformers/models/seamless_m4t/tokenization_seamless_m4t.py b/src/transformers/models/seamless_m4t/tokenization_seamless_m4t.py index 99dd1f0955063c..bb6beb760a0e14 100644 --- a/src/transformers/models/seamless_m4t/tokenization_seamless_m4t.py +++ b/src/transformers/models/seamless_m4t/tokenization_seamless_m4t.py @@ -32,13 +32,6 @@ logger = logging.get_logger(__name__) -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/hf-seamless-m4t-medium": ( - "https://huggingface.co/facebook/hf-seamless-m4t-medium/blob/main/sentencepiece.bpe.model" - ), - } -} SPIECE_UNDERLINE = "▁" @@ -46,11 +39,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/hf-seamless-m4t-medium": 2048, -} - - class SeamlessM4TTokenizer(PreTrainedTokenizer): """ Construct a SeamlessM4T tokenizer. @@ -126,8 +114,6 @@ class SeamlessM4TTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/seamless_m4t/tokenization_seamless_m4t_fast.py b/src/transformers/models/seamless_m4t/tokenization_seamless_m4t_fast.py index b7bedfb38a6295..a236db3cb57cf3 100644 --- a/src/transformers/models/seamless_m4t/tokenization_seamless_m4t_fast.py +++ b/src/transformers/models/seamless_m4t/tokenization_seamless_m4t_fast.py @@ -37,19 +37,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/hf-seamless-m4t-medium": "https://huggingface.co/facebook/hf-seamless-m4t-medium/resolve/main/vocab.txt", - }, - "tokenizer_file": { - "facebook/hf-seamless-m4t-medium": "https://huggingface.co/facebook/hf-seamless-m4t-medium/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/hf-seamless-m4t-medium": 2048, -} - class SeamlessM4TTokenizerFast(PreTrainedTokenizerFast): """ @@ -121,8 +108,6 @@ class SeamlessM4TTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = SeamlessM4TTokenizer model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/seamless_m4t_v2/__init__.py b/src/transformers/models/seamless_m4t_v2/__init__.py index ebc4caef2da10a..5fde6a5d332a39 100644 --- a/src/transformers/models/seamless_m4t_v2/__init__.py +++ b/src/transformers/models/seamless_m4t_v2/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_seamless_m4t_v2": ["SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "SeamlessM4Tv2Config"], + "configuration_seamless_m4t_v2": ["SeamlessM4Tv2Config"], } try: @@ -31,7 +31,6 @@ pass else: _import_structure["modeling_seamless_m4t_v2"] = [ - "SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4Tv2ForTextToSpeech", "SeamlessM4Tv2ForSpeechToSpeech", "SeamlessM4Tv2ForTextToText", @@ -41,7 +40,7 @@ ] if TYPE_CHECKING: - from .configuration_seamless_m4t_v2 import SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4Tv2Config + from .configuration_seamless_m4t_v2 import SeamlessM4Tv2Config try: if not is_torch_available(): @@ -50,7 +49,6 @@ pass else: from .modeling_seamless_m4t_v2 import ( - SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4Tv2ForSpeechToSpeech, SeamlessM4Tv2ForSpeechToText, SeamlessM4Tv2ForTextToSpeech, diff --git a/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py b/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py index 28c521f6a589b8..051a86cba1e96c 100644 --- a/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py +++ b/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "": "https://huggingface.co//resolve/main/config.json", -} - class SeamlessM4Tv2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py b/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py index fd64051f6c57b7..a0fa7c234cc05c 100644 --- a/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py +++ b/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py @@ -50,16 +50,6 @@ _CHECKPOINT_FOR_DOC = "" _CONFIG_FOR_DOC = "SeamlessM4Tv2Config" -SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/seamless-m4t-v2-large", - # See all SeamlessM4T-v2 models at https://huggingface.co/models?filter=seamless_m4t_v2 -] - - -SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = { - "microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json", -} - @dataclass # Copied from transformers.models.seamless_m4t.modeling_seamless_m4t.SeamlessM4TGenerationOutput with SeamlessM4T->SeamlessM4Tv2 diff --git a/src/transformers/models/segformer/__init__.py b/src/transformers/models/segformer/__init__.py index 22dc3655b889b5..8d8cccdf39ff42 100644 --- a/src/transformers/models/segformer/__init__.py +++ b/src/transformers/models/segformer/__init__.py @@ -22,9 +22,7 @@ ) -_import_structure = { - "configuration_segformer": ["SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegformerConfig", "SegformerOnnxConfig"] -} +_import_structure = {"configuration_segformer": ["SegformerConfig", "SegformerOnnxConfig"]} try: if not is_vision_available(): @@ -42,7 +40,6 @@ pass else: _import_structure["modeling_segformer"] = [ - "SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SegformerDecodeHead", "SegformerForImageClassification", "SegformerForSemanticSegmentation", @@ -58,7 +55,6 @@ pass else: _import_structure["modeling_tf_segformer"] = [ - "TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSegformerDecodeHead", "TFSegformerForImageClassification", "TFSegformerForSemanticSegmentation", @@ -68,7 +64,7 @@ if TYPE_CHECKING: - from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig + from .configuration_segformer import SegformerConfig, SegformerOnnxConfig try: if not is_vision_available(): @@ -86,7 +82,6 @@ pass else: from .modeling_segformer import ( - SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SegformerDecodeHead, SegformerForImageClassification, SegformerForSemanticSegmentation, @@ -101,7 +96,6 @@ pass else: from .modeling_tf_segformer import ( - TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFSegformerDecodeHead, TFSegformerForImageClassification, TFSegformerForSemanticSegmentation, diff --git a/src/transformers/models/segformer/configuration_segformer.py b/src/transformers/models/segformer/configuration_segformer.py index ad1c2053295b1f..6aadb64b6fe683 100644 --- a/src/transformers/models/segformer/configuration_segformer.py +++ b/src/transformers/models/segformer/configuration_segformer.py @@ -27,13 +27,6 @@ logger = logging.get_logger(__name__) -SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "nvidia/segformer-b0-finetuned-ade-512-512": ( - "https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json" - ), - # See all SegFormer models at https://huggingface.co/models?filter=segformer -} - class SegformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/segformer/modeling_segformer.py b/src/transformers/models/segformer/modeling_segformer.py index 47f42b5e0ed5de..d47219a0bd0d23 100755 --- a/src/transformers/models/segformer/modeling_segformer.py +++ b/src/transformers/models/segformer/modeling_segformer.py @@ -51,11 +51,6 @@ _IMAGE_CLASS_CHECKPOINT = "nvidia/mit-b0" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "nvidia/segformer-b0-finetuned-ade-512-512", - # See all SegFormer models at https://huggingface.co/models?filter=segformer -] - class SegFormerImageClassifierOutput(ImageClassifierOutput): """ diff --git a/src/transformers/models/segformer/modeling_tf_segformer.py b/src/transformers/models/segformer/modeling_tf_segformer.py index 75c8ee2b398b8b..0657f1b437e525 100644 --- a/src/transformers/models/segformer/modeling_tf_segformer.py +++ b/src/transformers/models/segformer/modeling_tf_segformer.py @@ -55,11 +55,6 @@ _IMAGE_CLASS_CHECKPOINT = "nvidia/mit-b0" _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "nvidia/segformer-b0-finetuned-ade-512-512", - # See all SegFormer models at https://huggingface.co/models?filter=segformer -] - # Copied from transformers.models.convnext.modeling_tf_convnext.TFConvNextDropPath with ConvNext->Segformer class TFSegformerDropPath(keras.layers.Layer): diff --git a/src/transformers/models/seggpt/__init__.py b/src/transformers/models/seggpt/__init__.py index 49649c92865da6..b6095b53277ae0 100644 --- a/src/transformers/models/seggpt/__init__.py +++ b/src/transformers/models/seggpt/__init__.py @@ -16,9 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = { - "configuration_seggpt": ["SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegGptConfig", "SegGptOnnxConfig"] -} +_import_structure = {"configuration_seggpt": ["SegGptConfig", "SegGptOnnxConfig"]} try: if not is_torch_available(): @@ -27,7 +25,6 @@ pass else: _import_structure["modeling_seggpt"] = [ - "SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "SegGptModel", "SegGptPreTrainedModel", "SegGptForImageSegmentation", @@ -42,7 +39,7 @@ _import_structure["image_processing_seggpt"] = ["SegGptImageProcessor"] if TYPE_CHECKING: - from .configuration_seggpt import SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, SegGptConfig, SegGptOnnxConfig + from .configuration_seggpt import SegGptConfig, SegGptOnnxConfig try: if not is_torch_available(): @@ -51,7 +48,6 @@ pass else: from .modeling_seggpt import ( - SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST, SegGptForImageSegmentation, SegGptModel, SegGptPreTrainedModel, diff --git a/src/transformers/models/seggpt/configuration_seggpt.py b/src/transformers/models/seggpt/configuration_seggpt.py index 37c81f10323a2f..bac482e97f875d 100644 --- a/src/transformers/models/seggpt/configuration_seggpt.py +++ b/src/transformers/models/seggpt/configuration_seggpt.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "BAAI/seggpt-vit-large": "https://huggingface.co/BAAI/seggpt-vit-large/resolve/main/config.json", -} - class SegGptConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/seggpt/modeling_seggpt.py b/src/transformers/models/seggpt/modeling_seggpt.py index 87175fdf38ce6e..df887a189134fd 100644 --- a/src/transformers/models/seggpt/modeling_seggpt.py +++ b/src/transformers/models/seggpt/modeling_seggpt.py @@ -47,12 +47,6 @@ _EXPECTED_OUTPUT_SHAPE = [3, 896, 448] -SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "BAAI/seggpt-vit-large", - # See all SegGpt models at https://huggingface.co/models?filter=seggpt -] - - @dataclass class SegGptEncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/sew/__init__.py b/src/transformers/models/sew/__init__.py index bd43be68b7c053..aba88cc45133c2 100644 --- a/src/transformers/models/sew/__init__.py +++ b/src/transformers/models/sew/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_sew": ["SEW_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWConfig"]} +_import_structure = {"configuration_sew": ["SEWConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_sew"] = [ - "SEW_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWForCTC", "SEWForSequenceClassification", "SEWModel", @@ -33,7 +32,7 @@ ] if TYPE_CHECKING: - from .configuration_sew import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWConfig + from .configuration_sew import SEWConfig try: if not is_torch_available(): @@ -42,7 +41,6 @@ pass else: from .modeling_sew import ( - SEW_PRETRAINED_MODEL_ARCHIVE_LIST, SEWForCTC, SEWForSequenceClassification, SEWModel, diff --git a/src/transformers/models/sew/configuration_sew.py b/src/transformers/models/sew/configuration_sew.py index f5db6fd2c1044a..33ea6d374fa71b 100644 --- a/src/transformers/models/sew/configuration_sew.py +++ b/src/transformers/models/sew/configuration_sew.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -SEW_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "asapp/sew-tiny-100k": "https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json", - # See all SEW models at https://huggingface.co/models?filter=sew -} - class SEWConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/sew/modeling_sew.py b/src/transformers/models/sew/modeling_sew.py index a5ebb9b2bb4245..d5d6963a0c7162 100644 --- a/src/transformers/models/sew/modeling_sew.py +++ b/src/transformers/models/sew/modeling_sew.py @@ -55,13 +55,6 @@ _SEQ_CLASS_EXPECTED_OUTPUT = "'_unknown_'" _SEQ_CLASS_EXPECTED_LOSS = 9.52 -SEW_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "asapp/sew-tiny-100k", - "asapp/sew-small-100k", - "asapp/sew-mid-100k", - # See all SEW models at https://huggingface.co/models?filter=sew -] - # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( diff --git a/src/transformers/models/sew_d/__init__.py b/src/transformers/models/sew_d/__init__.py index ab1dd5284a32e4..c99be845d544b5 100644 --- a/src/transformers/models/sew_d/__init__.py +++ b/src/transformers/models/sew_d/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_sew_d": ["SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWDConfig"]} +_import_structure = {"configuration_sew_d": ["SEWDConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_sew_d"] = [ - "SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWDForCTC", "SEWDForSequenceClassification", "SEWDModel", @@ -33,7 +32,7 @@ ] if TYPE_CHECKING: - from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig + from .configuration_sew_d import SEWDConfig try: if not is_torch_available(): @@ -42,7 +41,6 @@ pass else: from .modeling_sew_d import ( - SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST, SEWDForCTC, SEWDForSequenceClassification, SEWDModel, diff --git a/src/transformers/models/sew_d/configuration_sew_d.py b/src/transformers/models/sew_d/configuration_sew_d.py index 2f08ff81f50e46..aa4b60edc7e059 100644 --- a/src/transformers/models/sew_d/configuration_sew_d.py +++ b/src/transformers/models/sew_d/configuration_sew_d.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "asapp/sew-d-tiny-100k": "https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json", - # See all SEW-D models at https://huggingface.co/models?filter=sew-d -} - class SEWDConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/sew_d/modeling_sew_d.py b/src/transformers/models/sew_d/modeling_sew_d.py index 8e890f207d410a..342ea70a7f7e4c 100644 --- a/src/transformers/models/sew_d/modeling_sew_d.py +++ b/src/transformers/models/sew_d/modeling_sew_d.py @@ -55,19 +55,6 @@ _SEQ_CLASS_EXPECTED_OUTPUT = "'_unknown_'" _SEQ_CLASS_EXPECTED_LOSS = 3.16 -SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "asapp/sew-d-tiny-100k", - "asapp/sew-d-small-100k", - "asapp/sew-d-mid-100k", - "asapp/sew-d-mid-k127-100k", - "asapp/sew-d-base-100k", - "asapp/sew-d-base-plus-100k", - "asapp/sew-d-mid-400k", - "asapp/sew-d-mid-k127-400k", - "asapp/sew-d-base-plus-400k", - # See all SEW models at https://huggingface.co/models?filter=sew-d -] - # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( diff --git a/src/transformers/models/siglip/__init__.py b/src/transformers/models/siglip/__init__.py index ff44d5cbf14b3c..96ce20e7f230bf 100644 --- a/src/transformers/models/siglip/__init__.py +++ b/src/transformers/models/siglip/__init__.py @@ -24,7 +24,6 @@ _import_structure = { "configuration_siglip": [ - "SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "SiglipConfig", "SiglipTextConfig", "SiglipVisionConfig", @@ -56,7 +55,6 @@ pass else: _import_structure["modeling_siglip"] = [ - "SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "SiglipModel", "SiglipPreTrainedModel", "SiglipTextModel", @@ -67,7 +65,6 @@ if TYPE_CHECKING: from .configuration_siglip import ( - SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, SiglipConfig, SiglipTextConfig, SiglipVisionConfig, @@ -97,7 +94,6 @@ pass else: from .modeling_siglip import ( - SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST, SiglipForImageClassification, SiglipModel, SiglipPreTrainedModel, diff --git a/src/transformers/models/siglip/configuration_siglip.py b/src/transformers/models/siglip/configuration_siglip.py index 990bad7ace3808..7692f79abb333e 100644 --- a/src/transformers/models/siglip/configuration_siglip.py +++ b/src/transformers/models/siglip/configuration_siglip.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/siglip-base-patch16-224": "https://huggingface.co/google/siglip-base-patch16-224/resolve/main/config.json", -} - class SiglipTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/siglip/modeling_siglip.py b/src/transformers/models/siglip/modeling_siglip.py index 07f6dd67210aed..17e7a641eb542b 100644 --- a/src/transformers/models/siglip/modeling_siglip.py +++ b/src/transformers/models/siglip/modeling_siglip.py @@ -53,12 +53,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "LABEL_1" -SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/siglip-base-patch16-224", - # See all SigLIP models at https://huggingface.co/models?filter=siglip -] - - def _trunc_normal_(tensor, mean, std, a, b): # Cut & paste from PyTorch official master until it's in a few official releases - RW # Method based on https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf diff --git a/src/transformers/models/siglip/tokenization_siglip.py b/src/transformers/models/siglip/tokenization_siglip.py index 043d1d27b8f629..41277320a37ab2 100644 --- a/src/transformers/models/siglip/tokenization_siglip.py +++ b/src/transformers/models/siglip/tokenization_siglip.py @@ -37,15 +37,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google/siglip-base-patch16-224": "https://huggingface.co/google/siglip-base-patch16-224/resolve/main/spiece.model", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google/siglip-base-patch16-224": 256, -} SPIECE_UNDERLINE = "▁" @@ -92,8 +83,6 @@ class SiglipTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/speech_to_text/__init__.py b/src/transformers/models/speech_to_text/__init__.py index 3194f99931a4d6..4ad05da69710ad 100644 --- a/src/transformers/models/speech_to_text/__init__.py +++ b/src/transformers/models/speech_to_text/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_speech_to_text": ["SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2TextConfig"], + "configuration_speech_to_text": ["Speech2TextConfig"], "feature_extraction_speech_to_text": ["Speech2TextFeatureExtractor"], "processing_speech_to_text": ["Speech2TextProcessor"], } @@ -43,7 +43,6 @@ pass else: _import_structure["modeling_tf_speech_to_text"] = [ - "TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSpeech2TextForConditionalGeneration", "TFSpeech2TextModel", "TFSpeech2TextPreTrainedModel", @@ -56,7 +55,6 @@ pass else: _import_structure["modeling_speech_to_text"] = [ - "SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "Speech2TextForConditionalGeneration", "Speech2TextModel", "Speech2TextPreTrainedModel", @@ -64,7 +62,7 @@ if TYPE_CHECKING: - from .configuration_speech_to_text import SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2TextConfig + from .configuration_speech_to_text import Speech2TextConfig from .feature_extraction_speech_to_text import Speech2TextFeatureExtractor from .processing_speech_to_text import Speech2TextProcessor @@ -83,7 +81,6 @@ pass else: from .modeling_tf_speech_to_text import ( - TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, TFSpeech2TextForConditionalGeneration, TFSpeech2TextModel, TFSpeech2TextPreTrainedModel, @@ -96,7 +93,6 @@ pass else: from .modeling_speech_to_text import ( - SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, Speech2TextForConditionalGeneration, Speech2TextModel, Speech2TextPreTrainedModel, diff --git a/src/transformers/models/speech_to_text/configuration_speech_to_text.py b/src/transformers/models/speech_to_text/configuration_speech_to_text.py index fb1a8e1b5ac2ed..2b8e3bd22e2d7b 100644 --- a/src/transformers/models/speech_to_text/configuration_speech_to_text.py +++ b/src/transformers/models/speech_to_text/configuration_speech_to_text.py @@ -20,13 +20,6 @@ logger = logging.get_logger(__name__) -SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/s2t-small-librispeech-asr": ( - "https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json" - ), - # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text -} - class Speech2TextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/speech_to_text/modeling_speech_to_text.py b/src/transformers/models/speech_to_text/modeling_speech_to_text.py index a5ec9e9fd3b737..155d6a5dfe3e62 100755 --- a/src/transformers/models/speech_to_text/modeling_speech_to_text.py +++ b/src/transformers/models/speech_to_text/modeling_speech_to_text.py @@ -44,12 +44,6 @@ _CONFIG_FOR_DOC = "Speech2TextConfig" -SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/s2t-small-librispeech-asr", - # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text -] - - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py b/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py index 927d8e09ba2fdc..91e6028332f0a9 100755 --- a/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py +++ b/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py @@ -56,12 +56,6 @@ _CHECKPOINT_FOR_DOC = "facebook/s2t-small-librispeech-asr" -TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/s2t-small-librispeech-asr", - # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text -] - - LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/speech_to_text/tokenization_speech_to_text.py b/src/transformers/models/speech_to_text/tokenization_speech_to_text.py index b7104da7f1a873..27db0a671ebc7d 100644 --- a/src/transformers/models/speech_to_text/tokenization_speech_to_text.py +++ b/src/transformers/models/speech_to_text/tokenization_speech_to_text.py @@ -34,18 +34,6 @@ "spm_file": "sentencepiece.bpe.model", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/s2t-small-librispeech-asr": ( - "https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/vocab.json" - ), - }, - "spm_file": { - "facebook/s2t-small-librispeech-asr": ( - "https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/sentencepiece.bpe.model" - ) - }, -} MAX_MODEL_INPUT_SIZES = { "facebook/s2t-small-librispeech-asr": 1024, @@ -104,8 +92,6 @@ class Speech2TextTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = MAX_MODEL_INPUT_SIZES model_input_names = ["input_ids", "attention_mask"] prefix_tokens: List[int] = [] diff --git a/src/transformers/models/speech_to_text_2/__init__.py b/src/transformers/models/speech_to_text_2/__init__.py index bf842f6006b3ec..ab507bc19f85f9 100644 --- a/src/transformers/models/speech_to_text_2/__init__.py +++ b/src/transformers/models/speech_to_text_2/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_speech_to_text_2": ["SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2Text2Config"], + "configuration_speech_to_text_2": ["Speech2Text2Config"], "processing_speech_to_text_2": ["Speech2Text2Processor"], "tokenization_speech_to_text_2": ["Speech2Text2Tokenizer"], } @@ -36,14 +36,13 @@ pass else: _import_structure["modeling_speech_to_text_2"] = [ - "SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Speech2Text2ForCausalLM", "Speech2Text2PreTrainedModel", ] if TYPE_CHECKING: - from .configuration_speech_to_text_2 import SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2Text2Config + from .configuration_speech_to_text_2 import Speech2Text2Config from .processing_speech_to_text_2 import Speech2Text2Processor from .tokenization_speech_to_text_2 import Speech2Text2Tokenizer @@ -54,7 +53,6 @@ pass else: from .modeling_speech_to_text_2 import ( - SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST, Speech2Text2ForCausalLM, Speech2Text2PreTrainedModel, ) diff --git a/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py b/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py index 5dd34cb86baae4..5c9ebbe00fb9cd 100644 --- a/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py +++ b/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py @@ -20,13 +20,6 @@ logger = logging.get_logger(__name__) -SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/s2t-wav2vec2-large-en-de": ( - "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json" - ), - # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2 -} - class Speech2Text2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py b/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py index 4f5885f8c81ef4..20f8555bd9ecb2 100755 --- a/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py +++ b/src/transformers/models/speech_to_text_2/modeling_speech_to_text_2.py @@ -37,12 +37,6 @@ _CHECKPOINT_FOR_DOC = "facebook/s2t-wav2vec2-large-en-de" -SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/s2t-wav2vec2-large-en-de", - # See all Speech2Text2 models at https://huggingface.co/models?filter=speech2text2 -] - - # Copied from transformers.models.speech_to_text.modeling_speech_to_text.Speech2TextSinusoidalPositionalEmbedding with Speech2Text->Speech2Text2 class Speech2Text2SinusoidalPositionalEmbedding(nn.Module): """This module produces sinusoidal positional embeddings of any length.""" diff --git a/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py b/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py index 074576a6c0e0b0..8d6818356f3f2a 100644 --- a/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py +++ b/src/transformers/models/speech_to_text_2/tokenization_speech_to_text_2.py @@ -31,23 +31,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/s2t-wav2vec2-large-en-de": ( - "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/vocab.json" - ), - }, - "tokenizer_config_file": { - "facebook/s2t-wav2vec2-large-en-de": ( - "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/tokenizer_config.json" - ), - }, - "merges_file": { - "facebook/s2t-wav2vec2-large-en-de": ( - "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/merges.txt" - ), - }, -} BPE_TOKEN_MERGES = "" BPE_TOKEN_VOCAB = "@@ " @@ -67,7 +50,6 @@ def get_pairs(word): # Speech2Text2 has no max input length -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"facebook/s2t-wav2vec2-large-en-de": 1024} class Speech2Text2Tokenizer(PreTrainedTokenizer): @@ -95,8 +77,6 @@ class Speech2Text2Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/speecht5/__init__.py b/src/transformers/models/speecht5/__init__.py index 20606dda51ef87..f9afe52aa4b7ab 100644 --- a/src/transformers/models/speecht5/__init__.py +++ b/src/transformers/models/speecht5/__init__.py @@ -23,8 +23,6 @@ _import_structure = { "configuration_speecht5": [ - "SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP", - "SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP", "SpeechT5Config", "SpeechT5HifiGanConfig", ], @@ -47,7 +45,6 @@ pass else: _import_structure["modeling_speecht5"] = [ - "SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST", "SpeechT5ForSpeechToText", "SpeechT5ForSpeechToSpeech", "SpeechT5ForTextToSpeech", @@ -58,8 +55,6 @@ if TYPE_CHECKING: from .configuration_speecht5 import ( - SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP, - SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP, SpeechT5Config, SpeechT5HifiGanConfig, ) @@ -81,7 +76,6 @@ pass else: from .modeling_speecht5 import ( - SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST, SpeechT5ForSpeechToSpeech, SpeechT5ForSpeechToText, SpeechT5ForTextToSpeech, diff --git a/src/transformers/models/speecht5/configuration_speecht5.py b/src/transformers/models/speecht5/configuration_speecht5.py index c7cd7d2f62ffcc..91883253032497 100644 --- a/src/transformers/models/speecht5/configuration_speecht5.py +++ b/src/transformers/models/speecht5/configuration_speecht5.py @@ -23,16 +23,6 @@ logger = logging.get_logger(__name__) -SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/speecht5_asr": "https://huggingface.co/microsoft/speecht5_asr/resolve/main/config.json", - "microsoft/speecht5_tts": "https://huggingface.co/microsoft/speecht5_tts/resolve/main/config.json", - "microsoft/speecht5_vc": "https://huggingface.co/microsoft/speecht5_vc/resolve/main/config.json", -} - -SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = { - "microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json", -} - class SpeechT5Config(PretrainedConfig): r""" diff --git a/src/transformers/models/speecht5/modeling_speecht5.py b/src/transformers/models/speecht5/modeling_speecht5.py index e9f9f1e1711e98..2217a9270329e0 100644 --- a/src/transformers/models/speecht5/modeling_speecht5.py +++ b/src/transformers/models/speecht5/modeling_speecht5.py @@ -47,14 +47,6 @@ _CONFIG_FOR_DOC = "SpeechT5Config" -SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/speecht5_asr", - "microsoft/speecht5_tts", - "microsoft/speecht5_vc", - # See all SpeechT5 models at https://huggingface.co/models?filter=speecht5 -] - - # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/speecht5/tokenization_speecht5.py b/src/transformers/models/speecht5/tokenization_speecht5.py index 9f5ed8a5e00ff1..41cb296f8f0d08 100644 --- a/src/transformers/models/speecht5/tokenization_speecht5.py +++ b/src/transformers/models/speecht5/tokenization_speecht5.py @@ -30,20 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spm_char.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/speecht5_asr": "https://huggingface.co/microsoft/speecht5_asr/resolve/main/spm_char.model", - "microsoft/speecht5_tts": "https://huggingface.co/microsoft/speecht5_tts/resolve/main/spm_char.model", - "microsoft/speecht5_vc": "https://huggingface.co/microsoft/speecht5_vc/resolve/main/spm_char.model", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/speecht5_asr": 1024, - "microsoft/speecht5_tts": 1024, - "microsoft/speecht5_vc": 1024, -} - class SpeechT5Tokenizer(PreTrainedTokenizer): """ @@ -89,8 +75,6 @@ class SpeechT5Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/splinter/__init__.py b/src/transformers/models/splinter/__init__.py index 24355c01add73b..81896fb15a5b66 100644 --- a/src/transformers/models/splinter/__init__.py +++ b/src/transformers/models/splinter/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_splinter": ["SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SplinterConfig"], + "configuration_splinter": ["SplinterConfig"], "tokenization_splinter": ["SplinterTokenizer"], } @@ -36,7 +36,6 @@ pass else: _import_structure["modeling_splinter"] = [ - "SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST", "SplinterForQuestionAnswering", "SplinterForPreTraining", "SplinterLayer", @@ -46,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_splinter import SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig + from .configuration_splinter import SplinterConfig from .tokenization_splinter import SplinterTokenizer try: @@ -64,7 +63,6 @@ pass else: from .modeling_splinter import ( - SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST, SplinterForPreTraining, SplinterForQuestionAnswering, SplinterLayer, diff --git a/src/transformers/models/splinter/configuration_splinter.py b/src/transformers/models/splinter/configuration_splinter.py index e7325f01656f12..83e78e4e4a2638 100644 --- a/src/transformers/models/splinter/configuration_splinter.py +++ b/src/transformers/models/splinter/configuration_splinter.py @@ -20,14 +20,6 @@ logger = logging.get_logger(__name__) -SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "tau/splinter-base": "https://huggingface.co/tau/splinter-base/resolve/main/config.json", - "tau/splinter-base-qass": "https://huggingface.co/tau/splinter-base-qass/resolve/main/config.json", - "tau/splinter-large": "https://huggingface.co/tau/splinter-large/resolve/main/config.json", - "tau/splinter-large-qass": "https://huggingface.co/tau/splinter-large-qass/resolve/main/config.json", - # See all Splinter models at https://huggingface.co/models?filter=splinter -} - class SplinterConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/splinter/modeling_splinter.py b/src/transformers/models/splinter/modeling_splinter.py index 75187c36b930a4..d2f4cd80e84624 100755 --- a/src/transformers/models/splinter/modeling_splinter.py +++ b/src/transformers/models/splinter/modeling_splinter.py @@ -37,14 +37,6 @@ _CHECKPOINT_FOR_DOC = "tau/splinter-base" _CONFIG_FOR_DOC = "SplinterConfig" -SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "tau/splinter-base", - "tau/splinter-base-qass", - "tau/splinter-large", - "tau/splinter-large-qass", - # See all Splinter models at https://huggingface.co/models?filter=splinter -] - class SplinterEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/splinter/tokenization_splinter.py b/src/transformers/models/splinter/tokenization_splinter.py index 909905979be38c..ee82e19c6cb9b3 100644 --- a/src/transformers/models/splinter/tokenization_splinter.py +++ b/src/transformers/models/splinter/tokenization_splinter.py @@ -28,29 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "tau/splinter-base": "https://huggingface.co/tau/splinter-base/resolve/main/vocab.txt", - "tau/splinter-base-qass": "https://huggingface.co/tau/splinter-base-qass/resolve/main/vocab.txt", - "tau/splinter-large": "https://huggingface.co/tau/splinter-large/resolve/main/vocab.txt", - "tau/splinter-large-qass": "https://huggingface.co/tau/splinter-large-qass/resolve/main/vocab.txt", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "tau/splinter-base": 512, - "tau/splinter-base-qass": 512, - "tau/splinter-large": 512, - "tau/splinter-large-qass": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "tau/splinter-base": {"do_lower_case": False}, - "tau/splinter-base-qass": {"do_lower_case": False}, - "tau/splinter-large": {"do_lower_case": False}, - "tau/splinter-large-qass": {"do_lower_case": False}, -} - def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" @@ -117,9 +94,6 @@ class SplinterTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/splinter/tokenization_splinter_fast.py b/src/transformers/models/splinter/tokenization_splinter_fast.py index 97db72caadc05c..0371fdf2828eb2 100644 --- a/src/transformers/models/splinter/tokenization_splinter_fast.py +++ b/src/transformers/models/splinter/tokenization_splinter_fast.py @@ -28,29 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "tau/splinter-base": "https://huggingface.co/tau/splinter-base/resolve/main/vocab.txt", - "tau/splinter-base-qass": "https://huggingface.co/tau/splinter-base-qass/resolve/main/vocab.txt", - "tau/splinter-large": "https://huggingface.co/tau/splinter-large/resolve/main/vocab.txt", - "tau/splinter-large-qass": "https://huggingface.co/tau/splinter-large-qass/resolve/main/vocab.txt", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "tau/splinter-base": 512, - "tau/splinter-base-qass": 512, - "tau/splinter-large": 512, - "tau/splinter-large-qass": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "tau/splinter-base": {"do_lower_case": False}, - "tau/splinter-base-qass": {"do_lower_case": False}, - "tau/splinter-large": {"do_lower_case": False}, - "tau/splinter-large-qass": {"do_lower_case": False}, -} - class SplinterTokenizerFast(PreTrainedTokenizerFast): r""" @@ -95,9 +72,6 @@ class SplinterTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = SplinterTokenizer def __init__( diff --git a/src/transformers/models/squeezebert/__init__.py b/src/transformers/models/squeezebert/__init__.py index b3af76dff7e1ac..45aff2f64c1610 100644 --- a/src/transformers/models/squeezebert/__init__.py +++ b/src/transformers/models/squeezebert/__init__.py @@ -19,7 +19,6 @@ _import_structure = { "configuration_squeezebert": [ - "SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SqueezeBertConfig", "SqueezeBertOnnxConfig", ], @@ -41,7 +40,6 @@ pass else: _import_structure["modeling_squeezebert"] = [ - "SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "SqueezeBertForMaskedLM", "SqueezeBertForMultipleChoice", "SqueezeBertForQuestionAnswering", @@ -55,7 +53,6 @@ if TYPE_CHECKING: from .configuration_squeezebert import ( - SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, SqueezeBertConfig, SqueezeBertOnnxConfig, ) @@ -76,7 +73,6 @@ pass else: from .modeling_squeezebert import ( - SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, SqueezeBertForMaskedLM, SqueezeBertForMultipleChoice, SqueezeBertForQuestionAnswering, diff --git a/src/transformers/models/squeezebert/configuration_squeezebert.py b/src/transformers/models/squeezebert/configuration_squeezebert.py index 4926a73177670d..ec79988849e4cf 100644 --- a/src/transformers/models/squeezebert/configuration_squeezebert.py +++ b/src/transformers/models/squeezebert/configuration_squeezebert.py @@ -23,16 +23,6 @@ logger = logging.get_logger(__name__) -SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "squeezebert/squeezebert-uncased": ( - "https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/config.json" - ), - "squeezebert/squeezebert-mnli": "https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/config.json", - "squeezebert/squeezebert-mnli-headless": ( - "https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/config.json" - ), -} - class SqueezeBertConfig(PretrainedConfig): r""" @@ -105,12 +95,8 @@ class SqueezeBertConfig(PretrainedConfig): >>> # Accessing the model configuration >>> configuration = model.config ``` - - Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained - checkpoints. """ - pretrained_config_archive_map = SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP model_type = "squeezebert" def __init__( diff --git a/src/transformers/models/squeezebert/modeling_squeezebert.py b/src/transformers/models/squeezebert/modeling_squeezebert.py index 0ac1260c82b007..7144ee6ca74366 100644 --- a/src/transformers/models/squeezebert/modeling_squeezebert.py +++ b/src/transformers/models/squeezebert/modeling_squeezebert.py @@ -42,12 +42,6 @@ _CHECKPOINT_FOR_DOC = "squeezebert/squeezebert-uncased" _CONFIG_FOR_DOC = "SqueezeBertConfig" -SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "squeezebert/squeezebert-uncased", - "squeezebert/squeezebert-mnli", - "squeezebert/squeezebert-mnli-headless", -] - class SqueezeBertEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/squeezebert/tokenization_squeezebert.py b/src/transformers/models/squeezebert/tokenization_squeezebert.py index c655ba8ddaa2bb..30f866770d2465 100644 --- a/src/transformers/models/squeezebert/tokenization_squeezebert.py +++ b/src/transformers/models/squeezebert/tokenization_squeezebert.py @@ -27,31 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "squeezebert/squeezebert-uncased": ( - "https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/vocab.txt" - ), - "squeezebert/squeezebert-mnli": "https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/vocab.txt", - "squeezebert/squeezebert-mnli-headless": ( - "https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "squeezebert/squeezebert-uncased": 512, - "squeezebert/squeezebert-mnli": 512, - "squeezebert/squeezebert-mnli-headless": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "squeezebert/squeezebert-uncased": {"do_lower_case": True}, - "squeezebert/squeezebert-mnli": {"do_lower_case": True}, - "squeezebert/squeezebert-mnli-headless": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -119,9 +94,6 @@ class SqueezeBertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py b/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py index a06aaf615e10a6..985fe657f0c3b6 100644 --- a/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py +++ b/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py @@ -28,42 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "squeezebert/squeezebert-uncased": ( - "https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/vocab.txt" - ), - "squeezebert/squeezebert-mnli": "https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/vocab.txt", - "squeezebert/squeezebert-mnli-headless": ( - "https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "squeezebert/squeezebert-uncased": ( - "https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/tokenizer.json" - ), - "squeezebert/squeezebert-mnli": ( - "https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/tokenizer.json" - ), - "squeezebert/squeezebert-mnli-headless": ( - "https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "squeezebert/squeezebert-uncased": 512, - "squeezebert/squeezebert-mnli": 512, - "squeezebert/squeezebert-mnli-headless": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "squeezebert/squeezebert-uncased": {"do_lower_case": True}, - "squeezebert/squeezebert-mnli": {"do_lower_case": True}, - "squeezebert/squeezebert-mnli-headless": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert_fast.BertTokenizerFast with Bert->SqueezeBert,BERT->SqueezeBERT class SqueezeBertTokenizerFast(PreTrainedTokenizerFast): @@ -107,9 +71,6 @@ class SqueezeBertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = SqueezeBertTokenizer def __init__( diff --git a/src/transformers/models/stablelm/__init__.py b/src/transformers/models/stablelm/__init__.py index 5c846cad030978..7fc3a6857fa55a 100644 --- a/src/transformers/models/stablelm/__init__.py +++ b/src/transformers/models/stablelm/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_stablelm": ["STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP", "StableLmConfig"], + "configuration_stablelm": ["StableLmConfig"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_stablelm import STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP, StableLmConfig + from .configuration_stablelm import StableLmConfig try: if not is_torch_available(): diff --git a/src/transformers/models/stablelm/configuration_stablelm.py b/src/transformers/models/stablelm/configuration_stablelm.py index b3e7f3216c86c3..007b8cafee71c3 100644 --- a/src/transformers/models/stablelm/configuration_stablelm.py +++ b/src/transformers/models/stablelm/configuration_stablelm.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "stabilityai/stablelm-3b-4e1t": "https://huggingface.co/stabilityai/stablelm-3b-4e1t/resolve/main/config.json", - # See all StableLM models at https://huggingface.co/models?filter=stablelm -} - class StableLmConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/starcoder2/__init__.py b/src/transformers/models/starcoder2/__init__.py index a2b25f10090b36..1eb195fde16b03 100644 --- a/src/transformers/models/starcoder2/__init__.py +++ b/src/transformers/models/starcoder2/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_starcoder2": ["STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Starcoder2Config"], + "configuration_starcoder2": ["Starcoder2Config"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_starcoder2 import STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP, Starcoder2Config + from .configuration_starcoder2 import Starcoder2Config try: if not is_torch_available(): diff --git a/src/transformers/models/starcoder2/configuration_starcoder2.py b/src/transformers/models/starcoder2/configuration_starcoder2.py index d569ebb4f7ce26..3bb0d1b65519c7 100644 --- a/src/transformers/models/starcoder2/configuration_starcoder2.py +++ b/src/transformers/models/starcoder2/configuration_starcoder2.py @@ -20,8 +20,6 @@ logger = logging.get_logger(__name__) -STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP = {} - class Starcoder2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/swiftformer/__init__.py b/src/transformers/models/swiftformer/__init__.py index ddba2b806fd168..2440ac686e3c08 100644 --- a/src/transformers/models/swiftformer/__init__.py +++ b/src/transformers/models/swiftformer/__init__.py @@ -22,7 +22,6 @@ _import_structure = { "configuration_swiftformer": [ - "SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SwiftFormerConfig", "SwiftFormerOnnxConfig", ] @@ -35,7 +34,6 @@ pass else: _import_structure["modeling_swiftformer"] = [ - "SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SwiftFormerForImageClassification", "SwiftFormerModel", "SwiftFormerPreTrainedModel", @@ -43,7 +41,6 @@ if TYPE_CHECKING: from .configuration_swiftformer import ( - SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SwiftFormerConfig, SwiftFormerOnnxConfig, ) @@ -55,7 +52,6 @@ pass else: from .modeling_swiftformer import ( - SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SwiftFormerForImageClassification, SwiftFormerModel, SwiftFormerPreTrainedModel, diff --git a/src/transformers/models/swiftformer/configuration_swiftformer.py b/src/transformers/models/swiftformer/configuration_swiftformer.py index 3e06b2feab24e9..d1e0e666429b77 100644 --- a/src/transformers/models/swiftformer/configuration_swiftformer.py +++ b/src/transformers/models/swiftformer/configuration_swiftformer.py @@ -26,10 +26,6 @@ logger = logging.get_logger(__name__) -SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "MBZUAI/swiftformer-xs": "https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json", -} - class SwiftFormerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/swiftformer/modeling_swiftformer.py b/src/transformers/models/swiftformer/modeling_swiftformer.py index 0c59c6b5b2de62..d5da17d783345b 100644 --- a/src/transformers/models/swiftformer/modeling_swiftformer.py +++ b/src/transformers/models/swiftformer/modeling_swiftformer.py @@ -52,12 +52,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "MBZUAI/swiftformer-xs", - # See all SwiftFormer models at https://huggingface.co/models?filter=swiftformer -] - - class SwiftFormerPatchEmbedding(nn.Module): """ Patch Embedding Layer constructed of two 2D convolutional layers. diff --git a/src/transformers/models/swin/__init__.py b/src/transformers/models/swin/__init__.py index 39cace5d5e8875..a3458fe1efb848 100644 --- a/src/transformers/models/swin/__init__.py +++ b/src/transformers/models/swin/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available -_import_structure = {"configuration_swin": ["SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "SwinConfig", "SwinOnnxConfig"]} +_import_structure = {"configuration_swin": ["SwinConfig", "SwinOnnxConfig"]} try: @@ -26,7 +26,6 @@ pass else: _import_structure["modeling_swin"] = [ - "SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "SwinForImageClassification", "SwinForMaskedImageModeling", "SwinModel", @@ -41,7 +40,6 @@ pass else: _import_structure["modeling_tf_swin"] = [ - "TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSwinForImageClassification", "TFSwinForMaskedImageModeling", "TFSwinModel", @@ -49,7 +47,7 @@ ] if TYPE_CHECKING: - from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig + from .configuration_swin import SwinConfig, SwinOnnxConfig try: if not is_torch_available(): @@ -58,7 +56,6 @@ pass else: from .modeling_swin import ( - SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, SwinBackbone, SwinForImageClassification, SwinForMaskedImageModeling, @@ -73,7 +70,6 @@ pass else: from .modeling_tf_swin import ( - TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, TFSwinForImageClassification, TFSwinForMaskedImageModeling, TFSwinModel, diff --git a/src/transformers/models/swin/configuration_swin.py b/src/transformers/models/swin/configuration_swin.py index 20da7ac113148f..281d0f047b2a68 100644 --- a/src/transformers/models/swin/configuration_swin.py +++ b/src/transformers/models/swin/configuration_swin.py @@ -27,13 +27,6 @@ logger = logging.get_logger(__name__) -SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/swin-tiny-patch4-window7-224": ( - "https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json" - ), - # See all Swin models at https://huggingface.co/models?filter=swin -} - class SwinConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/swin/modeling_swin.py b/src/transformers/models/swin/modeling_swin.py index a3f0643512a34f..9bf25306e7ce9e 100644 --- a/src/transformers/models/swin/modeling_swin.py +++ b/src/transformers/models/swin/modeling_swin.py @@ -56,11 +56,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/swin-tiny-patch4-window7-224", - # See all Swin models at https://huggingface.co/models?filter=swin -] - # drop_path, SwinPatchEmbeddings, SwinPatchMerging and SwinDropPath are from the timm library. diff --git a/src/transformers/models/swin/modeling_tf_swin.py b/src/transformers/models/swin/modeling_tf_swin.py index 6632759f68bb22..99da3d7f1e2306 100644 --- a/src/transformers/models/swin/modeling_tf_swin.py +++ b/src/transformers/models/swin/modeling_tf_swin.py @@ -61,11 +61,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/swin-tiny-patch4-window7-224", - # See all Swin models at https://huggingface.co/models?filter=swin -] - # drop_path, TFSwinPatchEmbeddings, TFSwinPatchMerging and TFSwinDropPath are tensorflow # implementations of PyTorch functionalities in the timm library. diff --git a/src/transformers/models/swin2sr/__init__.py b/src/transformers/models/swin2sr/__init__.py index 881a7673512ef2..16495f1dc9712d 100644 --- a/src/transformers/models/swin2sr/__init__.py +++ b/src/transformers/models/swin2sr/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_swin2sr": ["SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP", "Swin2SRConfig"], + "configuration_swin2sr": ["Swin2SRConfig"], } @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_swin2sr"] = [ - "SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST", "Swin2SRForImageSuperResolution", "Swin2SRModel", "Swin2SRPreTrainedModel", @@ -45,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_swin2sr import SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP, Swin2SRConfig + from .configuration_swin2sr import Swin2SRConfig try: if not is_torch_available(): @@ -54,7 +53,6 @@ pass else: from .modeling_swin2sr import ( - SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST, Swin2SRForImageSuperResolution, Swin2SRModel, Swin2SRPreTrainedModel, diff --git a/src/transformers/models/swin2sr/configuration_swin2sr.py b/src/transformers/models/swin2sr/configuration_swin2sr.py index 81c6af31e27f23..98177a804aee57 100644 --- a/src/transformers/models/swin2sr/configuration_swin2sr.py +++ b/src/transformers/models/swin2sr/configuration_swin2sr.py @@ -20,12 +20,6 @@ logger = logging.get_logger(__name__) -SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "caidas/swin2sr-classicalsr-x2-64": ( - "https://huggingface.co/caidas/swin2sr-classicalsr-x2-64/resolve/main/config.json" - ), -} - class Swin2SRConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/swin2sr/modeling_swin2sr.py b/src/transformers/models/swin2sr/modeling_swin2sr.py index 86dbcbaa65f9e4..310d1d4fb8748a 100644 --- a/src/transformers/models/swin2sr/modeling_swin2sr.py +++ b/src/transformers/models/swin2sr/modeling_swin2sr.py @@ -49,12 +49,6 @@ _EXPECTED_OUTPUT_SHAPE = [1, 180, 488, 648] -SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "caidas/swin2SR-classical-sr-x2-64", - # See all Swin2SR models at https://huggingface.co/models?filter=swin2sr -] - - @dataclass class Swin2SREncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/swinv2/__init__.py b/src/transformers/models/swinv2/__init__.py index b104662e088b31..e3a13b79651fcd 100644 --- a/src/transformers/models/swinv2/__init__.py +++ b/src/transformers/models/swinv2/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_swinv2": ["SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Swinv2Config"], + "configuration_swinv2": ["Swinv2Config"], } @@ -28,7 +28,6 @@ pass else: _import_structure["modeling_swinv2"] = [ - "SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Swinv2ForImageClassification", "Swinv2ForMaskedImageModeling", "Swinv2Model", @@ -38,7 +37,7 @@ if TYPE_CHECKING: - from .configuration_swinv2 import SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Swinv2Config + from .configuration_swinv2 import Swinv2Config try: if not is_torch_available(): @@ -47,7 +46,6 @@ pass else: from .modeling_swinv2 import ( - SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST, Swinv2Backbone, Swinv2ForImageClassification, Swinv2ForMaskedImageModeling, diff --git a/src/transformers/models/swinv2/configuration_swinv2.py b/src/transformers/models/swinv2/configuration_swinv2.py index 3c839e3f94bad6..17e924804ca61a 100644 --- a/src/transformers/models/swinv2/configuration_swinv2.py +++ b/src/transformers/models/swinv2/configuration_swinv2.py @@ -21,12 +21,6 @@ logger = logging.get_logger(__name__) -SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/swinv2-tiny-patch4-window8-256": ( - "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json" - ), -} - class Swinv2Config(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/swinv2/modeling_swinv2.py b/src/transformers/models/swinv2/modeling_swinv2.py index 5dc3dd0de8d636..66156a84ae2818 100644 --- a/src/transformers/models/swinv2/modeling_swinv2.py +++ b/src/transformers/models/swinv2/modeling_swinv2.py @@ -56,12 +56,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "Egyptian cat" -SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/swinv2-tiny-patch4-window8-256", - # See all Swinv2 models at https://huggingface.co/models?filter=swinv2 -] - - # drop_path, Swinv2PatchEmbeddings, Swinv2PatchMerging and Swinv2DropPath are from https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/swin_transformer_v2.py. diff --git a/src/transformers/models/switch_transformers/__init__.py b/src/transformers/models/switch_transformers/__init__.py index 35816110111092..e6f9914fcbcc1e 100644 --- a/src/transformers/models/switch_transformers/__init__.py +++ b/src/transformers/models/switch_transformers/__init__.py @@ -27,7 +27,6 @@ _import_structure = { "configuration_switch_transformers": [ - "SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP", "SwitchTransformersConfig", "SwitchTransformersOnnxConfig", ] @@ -40,7 +39,6 @@ pass else: _import_structure["modeling_switch_transformers"] = [ - "SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST", "SwitchTransformersEncoderModel", "SwitchTransformersForConditionalGeneration", "SwitchTransformersModel", @@ -52,7 +50,6 @@ if TYPE_CHECKING: from .configuration_switch_transformers import ( - SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP, SwitchTransformersConfig, SwitchTransformersOnnxConfig, ) @@ -64,7 +61,6 @@ pass else: from .modeling_switch_transformers import ( - SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST, SwitchTransformersEncoderModel, SwitchTransformersForConditionalGeneration, SwitchTransformersModel, diff --git a/src/transformers/models/switch_transformers/configuration_switch_transformers.py b/src/transformers/models/switch_transformers/configuration_switch_transformers.py index f90874af4da67a..fe96297777c98d 100644 --- a/src/transformers/models/switch_transformers/configuration_switch_transformers.py +++ b/src/transformers/models/switch_transformers/configuration_switch_transformers.py @@ -19,10 +19,6 @@ logger = logging.get_logger(__name__) -SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/switch-base-8": "https://huggingface.co/google/switch-base-8/blob/main/config.json", -} - class SwitchTransformersConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/switch_transformers/modeling_switch_transformers.py b/src/transformers/models/switch_transformers/modeling_switch_transformers.py index 416549b7b75c72..a30f597ee8b25f 100644 --- a/src/transformers/models/switch_transformers/modeling_switch_transformers.py +++ b/src/transformers/models/switch_transformers/modeling_switch_transformers.py @@ -54,18 +54,6 @@ # This dict contains ids and associated url # for the pretrained weights provided with the models #################################################### -SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/switch-base-8", - "google/switch-base-16", - "google/switch-base-32", - "google/switch-base-64", - "google/switch-base-128", - "google/switch-base-256", - "google/switch-large-128", - "google/switch-xxl-128", - "google/switch-c-2048", - # See all SwitchTransformers models at https://huggingface.co/models?filter=switch_transformers -] def router_z_loss_func(router_logits: torch.Tensor) -> float: diff --git a/src/transformers/models/t5/__init__.py b/src/transformers/models/t5/__init__.py index dbdbe238ba3376..d6549e270abcb6 100644 --- a/src/transformers/models/t5/__init__.py +++ b/src/transformers/models/t5/__init__.py @@ -25,7 +25,7 @@ ) -_import_structure = {"configuration_t5": ["T5_PRETRAINED_CONFIG_ARCHIVE_MAP", "T5Config", "T5OnnxConfig"]} +_import_structure = {"configuration_t5": ["T5Config", "T5OnnxConfig"]} try: if not is_sentencepiece_available(): @@ -50,7 +50,6 @@ pass else: _import_structure["modeling_t5"] = [ - "T5_PRETRAINED_MODEL_ARCHIVE_LIST", "T5EncoderModel", "T5ForConditionalGeneration", "T5Model", @@ -68,7 +67,6 @@ pass else: _import_structure["modeling_tf_t5"] = [ - "TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST", "TFT5EncoderModel", "TFT5ForConditionalGeneration", "TFT5Model", @@ -90,7 +88,7 @@ if TYPE_CHECKING: - from .configuration_t5 import T5_PRETRAINED_CONFIG_ARCHIVE_MAP, T5Config, T5OnnxConfig + from .configuration_t5 import T5Config, T5OnnxConfig try: if not is_sentencepiece_available(): @@ -115,7 +113,6 @@ pass else: from .modeling_t5 import ( - T5_PRETRAINED_MODEL_ARCHIVE_LIST, T5EncoderModel, T5ForConditionalGeneration, T5ForQuestionAnswering, @@ -133,7 +130,6 @@ pass else: from .modeling_tf_t5 import ( - TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST, TFT5EncoderModel, TFT5ForConditionalGeneration, TFT5Model, diff --git a/src/transformers/models/t5/configuration_t5.py b/src/transformers/models/t5/configuration_t5.py index 6a1d3c529e0ac5..eec47e5eb2aba6 100644 --- a/src/transformers/models/t5/configuration_t5.py +++ b/src/transformers/models/t5/configuration_t5.py @@ -22,14 +22,6 @@ logger = logging.get_logger(__name__) -T5_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google-t5/t5-small": "https://huggingface.co/google-t5/t5-small/resolve/main/config.json", - "google-t5/t5-base": "https://huggingface.co/google-t5/t5-base/resolve/main/config.json", - "google-t5/t5-large": "https://huggingface.co/google-t5/t5-large/resolve/main/config.json", - "google-t5/t5-3b": "https://huggingface.co/google-t5/t5-3b/resolve/main/config.json", - "google-t5/t5-11b": "https://huggingface.co/google-t5/t5-11b/resolve/main/config.json", -} - class T5Config(PretrainedConfig): r""" diff --git a/src/transformers/models/t5/modeling_t5.py b/src/transformers/models/t5/modeling_t5.py index a3febdd1aa7bb6..b8f80cec2df97c 100644 --- a/src/transformers/models/t5/modeling_t5.py +++ b/src/transformers/models/t5/modeling_t5.py @@ -59,14 +59,6 @@ # This dict contains ids and associated url # for the pretrained weights provided with the models #################################################### -T5_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google-t5/t5-small", - "google-t5/t5-base", - "google-t5/t5-large", - "google-t5/t5-3b", - "google-t5/t5-11b", - # See all T5 models at https://huggingface.co/models?filter=t5 -] #################################################### diff --git a/src/transformers/models/t5/modeling_tf_t5.py b/src/transformers/models/t5/modeling_tf_t5.py index c809659477bcc6..7b97b26e2e53ad 100644 --- a/src/transformers/models/t5/modeling_tf_t5.py +++ b/src/transformers/models/t5/modeling_tf_t5.py @@ -58,14 +58,6 @@ _CONFIG_FOR_DOC = "T5Config" -TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google-t5/t5-small", - "google-t5/t5-base", - "google-t5/t5-large", - "google-t5/t5-3b", - "google-t5/t5-11b", - # See all T5 models at https://huggingface.co/models?filter=t5 -] #################################################### # TF 2.0 Models are constructed using Keras imperative API by sub-classing diff --git a/src/transformers/models/t5/tokenization_t5.py b/src/transformers/models/t5/tokenization_t5.py index fba83ae9203eeb..7292808adc6b56 100644 --- a/src/transformers/models/t5/tokenization_t5.py +++ b/src/transformers/models/t5/tokenization_t5.py @@ -37,25 +37,8 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google-t5/t5-small": "https://huggingface.co/google-t5/t5-small/resolve/main/spiece.model", - "google-t5/t5-base": "https://huggingface.co/google-t5/t5-base/resolve/main/spiece.model", - "google-t5/t5-large": "https://huggingface.co/google-t5/t5-large/resolve/main/spiece.model", - "google-t5/t5-3b": "https://huggingface.co/google-t5/t5-3b/resolve/main/spiece.model", - "google-t5/t5-11b": "https://huggingface.co/google-t5/t5-11b/resolve/main/spiece.model", - } -} - # TODO(PVP) - this should be removed in Transformers v5 -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google-t5/t5-small": 512, - "google-t5/t5-base": 512, - "google-t5/t5-large": 512, - "google-t5/t5-3b": 512, - "google-t5/t5-11b": 512, -} SPIECE_UNDERLINE = "▁" @@ -140,8 +123,6 @@ class T5Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/t5/tokenization_t5_fast.py b/src/transformers/models/t5/tokenization_t5_fast.py index bf1ef13cb519a7..e9f2033812e698 100644 --- a/src/transformers/models/t5/tokenization_t5_fast.py +++ b/src/transformers/models/t5/tokenization_t5_fast.py @@ -35,32 +35,8 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "google-t5/t5-small": "https://huggingface.co/google-t5/t5-small/resolve/main/spiece.model", - "google-t5/t5-base": "https://huggingface.co/google-t5/t5-base/resolve/main/spiece.model", - "google-t5/t5-large": "https://huggingface.co/google-t5/t5-large/resolve/main/spiece.model", - "google-t5/t5-3b": "https://huggingface.co/google-t5/t5-3b/resolve/main/spiece.model", - "google-t5/t5-11b": "https://huggingface.co/google-t5/t5-11b/resolve/main/spiece.model", - }, - "tokenizer_file": { - "google-t5/t5-small": "https://huggingface.co/google-t5/t5-small/resolve/main/tokenizer.json", - "google-t5/t5-base": "https://huggingface.co/google-t5/t5-base/resolve/main/tokenizer.json", - "google-t5/t5-large": "https://huggingface.co/google-t5/t5-large/resolve/main/tokenizer.json", - "google-t5/t5-3b": "https://huggingface.co/google-t5/t5-3b/resolve/main/tokenizer.json", - "google-t5/t5-11b": "https://huggingface.co/google-t5/t5-11b/resolve/main/tokenizer.json", - }, -} - # TODO(PVP) - this should be removed in Transformers v5 -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "google-t5/t5-small": 512, - "google-t5/t5-base": 512, - "google-t5/t5-large": 512, - "google-t5/t5-3b": 512, - "google-t5/t5-11b": 512, -} class T5TokenizerFast(PreTrainedTokenizerFast): @@ -103,8 +79,6 @@ class T5TokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = T5Tokenizer diff --git a/src/transformers/models/table_transformer/__init__.py b/src/transformers/models/table_transformer/__init__.py index 346bc9ef9caaa6..de993193b0c522 100644 --- a/src/transformers/models/table_transformer/__init__.py +++ b/src/transformers/models/table_transformer/__init__.py @@ -19,7 +19,6 @@ _import_structure = { "configuration_table_transformer": [ - "TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TableTransformerConfig", "TableTransformerOnnxConfig", ] @@ -32,7 +31,6 @@ pass else: _import_structure["modeling_table_transformer"] = [ - "TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TableTransformerForObjectDetection", "TableTransformerModel", "TableTransformerPreTrainedModel", @@ -41,7 +39,6 @@ if TYPE_CHECKING: from .configuration_table_transformer import ( - TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TableTransformerConfig, TableTransformerOnnxConfig, ) @@ -53,7 +50,6 @@ pass else: from .modeling_table_transformer import ( - TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TableTransformerForObjectDetection, TableTransformerModel, TableTransformerPreTrainedModel, diff --git a/src/transformers/models/table_transformer/configuration_table_transformer.py b/src/transformers/models/table_transformer/configuration_table_transformer.py index 12b62ee9736c7f..35ca9a6a4b9895 100644 --- a/src/transformers/models/table_transformer/configuration_table_transformer.py +++ b/src/transformers/models/table_transformer/configuration_table_transformer.py @@ -26,12 +26,6 @@ logger = logging.get_logger(__name__) -TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/table-transformer-detection": ( - "https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json" - ), -} - class TableTransformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/table_transformer/modeling_table_transformer.py b/src/transformers/models/table_transformer/modeling_table_transformer.py index 7f86b0ab53320b..a4bf4dfc119230 100644 --- a/src/transformers/models/table_transformer/modeling_table_transformer.py +++ b/src/transformers/models/table_transformer/modeling_table_transformer.py @@ -60,11 +60,6 @@ _CONFIG_FOR_DOC = "TableTransformerConfig" _CHECKPOINT_FOR_DOC = "microsoft/table-transformer-detection" -TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/table-transformer-detection", - # See all Table Transformer models at https://huggingface.co/models?filter=table-transformer -] - @dataclass # Copied from transformers.models.detr.modeling_detr.DetrDecoderOutput with DETR->TABLE_TRANSFORMER,Detr->TableTransformer diff --git a/src/transformers/models/tapas/__init__.py b/src/transformers/models/tapas/__init__.py index e1afab325420f7..750bf7e00f5a8f 100644 --- a/src/transformers/models/tapas/__init__.py +++ b/src/transformers/models/tapas/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_tapas": ["TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig"], + "configuration_tapas": ["TapasConfig"], "tokenization_tapas": ["TapasTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_tapas"] = [ - "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TapasForMaskedLM", "TapasForQuestionAnswering", "TapasForSequenceClassification", @@ -44,7 +43,6 @@ pass else: _import_structure["modeling_tf_tapas"] = [ - "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TFTapasForMaskedLM", "TFTapasForQuestionAnswering", "TFTapasForSequenceClassification", @@ -54,7 +52,7 @@ if TYPE_CHECKING: - from .configuration_tapas import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig + from .configuration_tapas import TapasConfig from .tokenization_tapas import TapasTokenizer try: @@ -64,7 +62,6 @@ pass else: from .modeling_tapas import ( - TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TapasForMaskedLM, TapasForQuestionAnswering, TapasForSequenceClassification, @@ -80,7 +77,6 @@ pass else: from .modeling_tf_tapas import ( - TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TFTapasForMaskedLM, TFTapasForQuestionAnswering, TFTapasForSequenceClassification, diff --git a/src/transformers/models/tapas/configuration_tapas.py b/src/transformers/models/tapas/configuration_tapas.py index f466ab42545f04..cbc5cebf4e1b76 100644 --- a/src/transformers/models/tapas/configuration_tapas.py +++ b/src/transformers/models/tapas/configuration_tapas.py @@ -26,22 +26,6 @@ from ...configuration_utils import PretrainedConfig -TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/tapas-base-finetuned-sqa": ( - "https://huggingface.co/google/tapas-base-finetuned-sqa/resolve/main/config.json" - ), - "google/tapas-base-finetuned-wtq": ( - "https://huggingface.co/google/tapas-base-finetuned-wtq/resolve/main/config.json" - ), - "google/tapas-base-finetuned-wikisql-supervised": ( - "https://huggingface.co/google/tapas-base-finetuned-wikisql-supervised/resolve/main/config.json" - ), - "google/tapas-base-finetuned-tabfact": ( - "https://huggingface.co/google/tapas-base-finetuned-tabfact/resolve/main/config.json" - ), -} - - class TapasConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TapasModel`]. It is used to instantiate a TAPAS diff --git a/src/transformers/models/tapas/modeling_tapas.py b/src/transformers/models/tapas/modeling_tapas.py index 1e7a4372bb015e..729e10e062f8fa 100644 --- a/src/transformers/models/tapas/modeling_tapas.py +++ b/src/transformers/models/tapas/modeling_tapas.py @@ -56,39 +56,6 @@ _CONFIG_FOR_DOC = "TapasConfig" _CHECKPOINT_FOR_DOC = "google/tapas-base" -TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - # large models - "google/tapas-large", - "google/tapas-large-finetuned-sqa", - "google/tapas-large-finetuned-wtq", - "google/tapas-large-finetuned-wikisql-supervised", - "google/tapas-large-finetuned-tabfact", - # base models - "google/tapas-base", - "google/tapas-base-finetuned-sqa", - "google/tapas-base-finetuned-wtq", - "google/tapas-base-finetuned-wikisql-supervised", - "google/tapas-base-finetuned-tabfact", - # small models - "google/tapas-small", - "google/tapas-small-finetuned-sqa", - "google/tapas-small-finetuned-wtq", - "google/tapas-small-finetuned-wikisql-supervised", - "google/tapas-small-finetuned-tabfact", - # mini models - "google/tapas-mini", - "google/tapas-mini-finetuned-sqa", - "google/tapas-mini-finetuned-wtq", - "google/tapas-mini-finetuned-wikisql-supervised", - "google/tapas-mini-finetuned-tabfact", - # tiny models - "google/tapas-tiny", - "google/tapas-tiny-finetuned-sqa", - "google/tapas-tiny-finetuned-wtq", - "google/tapas-tiny-finetuned-wikisql-supervised", - "google/tapas-tiny-finetuned-tabfact", - # See all TAPAS models at https://huggingface.co/models?filter=tapas -] EPSILON_ZERO_DIVISION = 1e-10 CLOSE_ENOUGH_TO_LOG_ZERO = -10000.0 diff --git a/src/transformers/models/tapas/modeling_tf_tapas.py b/src/transformers/models/tapas/modeling_tf_tapas.py index 79b1a9ebfc7b6c..bc7e7b7d75922f 100644 --- a/src/transformers/models/tapas/modeling_tf_tapas.py +++ b/src/transformers/models/tapas/modeling_tf_tapas.py @@ -75,39 +75,6 @@ _CONFIG_FOR_DOC = "TapasConfig" _CHECKPOINT_FOR_DOC = "google/tapas-base" -TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - # large models - "google/tapas-large", - "google/tapas-large-finetuned-sqa", - "google/tapas-large-finetuned-wtq", - "google/tapas-large-finetuned-wikisql-supervised", - "google/tapas-large-finetuned-tabfact", - # base models - "google/tapas-base", - "google/tapas-base-finetuned-sqa", - "google/tapas-base-finetuned-wtq", - "google/tapas-base-finetuned-wikisql-supervised", - "google/tapas-base-finetuned-tabfact", - # small models - "google/tapas-small", - "google/tapas-small-finetuned-sqa", - "google/tapas-small-finetuned-wtq", - "google/tapas-small-finetuned-wikisql-supervised", - "google/tapas-small-finetuned-tabfact", - # mini models - "google/tapas-mini", - "google/tapas-mini-finetuned-sqa", - "google/tapas-mini-finetuned-wtq", - "google/tapas-mini-finetuned-wikisql-supervised", - "google/tapas-mini-finetuned-tabfact", - # tiny models - "google/tapas-tiny", - "google/tapas-tiny-finetuned-sqa", - "google/tapas-tiny-finetuned-wtq", - "google/tapas-tiny-finetuned-wikisql-supervised", - "google/tapas-tiny-finetuned-tabfact", - # See all TAPAS models at https://huggingface.co/models?filter=tapas -] EPSILON_ZERO_DIVISION = 1e-10 CLOSE_ENOUGH_TO_LOG_ZERO = -10000.0 diff --git a/src/transformers/models/tapas/tokenization_tapas.py b/src/transformers/models/tapas/tokenization_tapas.py index 7ec1e68f21d75c..124d48df24ca20 100644 --- a/src/transformers/models/tapas/tokenization_tapas.py +++ b/src/transformers/models/tapas/tokenization_tapas.py @@ -48,92 +48,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - # large models - "google/tapas-large-finetuned-sqa": ( - "https://huggingface.co/google/tapas-large-finetuned-sqa/resolve/main/vocab.txt" - ), - "google/tapas-large-finetuned-wtq": ( - "https://huggingface.co/google/tapas-large-finetuned-wtq/resolve/main/vocab.txt" - ), - "google/tapas-large-finetuned-wikisql-supervised": ( - "https://huggingface.co/google/tapas-large-finetuned-wikisql-supervised/resolve/main/vocab.txt" - ), - "google/tapas-large-finetuned-tabfact": ( - "https://huggingface.co/google/tapas-large-finetuned-tabfact/resolve/main/vocab.txt" - ), - # base models - "google/tapas-base-finetuned-sqa": ( - "https://huggingface.co/google/tapas-base-finetuned-sqa/resolve/main/vocab.txt" - ), - "google/tapas-base-finetuned-wtq": ( - "https://huggingface.co/google/tapas-base-finetuned-wtq/resolve/main/vocab.txt" - ), - "google/tapas-base-finetuned-wikisql-supervised": ( - "https://huggingface.co/google/tapas-base-finetuned-wikisql-supervised/resolve/main/vocab.txt" - ), - "google/tapas-base-finetuned-tabfact": ( - "https://huggingface.co/google/tapas-base-finetuned-tabfact/resolve/main/vocab.txt" - ), - # medium models - "google/tapas-medium-finetuned-sqa": ( - "https://huggingface.co/google/tapas-medium-finetuned-sqa/resolve/main/vocab.txt" - ), - "google/tapas-medium-finetuned-wtq": ( - "https://huggingface.co/google/tapas-medium-finetuned-wtq/resolve/main/vocab.txt" - ), - "google/tapas-medium-finetuned-wikisql-supervised": ( - "https://huggingface.co/google/tapas-medium-finetuned-wikisql-supervised/resolve/main/vocab.txt" - ), - "google/tapas-medium-finetuned-tabfact": ( - "https://huggingface.co/google/tapas-medium-finetuned-tabfact/resolve/main/vocab.txt" - ), - # small models - "google/tapas-small-finetuned-sqa": ( - "https://huggingface.co/google/tapas-small-finetuned-sqa/resolve/main/vocab.txt" - ), - "google/tapas-small-finetuned-wtq": ( - "https://huggingface.co/google/tapas-small-finetuned-wtq/resolve/main/vocab.txt" - ), - "google/tapas-small-finetuned-wikisql-supervised": ( - "https://huggingface.co/google/tapas-small-finetuned-wikisql-supervised/resolve/main/vocab.txt" - ), - "google/tapas-small-finetuned-tabfact": ( - "https://huggingface.co/google/tapas-small-finetuned-tabfact/resolve/main/vocab.txt" - ), - # tiny models - "google/tapas-tiny-finetuned-sqa": ( - "https://huggingface.co/google/tapas-tiny-finetuned-sqa/resolve/main/vocab.txt" - ), - "google/tapas-tiny-finetuned-wtq": ( - "https://huggingface.co/google/tapas-tiny-finetuned-wtq/resolve/main/vocab.txt" - ), - "google/tapas-tiny-finetuned-wikisql-supervised": ( - "https://huggingface.co/google/tapas-tiny-finetuned-wikisql-supervised/resolve/main/vocab.txt" - ), - "google/tapas-tiny-finetuned-tabfact": ( - "https://huggingface.co/google/tapas-tiny-finetuned-tabfact/resolve/main/vocab.txt" - ), - # mini models - "google/tapas-mini-finetuned-sqa": ( - "https://huggingface.co/google/tapas-mini-finetuned-sqa/resolve/main/vocab.txt" - ), - "google/tapas-mini-finetuned-wtq": ( - "https://huggingface.co/google/tapas-mini-finetuned-wtq/resolve/main/vocab.txt" - ), - "google/tapas-mini-finetuned-wikisql-supervised": ( - "https://huggingface.co/google/tapas-mini-finetuned-wikisql-supervised/resolve/main/vocab.txt" - ), - "google/tapas-mini-finetuned-tabfact": ( - "https://huggingface.co/google/tapas-mini-finetuned-tabfact/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {name: 512 for name in PRETRAINED_VOCAB_FILES_MAP.keys()} -PRETRAINED_INIT_CONFIGURATION = {name: {"do_lower_case": True} for name in PRETRAINED_VOCAB_FILES_MAP.keys()} - class TapasTruncationStrategy(ExplicitEnum): """ @@ -315,8 +229,6 @@ class TapasTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/time_series_transformer/__init__.py b/src/transformers/models/time_series_transformer/__init__.py index 1c09b683a34625..39879ed1bc00b7 100644 --- a/src/transformers/models/time_series_transformer/__init__.py +++ b/src/transformers/models/time_series_transformer/__init__.py @@ -17,10 +17,7 @@ _import_structure = { - "configuration_time_series_transformer": [ - "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "TimeSeriesTransformerConfig", - ], + "configuration_time_series_transformer": ["TimeSeriesTransformerConfig"], } try: @@ -30,7 +27,6 @@ pass else: _import_structure["modeling_time_series_transformer"] = [ - "TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimeSeriesTransformerForPrediction", "TimeSeriesTransformerModel", "TimeSeriesTransformerPreTrainedModel", @@ -39,7 +35,6 @@ if TYPE_CHECKING: from .configuration_time_series_transformer import ( - TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimeSeriesTransformerConfig, ) @@ -50,7 +45,6 @@ pass else: from .modeling_time_series_transformer import ( - TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimeSeriesTransformerForPrediction, TimeSeriesTransformerModel, TimeSeriesTransformerPreTrainedModel, diff --git a/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py b/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py index a2e31ba48d3bc8..8c74f151749f6b 100644 --- a/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py +++ b/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py @@ -22,13 +22,6 @@ logger = logging.get_logger(__name__) -TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "huggingface/time-series-transformer-tourism-monthly": ( - "https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json" - ), - # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer -} - class TimeSeriesTransformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py b/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py index b6e86735c6a3d0..dd7a2228a32790 100644 --- a/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py +++ b/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py @@ -46,12 +46,6 @@ _CONFIG_FOR_DOC = "TimeSeriesTransformerConfig" -TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "huggingface/time-series-transformer-tourism-monthly", - # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer -] - - class TimeSeriesFeatureEmbedder(nn.Module): """ Embed a sequence of categorical features. diff --git a/src/transformers/models/timesformer/__init__.py b/src/transformers/models/timesformer/__init__.py index f777a11ad1bdcf..48a2aa9fa47464 100644 --- a/src/transformers/models/timesformer/__init__.py +++ b/src/transformers/models/timesformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_timesformer": ["TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TimesformerConfig"], + "configuration_timesformer": ["TimesformerConfig"], } try: @@ -27,14 +27,13 @@ pass else: _import_structure["modeling_timesformer"] = [ - "TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimesformerModel", "TimesformerForVideoClassification", "TimesformerPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig + from .configuration_timesformer import TimesformerConfig try: if not is_torch_available(): @@ -43,7 +42,6 @@ pass else: from .modeling_timesformer import ( - TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimesformerForVideoClassification, TimesformerModel, TimesformerPreTrainedModel, diff --git a/src/transformers/models/timesformer/configuration_timesformer.py b/src/transformers/models/timesformer/configuration_timesformer.py index e910564fb1bbf5..ebcfcc82482a6f 100644 --- a/src/transformers/models/timesformer/configuration_timesformer.py +++ b/src/transformers/models/timesformer/configuration_timesformer.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/timesformer": "https://huggingface.co/facebook/timesformer/resolve/main/config.json", -} - class TimesformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/timesformer/modeling_timesformer.py b/src/transformers/models/timesformer/modeling_timesformer.py index 73ce6bf7737f62..51315922db9648 100644 --- a/src/transformers/models/timesformer/modeling_timesformer.py +++ b/src/transformers/models/timesformer/modeling_timesformer.py @@ -36,11 +36,6 @@ _CONFIG_FOR_DOC = "TimesformerConfig" _CHECKPOINT_FOR_DOC = "facebook/timesformer" -TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/timesformer-base-finetuned-k400", - # See all TimeSformer models at https://huggingface.co/models?filter=timesformer -] - # Adapted from https://github.com/facebookresearch/TimeSformer/blob/a5ef29a7b7264baff199a30b3306ac27de901133/timesformer/models/vit.py#L155 class TimesformerPatchEmbeddings(nn.Module): diff --git a/src/transformers/models/trocr/__init__.py b/src/transformers/models/trocr/__init__.py index 08400fc916ec21..14854857586d97 100644 --- a/src/transformers/models/trocr/__init__.py +++ b/src/transformers/models/trocr/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_trocr": ["TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP", "TrOCRConfig"], + "configuration_trocr": ["TrOCRConfig"], "processing_trocr": ["TrOCRProcessor"], } @@ -35,14 +35,13 @@ pass else: _import_structure["modeling_trocr"] = [ - "TROCR_PRETRAINED_MODEL_ARCHIVE_LIST", "TrOCRForCausalLM", "TrOCRPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_trocr import TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig + from .configuration_trocr import TrOCRConfig from .processing_trocr import TrOCRProcessor try: @@ -51,7 +50,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_trocr import TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel + from .modeling_trocr import TrOCRForCausalLM, TrOCRPreTrainedModel else: import sys diff --git a/src/transformers/models/trocr/configuration_trocr.py b/src/transformers/models/trocr/configuration_trocr.py index 4964ab27acb818..efa20d884e381d 100644 --- a/src/transformers/models/trocr/configuration_trocr.py +++ b/src/transformers/models/trocr/configuration_trocr.py @@ -20,13 +20,6 @@ logger = logging.get_logger(__name__) -TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/trocr-base-handwritten": ( - "https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json" - ), - # See all TrOCR models at https://huggingface.co/models?filter=trocr -} - class TrOCRConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/trocr/modeling_trocr.py b/src/transformers/models/trocr/modeling_trocr.py index a21f6338ba2e6e..5a6c4a89d16af2 100644 --- a/src/transformers/models/trocr/modeling_trocr.py +++ b/src/transformers/models/trocr/modeling_trocr.py @@ -37,12 +37,6 @@ _CHECKPOINT_FOR_DOC = "microsoft/trocr-base-handwritten" -TROCR_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/trocr-base-handwritten", - # See all TrOCR models at https://huggingface.co/models?filter=trocr -] - - # Copied from transformers.models.bart.modeling_bart.BartLearnedPositionalEmbedding with Bart->TrOCR class TrOCRLearnedPositionalEmbedding(nn.Embedding): """ diff --git a/src/transformers/models/tvlt/__init__.py b/src/transformers/models/tvlt/__init__.py index 86c0f7c1c0b99d..d63bad0a7adc81 100644 --- a/src/transformers/models/tvlt/__init__.py +++ b/src/transformers/models/tvlt/__init__.py @@ -26,7 +26,7 @@ _import_structure = { - "configuration_tvlt": ["TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP", "TvltConfig"], + "configuration_tvlt": ["TvltConfig"], "feature_extraction_tvlt": ["TvltFeatureExtractor"], "processing_tvlt": ["TvltProcessor"], } @@ -38,7 +38,6 @@ pass else: _import_structure["modeling_tvlt"] = [ - "TVLT_PRETRAINED_MODEL_ARCHIVE_LIST", "TvltModel", "TvltForPreTraining", "TvltForAudioVisualClassification", @@ -55,7 +54,7 @@ if TYPE_CHECKING: - from .configuration_tvlt import TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP, TvltConfig + from .configuration_tvlt import TvltConfig from .processing_tvlt import TvltProcessor from .feature_extraction_tvlt import TvltFeatureExtractor @@ -66,7 +65,6 @@ pass else: from .modeling_tvlt import ( - TVLT_PRETRAINED_MODEL_ARCHIVE_LIST, TvltForAudioVisualClassification, TvltForPreTraining, TvltModel, diff --git a/src/transformers/models/tvlt/configuration_tvlt.py b/src/transformers/models/tvlt/configuration_tvlt.py index 1200eb470b75bd..fbf65effd96ea3 100644 --- a/src/transformers/models/tvlt/configuration_tvlt.py +++ b/src/transformers/models/tvlt/configuration_tvlt.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "ZinengTang/tvlt-base": "https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json", -} - class TvltConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/tvlt/modeling_tvlt.py b/src/transformers/models/tvlt/modeling_tvlt.py index d2fe1040a3ed71..0376570fe5a3b8 100644 --- a/src/transformers/models/tvlt/modeling_tvlt.py +++ b/src/transformers/models/tvlt/modeling_tvlt.py @@ -45,11 +45,6 @@ _CONFIG_FOR_DOC = "TvltConfig" _CHECKPOINT_FOR_DOC = "ZinengTang/tvlt-base" -TVLT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "ZinengTang/tvlt-base", - # See all TVLT models at https://huggingface.co/ZinengTang/tvlt-base -] - @dataclass class TvltModelOutput(ModelOutput): diff --git a/src/transformers/models/tvp/__init__.py b/src/transformers/models/tvp/__init__.py index 63c0bd27174471..b8479dbdd331b8 100644 --- a/src/transformers/models/tvp/__init__.py +++ b/src/transformers/models/tvp/__init__.py @@ -18,10 +18,7 @@ _import_structure = { - "configuration_tvp": [ - "TVP_PRETRAINED_CONFIG_ARCHIVE_MAP", - "TvpConfig", - ], + "configuration_tvp": ["TvpConfig"], "processing_tvp": ["TvpProcessor"], } @@ -40,7 +37,6 @@ pass else: _import_structure["modeling_tvp"] = [ - "TVP_PRETRAINED_MODEL_ARCHIVE_LIST", "TvpModel", "TvpPreTrainedModel", "TvpForVideoGrounding", @@ -48,7 +44,6 @@ if TYPE_CHECKING: from .configuration_tvp import ( - TVP_PRETRAINED_CONFIG_ARCHIVE_MAP, TvpConfig, ) from .processing_tvp import TvpProcessor @@ -68,7 +63,6 @@ pass else: from .modeling_tvp import ( - TVP_PRETRAINED_MODEL_ARCHIVE_LIST, TvpForVideoGrounding, TvpModel, TvpPreTrainedModel, diff --git a/src/transformers/models/tvp/configuration_tvp.py b/src/transformers/models/tvp/configuration_tvp.py index f39a0ab5dfcdbf..65c4e3a5225b4a 100644 --- a/src/transformers/models/tvp/configuration_tvp.py +++ b/src/transformers/models/tvp/configuration_tvp.py @@ -24,11 +24,6 @@ logger = logging.get_logger(__name__) -TVP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "Intel/tvp-base": "https://huggingface.co/Intel/tvp-base/resolve/main/config.json", -} - - class TvpConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TvpModel`]. It is used to instantiate an Tvp diff --git a/src/transformers/models/tvp/modeling_tvp.py b/src/transformers/models/tvp/modeling_tvp.py index 159b4926af7e8f..121cd7b5f3f375 100644 --- a/src/transformers/models/tvp/modeling_tvp.py +++ b/src/transformers/models/tvp/modeling_tvp.py @@ -34,12 +34,6 @@ logger = logging.get_logger(__name__) -TVP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "Intel/tvp-base", - "Intel/tvp-base-ANet", - # See all Tvp models at https://huggingface.co/models?filter=tvp -] - @dataclass class TvpVideoGroundingOutput(ModelOutput): diff --git a/src/transformers/models/udop/__init__.py b/src/transformers/models/udop/__init__.py index 5066fde6af1d15..732d97aa7a99c7 100644 --- a/src/transformers/models/udop/__init__.py +++ b/src/transformers/models/udop/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_udop": ["UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP", "UdopConfig"], + "configuration_udop": ["UdopConfig"], "processing_udop": ["UdopProcessor"], } @@ -51,7 +51,6 @@ pass else: _import_structure["modeling_udop"] = [ - "UDOP_PRETRAINED_MODEL_ARCHIVE_LIST", "UdopForConditionalGeneration", "UdopPreTrainedModel", "UdopModel", @@ -59,7 +58,7 @@ ] if TYPE_CHECKING: - from .configuration_udop import UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP, UdopConfig + from .configuration_udop import UdopConfig from .processing_udop import UdopProcessor try: @@ -85,7 +84,6 @@ pass else: from .modeling_udop import ( - UDOP_PRETRAINED_MODEL_ARCHIVE_LIST, UdopEncoderModel, UdopForConditionalGeneration, UdopModel, diff --git a/src/transformers/models/udop/configuration_udop.py b/src/transformers/models/udop/configuration_udop.py index 8647a7bae29acf..3802b6de01a75b 100644 --- a/src/transformers/models/udop/configuration_udop.py +++ b/src/transformers/models/udop/configuration_udop.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/udop-large": "https://huggingface.co/microsoft/udop-large/resolve/main/config.json", -} - class UdopConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/udop/modeling_udop.py b/src/transformers/models/udop/modeling_udop.py index 62192eea7f5a5e..9c2e06f16825ce 100644 --- a/src/transformers/models/udop/modeling_udop.py +++ b/src/transformers/models/udop/modeling_udop.py @@ -46,11 +46,6 @@ logger = logging.getLogger(__name__) -UDOP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/udop-large", - # See all UDOP models at https://huggingface.co/models?filter=udop -] - _CONFIG_FOR_DOC = "UdopConfig" diff --git a/src/transformers/models/umt5/configuration_umt5.py b/src/transformers/models/umt5/configuration_umt5.py index ccd2392d720a24..9365717c282ae6 100644 --- a/src/transformers/models/umt5/configuration_umt5.py +++ b/src/transformers/models/umt5/configuration_umt5.py @@ -22,11 +22,6 @@ logger = logging.get_logger(__name__) -UMT5_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/umt5-small": "https://huggingface.co/google/umt5-small/resolve/main/config.json", - # See all umt5 models at https://huggingface.co/models?filter=umt5 -} - class UMT5Config(PretrainedConfig): r""" diff --git a/src/transformers/models/unispeech/__init__.py b/src/transformers/models/unispeech/__init__.py index 2800fa17076e6e..91db9ada5ef297 100644 --- a/src/transformers/models/unispeech/__init__.py +++ b/src/transformers/models/unispeech/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_unispeech": ["UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP", "UniSpeechConfig"]} +_import_structure = {"configuration_unispeech": ["UniSpeechConfig"]} try: if not is_torch_available(): @@ -31,7 +31,6 @@ pass else: _import_structure["modeling_unispeech"] = [ - "UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechForCTC", "UniSpeechForPreTraining", "UniSpeechForSequenceClassification", @@ -40,7 +39,7 @@ ] if TYPE_CHECKING: - from .configuration_unispeech import UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechConfig + from .configuration_unispeech import UniSpeechConfig try: if not is_torch_available(): @@ -49,7 +48,6 @@ pass else: from .modeling_unispeech import ( - UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechForCTC, UniSpeechForPreTraining, UniSpeechForSequenceClassification, diff --git a/src/transformers/models/unispeech/configuration_unispeech.py b/src/transformers/models/unispeech/configuration_unispeech.py index d7234339031eaa..18502adcb0ec4b 100644 --- a/src/transformers/models/unispeech/configuration_unispeech.py +++ b/src/transformers/models/unispeech/configuration_unispeech.py @@ -23,13 +23,6 @@ logger = logging.get_logger(__name__) -UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/unispeech-large-1500h-cv": ( - "https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json" - ), - # See all UniSpeech models at https://huggingface.co/models?filter=unispeech -} - class UniSpeechConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/unispeech/modeling_unispeech.py b/src/transformers/models/unispeech/modeling_unispeech.py index 11965bdb50e978..fee3dadf9dd65f 100755 --- a/src/transformers/models/unispeech/modeling_unispeech.py +++ b/src/transformers/models/unispeech/modeling_unispeech.py @@ -56,12 +56,6 @@ _CTC_EXPECTED_OUTPUT = "'mister quilter is the apposl of the midle classes and weare glad to welcom his gosepl'" _CTC_EXPECTED_LOSS = 17.17 -UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/unispeech-large-1500h-cv", - "microsoft/unispeech-large-multi-lingual-1500h-cv", - # See all UniSpeech models at https://huggingface.co/models?filter=unispeech -] - @dataclass class UniSpeechForPreTrainingOutput(ModelOutput): diff --git a/src/transformers/models/unispeech_sat/__init__.py b/src/transformers/models/unispeech_sat/__init__.py index d1ac3ec2c43fb9..275f98ac222024 100644 --- a/src/transformers/models/unispeech_sat/__init__.py +++ b/src/transformers/models/unispeech_sat/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_unispeech_sat": ["UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "UniSpeechSatConfig"], + "configuration_unispeech_sat": ["UniSpeechSatConfig"], } try: @@ -33,7 +33,6 @@ pass else: _import_structure["modeling_unispeech_sat"] = [ - "UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechSatForAudioFrameClassification", "UniSpeechSatForCTC", "UniSpeechSatForPreTraining", @@ -44,7 +43,7 @@ ] if TYPE_CHECKING: - from .configuration_unispeech_sat import UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig + from .configuration_unispeech_sat import UniSpeechSatConfig try: if not is_torch_available(): @@ -53,7 +52,6 @@ pass else: from .modeling_unispeech_sat import ( - UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechSatForAudioFrameClassification, UniSpeechSatForCTC, UniSpeechSatForPreTraining, diff --git a/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py b/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py index fea89da119acbd..87b4bc8506dd73 100644 --- a/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py +++ b/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py @@ -23,13 +23,6 @@ logger = logging.get_logger(__name__) -UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/unispeech-sat-base-100h-libri-ft": ( - "https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json" - ), - # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat -} - class UniSpeechSatConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py b/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py index aec02db00fef24..0faa4eba4eb172 100755 --- a/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py +++ b/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py @@ -72,10 +72,6 @@ _XVECTOR_CHECKPOINT = "microsoft/unispeech-sat-base-plus-sv" _XVECTOR_EXPECTED_OUTPUT = 0.97 -UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat -] - @dataclass class UniSpeechSatForPreTrainingOutput(ModelOutput): diff --git a/src/transformers/models/univnet/__init__.py b/src/transformers/models/univnet/__init__.py index afb03ee9894b0e..ea9babc3314f40 100644 --- a/src/transformers/models/univnet/__init__.py +++ b/src/transformers/models/univnet/__init__.py @@ -22,10 +22,7 @@ _import_structure = { - "configuration_univnet": [ - "UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP", - "UnivNetConfig", - ], + "configuration_univnet": ["UnivNetConfig"], "feature_extraction_univnet": ["UnivNetFeatureExtractor"], } @@ -36,14 +33,12 @@ pass else: _import_structure["modeling_univnet"] = [ - "UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST", "UnivNetModel", ] if TYPE_CHECKING: from .configuration_univnet import ( - UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP, UnivNetConfig, ) from .feature_extraction_univnet import UnivNetFeatureExtractor @@ -55,7 +50,6 @@ pass else: from .modeling_univnet import ( - UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST, UnivNetModel, ) diff --git a/src/transformers/models/univnet/configuration_univnet.py b/src/transformers/models/univnet/configuration_univnet.py index c9dbbb5328210e..27850e114d3d2d 100644 --- a/src/transformers/models/univnet/configuration_univnet.py +++ b/src/transformers/models/univnet/configuration_univnet.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "dg845/univnet-dev": "https://huggingface.co/dg845/univnet-dev/resolve/main/config.json", -} - - class UnivNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`UnivNetModel`]. It is used to instantiate a diff --git a/src/transformers/models/univnet/modeling_univnet.py b/src/transformers/models/univnet/modeling_univnet.py index dc9beddec525b8..e4fc1215c08bd6 100644 --- a/src/transformers/models/univnet/modeling_univnet.py +++ b/src/transformers/models/univnet/modeling_univnet.py @@ -32,11 +32,6 @@ _CHECKPOINT_FOR_DOC = "dg845/univnet-dev" -UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "dg845/univnet-dev", - # See all UnivNet models at https://huggingface.co/models?filter=univnet -] - @dataclass class UnivNetModelOutput(ModelOutput): diff --git a/src/transformers/models/upernet/modeling_upernet.py b/src/transformers/models/upernet/modeling_upernet.py index b889ae4eb4ce82..2d5b4443e35df3 100644 --- a/src/transformers/models/upernet/modeling_upernet.py +++ b/src/transformers/models/upernet/modeling_upernet.py @@ -27,11 +27,6 @@ from .configuration_upernet import UperNetConfig -UPERNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openmmlab/upernet-convnext-tiny", - # See all UperNet models at https://huggingface.co/models?filter=upernet -] - # General docstring _CONFIG_FOR_DOC = "UperNetConfig" diff --git a/src/transformers/models/videomae/__init__.py b/src/transformers/models/videomae/__init__.py index 663b6d41aba605..0e52081adbca5b 100644 --- a/src/transformers/models/videomae/__init__.py +++ b/src/transformers/models/videomae/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_videomae": ["VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VideoMAEConfig"], + "configuration_videomae": ["VideoMAEConfig"], } try: @@ -27,7 +27,6 @@ pass else: _import_structure["modeling_videomae"] = [ - "VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST", "VideoMAEForPreTraining", "VideoMAEModel", "VideoMAEPreTrainedModel", @@ -44,7 +43,7 @@ _import_structure["image_processing_videomae"] = ["VideoMAEImageProcessor"] if TYPE_CHECKING: - from .configuration_videomae import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP, VideoMAEConfig + from .configuration_videomae import VideoMAEConfig try: if not is_torch_available(): @@ -53,7 +52,6 @@ pass else: from .modeling_videomae import ( - VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST, VideoMAEForPreTraining, VideoMAEForVideoClassification, VideoMAEModel, diff --git a/src/transformers/models/videomae/configuration_videomae.py b/src/transformers/models/videomae/configuration_videomae.py index 1645b4985dac79..b1cfcaecfae2c6 100644 --- a/src/transformers/models/videomae/configuration_videomae.py +++ b/src/transformers/models/videomae/configuration_videomae.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "MCG-NJU/videomae-base": "https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json", -} - class VideoMAEConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/videomae/modeling_videomae.py b/src/transformers/models/videomae/modeling_videomae.py index aac69b6c536be4..100bee54389569 100644 --- a/src/transformers/models/videomae/modeling_videomae.py +++ b/src/transformers/models/videomae/modeling_videomae.py @@ -47,11 +47,6 @@ _CONFIG_FOR_DOC = "VideoMAEConfig" _CHECKPOINT_FOR_DOC = "MCG-NJU/videomae-base" -VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "MCG-NJU/videomae-base", - # See all VideoMAE models at https://huggingface.co/models?filter=videomae -] - @dataclass class VideoMAEDecoderOutput(ModelOutput): diff --git a/src/transformers/models/vilt/__init__.py b/src/transformers/models/vilt/__init__.py index 6d5afba10dacfc..6fcfd64c8beb68 100644 --- a/src/transformers/models/vilt/__init__.py +++ b/src/transformers/models/vilt/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_vilt": ["VILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViltConfig"]} +_import_structure = {"configuration_vilt": ["ViltConfig"]} try: if not is_vision_available(): @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_vilt"] = [ - "VILT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViltForImageAndTextRetrieval", "ViltForImagesAndTextClassification", "ViltForTokenClassification", @@ -48,7 +47,7 @@ if TYPE_CHECKING: - from .configuration_vilt import VILT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViltConfig + from .configuration_vilt import ViltConfig try: if not is_vision_available(): @@ -67,7 +66,6 @@ pass else: from .modeling_vilt import ( - VILT_PRETRAINED_MODEL_ARCHIVE_LIST, ViltForImageAndTextRetrieval, ViltForImagesAndTextClassification, ViltForMaskedLM, diff --git a/src/transformers/models/vilt/configuration_vilt.py b/src/transformers/models/vilt/configuration_vilt.py index bd419285e98ca0..ef0ce550d2a044 100644 --- a/src/transformers/models/vilt/configuration_vilt.py +++ b/src/transformers/models/vilt/configuration_vilt.py @@ -20,10 +20,6 @@ logger = logging.get_logger(__name__) -VILT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "dandelin/vilt-b32-mlm": "https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json" -} - class ViltConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vilt/modeling_vilt.py b/src/transformers/models/vilt/modeling_vilt.py index 9ffa9fff013c88..f3eff9277c8a67 100755 --- a/src/transformers/models/vilt/modeling_vilt.py +++ b/src/transformers/models/vilt/modeling_vilt.py @@ -48,11 +48,6 @@ _CONFIG_FOR_DOC = "ViltConfig" _CHECKPOINT_FOR_DOC = "dandelin/vilt-b32-mlm" -VILT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "dandelin/vilt-b32-mlm", - # See all ViLT models at https://huggingface.co/models?filter=vilt -] - @dataclass class ViltForImagesAndTextClassificationOutput(ModelOutput): diff --git a/src/transformers/models/vipllava/__init__.py b/src/transformers/models/vipllava/__init__.py index 2853605ba2d275..edc2a5106ba7cf 100644 --- a/src/transformers/models/vipllava/__init__.py +++ b/src/transformers/models/vipllava/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_vipllava": ["VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "VipLlavaConfig"]} +_import_structure = {"configuration_vipllava": ["VipLlavaConfig"]} try: @@ -26,14 +26,13 @@ pass else: _import_structure["modeling_vipllava"] = [ - "VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "VipLlavaForConditionalGeneration", "VipLlavaPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_vipllava import VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, VipLlavaConfig + from .configuration_vipllava import VipLlavaConfig try: if not is_torch_available(): @@ -42,7 +41,6 @@ pass else: from .modeling_vipllava import ( - VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, VipLlavaForConditionalGeneration, VipLlavaPreTrainedModel, ) diff --git a/src/transformers/models/vipllava/configuration_vipllava.py b/src/transformers/models/vipllava/configuration_vipllava.py index bba02bea789a6b..e94d4be6c1e0b6 100644 --- a/src/transformers/models/vipllava/configuration_vipllava.py +++ b/src/transformers/models/vipllava/configuration_vipllava.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "ybelkada/vip-llava-7b-hf": "https://huggingface.co/llava-hf/vip-llava-7b-hf/resolve/main/config.json", -} - class VipLlavaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vipllava/modeling_vipllava.py b/src/transformers/models/vipllava/modeling_vipllava.py index 34582a912a6e08..82af43fab5def7 100644 --- a/src/transformers/models/vipllava/modeling_vipllava.py +++ b/src/transformers/models/vipllava/modeling_vipllava.py @@ -38,11 +38,6 @@ _CONFIG_FOR_DOC = "VipLlavaConfig" -VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "llava-hf/vip-llava-7b-hf", - # See all VipLlava models at https://huggingface.co/models?filter=vipllava -] - @dataclass # Copied from transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast with Idefics->VipLlava diff --git a/src/transformers/models/visual_bert/__init__.py b/src/transformers/models/visual_bert/__init__.py index a752f1fa0c1476..db74a924a85cc7 100644 --- a/src/transformers/models/visual_bert/__init__.py +++ b/src/transformers/models/visual_bert/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_visual_bert": ["VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VisualBertConfig"]} +_import_structure = {"configuration_visual_bert": ["VisualBertConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_visual_bert"] = [ - "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "VisualBertForMultipleChoice", "VisualBertForPreTraining", "VisualBertForQuestionAnswering", @@ -38,7 +37,7 @@ if TYPE_CHECKING: - from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig + from .configuration_visual_bert import VisualBertConfig try: if not is_torch_available(): @@ -47,7 +46,6 @@ pass else: from .modeling_visual_bert import ( - VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, VisualBertForMultipleChoice, VisualBertForPreTraining, VisualBertForQuestionAnswering, diff --git a/src/transformers/models/visual_bert/configuration_visual_bert.py b/src/transformers/models/visual_bert/configuration_visual_bert.py index 9b675ff602bc77..bb146a143aab9f 100644 --- a/src/transformers/models/visual_bert/configuration_visual_bert.py +++ b/src/transformers/models/visual_bert/configuration_visual_bert.py @@ -20,25 +20,6 @@ logger = logging.get_logger(__name__) -VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "uclanlp/visualbert-vqa": "https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json", - "uclanlp/visualbert-vqa-pre": "https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json", - "uclanlp/visualbert-vqa-coco-pre": ( - "https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json" - ), - "uclanlp/visualbert-vcr": "https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json", - "uclanlp/visualbert-vcr-pre": "https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json", - "uclanlp/visualbert-vcr-coco-pre": ( - "https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json" - ), - "uclanlp/visualbert-nlvr2": "https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json", - "uclanlp/visualbert-nlvr2-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json", - "uclanlp/visualbert-nlvr2-coco-pre": ( - "https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json" - ), - # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert -} - class VisualBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/visual_bert/modeling_visual_bert.py b/src/transformers/models/visual_bert/modeling_visual_bert.py index 4af7696fc39634..805dd8776531db 100755 --- a/src/transformers/models/visual_bert/modeling_visual_bert.py +++ b/src/transformers/models/visual_bert/modeling_visual_bert.py @@ -48,19 +48,6 @@ _CONFIG_FOR_DOC = "VisualBertConfig" _CHECKPOINT_FOR_DOC = "uclanlp/visualbert-vqa-coco-pre" -VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "uclanlp/visualbert-vqa", - "uclanlp/visualbert-vqa-pre", - "uclanlp/visualbert-vqa-coco-pre", - "uclanlp/visualbert-vcr", - "uclanlp/visualbert-vcr-pre", - "uclanlp/visualbert-vcr-coco-pre", - "uclanlp/visualbert-nlvr2", - "uclanlp/visualbert-nlvr2-pre", - "uclanlp/visualbert-nlvr2-coco-pre", - # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert -] - class VisualBertEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings and visual embeddings.""" diff --git a/src/transformers/models/vit/__init__.py b/src/transformers/models/vit/__init__.py index d426ec93bf5859..db41e881faafa6 100644 --- a/src/transformers/models/vit/__init__.py +++ b/src/transformers/models/vit/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig", "ViTOnnxConfig"]} +_import_structure = {"configuration_vit": ["ViTConfig", "ViTOnnxConfig"]} try: if not is_vision_available(): @@ -41,7 +41,6 @@ pass else: _import_structure["modeling_vit"] = [ - "VIT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTForImageClassification", "ViTForMaskedImageModeling", "ViTModel", @@ -73,7 +72,7 @@ ] if TYPE_CHECKING: - from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig, ViTOnnxConfig + from .configuration_vit import ViTConfig, ViTOnnxConfig try: if not is_vision_available(): @@ -91,7 +90,6 @@ pass else: from .modeling_vit import ( - VIT_PRETRAINED_MODEL_ARCHIVE_LIST, ViTForImageClassification, ViTForMaskedImageModeling, ViTModel, diff --git a/src/transformers/models/vit/configuration_vit.py b/src/transformers/models/vit/configuration_vit.py index 5eda0385c30c1d..286d302c7883d5 100644 --- a/src/transformers/models/vit/configuration_vit.py +++ b/src/transformers/models/vit/configuration_vit.py @@ -26,11 +26,6 @@ logger = logging.get_logger(__name__) -VIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/vit-base-patch16-224": "https://huggingface.co/vit-base-patch16-224/resolve/main/config.json", - # See all ViT models at https://huggingface.co/models?filter=vit -} - class ViTConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vit/modeling_vit.py b/src/transformers/models/vit/modeling_vit.py index 734ccf6a9e80f4..8aa43c5c43c500 100644 --- a/src/transformers/models/vit/modeling_vit.py +++ b/src/transformers/models/vit/modeling_vit.py @@ -57,12 +57,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "Egyptian cat" -VIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/vit-base-patch16-224", - # See all ViT models at https://huggingface.co/models?filter=vit -] - - class ViTEmbeddings(nn.Module): """ Construct the CLS token, position and patch embeddings. Optionally, also the mask token. diff --git a/src/transformers/models/vit_hybrid/__init__.py b/src/transformers/models/vit_hybrid/__init__.py index 47342d3a260438..f87e44449a978e 100644 --- a/src/transformers/models/vit_hybrid/__init__.py +++ b/src/transformers/models/vit_hybrid/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_vit_hybrid": ["VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTHybridConfig"]} +_import_structure = {"configuration_vit_hybrid": ["ViTHybridConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_vit_hybrid"] = [ - "VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTHybridForImageClassification", "ViTHybridModel", "ViTHybridPreTrainedModel", @@ -41,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_vit_hybrid import VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTHybridConfig + from .configuration_vit_hybrid import ViTHybridConfig try: if not is_torch_available(): @@ -50,7 +49,6 @@ pass else: from .modeling_vit_hybrid import ( - VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST, ViTHybridForImageClassification, ViTHybridModel, ViTHybridPreTrainedModel, diff --git a/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py b/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py index 2875e62dd47200..2b9dcd0a81159f 100644 --- a/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py +++ b/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/vit-hybrid-base-bit-384": "https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json", - # See all ViT hybrid models at https://huggingface.co/models?filter=vit -} - class ViTHybridConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py b/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py index 3dc715af511ca8..20579e0d3db2cc 100644 --- a/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py +++ b/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py @@ -47,12 +47,6 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" -VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/vit-hybrid-base-bit-384", - # See all ViT hybrid models at https://huggingface.co/models?filter=vit-hybrid -] - - class ViTHybridEmbeddings(nn.Module): """ Construct the CLS token, position and patch embeddings. Optionally, also the mask token. diff --git a/src/transformers/models/vit_mae/__init__.py b/src/transformers/models/vit_mae/__init__.py index bfd200e9dcb913..f5360061762e6f 100644 --- a/src/transformers/models/vit_mae/__init__.py +++ b/src/transformers/models/vit_mae/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_vit_mae": ["VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMAEConfig"]} +_import_structure = {"configuration_vit_mae": ["ViTMAEConfig"]} try: if not is_torch_available(): @@ -31,7 +31,6 @@ pass else: _import_structure["modeling_vit_mae"] = [ - "VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMAEForPreTraining", "ViTMAELayer", "ViTMAEModel", @@ -51,7 +50,7 @@ ] if TYPE_CHECKING: - from .configuration_vit_mae import VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMAEConfig + from .configuration_vit_mae import ViTMAEConfig try: if not is_torch_available(): @@ -60,7 +59,6 @@ pass else: from .modeling_vit_mae import ( - VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMAEForPreTraining, ViTMAELayer, ViTMAEModel, diff --git a/src/transformers/models/vit_mae/configuration_vit_mae.py b/src/transformers/models/vit_mae/configuration_vit_mae.py index 42697f382c3959..e4e46e7e4202d0 100644 --- a/src/transformers/models/vit_mae/configuration_vit_mae.py +++ b/src/transformers/models/vit_mae/configuration_vit_mae.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/vit-mae-base": "https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json", - # See all ViT MAE models at https://huggingface.co/models?filter=vit-mae -} - class ViTMAEConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vit_mae/modeling_vit_mae.py b/src/transformers/models/vit_mae/modeling_vit_mae.py index 910353217fa9fc..b652c9e71f9106 100755 --- a/src/transformers/models/vit_mae/modeling_vit_mae.py +++ b/src/transformers/models/vit_mae/modeling_vit_mae.py @@ -45,11 +45,6 @@ _CONFIG_FOR_DOC = "ViTMAEConfig" _CHECKPOINT_FOR_DOC = "facebook/vit-mae-base" -VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/vit-mae-base", - # See all ViTMAE models at https://huggingface.co/models?filter=vit_mae -] - @dataclass class ViTMAEModelOutput(ModelOutput): diff --git a/src/transformers/models/vit_msn/__init__.py b/src/transformers/models/vit_msn/__init__.py index c36cb750cfa4e6..88f7ff73d29b69 100644 --- a/src/transformers/models/vit_msn/__init__.py +++ b/src/transformers/models/vit_msn/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_vit_msn": ["VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMSNConfig"]} +_import_structure = {"configuration_vit_msn": ["ViTMSNConfig"]} try: if not is_torch_available(): @@ -25,14 +25,13 @@ pass else: _import_structure["modeling_vit_msn"] = [ - "VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMSNModel", "ViTMSNForImageClassification", "ViTMSNPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig + from .configuration_vit_msn import ViTMSNConfig try: if not is_torch_available(): @@ -41,7 +40,6 @@ pass else: from .modeling_vit_msn import ( - VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMSNForImageClassification, ViTMSNModel, ViTMSNPreTrainedModel, diff --git a/src/transformers/models/vit_msn/configuration_vit_msn.py b/src/transformers/models/vit_msn/configuration_vit_msn.py index 4ee05e3c393be0..14acb15d549c04 100644 --- a/src/transformers/models/vit_msn/configuration_vit_msn.py +++ b/src/transformers/models/vit_msn/configuration_vit_msn.py @@ -21,11 +21,6 @@ logger = logging.get_logger(__name__) -VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "sayakpaul/vit-msn-base": "https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json", - # See all ViT MSN models at https://huggingface.co/models?filter=vit_msn -} - class ViTMSNConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vit_msn/modeling_vit_msn.py b/src/transformers/models/vit_msn/modeling_vit_msn.py index 6b10eb9f245059..dd42ae26dffaf3 100644 --- a/src/transformers/models/vit_msn/modeling_vit_msn.py +++ b/src/transformers/models/vit_msn/modeling_vit_msn.py @@ -37,10 +37,6 @@ _CONFIG_FOR_DOC = "ViTMSNConfig" _CHECKPOINT_FOR_DOC = "facebook/vit-msn-small" -VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/vit-msn-small", - # See all ViTMSN models at https://huggingface.co/models?filter=vit_msn -] class ViTMSNEmbeddings(nn.Module): diff --git a/src/transformers/models/vitdet/__init__.py b/src/transformers/models/vitdet/__init__.py index 8ccc1365820d69..a7ee9c755ff19b 100644 --- a/src/transformers/models/vitdet/__init__.py +++ b/src/transformers/models/vitdet/__init__.py @@ -20,7 +20,7 @@ ) -_import_structure = {"configuration_vitdet": ["VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitDetConfig"]} +_import_structure = {"configuration_vitdet": ["VitDetConfig"]} try: if not is_torch_available(): @@ -29,14 +29,13 @@ pass else: _import_structure["modeling_vitdet"] = [ - "VITDET_PRETRAINED_MODEL_ARCHIVE_LIST", "VitDetModel", "VitDetPreTrainedModel", "VitDetBackbone", ] if TYPE_CHECKING: - from .configuration_vitdet import VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP, VitDetConfig + from .configuration_vitdet import VitDetConfig try: if not is_torch_available(): @@ -45,7 +44,6 @@ pass else: from .modeling_vitdet import ( - VITDET_PRETRAINED_MODEL_ARCHIVE_LIST, VitDetBackbone, VitDetModel, VitDetPreTrainedModel, diff --git a/src/transformers/models/vitdet/configuration_vitdet.py b/src/transformers/models/vitdet/configuration_vitdet.py index 2b1f37e311434c..f85558c254018d 100644 --- a/src/transformers/models/vitdet/configuration_vitdet.py +++ b/src/transformers/models/vitdet/configuration_vitdet.py @@ -22,10 +22,6 @@ logger = logging.get_logger(__name__) -VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/vit-det-base": "https://huggingface.co/facebook/vit-det-base/resolve/main/config.json", -} - class VitDetConfig(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/vitdet/modeling_vitdet.py b/src/transformers/models/vitdet/modeling_vitdet.py index 7af69d28697cd8..8d54da846950e9 100644 --- a/src/transformers/models/vitdet/modeling_vitdet.py +++ b/src/transformers/models/vitdet/modeling_vitdet.py @@ -42,12 +42,6 @@ _CONFIG_FOR_DOC = "VitDetConfig" -VITDET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/vit-det-base", - # See all ViTDet models at https://huggingface.co/models?filter=vitdet -] - - class VitDetEmbeddings(nn.Module): """ This class turns `pixel_values` of shape `(batch_size, num_channels, height, width)` into the initial diff --git a/src/transformers/models/vitmatte/__init__.py b/src/transformers/models/vitmatte/__init__.py index abbfae97c22030..7745a96cc6d545 100644 --- a/src/transformers/models/vitmatte/__init__.py +++ b/src/transformers/models/vitmatte/__init__.py @@ -21,7 +21,7 @@ ) -_import_structure = {"configuration_vitmatte": ["VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitMatteConfig"]} +_import_structure = {"configuration_vitmatte": ["VitMatteConfig"]} try: if not is_vision_available(): @@ -38,13 +38,12 @@ pass else: _import_structure["modeling_vitmatte"] = [ - "VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST", "VitMattePreTrainedModel", "VitMatteForImageMatting", ] if TYPE_CHECKING: - from .configuration_vitmatte import VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP, VitMatteConfig + from .configuration_vitmatte import VitMatteConfig try: if not is_vision_available(): @@ -61,7 +60,6 @@ pass else: from .modeling_vitmatte import ( - VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST, VitMatteForImageMatting, VitMattePreTrainedModel, ) diff --git a/src/transformers/models/vitmatte/configuration_vitmatte.py b/src/transformers/models/vitmatte/configuration_vitmatte.py index 13f9942c9e0013..67f562d2bd13d5 100644 --- a/src/transformers/models/vitmatte/configuration_vitmatte.py +++ b/src/transformers/models/vitmatte/configuration_vitmatte.py @@ -24,10 +24,6 @@ logger = logging.get_logger(__name__) -VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "hustvl/vitmatte-small-composition-1k": "https://huggingface.co/hustvl/vitmatte-small-composition-1k/resolve/main/config.json", -} - class VitMatteConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vitmatte/modeling_vitmatte.py b/src/transformers/models/vitmatte/modeling_vitmatte.py index 465f5da6adf5ab..75f13885ea994f 100644 --- a/src/transformers/models/vitmatte/modeling_vitmatte.py +++ b/src/transformers/models/vitmatte/modeling_vitmatte.py @@ -31,12 +31,6 @@ from .configuration_vitmatte import VitMatteConfig -VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "hustvl/vitmatte-small-composition-1k", - # See all VitMatte models at https://huggingface.co/models?filter=vitmatte -] - - # General docstring _CONFIG_FOR_DOC = "VitMatteConfig" diff --git a/src/transformers/models/vits/__init__.py b/src/transformers/models/vits/__init__.py index 79c18048e7c776..14428463d28a50 100644 --- a/src/transformers/models/vits/__init__.py +++ b/src/transformers/models/vits/__init__.py @@ -23,10 +23,7 @@ _import_structure = { - "configuration_vits": [ - "VITS_PRETRAINED_CONFIG_ARCHIVE_MAP", - "VitsConfig", - ], + "configuration_vits": ["VitsConfig"], "tokenization_vits": ["VitsTokenizer"], } @@ -37,14 +34,12 @@ pass else: _import_structure["modeling_vits"] = [ - "VITS_PRETRAINED_MODEL_ARCHIVE_LIST", "VitsModel", "VitsPreTrainedModel", ] if TYPE_CHECKING: from .configuration_vits import ( - VITS_PRETRAINED_CONFIG_ARCHIVE_MAP, VitsConfig, ) from .tokenization_vits import VitsTokenizer @@ -56,7 +51,6 @@ pass else: from .modeling_vits import ( - VITS_PRETRAINED_MODEL_ARCHIVE_LIST, VitsModel, VitsPreTrainedModel, ) diff --git a/src/transformers/models/vits/configuration_vits.py b/src/transformers/models/vits/configuration_vits.py index 72f69e75a51b16..8d5ffca36f3674 100644 --- a/src/transformers/models/vits/configuration_vits.py +++ b/src/transformers/models/vits/configuration_vits.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -VITS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/mms-tts-eng": "https://huggingface.co/facebook/mms-tts-eng/resolve/main/config.json", -} - class VitsConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vits/modeling_vits.py b/src/transformers/models/vits/modeling_vits.py index 18309f3a107d6c..905945e01ae1d8 100644 --- a/src/transformers/models/vits/modeling_vits.py +++ b/src/transformers/models/vits/modeling_vits.py @@ -42,13 +42,6 @@ _CONFIG_FOR_DOC = "VitsConfig" -VITS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/mms-tts-eng", - # See all VITS models at https://huggingface.co/models?filter=vits - # and all MMS models at https://huggingface.co/models?sort=trending&search=facebook%2Fmms-tts -] - - @dataclass class VitsModelOutput(ModelOutput): """ diff --git a/src/transformers/models/vits/tokenization_vits.py b/src/transformers/models/vits/tokenization_vits.py index 0563be326cdb51..c8b115c176bcef 100644 --- a/src/transformers/models/vits/tokenization_vits.py +++ b/src/transformers/models/vits/tokenization_vits.py @@ -32,17 +32,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/mms-tts-eng": "https://huggingface.co/facebook/mms-tts-eng/resolve/main/vocab.json", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - # This model does not have a maximum input length. - "facebook/mms-tts-eng": 4096, -} - def has_non_roman_characters(input_string): # Find any character outside the ASCII range @@ -77,8 +66,6 @@ class VitsTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/vivit/__init__.py b/src/transformers/models/vivit/__init__.py index ec446b79707255..261238edccbe75 100644 --- a/src/transformers/models/vivit/__init__.py +++ b/src/transformers/models/vivit/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_vivit": ["VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VivitConfig"], + "configuration_vivit": ["VivitConfig"], } try: if not is_vision_available(): @@ -40,7 +40,6 @@ pass else: _import_structure["modeling_vivit"] = [ - "VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "VivitModel", "VivitPreTrainedModel", "VivitForVideoClassification", @@ -48,7 +47,7 @@ if TYPE_CHECKING: - from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig + from .configuration_vivit import VivitConfig try: if not is_vision_available(): @@ -65,7 +64,6 @@ pass else: from .modeling_vivit import ( - VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST, VivitForVideoClassification, VivitModel, VivitPreTrainedModel, diff --git a/src/transformers/models/vivit/configuration_vivit.py b/src/transformers/models/vivit/configuration_vivit.py index 0e367fcb9b79b1..4cbebc7692c804 100644 --- a/src/transformers/models/vivit/configuration_vivit.py +++ b/src/transformers/models/vivit/configuration_vivit.py @@ -20,13 +20,6 @@ logger = logging.get_logger(__name__) -VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "google/vivit-b-16x2-kinetics400": ( - "https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json" - ), - # See all Vivit models at https://huggingface.co/models?filter=vivit -} - class VivitConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/vivit/modeling_vivit.py b/src/transformers/models/vivit/modeling_vivit.py index a9c3f5fd651543..27035f4424f4ab 100755 --- a/src/transformers/models/vivit/modeling_vivit.py +++ b/src/transformers/models/vivit/modeling_vivit.py @@ -36,11 +36,6 @@ _CHECKPOINT_FOR_DOC = "google/vivit-b-16x2-kinetics400" _CONFIG_FOR_DOC = "VivitConfig" -VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "google/vivit-b-16x2-kinetics400", - # See all Vivit models at https://huggingface.co/models?filter=vivit -] - class VivitTubeletEmbeddings(nn.Module): """ diff --git a/src/transformers/models/wav2vec2/__init__.py b/src/transformers/models/wav2vec2/__init__.py index b3abdb99ec722d..06e1c6628db9a8 100644 --- a/src/transformers/models/wav2vec2/__init__.py +++ b/src/transformers/models/wav2vec2/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_wav2vec2": ["WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Wav2Vec2Config"], + "configuration_wav2vec2": ["Wav2Vec2Config"], "feature_extraction_wav2vec2": ["Wav2Vec2FeatureExtractor"], "processing_wav2vec2": ["Wav2Vec2Processor"], "tokenization_wav2vec2": ["Wav2Vec2CTCTokenizer", "Wav2Vec2Tokenizer"], @@ -37,7 +37,6 @@ pass else: _import_structure["modeling_wav2vec2"] = [ - "WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ForAudioFrameClassification", "Wav2Vec2ForCTC", "Wav2Vec2ForMaskedLM", @@ -55,7 +54,6 @@ pass else: _import_structure["modeling_tf_wav2vec2"] = [ - "TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWav2Vec2ForCTC", "TFWav2Vec2Model", "TFWav2Vec2PreTrainedModel", @@ -77,7 +75,7 @@ if TYPE_CHECKING: - from .configuration_wav2vec2 import WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2Config + from .configuration_wav2vec2 import Wav2Vec2Config from .feature_extraction_wav2vec2 import Wav2Vec2FeatureExtractor from .processing_wav2vec2 import Wav2Vec2Processor from .tokenization_wav2vec2 import Wav2Vec2CTCTokenizer, Wav2Vec2Tokenizer @@ -89,7 +87,6 @@ pass else: from .modeling_wav2vec2 import ( - WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ForAudioFrameClassification, Wav2Vec2ForCTC, Wav2Vec2ForMaskedLM, @@ -107,7 +104,6 @@ pass else: from .modeling_tf_wav2vec2 import ( - TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, TFWav2Vec2ForCTC, TFWav2Vec2ForSequenceClassification, TFWav2Vec2Model, diff --git a/src/transformers/models/wav2vec2/configuration_wav2vec2.py b/src/transformers/models/wav2vec2/configuration_wav2vec2.py index fadf1b6b6a5262..1d6777efcb74ee 100644 --- a/src/transformers/models/wav2vec2/configuration_wav2vec2.py +++ b/src/transformers/models/wav2vec2/configuration_wav2vec2.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/wav2vec2-base-960h": "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json", - # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2 -} - class Wav2Vec2Config(PretrainedConfig): r""" diff --git a/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py b/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py index e6a6cb4a756bb0..efbae8f2324812 100644 --- a/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py +++ b/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py @@ -52,13 +52,6 @@ _CHECKPOINT_FOR_DOC = "facebook/wav2vec2-base-960h" _CONFIG_FOR_DOC = "Wav2Vec2Config" -TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/wav2vec2-base-960h", - "facebook/wav2vec2-large-960h", - "facebook/wav2vec2-large-960h-lv60", - "facebook/wav2vec2-large-960h-lv60-self", - # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2 -] LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/wav2vec2/modeling_wav2vec2.py b/src/transformers/models/wav2vec2/modeling_wav2vec2.py index 082dd18dce844e..94e172d28a9d5b 100755 --- a/src/transformers/models/wav2vec2/modeling_wav2vec2.py +++ b/src/transformers/models/wav2vec2/modeling_wav2vec2.py @@ -89,15 +89,6 @@ _XVECTOR_EXPECTED_OUTPUT = 0.98 -WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/wav2vec2-base-960h", - "facebook/wav2vec2-large-960h", - "facebook/wav2vec2-large-960h-lv60", - "facebook/wav2vec2-large-960h-lv60-self", - # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2 -] - - @dataclass class Wav2Vec2ForPreTrainingOutput(ModelOutput): """ diff --git a/src/transformers/models/wav2vec2/tokenization_wav2vec2.py b/src/transformers/models/wav2vec2/tokenization_wav2vec2.py index 00bb00fba375e7..42b1aa306385df 100644 --- a/src/transformers/models/wav2vec2/tokenization_wav2vec2.py +++ b/src/transformers/models/wav2vec2/tokenization_wav2vec2.py @@ -16,7 +16,6 @@ import json import os -import sys import warnings from dataclasses import dataclass from itertools import groupby @@ -56,19 +55,8 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/wav2vec2-base-960h": "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/vocab.json", - }, - "tokenizer_config_file": { - "facebook/wav2vec2-base-960h": ( - "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/tokenizer_config.json" - ), - }, -} # Wav2Vec2 has no max input length -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"facebook/wav2vec2-base-960h": sys.maxsize} WAV2VEC2_KWARGS_DOCSTRING = r""" padding (`bool`, `str` or [`~utils.PaddingStrategy`], *optional*, defaults to `False`): @@ -157,8 +145,6 @@ class Wav2Vec2CTCTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/wav2vec2_bert/__init__.py b/src/transformers/models/wav2vec2_bert/__init__.py index 594f108bcaad96..be37038211a811 100644 --- a/src/transformers/models/wav2vec2_bert/__init__.py +++ b/src/transformers/models/wav2vec2_bert/__init__.py @@ -17,10 +17,7 @@ _import_structure = { - "configuration_wav2vec2_bert": [ - "WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", - "Wav2Vec2BertConfig", - ], + "configuration_wav2vec2_bert": ["Wav2Vec2BertConfig"], "processing_wav2vec2_bert": ["Wav2Vec2BertProcessor"], } @@ -32,7 +29,6 @@ pass else: _import_structure["modeling_wav2vec2_bert"] = [ - "WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2BertForAudioFrameClassification", "Wav2Vec2BertForCTC", "Wav2Vec2BertForSequenceClassification", @@ -43,7 +39,6 @@ if TYPE_CHECKING: from .configuration_wav2vec2_bert import ( - WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2BertConfig, ) from .processing_wav2vec2_bert import Wav2Vec2BertProcessor @@ -55,7 +50,6 @@ pass else: from .modeling_wav2vec2_bert import ( - WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2BertForAudioFrameClassification, Wav2Vec2BertForCTC, Wav2Vec2BertForSequenceClassification, diff --git a/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py b/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py index 621aede3e3f1c3..f6c364884bd2b4 100644 --- a/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py +++ b/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py @@ -21,10 +21,6 @@ logger = logging.get_logger(__name__) -WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/w2v-bert-2.0": "https://huggingface.co/facebook/w2v-bert-2.0/resolve/main/config.json", -} - class Wav2Vec2BertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py b/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py index 858f270a87f138..9f0d631a402091 100644 --- a/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py +++ b/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py @@ -64,12 +64,6 @@ _CTC_EXPECTED_LOSS = 17.04 -WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/w2v-bert-2.0", - # See all Wav2Vec2-BERT models at https://huggingface.co/models?filter=wav2vec2-bert -] - - # Copied from transformers.models.seamless_m4t_v2.modeling_seamless_m4t_v2._compute_new_attention_mask def _compute_new_attention_mask(hidden_states: torch.Tensor, seq_lens: torch.Tensor): """ diff --git a/src/transformers/models/wav2vec2_conformer/__init__.py b/src/transformers/models/wav2vec2_conformer/__init__.py index 35081cfcdef97b..a780a50b6cce11 100644 --- a/src/transformers/models/wav2vec2_conformer/__init__.py +++ b/src/transformers/models/wav2vec2_conformer/__init__.py @@ -17,10 +17,7 @@ _import_structure = { - "configuration_wav2vec2_conformer": [ - "WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", - "Wav2Vec2ConformerConfig", - ], + "configuration_wav2vec2_conformer": ["Wav2Vec2ConformerConfig"], } @@ -31,7 +28,6 @@ pass else: _import_structure["modeling_wav2vec2_conformer"] = [ - "WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ConformerForAudioFrameClassification", "Wav2Vec2ConformerForCTC", "Wav2Vec2ConformerForPreTraining", @@ -43,7 +39,6 @@ if TYPE_CHECKING: from .configuration_wav2vec2_conformer import ( - WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2ConformerConfig, ) @@ -54,7 +49,6 @@ pass else: from .modeling_wav2vec2_conformer import ( - WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ConformerForAudioFrameClassification, Wav2Vec2ConformerForCTC, Wav2Vec2ConformerForPreTraining, diff --git a/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py b/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py index 9983f01bbf13eb..5c931342c9cf31 100644 --- a/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py +++ b/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py @@ -23,12 +23,6 @@ logger = logging.get_logger(__name__) -WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/wav2vec2-conformer-rel-pos-large": ( - "https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large/resolve/main/config.json" - ), -} - class Wav2Vec2ConformerConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py b/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py index 3ba2ff7bb3ae70..1680b2a60c64ab 100644 --- a/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py +++ b/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py @@ -65,12 +65,6 @@ _CTC_EXPECTED_LOSS = 64.21 -WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/wav2vec2-conformer-rel-pos-large", - # See all Wav2Vec2Conformer models at https://huggingface.co/models?filter=wav2vec2-conformer -] - - @dataclass # Copied from transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput with Wav2Vec2->Wav2Vec2Conformer class Wav2Vec2ConformerForPreTrainingOutput(ModelOutput): diff --git a/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py b/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py index c10b679409de12..8809e2c2e87c89 100644 --- a/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py +++ b/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py @@ -16,7 +16,6 @@ import json import os -import sys from dataclasses import dataclass from itertools import groupby from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union @@ -53,21 +52,8 @@ "tokenizer_config_file": "tokenizer_config.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/wav2vec2-lv-60-espeak-cv-ft": ( - "https://huggingface.co/facebook/wav2vec2-lv-60-espeak-cv-ft/resolve/main/vocab.json" - ), - }, - "tokenizer_config_file": { - "facebook/wav2vec2-lv-60-espeak-cv-ft": ( - "https://huggingface.co/facebook/wav2vec2-lv-60-espeak-cv-ft/resolve/main/tokenizer_config.json" - ), - }, -} # Wav2Vec2Phoneme has no max input length -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {"facebook/wav2vec2-lv-60-espeak-cv-ft": sys.maxsize} ListOfDict = List[Dict[str, Union[int, str]]] @@ -125,8 +111,6 @@ class Wav2Vec2PhonemeCTCTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/wavlm/__init__.py b/src/transformers/models/wavlm/__init__.py index 3d48a3615bb4a3..d615a3a5ae4062 100644 --- a/src/transformers/models/wavlm/__init__.py +++ b/src/transformers/models/wavlm/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_wavlm": ["WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "WavLMConfig"]} +_import_structure = {"configuration_wavlm": ["WavLMConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_wavlm"] = [ - "WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST", "WavLMForAudioFrameClassification", "WavLMForCTC", "WavLMForSequenceClassification", @@ -35,7 +34,7 @@ ] if TYPE_CHECKING: - from .configuration_wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig + from .configuration_wavlm import WavLMConfig try: if not is_torch_available(): @@ -44,7 +43,6 @@ pass else: from .modeling_wavlm import ( - WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST, WavLMForAudioFrameClassification, WavLMForCTC, WavLMForSequenceClassification, diff --git a/src/transformers/models/wavlm/configuration_wavlm.py b/src/transformers/models/wavlm/configuration_wavlm.py index 589741c520fad0..a860475336f931 100644 --- a/src/transformers/models/wavlm/configuration_wavlm.py +++ b/src/transformers/models/wavlm/configuration_wavlm.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/wavlm-base": "https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json", - # See all WavLM models at https://huggingface.co/models?filter=wavlm -} - class WavLMConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/wavlm/modeling_wavlm.py b/src/transformers/models/wavlm/modeling_wavlm.py index bfe0ced2b5a69d..f6d37cfaa17ceb 100755 --- a/src/transformers/models/wavlm/modeling_wavlm.py +++ b/src/transformers/models/wavlm/modeling_wavlm.py @@ -70,13 +70,6 @@ _XVECTOR_CHECKPOINT = "microsoft/wavlm-base-plus-sv" _XVECTOR_EXPECTED_OUTPUT = 0.97 -WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/wavlm-base", - "microsoft/wavlm-base-plus", - "microsoft/wavlm-large", - # See all WavLM models at https://huggingface.co/models?filter=wavlm -] - # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( diff --git a/src/transformers/models/whisper/__init__.py b/src/transformers/models/whisper/__init__.py index d87828da69f5d1..5d37e72c02b5df 100644 --- a/src/transformers/models/whisper/__init__.py +++ b/src/transformers/models/whisper/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_whisper": ["WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP", "WhisperConfig", "WhisperOnnxConfig"], + "configuration_whisper": ["WhisperConfig", "WhisperOnnxConfig"], "feature_extraction_whisper": ["WhisperFeatureExtractor"], "processing_whisper": ["WhisperProcessor"], "tokenization_whisper": ["WhisperTokenizer"], @@ -45,7 +45,6 @@ pass else: _import_structure["modeling_whisper"] = [ - "WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "WhisperForCausalLM", "WhisperForConditionalGeneration", "WhisperModel", @@ -60,7 +59,6 @@ pass else: _import_structure["modeling_tf_whisper"] = [ - "TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWhisperForConditionalGeneration", "TFWhisperModel", "TFWhisperPreTrainedModel", @@ -81,7 +79,7 @@ if TYPE_CHECKING: - from .configuration_whisper import WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperOnnxConfig + from .configuration_whisper import WhisperConfig, WhisperOnnxConfig from .feature_extraction_whisper import WhisperFeatureExtractor from .processing_whisper import WhisperProcessor from .tokenization_whisper import WhisperTokenizer @@ -101,7 +99,6 @@ pass else: from .modeling_whisper import ( - WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, WhisperForAudioClassification, WhisperForCausalLM, WhisperForConditionalGeneration, @@ -116,7 +113,6 @@ pass else: from .modeling_tf_whisper import ( - TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, TFWhisperForConditionalGeneration, TFWhisperModel, TFWhisperPreTrainedModel, diff --git a/src/transformers/models/whisper/configuration_whisper.py b/src/transformers/models/whisper/configuration_whisper.py index 5af3242141804e..c924a21c2a571c 100644 --- a/src/transformers/models/whisper/configuration_whisper.py +++ b/src/transformers/models/whisper/configuration_whisper.py @@ -29,9 +29,6 @@ logger = logging.get_logger(__name__) -WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/config.json", -} # fmt: off NON_SPEECH_TOKENS = [ diff --git a/src/transformers/models/whisper/modeling_tf_whisper.py b/src/transformers/models/whisper/modeling_tf_whisper.py index e5d59c00d3ed08..8033bb584fd2aa 100644 --- a/src/transformers/models/whisper/modeling_tf_whisper.py +++ b/src/transformers/models/whisper/modeling_tf_whisper.py @@ -52,11 +52,6 @@ _CONFIG_FOR_DOC = "WhisperConfig" -TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai/whisper-base", - # See all Whisper models at https://huggingface.co/models?filter=whisper -] - LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/whisper/modeling_whisper.py b/src/transformers/models/whisper/modeling_whisper.py index 45f2d9fc5ccca6..ec06a24e6528a3 100644 --- a/src/transformers/models/whisper/modeling_whisper.py +++ b/src/transformers/models/whisper/modeling_whisper.py @@ -59,12 +59,6 @@ _CHECKPOINT_FOR_DOC = "openai/whisper-tiny" -WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "openai/whisper-base", - # See all Whisper models at https://huggingface.co/models?filter=whisper -] - - # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/whisper/tokenization_whisper.py b/src/transformers/models/whisper/tokenization_whisper.py index f853c60e260f50..25e80d477fda3b 100644 --- a/src/transformers/models/whisper/tokenization_whisper.py +++ b/src/transformers/models/whisper/tokenization_whisper.py @@ -34,15 +34,6 @@ "normalizer_file": "normalizer.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/vocab.json", - }, - "merges_file": {"openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/merges_file.txt"}, - "normalizer_file": { - "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/normalizer.json" - }, -} MAX_MODEL_INPUT_SIZES = { "openai/whisper-base": 448, @@ -257,8 +248,6 @@ class WhisperTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = MAX_MODEL_INPUT_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/whisper/tokenization_whisper_fast.py b/src/transformers/models/whisper/tokenization_whisper_fast.py index dc5a3e0dc1f784..0463d521d5839c 100644 --- a/src/transformers/models/whisper/tokenization_whisper_fast.py +++ b/src/transformers/models/whisper/tokenization_whisper_fast.py @@ -39,54 +39,6 @@ "normalizer_file": "normalizer.json", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "openai/whisper-tiny": "https://huggingface.co/openai/whisper-tiny/resolve/main/vocab.json", - "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/vocab.json", - "openai/whisper-small": "https://huggingface.co/openai/whisper-small/resolve/main/vocab.json", - "openai/whisper-medium": "https://huggingface.co/openai/whisper-medium/resolve/main/vocab.json", - "openai/whisper-large": "https://huggingface.co/openai/whisper-large/resolve/main/vocab.json", - "openai/whisper-tiny.en": "https://huggingface.co/openai/whisper-tiny.en/resolve/main/vocab.json", - "openai/whisper-base.en": "https://huggingface.co/openai/whisper-base.en/resolve/main/vocab.json", - "openai/whisper-small.en": "https://huggingface.co/openai/whisper-small.en/resolve/main/vocab.json", - "openai/whisper-medium.en": "https://huggingface.co/openai/whisper-medium.en/resolve/main/vocab.json", - }, - "merges_file": { - "openai/whisper-tiny": "https://huggingface.co/openai/whisper-tiny/resolve/main/merges.txt", - "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/merges.txt", - "openai/whisper-small": "https://huggingface.co/openai/whisper-small/resolve/main/merges.txt", - "openai/whisper-medium": "https://huggingface.co/openai/whisper-medium/resolve/main/merges.txt", - "openai/whisper-large": "https://huggingface.co/openai/whisper-large/resolve/main/merges.txt", - "openai/whisper-tiny.en": "https://huggingface.co/openai/whisper-tiny.en/resolve/main/merges.txt", - "openai/whisper-base.en": "https://huggingface.co/openai/whisper-base.en/resolve/main/merges.txt", - "openai/whisper-small.en": "https://huggingface.co/openai/whisper-small.en/resolve/main/merges.txt", - "openai/whisper-medium.en": "https://huggingface.co/openai/whisper-medium.en/resolve/main/merges.txt", - }, - "tokenizer_file": { - "openai/whisper-tiny": "https://huggingface.co/openai/whisper-tiny/resolve/main/tokenizer.json", - "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/tokenizer.json", - "openai/whisper-small": "https://huggingface.co/openai/whisper-small/resolve/main/tokenizer.json", - "openai/whisper-medium": "https://huggingface.co/openai/whisper-medium/resolve/main/tokenizer.json", - "openai/whisper-large": "https://huggingface.co/openai/whisper-large/resolve/main/tokenizer.json", - "openai/whisper-tiny.en": "https://huggingface.co/openai/whisper-tiny.en/resolve/main/tokenizer.json", - "openai/whisper-base.en": "https://huggingface.co/openai/whisper-base.en/resolve/main/tokenizer.json", - "openai/whisper-small.en": "https://huggingface.co/openai/whisper-small.en/resolve/main/tokenizer.json", - "openai/whisper-medium.en": "https://huggingface.co/openai/whisper-medium.en/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "openai/whisper-tiny": 1500, - "openai/whisper-base": 1500, - "openai/whisper-small": 1500, - "openai/whisper-medium": 1500, - "openai/whisper-large": 1500, - "openai/whisper-tiny.en": 1500, - "openai/whisper-base.en": 1500, - "openai/whisper-small.en": 1500, - "openai/whisper-medium.en": 1500, -} - class WhisperTokenizerFast(PreTrainedTokenizerFast): """ @@ -128,8 +80,6 @@ class WhisperTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = WhisperTokenizer diff --git a/src/transformers/models/x_clip/__init__.py b/src/transformers/models/x_clip/__init__.py index ed3d2ff5152830..2f60ad0ddee2d2 100644 --- a/src/transformers/models/x_clip/__init__.py +++ b/src/transformers/models/x_clip/__init__.py @@ -18,7 +18,6 @@ _import_structure = { "configuration_x_clip": [ - "XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "XCLIPConfig", "XCLIPTextConfig", "XCLIPVisionConfig", @@ -33,7 +32,6 @@ pass else: _import_structure["modeling_x_clip"] = [ - "XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "XCLIPModel", "XCLIPPreTrainedModel", "XCLIPTextModel", @@ -42,7 +40,6 @@ if TYPE_CHECKING: from .configuration_x_clip import ( - XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, XCLIPConfig, XCLIPTextConfig, XCLIPVisionConfig, @@ -56,7 +53,6 @@ pass else: from .modeling_x_clip import ( - XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, XCLIPModel, XCLIPPreTrainedModel, XCLIPTextModel, diff --git a/src/transformers/models/x_clip/configuration_x_clip.py b/src/transformers/models/x_clip/configuration_x_clip.py index c7e23ae3ba80cf..757429d6dfe61a 100644 --- a/src/transformers/models/x_clip/configuration_x_clip.py +++ b/src/transformers/models/x_clip/configuration_x_clip.py @@ -23,10 +23,6 @@ logger = logging.get_logger(__name__) -XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/xclip-base-patch32": "https://huggingface.co/microsoft/xclip-base-patch32/resolve/main/config.json", -} - class XCLIPTextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/x_clip/modeling_x_clip.py b/src/transformers/models/x_clip/modeling_x_clip.py index e341b9639d87f0..092ea947617398 100644 --- a/src/transformers/models/x_clip/modeling_x_clip.py +++ b/src/transformers/models/x_clip/modeling_x_clip.py @@ -41,11 +41,6 @@ _CHECKPOINT_FOR_DOC = "microsoft/xclip-base-patch32" -XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/xclip-base-patch32", - # See all X-CLIP models at https://huggingface.co/models?filter=x-clip -] - # contrastive loss function, adapted from # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html diff --git a/src/transformers/models/xglm/__init__.py b/src/transformers/models/xglm/__init__.py index 747a4ddb4ed9c7..59bba032f4ea2a 100644 --- a/src/transformers/models/xglm/__init__.py +++ b/src/transformers/models/xglm/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_xglm": ["XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XGLMConfig"]} +_import_structure = {"configuration_xglm": ["XGLMConfig"]} try: if not is_sentencepiece_available(): @@ -49,7 +49,6 @@ pass else: _import_structure["modeling_xglm"] = [ - "XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XGLMForCausalLM", "XGLMModel", "XGLMPreTrainedModel", @@ -76,7 +75,6 @@ pass else: _import_structure["modeling_tf_xglm"] = [ - "TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXGLMForCausalLM", "TFXGLMModel", "TFXGLMPreTrainedModel", @@ -84,7 +82,7 @@ if TYPE_CHECKING: - from .configuration_xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig + from .configuration_xglm import XGLMConfig try: if not is_sentencepiece_available(): @@ -108,7 +106,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_xglm import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel + from .modeling_xglm import XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel try: if not is_flax_available(): @@ -125,7 +123,6 @@ pass else: from .modeling_tf_xglm import ( - TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXGLMForCausalLM, TFXGLMModel, TFXGLMPreTrainedModel, diff --git a/src/transformers/models/xglm/configuration_xglm.py b/src/transformers/models/xglm/configuration_xglm.py index 9377bbce6f01ec..8eebcfaee68bbb 100644 --- a/src/transformers/models/xglm/configuration_xglm.py +++ b/src/transformers/models/xglm/configuration_xglm.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/xglm-564M": "https://huggingface.co/facebook/xglm-564M/resolve/main/config.json", - # See all XGLM models at https://huggingface.co/models?filter=xglm -} - class XGLMConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/xglm/modeling_tf_xglm.py b/src/transformers/models/xglm/modeling_tf_xglm.py index 4157cc061695e9..6b563b665766cc 100644 --- a/src/transformers/models/xglm/modeling_tf_xglm.py +++ b/src/transformers/models/xglm/modeling_tf_xglm.py @@ -55,12 +55,6 @@ _CONFIG_FOR_DOC = "XGLMConfig" -TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/xglm-564M", - # See all XGLM models at https://huggingface.co/models?filter=xglm -] - - LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/xglm/modeling_xglm.py b/src/transformers/models/xglm/modeling_xglm.py index ee98f2090c2c19..faffd6e4741138 100755 --- a/src/transformers/models/xglm/modeling_xglm.py +++ b/src/transformers/models/xglm/modeling_xglm.py @@ -37,11 +37,6 @@ _CONFIG_FOR_DOC = "XGLMConfig" -XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/xglm-564M", - # See all XGLM models at https://huggingface.co/models?filter=xglm -] - XGLM_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads diff --git a/src/transformers/models/xglm/tokenization_xglm.py b/src/transformers/models/xglm/tokenization_xglm.py index a8c93dc3bc4a6b..818ca163da02af 100644 --- a/src/transformers/models/xglm/tokenization_xglm.py +++ b/src/transformers/models/xglm/tokenization_xglm.py @@ -29,16 +29,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/xglm-564M": "https://huggingface.co/facebook/xglm-564M/resolve/main/sentencepiece.bpe.model", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/xglm-564M": 2048, -} - class XGLMTokenizer(PreTrainedTokenizer): """ @@ -105,8 +95,6 @@ class XGLMTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/xglm/tokenization_xglm_fast.py b/src/transformers/models/xglm/tokenization_xglm_fast.py index 62db9dd694abd3..2f8b0480c82dff 100644 --- a/src/transformers/models/xglm/tokenization_xglm_fast.py +++ b/src/transformers/models/xglm/tokenization_xglm_fast.py @@ -32,19 +32,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "facebook/xglm-564M": "https://huggingface.co/facebook/xglm-564M/resolve/main/sentencepiece.bpe.model", - }, - "tokenizer_file": { - "facebook/xglm-564M": "https://huggingface.co/facebook/xglm-564M/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "facebook/xglm-564M": 2048, -} - class XGLMTokenizerFast(PreTrainedTokenizerFast): """ @@ -95,8 +82,6 @@ class XGLMTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = XGLMTokenizer diff --git a/src/transformers/models/xlm/__init__.py b/src/transformers/models/xlm/__init__.py index 1dd57a90b92744..97d0933b8b9a7d 100644 --- a/src/transformers/models/xlm/__init__.py +++ b/src/transformers/models/xlm/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_xlm": ["XLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMConfig", "XLMOnnxConfig"], + "configuration_xlm": ["XLMConfig", "XLMOnnxConfig"], "tokenization_xlm": ["XLMTokenizer"], } @@ -29,7 +29,6 @@ pass else: _import_structure["modeling_xlm"] = [ - "XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMForMultipleChoice", "XLMForQuestionAnswering", "XLMForQuestionAnsweringSimple", @@ -47,7 +46,6 @@ pass else: _import_structure["modeling_tf_xlm"] = [ - "TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMForMultipleChoice", "TFXLMForQuestionAnsweringSimple", "TFXLMForSequenceClassification", @@ -60,7 +58,7 @@ if TYPE_CHECKING: - from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig + from .configuration_xlm import XLMConfig, XLMOnnxConfig from .tokenization_xlm import XLMTokenizer try: @@ -70,7 +68,6 @@ pass else: from .modeling_xlm import ( - XLM_PRETRAINED_MODEL_ARCHIVE_LIST, XLMForMultipleChoice, XLMForQuestionAnswering, XLMForQuestionAnsweringSimple, @@ -88,7 +85,6 @@ pass else: from .modeling_tf_xlm import ( - TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMForMultipleChoice, TFXLMForQuestionAnsweringSimple, TFXLMForSequenceClassification, diff --git a/src/transformers/models/xlm/configuration_xlm.py b/src/transformers/models/xlm/configuration_xlm.py index 2992a3ab322d63..2f8b5d6ef29d82 100644 --- a/src/transformers/models/xlm/configuration_xlm.py +++ b/src/transformers/models/xlm/configuration_xlm.py @@ -23,19 +23,6 @@ logger = logging.get_logger(__name__) -XLM_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "FacebookAI/xlm-mlm-en-2048": "https://huggingface.co/FacebookAI/xlm-mlm-en-2048/resolve/main/config.json", - "FacebookAI/xlm-mlm-ende-1024": "https://huggingface.co/FacebookAI/xlm-mlm-ende-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enfr-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-enro-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enro-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-xnli15-1024/resolve/main/config.json", - "FacebookAI/xlm-clm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-clm-enfr-1024/resolve/main/config.json", - "FacebookAI/xlm-clm-ende-1024": "https://huggingface.co/FacebookAI/xlm-clm-ende-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-17-1280": "https://huggingface.co/FacebookAI/xlm-mlm-17-1280/resolve/main/config.json", - "FacebookAI/xlm-mlm-100-1280": "https://huggingface.co/FacebookAI/xlm-mlm-100-1280/resolve/main/config.json", -} - class XLMConfig(PretrainedConfig): """ diff --git a/src/transformers/models/xlm/modeling_tf_xlm.py b/src/transformers/models/xlm/modeling_tf_xlm.py index 173f1d0acdb03d..ff5211a27cf2b1 100644 --- a/src/transformers/models/xlm/modeling_tf_xlm.py +++ b/src/transformers/models/xlm/modeling_tf_xlm.py @@ -66,20 +66,6 @@ _CHECKPOINT_FOR_DOC = "FacebookAI/xlm-mlm-en-2048" _CONFIG_FOR_DOC = "XLMConfig" -TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "FacebookAI/xlm-mlm-en-2048", - "FacebookAI/xlm-mlm-ende-1024", - "FacebookAI/xlm-mlm-enfr-1024", - "FacebookAI/xlm-mlm-enro-1024", - "FacebookAI/xlm-mlm-tlm-xnli15-1024", - "FacebookAI/xlm-mlm-xnli15-1024", - "FacebookAI/xlm-clm-enfr-1024", - "FacebookAI/xlm-clm-ende-1024", - "FacebookAI/xlm-mlm-17-1280", - "FacebookAI/xlm-mlm-100-1280", - # See all XLM models at https://huggingface.co/models?filter=xlm -] - def create_sinusoidal_embeddings(n_pos, dim, out): position_enc = np.array([[pos / np.power(10000, 2 * (j // 2) / dim) for j in range(dim)] for pos in range(n_pos)]) diff --git a/src/transformers/models/xlm/modeling_xlm.py b/src/transformers/models/xlm/modeling_xlm.py index de07829974d747..c26ef80a759b77 100755 --- a/src/transformers/models/xlm/modeling_xlm.py +++ b/src/transformers/models/xlm/modeling_xlm.py @@ -53,20 +53,6 @@ _CHECKPOINT_FOR_DOC = "FacebookAI/xlm-mlm-en-2048" _CONFIG_FOR_DOC = "XLMConfig" -XLM_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "FacebookAI/xlm-mlm-en-2048", - "FacebookAI/xlm-mlm-ende-1024", - "FacebookAI/xlm-mlm-enfr-1024", - "FacebookAI/xlm-mlm-enro-1024", - "FacebookAI/xlm-mlm-tlm-xnli15-1024", - "FacebookAI/xlm-mlm-xnli15-1024", - "FacebookAI/xlm-clm-enfr-1024", - "FacebookAI/xlm-clm-ende-1024", - "FacebookAI/xlm-mlm-17-1280", - "FacebookAI/xlm-mlm-100-1280", - # See all XLM models at https://huggingface.co/models?filter=xlm -] - def create_sinusoidal_embeddings(n_pos, dim, out): position_enc = np.array([[pos / np.power(10000, 2 * (j // 2) / dim) for j in range(dim)] for pos in range(n_pos)]) diff --git a/src/transformers/models/xlm/tokenization_xlm.py b/src/transformers/models/xlm/tokenization_xlm.py index a99b5cb73c9e71..b39e4c2708c791 100644 --- a/src/transformers/models/xlm/tokenization_xlm.py +++ b/src/transformers/models/xlm/tokenization_xlm.py @@ -33,397 +33,6 @@ "merges_file": "merges.txt", } -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "FacebookAI/xlm-mlm-en-2048": "https://huggingface.co/FacebookAI/xlm-mlm-en-2048/resolve/main/vocab.json", - "FacebookAI/xlm-mlm-ende-1024": "https://huggingface.co/FacebookAI/xlm-mlm-ende-1024/resolve/main/vocab.json", - "FacebookAI/xlm-mlm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enfr-1024/resolve/main/vocab.json", - "FacebookAI/xlm-mlm-enro-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enro-1024/resolve/main/vocab.json", - "FacebookAI/xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-tlm-xnli15-1024/resolve/main/vocab.json", - "FacebookAI/xlm-mlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-xnli15-1024/resolve/main/vocab.json", - "FacebookAI/xlm-clm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-clm-enfr-1024/resolve/main/vocab.json", - "FacebookAI/xlm-clm-ende-1024": "https://huggingface.co/FacebookAI/xlm-clm-ende-1024/resolve/main/vocab.json", - "FacebookAI/xlm-mlm-17-1280": "https://huggingface.co/FacebookAI/xlm-mlm-17-1280/resolve/main/vocab.json", - "FacebookAI/xlm-mlm-100-1280": "https://huggingface.co/FacebookAI/xlm-mlm-100-1280/resolve/main/vocab.json", - }, - "merges_file": { - "FacebookAI/xlm-mlm-en-2048": "https://huggingface.co/FacebookAI/xlm-mlm-en-2048/resolve/main/merges.txt", - "FacebookAI/xlm-mlm-ende-1024": "https://huggingface.co/FacebookAI/xlm-mlm-ende-1024/resolve/main/merges.txt", - "FacebookAI/xlm-mlm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enfr-1024/resolve/main/merges.txt", - "FacebookAI/xlm-mlm-enro-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enro-1024/resolve/main/merges.txt", - "FacebookAI/xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-tlm-xnli15-1024/resolve/main/merges.txt", - "FacebookAI/xlm-mlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-xnli15-1024/resolve/main/merges.txt", - "FacebookAI/xlm-clm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-clm-enfr-1024/resolve/main/merges.txt", - "FacebookAI/xlm-clm-ende-1024": "https://huggingface.co/FacebookAI/xlm-clm-ende-1024/resolve/main/merges.txt", - "FacebookAI/xlm-mlm-17-1280": "https://huggingface.co/FacebookAI/xlm-mlm-17-1280/resolve/main/merges.txt", - "FacebookAI/xlm-mlm-100-1280": "https://huggingface.co/FacebookAI/xlm-mlm-100-1280/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "FacebookAI/xlm-mlm-en-2048": 512, - "FacebookAI/xlm-mlm-ende-1024": 512, - "FacebookAI/xlm-mlm-enfr-1024": 512, - "FacebookAI/xlm-mlm-enro-1024": 512, - "FacebookAI/xlm-mlm-tlm-xnli15-1024": 512, - "FacebookAI/xlm-mlm-xnli15-1024": 512, - "FacebookAI/xlm-clm-enfr-1024": 512, - "FacebookAI/xlm-clm-ende-1024": 512, - "FacebookAI/xlm-mlm-17-1280": 512, - "FacebookAI/xlm-mlm-100-1280": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "FacebookAI/xlm-mlm-en-2048": {"do_lowercase_and_remove_accent": True}, - "FacebookAI/xlm-mlm-ende-1024": { - "do_lowercase_and_remove_accent": True, - "id2lang": {0: "de", 1: "en"}, - "lang2id": {"de": 0, "en": 1}, - }, - "FacebookAI/xlm-mlm-enfr-1024": { - "do_lowercase_and_remove_accent": True, - "id2lang": {0: "en", 1: "fr"}, - "lang2id": {"en": 0, "fr": 1}, - }, - "FacebookAI/xlm-mlm-enro-1024": { - "do_lowercase_and_remove_accent": True, - "id2lang": {0: "en", 1: "ro"}, - "lang2id": {"en": 0, "ro": 1}, - }, - "FacebookAI/xlm-mlm-tlm-xnli15-1024": { - "do_lowercase_and_remove_accent": True, - "id2lang": { - 0: "ar", - 1: "bg", - 2: "de", - 3: "el", - 4: "en", - 5: "es", - 6: "fr", - 7: "hi", - 8: "ru", - 9: "sw", - 10: "th", - 11: "tr", - 12: "ur", - 13: "vi", - 14: "zh", - }, - "lang2id": { - "ar": 0, - "bg": 1, - "de": 2, - "el": 3, - "en": 4, - "es": 5, - "fr": 6, - "hi": 7, - "ru": 8, - "sw": 9, - "th": 10, - "tr": 11, - "ur": 12, - "vi": 13, - "zh": 14, - }, - }, - "FacebookAI/xlm-mlm-xnli15-1024": { - "do_lowercase_and_remove_accent": True, - "id2lang": { - 0: "ar", - 1: "bg", - 2: "de", - 3: "el", - 4: "en", - 5: "es", - 6: "fr", - 7: "hi", - 8: "ru", - 9: "sw", - 10: "th", - 11: "tr", - 12: "ur", - 13: "vi", - 14: "zh", - }, - "lang2id": { - "ar": 0, - "bg": 1, - "de": 2, - "el": 3, - "en": 4, - "es": 5, - "fr": 6, - "hi": 7, - "ru": 8, - "sw": 9, - "th": 10, - "tr": 11, - "ur": 12, - "vi": 13, - "zh": 14, - }, - }, - "FacebookAI/xlm-clm-enfr-1024": { - "do_lowercase_and_remove_accent": True, - "id2lang": {0: "en", 1: "fr"}, - "lang2id": {"en": 0, "fr": 1}, - }, - "FacebookAI/xlm-clm-ende-1024": { - "do_lowercase_and_remove_accent": True, - "id2lang": {0: "de", 1: "en"}, - "lang2id": {"de": 0, "en": 1}, - }, - "FacebookAI/xlm-mlm-17-1280": { - "do_lowercase_and_remove_accent": False, - "id2lang": { - 0: "ar", - 1: "de", - 2: "en", - 3: "es", - 4: "fr", - 5: "hi", - 6: "it", - 7: "ja", - 8: "ko", - 9: "nl", - 10: "pl", - 11: "pt", - 12: "ru", - 13: "sv", - 14: "tr", - 15: "vi", - 16: "zh", - }, - "lang2id": { - "ar": 0, - "de": 1, - "en": 2, - "es": 3, - "fr": 4, - "hi": 5, - "it": 6, - "ja": 7, - "ko": 8, - "nl": 9, - "pl": 10, - "pt": 11, - "ru": 12, - "sv": 13, - "tr": 14, - "vi": 15, - "zh": 16, - }, - }, - "FacebookAI/xlm-mlm-100-1280": { - "do_lowercase_and_remove_accent": False, - "id2lang": { - 0: "af", - 1: "als", - 2: "am", - 3: "an", - 4: "ang", - 5: "ar", - 6: "arz", - 7: "ast", - 8: "az", - 9: "bar", - 10: "be", - 11: "bg", - 12: "bn", - 13: "br", - 14: "bs", - 15: "ca", - 16: "ceb", - 17: "ckb", - 18: "cs", - 19: "cy", - 20: "da", - 21: "de", - 22: "el", - 23: "en", - 24: "eo", - 25: "es", - 26: "et", - 27: "eu", - 28: "fa", - 29: "fi", - 30: "fr", - 31: "fy", - 32: "ga", - 33: "gan", - 34: "gl", - 35: "gu", - 36: "he", - 37: "hi", - 38: "hr", - 39: "hu", - 40: "hy", - 41: "ia", - 42: "id", - 43: "is", - 44: "it", - 45: "ja", - 46: "jv", - 47: "ka", - 48: "kk", - 49: "kn", - 50: "ko", - 51: "ku", - 52: "la", - 53: "lb", - 54: "lt", - 55: "lv", - 56: "mk", - 57: "ml", - 58: "mn", - 59: "mr", - 60: "ms", - 61: "my", - 62: "nds", - 63: "ne", - 64: "nl", - 65: "nn", - 66: "no", - 67: "oc", - 68: "pl", - 69: "pt", - 70: "ro", - 71: "ru", - 72: "scn", - 73: "sco", - 74: "sh", - 75: "si", - 76: "simple", - 77: "sk", - 78: "sl", - 79: "sq", - 80: "sr", - 81: "sv", - 82: "sw", - 83: "ta", - 84: "te", - 85: "th", - 86: "tl", - 87: "tr", - 88: "tt", - 89: "uk", - 90: "ur", - 91: "uz", - 92: "vi", - 93: "war", - 94: "wuu", - 95: "yi", - 96: "zh", - 97: "zh_classical", - 98: "zh_min_nan", - 99: "zh_yue", - }, - "lang2id": { - "af": 0, - "als": 1, - "am": 2, - "an": 3, - "ang": 4, - "ar": 5, - "arz": 6, - "ast": 7, - "az": 8, - "bar": 9, - "be": 10, - "bg": 11, - "bn": 12, - "br": 13, - "bs": 14, - "ca": 15, - "ceb": 16, - "ckb": 17, - "cs": 18, - "cy": 19, - "da": 20, - "de": 21, - "el": 22, - "en": 23, - "eo": 24, - "es": 25, - "et": 26, - "eu": 27, - "fa": 28, - "fi": 29, - "fr": 30, - "fy": 31, - "ga": 32, - "gan": 33, - "gl": 34, - "gu": 35, - "he": 36, - "hi": 37, - "hr": 38, - "hu": 39, - "hy": 40, - "ia": 41, - "id": 42, - "is": 43, - "it": 44, - "ja": 45, - "jv": 46, - "ka": 47, - "kk": 48, - "kn": 49, - "ko": 50, - "ku": 51, - "la": 52, - "lb": 53, - "lt": 54, - "lv": 55, - "mk": 56, - "ml": 57, - "mn": 58, - "mr": 59, - "ms": 60, - "my": 61, - "nds": 62, - "ne": 63, - "nl": 64, - "nn": 65, - "no": 66, - "oc": 67, - "pl": 68, - "pt": 69, - "ro": 70, - "ru": 71, - "scn": 72, - "sco": 73, - "sh": 74, - "si": 75, - "simple": 76, - "sk": 77, - "sl": 78, - "sq": 79, - "sr": 80, - "sv": 81, - "sw": 82, - "ta": 83, - "te": 84, - "th": 85, - "tl": 86, - "tr": 87, - "tt": 88, - "uk": 89, - "ur": 90, - "uz": 91, - "vi": 92, - "war": 93, - "wuu": 94, - "yi": 95, - "zh": 96, - "zh_classical": 97, - "zh_min_nan": 98, - "zh_yue": 99, - }, - }, -} - def get_pairs(word): """ @@ -582,9 +191,6 @@ class XLMTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES def __init__( self, diff --git a/src/transformers/models/xlm_prophetnet/__init__.py b/src/transformers/models/xlm_prophetnet/__init__.py index ff14e5b987a789..d9c24d9b4d2513 100644 --- a/src/transformers/models/xlm_prophetnet/__init__.py +++ b/src/transformers/models/xlm_prophetnet/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_xlm_prophetnet": ["XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMProphetNetConfig"], + "configuration_xlm_prophetnet": ["XLMProphetNetConfig"], } try: @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_xlm_prophetnet"] = [ - "XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMProphetNetDecoder", "XLMProphetNetEncoder", "XLMProphetNetForCausalLM", @@ -46,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig + from .configuration_xlm_prophetnet import XLMProphetNetConfig try: if not is_sentencepiece_available(): @@ -63,7 +62,6 @@ pass else: from .modeling_xlm_prophetnet import ( - XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLMProphetNetDecoder, XLMProphetNetEncoder, XLMProphetNetForCausalLM, diff --git a/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py b/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py index 88ca83a73226ce..bfb2a898f06ae8 100644 --- a/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py +++ b/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py @@ -23,12 +23,6 @@ logger = logging.get_logger(__name__) -XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "microsoft/xprophetnet-large-wiki100-cased": ( - "https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json" - ), -} - class XLMProphetNetConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py b/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py index e705b95b177877..ccba8fde5db2e8 100644 --- a/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py +++ b/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py @@ -44,10 +44,6 @@ _CONFIG_FOR_DOC = "XLMProphetNetConfig" -XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "microsoft/xprophetnet-large-wiki100-cased", - # See all XLMProphetNet models at https://huggingface.co/models?filter=xprophetnet -] # Copied from src.transformers.models.prophetnet.modeling_prophetnet.PROPHETNET_START_DOCSTRING with ProphetNetConfig->XLMProphetNetConfig XLM_PROPHETNET_START_DOCSTRING = r""" diff --git a/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py b/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py index c024d5d16dc04a..fa65fa5cbfbaf2 100644 --- a/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py +++ b/src/transformers/models/xlm_prophetnet/tokenization_xlm_prophetnet.py @@ -28,22 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "prophetnet.tokenizer"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/xprophetnet-large-wiki100-cased": ( - "https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/prophetnet.tokenizer" - ), - } -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/xprophetnet-large-wiki100-cased": {"do_lower_case": False}, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/xprophetnet-large-wiki100-cased": 512, -} - def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" @@ -124,8 +108,6 @@ class XLMProphetNetTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/xlm_roberta/__init__.py b/src/transformers/models/xlm_roberta/__init__.py index 813cba9fe17c1d..00658bb9ed9b8d 100644 --- a/src/transformers/models/xlm_roberta/__init__.py +++ b/src/transformers/models/xlm_roberta/__init__.py @@ -27,7 +27,6 @@ _import_structure = { "configuration_xlm_roberta": [ - "XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMRobertaConfig", "XLMRobertaOnnxConfig", ], @@ -56,7 +55,6 @@ pass else: _import_structure["modeling_xlm_roberta"] = [ - "XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaForCausalLM", "XLMRobertaForMaskedLM", "XLMRobertaForMultipleChoice", @@ -74,7 +72,6 @@ pass else: _import_structure["modeling_tf_xlm_roberta"] = [ - "TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMRobertaForCausalLM", "TFXLMRobertaForMaskedLM", "TFXLMRobertaForMultipleChoice", @@ -92,7 +89,6 @@ pass else: _import_structure["modeling_flax_xlm_roberta"] = [ - "FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaxXLMRobertaForMaskedLM", "FlaxXLMRobertaForCausalLM", "FlaxXLMRobertaForMultipleChoice", @@ -105,7 +101,6 @@ if TYPE_CHECKING: from .configuration_xlm_roberta import ( - XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaConfig, XLMRobertaOnnxConfig, ) @@ -133,7 +128,6 @@ pass else: from .modeling_xlm_roberta import ( - XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaForCausalLM, XLMRobertaForMaskedLM, XLMRobertaForMultipleChoice, @@ -151,7 +145,6 @@ pass else: from .modeling_tf_xlm_roberta import ( - TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMRobertaForCausalLM, TFXLMRobertaForMaskedLM, TFXLMRobertaForMultipleChoice, @@ -169,7 +162,6 @@ pass else: from .modeling_flax_xlm_roberta import ( - FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, FlaxXLMRobertaForCausalLM, FlaxXLMRobertaForMaskedLM, FlaxXLMRobertaForMultipleChoice, diff --git a/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py b/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py index 65c536ba437346..b9e348e498e4c9 100644 --- a/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py @@ -24,23 +24,6 @@ logger = logging.get_logger(__name__) -XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "FacebookAI/xlm-roberta-base": "https://huggingface.co/FacebookAI/xlm-roberta-base/resolve/main/config.json", - "FacebookAI/xlm-roberta-large": "https://huggingface.co/FacebookAI/xlm-roberta-large/resolve/main/config.json", - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-english": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-german": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json" - ), -} - class XLMRobertaConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py b/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py index 0017be6bd8c145..e700fcd0244ad5 100644 --- a/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py @@ -51,12 +51,6 @@ remat = nn_partitioning.remat -FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "FacebookAI/xlm-roberta-base", - "FacebookAI/xlm-roberta-large", - # See all XLM-RoBERTa models at https://huggingface.co/models?filter=xlm-roberta -] - # Copied from transformers.models.roberta.modeling_flax_roberta.create_position_ids_from_input_ids def create_position_ids_from_input_ids(input_ids, padding_idx): diff --git a/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py b/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py index dcf1b018b2af66..c0ad2c7c7dfc38 100644 --- a/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py @@ -67,13 +67,6 @@ _CHECKPOINT_FOR_DOC = "FacebookAI/xlm-roberta-base" _CONFIG_FOR_DOC = "XLMRobertaConfig" -TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "FacebookAI/xlm-roberta-base", - "FacebookAI/xlm-roberta-large", - "joeddav/xlm-roberta-large-xnli", - "cardiffnlp/twitter-xlm-roberta-base-sentiment", - # See all XLM-RoBERTa models at https://huggingface.co/models?filter=xlm-roberta -] XLM_ROBERTA_START_DOCSTRING = r""" diff --git a/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py b/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py index 8abd77b8c30215..53733704d78617 100644 --- a/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py @@ -51,16 +51,6 @@ _CHECKPOINT_FOR_DOC = "FacebookAI/xlm-roberta-base" _CONFIG_FOR_DOC = "XLMRobertaConfig" -XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "FacebookAI/xlm-roberta-base", - "FacebookAI/xlm-roberta-large", - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch", - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish", - "FacebookAI/xlm-roberta-large-finetuned-conll03-english", - "FacebookAI/xlm-roberta-large-finetuned-conll03-german", - # See all XLM-RoBERTa models at https://huggingface.co/models?filter=xlm-roberta -] - # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->XLMRoberta class XLMRobertaEmbeddings(nn.Module): diff --git a/src/transformers/models/xlm_roberta/tokenization_xlm_roberta.py b/src/transformers/models/xlm_roberta/tokenization_xlm_roberta.py index 3f87bd9b0dd9fa..20300a19ceeb7d 100644 --- a/src/transformers/models/xlm_roberta/tokenization_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/tokenization_xlm_roberta.py @@ -31,34 +31,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "FacebookAI/xlm-roberta-base": "https://huggingface.co/FacebookAI/xlm-roberta-base/resolve/main/sentencepiece.bpe.model", - "FacebookAI/xlm-roberta-large": "https://huggingface.co/FacebookAI/xlm-roberta-large/resolve/main/sentencepiece.bpe.model", - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/sentencepiece.bpe.model" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/sentencepiece.bpe.model" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-english": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-english/resolve/main/sentencepiece.bpe.model" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-german": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-german/resolve/main/sentencepiece.bpe.model" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "FacebookAI/xlm-roberta-base": 512, - "FacebookAI/xlm-roberta-large": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll03-english": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll03-german": 512, -} - class XLMRobertaTokenizer(PreTrainedTokenizer): """ @@ -128,8 +100,6 @@ class XLMRobertaTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/xlm_roberta/tokenization_xlm_roberta_fast.py b/src/transformers/models/xlm_roberta/tokenization_xlm_roberta_fast.py index 8f2c1e02a0a37e..f32e71515498f7 100644 --- a/src/transformers/models/xlm_roberta/tokenization_xlm_roberta_fast.py +++ b/src/transformers/models/xlm_roberta/tokenization_xlm_roberta_fast.py @@ -34,50 +34,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "sentencepiece.bpe.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "FacebookAI/xlm-roberta-base": "https://huggingface.co/FacebookAI/xlm-roberta-base/resolve/main/sentencepiece.bpe.model", - "FacebookAI/xlm-roberta-large": "https://huggingface.co/FacebookAI/xlm-roberta-large/resolve/main/sentencepiece.bpe.model", - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/sentencepiece.bpe.model" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/sentencepiece.bpe.model" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-english": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-english/resolve/main/sentencepiece.bpe.model" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-german": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-german/resolve/main/sentencepiece.bpe.model" - ), - }, - "tokenizer_file": { - "FacebookAI/xlm-roberta-base": "https://huggingface.co/FacebookAI/xlm-roberta-base/resolve/main/tokenizer.json", - "FacebookAI/xlm-roberta-large": "https://huggingface.co/FacebookAI/xlm-roberta-large/resolve/main/tokenizer.json", - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/tokenizer.json" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/tokenizer.json" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-english": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-english/resolve/main/tokenizer.json" - ), - "FacebookAI/xlm-roberta-large-finetuned-conll03-german": ( - "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-german/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "FacebookAI/xlm-roberta-base": 512, - "FacebookAI/xlm-roberta-large": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll03-english": 512, - "FacebookAI/xlm-roberta-large-finetuned-conll03-german": 512, -} - class XLMRobertaTokenizerFast(PreTrainedTokenizerFast): """ @@ -131,8 +87,6 @@ class XLMRobertaTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] slow_tokenizer_class = XLMRobertaTokenizer diff --git a/src/transformers/models/xlm_roberta_xl/__init__.py b/src/transformers/models/xlm_roberta_xl/__init__.py index 2df95dbc49200e..68ae26b06d6ca9 100644 --- a/src/transformers/models/xlm_roberta_xl/__init__.py +++ b/src/transformers/models/xlm_roberta_xl/__init__.py @@ -19,7 +19,6 @@ _import_structure = { "configuration_xlm_roberta_xl": [ - "XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMRobertaXLConfig", "XLMRobertaXLOnnxConfig", ], @@ -32,7 +31,6 @@ pass else: _import_structure["modeling_xlm_roberta_xl"] = [ - "XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaXLForCausalLM", "XLMRobertaXLForMaskedLM", "XLMRobertaXLForMultipleChoice", @@ -45,7 +43,6 @@ if TYPE_CHECKING: from .configuration_xlm_roberta_xl import ( - XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaXLConfig, XLMRobertaXLOnnxConfig, ) @@ -57,7 +54,6 @@ pass else: from .modeling_xlm_roberta_xl import ( - XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaXLForCausalLM, XLMRobertaXLForMaskedLM, XLMRobertaXLForMultipleChoice, diff --git a/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py b/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py index acb9c630970975..ac7b13755cfea0 100644 --- a/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py +++ b/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py @@ -24,12 +24,6 @@ logger = logging.get_logger(__name__) -XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/xlm-roberta-xl": "https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json", - "facebook/xlm-roberta-xxl": "https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json", - # See all XLM-RoBERTa-XL models at https://huggingface.co/models?filter=xlm-roberta-xl -} - class XLMRobertaXLConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py b/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py index 2799752ca4bdd9..5b2eeec55ef518 100644 --- a/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py +++ b/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py @@ -50,12 +50,6 @@ _CHECKPOINT_FOR_DOC = "facebook/xlm-roberta-xl" _CONFIG_FOR_DOC = "XLMRobertaXLConfig" -XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/xlm-roberta-xl", - "facebook/xlm-roberta-xxl", - # See all RoBERTa models at https://huggingface.co/models?filter=xlm-roberta-xl -] - class XLMRobertaXLEmbeddings(nn.Module): """ diff --git a/src/transformers/models/xlnet/__init__.py b/src/transformers/models/xlnet/__init__.py index f5e1d4568a66a4..f50d4cc178d3b9 100644 --- a/src/transformers/models/xlnet/__init__.py +++ b/src/transformers/models/xlnet/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_xlnet": ["XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLNetConfig"]} +_import_structure = {"configuration_xlnet": ["XLNetConfig"]} try: if not is_sentencepiece_available(): @@ -49,7 +49,6 @@ pass else: _import_structure["modeling_xlnet"] = [ - "XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLNetForMultipleChoice", "XLNetForQuestionAnswering", "XLNetForQuestionAnsweringSimple", @@ -68,7 +67,6 @@ pass else: _import_structure["modeling_tf_xlnet"] = [ - "TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLNetForMultipleChoice", "TFXLNetForQuestionAnsweringSimple", "TFXLNetForSequenceClassification", @@ -81,7 +79,7 @@ if TYPE_CHECKING: - from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig + from .configuration_xlnet import XLNetConfig try: if not is_sentencepiece_available(): @@ -106,7 +104,6 @@ pass else: from .modeling_xlnet import ( - XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLNetForMultipleChoice, XLNetForQuestionAnswering, XLNetForQuestionAnsweringSimple, @@ -125,7 +122,6 @@ pass else: from .modeling_tf_xlnet import ( - TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLNetForMultipleChoice, TFXLNetForQuestionAnsweringSimple, TFXLNetForSequenceClassification, diff --git a/src/transformers/models/xlnet/configuration_xlnet.py b/src/transformers/models/xlnet/configuration_xlnet.py index 8528bb06394d25..957a09dbf61958 100644 --- a/src/transformers/models/xlnet/configuration_xlnet.py +++ b/src/transformers/models/xlnet/configuration_xlnet.py @@ -23,11 +23,6 @@ logger = logging.get_logger(__name__) -XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "xlnet/xlnet-base-cased": "https://huggingface.co/xlnet/xlnet-base-cased/resolve/main/config.json", - "xlnet/xlnet-large-cased": "https://huggingface.co/xlnet/xlnet-large-cased/resolve/main/config.json", -} - class XLNetConfig(PretrainedConfig): """ diff --git a/src/transformers/models/xlnet/modeling_tf_xlnet.py b/src/transformers/models/xlnet/modeling_tf_xlnet.py index 598af1b707a5e9..f998b19bb6d3ac 100644 --- a/src/transformers/models/xlnet/modeling_tf_xlnet.py +++ b/src/transformers/models/xlnet/modeling_tf_xlnet.py @@ -60,12 +60,6 @@ _CHECKPOINT_FOR_DOC = "xlnet/xlnet-base-cased" _CONFIG_FOR_DOC = "XLNetConfig" -TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "xlnet/xlnet-base-cased", - "xlnet/xlnet-large-cased", - # See all XLNet models at https://huggingface.co/models?filter=xlnet -] - class TFXLNetRelativeAttention(keras.layers.Layer): def __init__(self, config, **kwargs): diff --git a/src/transformers/models/xlnet/modeling_xlnet.py b/src/transformers/models/xlnet/modeling_xlnet.py index 6def87ef07b4e3..7d04fe8cfa1b2d 100755 --- a/src/transformers/models/xlnet/modeling_xlnet.py +++ b/src/transformers/models/xlnet/modeling_xlnet.py @@ -43,12 +43,6 @@ _CHECKPOINT_FOR_DOC = "xlnet/xlnet-base-cased" _CONFIG_FOR_DOC = "XLNetConfig" -XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "xlnet/xlnet-base-cased", - "xlnet/xlnet-large-cased", - # See all XLNet models at https://huggingface.co/models?filter=xlnet -] - def build_tf_xlnet_to_pytorch_map(model, config, tf_weights=None): """ diff --git a/src/transformers/models/xlnet/tokenization_xlnet.py b/src/transformers/models/xlnet/tokenization_xlnet.py index 808a7ff5bfc07f..8d87f34ba2462e 100644 --- a/src/transformers/models/xlnet/tokenization_xlnet.py +++ b/src/transformers/models/xlnet/tokenization_xlnet.py @@ -30,17 +30,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "xlnet/xlnet-base-cased": "https://huggingface.co/xlnet/xlnet-base-cased/resolve/main/spiece.model", - "xlnet/xlnet-large-cased": "https://huggingface.co/xlnet/xlnet-large-cased/resolve/main/spiece.model", - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "xlnet/xlnet-base-cased": None, - "xlnet/xlnet-large-cased": None, -} # Segments (not really needed) SEG_ID_A = 0 @@ -126,8 +115,6 @@ class XLNetTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES padding_side = "left" def __init__( diff --git a/src/transformers/models/xlnet/tokenization_xlnet_fast.py b/src/transformers/models/xlnet/tokenization_xlnet_fast.py index c43016a1a77799..d77307e7a3dfba 100644 --- a/src/transformers/models/xlnet/tokenization_xlnet_fast.py +++ b/src/transformers/models/xlnet/tokenization_xlnet_fast.py @@ -34,21 +34,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "spiece.model", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "xlnet/xlnet-base-cased": "https://huggingface.co/xlnet/xlnet-base-cased/resolve/main/spiece.model", - "xlnet/xlnet-large-cased": "https://huggingface.co/xlnet/xlnet-large-cased/resolve/main/spiece.model", - }, - "tokenizer_file": { - "xlnet/xlnet-base-cased": "https://huggingface.co/xlnet/xlnet-base-cased/resolve/main/tokenizer.json", - "xlnet/xlnet-large-cased": "https://huggingface.co/xlnet/xlnet-large-cased/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "xlnet/xlnet-base-cased": None, - "xlnet/xlnet-large-cased": None, -} SPIECE_UNDERLINE = "▁" @@ -122,8 +107,6 @@ class XLNetTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES padding_side = "left" slow_tokenizer_class = XLNetTokenizer diff --git a/src/transformers/models/xmod/__init__.py b/src/transformers/models/xmod/__init__.py index f3cb6f195bd458..9b9cb36e3b93e5 100644 --- a/src/transformers/models/xmod/__init__.py +++ b/src/transformers/models/xmod/__init__.py @@ -23,7 +23,6 @@ _import_structure = { "configuration_xmod": [ - "XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP", "XmodConfig", "XmodOnnxConfig", ], @@ -36,7 +35,6 @@ pass else: _import_structure["modeling_xmod"] = [ - "XMOD_PRETRAINED_MODEL_ARCHIVE_LIST", "XmodForCausalLM", "XmodForMaskedLM", "XmodForMultipleChoice", @@ -48,7 +46,7 @@ ] if TYPE_CHECKING: - from .configuration_xmod import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP, XmodConfig, XmodOnnxConfig + from .configuration_xmod import XmodConfig, XmodOnnxConfig try: if not is_torch_available(): @@ -57,7 +55,6 @@ pass else: from .modeling_xmod import ( - XMOD_PRETRAINED_MODEL_ARCHIVE_LIST, XmodForCausalLM, XmodForMaskedLM, XmodForMultipleChoice, diff --git a/src/transformers/models/xmod/configuration_xmod.py b/src/transformers/models/xmod/configuration_xmod.py index abf7a3275c5415..4ca52652513b3e 100644 --- a/src/transformers/models/xmod/configuration_xmod.py +++ b/src/transformers/models/xmod/configuration_xmod.py @@ -24,18 +24,6 @@ logger = logging.get_logger(__name__) -XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "facebook/xmod-base": "https://huggingface.co/facebook/xmod-base/resolve/main/config.json", - "facebook/xmod-large-prenorm": "https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json", - "facebook/xmod-base-13-125k": "https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json", - "facebook/xmod-base-30-125k": "https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json", - "facebook/xmod-base-30-195k": "https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json", - "facebook/xmod-base-60-125k": "https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json", - "facebook/xmod-base-60-265k": "https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json", - "facebook/xmod-base-75-125k": "https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json", - "facebook/xmod-base-75-269k": "https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json", -} - class XmodConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/xmod/modeling_xmod.py b/src/transformers/models/xmod/modeling_xmod.py index ba5ba6b7271b23..2aa07ed48b44cd 100644 --- a/src/transformers/models/xmod/modeling_xmod.py +++ b/src/transformers/models/xmod/modeling_xmod.py @@ -41,19 +41,6 @@ logger = logging.get_logger(__name__) -XMOD_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "facebook/xmod-base", - "facebook/xmod-large-prenorm", - "facebook/xmod-base-13-125k", - "facebook/xmod-base-30-125k", - "facebook/xmod-base-30-195k", - "facebook/xmod-base-60-125k", - "facebook/xmod-base-60-265k", - "facebook/xmod-base-75-125k", - "facebook/xmod-base-75-269k", - # See all X-MOD models at https://huggingface.co/models?filter=xmod -] - # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->Xmod class XmodEmbeddings(nn.Module): diff --git a/src/transformers/models/yolos/__init__.py b/src/transformers/models/yolos/__init__.py index 28d59763bb8550..fdf7c5db1cb220 100644 --- a/src/transformers/models/yolos/__init__.py +++ b/src/transformers/models/yolos/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_yolos": ["YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP", "YolosConfig", "YolosOnnxConfig"]} +_import_structure = {"configuration_yolos": ["YolosConfig", "YolosOnnxConfig"]} try: if not is_vision_available(): @@ -34,7 +34,6 @@ pass else: _import_structure["modeling_yolos"] = [ - "YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST", "YolosForObjectDetection", "YolosModel", "YolosPreTrainedModel", @@ -42,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig, YolosOnnxConfig + from .configuration_yolos import YolosConfig, YolosOnnxConfig try: if not is_vision_available(): @@ -60,7 +59,6 @@ pass else: from .modeling_yolos import ( - YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST, YolosForObjectDetection, YolosModel, YolosPreTrainedModel, diff --git a/src/transformers/models/yolos/configuration_yolos.py b/src/transformers/models/yolos/configuration_yolos.py index 9398d29e0417f7..2493403b4f375e 100644 --- a/src/transformers/models/yolos/configuration_yolos.py +++ b/src/transformers/models/yolos/configuration_yolos.py @@ -26,11 +26,6 @@ logger = logging.get_logger(__name__) -YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json", - # See all YOLOS models at https://huggingface.co/models?filter=yolos -} - class YolosConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/yolos/modeling_yolos.py b/src/transformers/models/yolos/modeling_yolos.py index 86ab375cdf8346..88d2497a1ea51d 100755 --- a/src/transformers/models/yolos/modeling_yolos.py +++ b/src/transformers/models/yolos/modeling_yolos.py @@ -63,12 +63,6 @@ _EXPECTED_OUTPUT_SHAPE = [1, 3401, 384] -YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "hustvl/yolos-small", - # See all YOLOS models at https://huggingface.co/models?filter=yolos -] - - @dataclass class YolosObjectDetectionOutput(ModelOutput): """ diff --git a/src/transformers/models/yoso/__init__.py b/src/transformers/models/yoso/__init__.py index e1f89d73ac47c5..c4c73385017eb7 100644 --- a/src/transformers/models/yoso/__init__.py +++ b/src/transformers/models/yoso/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available -_import_structure = {"configuration_yoso": ["YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP", "YosoConfig"]} +_import_structure = {"configuration_yoso": ["YosoConfig"]} try: if not is_torch_available(): @@ -25,7 +25,6 @@ pass else: _import_structure["modeling_yoso"] = [ - "YOSO_PRETRAINED_MODEL_ARCHIVE_LIST", "YosoForMaskedLM", "YosoForMultipleChoice", "YosoForQuestionAnswering", @@ -38,7 +37,7 @@ if TYPE_CHECKING: - from .configuration_yoso import YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP, YosoConfig + from .configuration_yoso import YosoConfig try: if not is_torch_available(): @@ -47,7 +46,6 @@ pass else: from .modeling_yoso import ( - YOSO_PRETRAINED_MODEL_ARCHIVE_LIST, YosoForMaskedLM, YosoForMultipleChoice, YosoForQuestionAnswering, diff --git a/src/transformers/models/yoso/configuration_yoso.py b/src/transformers/models/yoso/configuration_yoso.py index 02d7f44d3cf2a0..906856fa5d711d 100644 --- a/src/transformers/models/yoso/configuration_yoso.py +++ b/src/transformers/models/yoso/configuration_yoso.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "uw-madison/yoso-4096": "https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json", - # See all YOSO models at https://huggingface.co/models?filter=yoso -} - class YosoConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/yoso/modeling_yoso.py b/src/transformers/models/yoso/modeling_yoso.py index 41e34a6c66c42b..d75d3f9aa1887c 100644 --- a/src/transformers/models/yoso/modeling_yoso.py +++ b/src/transformers/models/yoso/modeling_yoso.py @@ -51,10 +51,6 @@ _CHECKPOINT_FOR_DOC = "uw-madison/yoso-4096" _CONFIG_FOR_DOC = "YosoConfig" -YOSO_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "uw-madison/yoso-4096", - # See all YOSO models at https://huggingface.co/models?filter=yoso -] lsh_cumulation = None diff --git a/src/transformers/tokenization_utils_base.py b/src/transformers/tokenization_utils_base.py index e4df71c752c2b3..7d56ed204423c0 100644 --- a/src/transformers/tokenization_utils_base.py +++ b/src/transformers/tokenization_utils_base.py @@ -1484,13 +1484,6 @@ def all_special_ids(self) -> List[int]: high-level keys being the `__init__` keyword name of each vocabulary file required by the model, the low-level being the `short-cut-names` of the pretrained models with, as associated values, the `url` to the associated pretrained vocabulary file. - - **max_model_input_sizes** (`Dict[str, Optional[int]]`) -- A dictionary with, as keys, the `short-cut-names` - of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model, - or `None` if the model has no maximum input size. - - **pretrained_init_configuration** (`Dict[str, Dict[str, Any]]`) -- A dictionary with, as keys, the - `short-cut-names` of the pretrained models, and as associated values, a dictionary of specific arguments to - pass to the `__init__` method of the tokenizer class for this pretrained model when loading the tokenizer - with the [`~tokenization_utils_base.PreTrainedTokenizerBase.from_pretrained`] method. - **model_input_names** (`List[str]`) -- A list of inputs expected in the forward pass of the model. - **padding_side** (`str`) -- The default value for the side on which the model should have padding applied. Should be `'right'` or `'left'`. @@ -1561,8 +1554,6 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin): vocab_files_names: Dict[str, str] = {} pretrained_vocab_files_map: Dict[str, Dict[str, str]] = {} - pretrained_init_configuration: Dict[str, Dict[str, Any]] = {} - max_model_input_sizes: Dict[str, Optional[int]] = {} _auto_class: Optional[str] = None # first name has to correspond to main model input name @@ -2224,23 +2215,6 @@ def _from_pretrained( # Update with newly provided kwargs init_kwargs.update(kwargs) - # Set max length if needed - if pretrained_model_name_or_path in cls.max_model_input_sizes: - # if we're using a pretrained model, ensure the tokenizer - # wont index sequences longer than the number of positional embeddings - - model_max_length = cls.max_model_input_sizes[pretrained_model_name_or_path] - if model_max_length is not None and isinstance(model_max_length, (int, float)): - model_max_length = min(init_kwargs.get("model_max_length", int(1e30)), model_max_length) - # TODO(PVP) - uncomment following line in Transformers v5 - # init_kwargs["model_max_length"] = model_max_length - # TODO(PVP) - remove in Transformers v5 - # --- - init_kwargs["model_max_length"] = cls._eventually_correct_t5_max_length( - pretrained_model_name_or_path, model_max_length, init_kwargs.get("model_max_length") - ) - # --- - # Merge resolved_vocab_files arguments in init_kwargs. added_tokens_file = resolved_vocab_files.pop("added_tokens_file", None) special_tokens_map_file = resolved_vocab_files.pop("special_tokens_map_file", None) diff --git a/src/transformers/utils/dummy_detectron2_objects.py b/src/transformers/utils/dummy_detectron2_objects.py index 41dfb6f81d34ef..22ec32fe30a1b9 100644 --- a/src/transformers/utils/dummy_detectron2_objects.py +++ b/src/transformers/utils/dummy_detectron2_objects.py @@ -2,9 +2,6 @@ from ..utils import requires_backends -LAYOUTLM_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LayoutLMv2Model: def __init__(self, *args, **kwargs): requires_backends(self, ["detectron2"]) diff --git a/src/transformers/utils/dummy_flax_objects.py b/src/transformers/utils/dummy_flax_objects.py index 281ddf56a99450..627daa228c73d6 100644 --- a/src/transformers/utils/dummy_flax_objects.py +++ b/src/transformers/utils/dummy_flax_objects.py @@ -1353,9 +1353,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) -FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FlaxXLMRobertaForCausalLM(metaclass=DummyObject): _backends = ["flax"] diff --git a/src/transformers/utils/dummy_pt_objects.py b/src/transformers/utils/dummy_pt_objects.py index 5b698e0afe50dd..ee3f2401f6bbe0 100644 --- a/src/transformers/utils/dummy_pt_objects.py +++ b/src/transformers/utils/dummy_pt_objects.py @@ -415,9 +415,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class AlbertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -478,9 +475,6 @@ def load_tf_weights_in_albert(*args, **kwargs): requires_backends(load_tf_weights_in_albert, ["torch"]) -ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class AlignModel(metaclass=DummyObject): _backends = ["torch"] @@ -509,9 +503,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class AltCLIPModel(metaclass=DummyObject): _backends = ["torch"] @@ -540,9 +531,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ASTForAudioClassification(metaclass=DummyObject): _backends = ["torch"] @@ -956,9 +944,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class AutoformerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -980,9 +965,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BARK_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BarkCausalModel(metaclass=DummyObject): _backends = ["torch"] @@ -1025,9 +1007,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BART_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BartForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1084,9 +1063,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BeitBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -1129,9 +1105,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -1238,9 +1211,6 @@ def load_tf_weights_in_bert_generation(*args, **kwargs): requires_backends(load_tf_weights_in_bert_generation, ["torch"]) -BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BigBirdForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1315,9 +1285,6 @@ def load_tf_weights_in_big_bird(*args, **kwargs): requires_backends(load_tf_weights_in_big_bird, ["torch"]) -BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BigBirdPegasusForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1360,9 +1327,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BioGptForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1398,9 +1362,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BitBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -1429,9 +1390,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BlenderbotForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1460,9 +1418,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BlenderbotSmallForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1491,9 +1446,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BlipForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -1543,9 +1495,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Blip2ForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -1581,9 +1530,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BloomForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1626,9 +1572,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BridgeTowerForContrastiveLearning(metaclass=DummyObject): _backends = ["torch"] @@ -1664,9 +1607,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -BROS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class BrosForTokenClassification(metaclass=DummyObject): _backends = ["torch"] @@ -1709,9 +1649,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CamembertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1768,9 +1705,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CANINE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CanineForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -1824,9 +1758,6 @@ def load_tf_weights_in_canine(*args, **kwargs): requires_backends(load_tf_weights_in_canine, ["torch"]) -CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ChineseCLIPModel(metaclass=DummyObject): _backends = ["torch"] @@ -1855,9 +1786,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CLAP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ClapAudioModel(metaclass=DummyObject): _backends = ["torch"] @@ -1907,9 +1835,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CLIPForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -1959,9 +1884,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CLIPSegForImageSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -1997,9 +1919,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CLVP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ClvpDecoder(metaclass=DummyObject): _backends = ["torch"] @@ -2042,9 +1961,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CodeGenForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -2066,30 +1982,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class CohereForCausalLM(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -class CohereModel(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -class CoherePreTrainedModel(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ConditionalDetrForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2118,9 +2010,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ConvBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -2181,9 +2070,6 @@ def load_tf_weights_in_convbert(*args, **kwargs): requires_backends(load_tf_weights_in_convbert, ["torch"]) -CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ConvNextBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -2212,9 +2098,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ConvNextV2Backbone(metaclass=DummyObject): _backends = ["torch"] @@ -2243,9 +2126,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CpmAntForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -2267,9 +2147,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CTRLForSequenceClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2298,9 +2175,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -CVT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class CvtForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2322,15 +2196,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Data2VecAudioForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2457,9 +2322,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DebertaForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -2502,9 +2364,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DebertaV2ForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -2554,9 +2413,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DecisionTransformerGPT2Model(metaclass=DummyObject): _backends = ["torch"] @@ -2585,9 +2441,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DeformableDetrForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2609,9 +2462,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DeiTForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2647,9 +2497,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MCTCTForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -2720,9 +2567,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RetriBertModel(metaclass=DummyObject): _backends = ["torch"] @@ -2737,9 +2581,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TrajectoryTransformerModel(metaclass=DummyObject): _backends = ["torch"] @@ -2754,9 +2595,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class AdaptiveEmbedding(metaclass=DummyObject): _backends = ["torch"] @@ -2796,9 +2634,6 @@ def load_tf_weights_in_transfo_xl(*args, **kwargs): requires_backends(load_tf_weights_in_transfo_xl, ["torch"]) -VAN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VanForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2820,9 +2655,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DepthAnythingForDepthEstimation(metaclass=DummyObject): _backends = ["torch"] @@ -2837,9 +2669,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DETA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DetaForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2861,9 +2690,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DetrForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2892,9 +2718,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DINAT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DinatBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -2923,9 +2746,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Dinov2Backbone(metaclass=DummyObject): _backends = ["torch"] @@ -2954,9 +2774,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DistilBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -3006,9 +2823,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DonutSwinModel(metaclass=DummyObject): _backends = ["torch"] @@ -3023,15 +2837,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DPRContextEncoder(metaclass=DummyObject): _backends = ["torch"] @@ -3081,9 +2886,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -DPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class DPTForDepthEstimation(metaclass=DummyObject): _backends = ["torch"] @@ -3112,9 +2914,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class EfficientFormerForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -3143,9 +2942,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class EfficientNetForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -3167,9 +2963,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ElectraForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3237,9 +3030,6 @@ def load_tf_weights_in_electra(*args, **kwargs): requires_backends(load_tf_weights_in_electra, ["torch"]) -ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class EncodecModel(metaclass=DummyObject): _backends = ["torch"] @@ -3261,9 +3051,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ErnieForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3334,9 +3121,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ErnieMForInformationExtraction(metaclass=DummyObject): _backends = ["torch"] @@ -3386,9 +3170,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ESM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class EsmFoldPreTrainedModel(metaclass=DummyObject): _backends = ["torch"] @@ -3438,9 +3219,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -FALCON_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FalconForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3483,9 +3261,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FastSpeech2ConformerHifiGan(metaclass=DummyObject): _backends = ["torch"] @@ -3514,9 +3289,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FlaubertForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -3573,9 +3345,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FlavaForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -3625,9 +3394,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -FNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FNetForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -3698,9 +3464,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FocalNetBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -3757,9 +3520,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class FunnelBaseModel(metaclass=DummyObject): _backends = ["torch"] @@ -3869,9 +3629,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GitForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3900,9 +3657,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GLPN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GLPNForDepthEstimation(metaclass=DummyObject): _backends = ["torch"] @@ -3924,9 +3678,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GPT2DoubleHeadsModel(metaclass=DummyObject): _backends = ["torch"] @@ -3980,9 +3731,6 @@ def load_tf_weights_in_gpt2(*args, **kwargs): requires_backends(load_tf_weights_in_gpt2, ["torch"]) -GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GPTBigCodeForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -4018,9 +3766,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GPTNeoForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -4067,9 +3812,6 @@ def load_tf_weights_in_gpt_neo(*args, **kwargs): requires_backends(load_tf_weights_in_gpt_neo, ["torch"]) -GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GPTNeoXForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -4119,9 +3861,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GPTNeoXJapaneseForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -4150,9 +3889,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GPTJForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -4188,9 +3924,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GPTSanJapaneseForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4212,9 +3945,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GraphormerForGraphClassification(metaclass=DummyObject): _backends = ["torch"] @@ -4236,9 +3966,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class GroupViTModel(metaclass=DummyObject): _backends = ["torch"] @@ -4267,9 +3994,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class HubertForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -4298,9 +4022,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -IBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class IBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -4350,9 +4071,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class IdeficsForVisionText2Text(metaclass=DummyObject): _backends = ["torch"] @@ -4381,9 +4099,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ImageGPTForCausalImageModeling(metaclass=DummyObject): _backends = ["torch"] @@ -4416,9 +4131,6 @@ def load_tf_weights_in_imagegpt(*args, **kwargs): requires_backends(load_tf_weights_in_imagegpt, ["torch"]) -INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class InformerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -4440,9 +4152,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class InstructBlipForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4471,9 +4180,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class JukeboxModel(metaclass=DummyObject): _backends = ["torch"] @@ -4502,9 +4208,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Kosmos2ForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4526,9 +4229,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LayoutLMForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -4571,9 +4271,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LayoutLMv2ForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -4609,9 +4306,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LayoutLMv3ForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -4647,9 +4341,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LED_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LEDForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4685,9 +4376,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LevitForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -4716,9 +4404,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LILT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LiltForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -4789,9 +4474,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LlavaForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4816,16 +4498,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -class LlavaNextPreTrainedModel(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LongformerForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -4882,9 +4554,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LongT5EncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -4913,9 +4582,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -LUKE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class LukeForEntityClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5035,9 +4701,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class M2M100ForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -5059,9 +4722,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MambaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5104,9 +4764,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MarkupLMForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -5142,9 +4799,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Mask2FormerForUniversalSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -5166,9 +4820,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MaskFormerForInstanceSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -5239,9 +4890,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MEGA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MegaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5298,9 +4946,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MegatronBertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5371,9 +5016,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MgpstrForSceneTextRecognition(metaclass=DummyObject): _backends = ["torch"] @@ -5451,9 +5093,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MobileBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5528,9 +5167,6 @@ def load_tf_weights_in_mobilebert(*args, **kwargs): requires_backends(load_tf_weights_in_mobilebert, ["torch"]) -MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MobileNetV1ForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5556,9 +5192,6 @@ def load_tf_weights_in_mobilenet_v1(*args, **kwargs): requires_backends(load_tf_weights_in_mobilenet_v1, ["torch"]) -MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MobileNetV2ForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5591,9 +5224,6 @@ def load_tf_weights_in_mobilenet_v2(*args, **kwargs): requires_backends(load_tf_weights_in_mobilenet_v2, ["torch"]) -MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MobileViTForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5622,9 +5252,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MobileViTV2ForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5653,9 +5280,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MPNetForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5712,9 +5336,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MptForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5757,9 +5378,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MRA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MraForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5858,9 +5476,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MusicgenForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5896,40 +5511,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -MUSICGEN_MELODY_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -class MusicgenMelodyForCausalLM(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -class MusicgenMelodyForConditionalGeneration(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -class MusicgenMelodyModel(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -class MusicgenMelodyPreTrainedModel(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -MVP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class MvpForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5972,9 +5553,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -NAT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class NatBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -6003,9 +5581,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class NezhaForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -6069,9 +5644,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class NllbMoeForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -6107,9 +5679,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class NystromformerForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -6166,9 +5735,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class OneFormerForUniversalSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -6190,9 +5756,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class OpenAIGPTDoubleHeadsModel(metaclass=DummyObject): _backends = ["torch"] @@ -6232,9 +5795,6 @@ def load_tf_weights_in_openai_gpt(*args, **kwargs): requires_backends(load_tf_weights_in_openai_gpt, ["torch"]) -OPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class OPTForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6270,9 +5830,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Owlv2ForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -6308,9 +5865,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class OwlViTForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -6346,9 +5900,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PatchTSMixerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -6391,9 +5942,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PatchTSTForClassification(metaclass=DummyObject): _backends = ["torch"] @@ -6464,9 +6012,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PegasusXForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -6488,9 +6033,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PerceiverForImageClassificationConvProcessing(metaclass=DummyObject): _backends = ["torch"] @@ -6589,9 +6131,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PHI_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PhiForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6627,9 +6166,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Pix2StructForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -6658,9 +6194,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PLBART_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PLBartForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6696,9 +6229,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PoolFormerForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -6720,9 +6250,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Pop2PianoForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -6737,9 +6264,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ProphetNetDecoder(metaclass=DummyObject): _backends = ["torch"] @@ -6782,9 +6306,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PVT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PvtForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -6970,9 +6491,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -REALM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RealmEmbedder(metaclass=DummyObject): _backends = ["torch"] @@ -7026,9 +6544,6 @@ def load_tf_weights_in_realm(*args, **kwargs): requires_backends(load_tf_weights_in_realm, ["torch"]) -REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ReformerAttention(metaclass=DummyObject): _backends = ["torch"] @@ -7085,9 +6600,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RegNetForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -7109,9 +6621,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RemBertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -7179,9 +6688,6 @@ def load_tf_weights_in_rembert(*args, **kwargs): requires_backends(load_tf_weights_in_rembert, ["torch"]) -RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ResNetBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -7210,9 +6716,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RobertaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -7269,9 +6772,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RobertaPreLayerNormForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -7328,9 +6828,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RoCBertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -7405,9 +6902,6 @@ def load_tf_weights_in_roc_bert(*args, **kwargs): requires_backends(load_tf_weights_in_roc_bert, ["torch"]) -ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RoFormerForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -7475,9 +6969,6 @@ def load_tf_weights_in_roformer(*args, **kwargs): requires_backends(load_tf_weights_in_roformer, ["torch"]) -RWKV_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class RwkvForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -7499,9 +6990,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SAM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SamModel(metaclass=DummyObject): _backends = ["torch"] @@ -7516,9 +7004,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SeamlessM4TCodeHifiGan(metaclass=DummyObject): _backends = ["torch"] @@ -7589,9 +7074,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SeamlessM4Tv2ForSpeechToSpeech(metaclass=DummyObject): _backends = ["torch"] @@ -7634,9 +7116,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SegformerDecodeHead(metaclass=DummyObject): _backends = ["torch"] @@ -7679,9 +7158,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SegGptForImageSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -7703,9 +7179,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SEW_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SEWForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -7734,9 +7207,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SEWDForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -7765,9 +7235,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SiglipForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -7810,9 +7277,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Speech2TextForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -7848,9 +7312,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SpeechT5ForSpeechToSpeech(metaclass=DummyObject): _backends = ["torch"] @@ -7893,9 +7354,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SplinterForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -7931,9 +7389,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SqueezeBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -8046,26 +7501,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SUPERPOINT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -class SuperPointForKeypointDetection(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -class SuperPointPreTrainedModel(metaclass=DummyObject): - _backends = ["torch"] - - def __init__(self, *args, **kwargs): - requires_backends(self, ["torch"]) - - -SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SwiftFormerForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8087,9 +7522,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SwinBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -8125,9 +7557,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Swin2SRForImageSuperResolution(metaclass=DummyObject): _backends = ["torch"] @@ -8149,9 +7578,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Swinv2Backbone(metaclass=DummyObject): _backends = ["torch"] @@ -8187,9 +7613,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class SwitchTransformersEncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -8232,9 +7655,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -T5_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class T5EncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -8288,9 +7708,6 @@ def load_tf_weights_in_t5(*args, **kwargs): requires_backends(load_tf_weights_in_t5, ["torch"]) -TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TableTransformerForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -8312,9 +7729,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TapasForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -8354,9 +7768,6 @@ def load_tf_weights_in_tapas(*args, **kwargs): requires_backends(load_tf_weights_in_tapas, ["torch"]) -TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TimeSeriesTransformerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -8378,9 +7789,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TimesformerForVideoClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8409,9 +7817,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -TROCR_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TrOCRForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -8426,9 +7831,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -TVLT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TvltForAudioVisualClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8457,9 +7859,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -TVP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TvpForVideoGrounding(metaclass=DummyObject): _backends = ["torch"] @@ -8481,9 +7880,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -UDOP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class UdopEncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -8561,9 +7957,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class UniSpeechForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -8599,9 +7992,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class UniSpeechSatForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8651,9 +8041,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class UnivNetModel(metaclass=DummyObject): _backends = ["torch"] @@ -8675,9 +8062,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VideoMAEForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -8706,9 +8090,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VILT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ViltForImageAndTextRetrieval(metaclass=DummyObject): _backends = ["torch"] @@ -8765,9 +8146,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VipLlavaForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -8796,9 +8174,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VisualBertForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -8855,9 +8230,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ViTForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8886,9 +8258,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ViTHybridForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8910,9 +8279,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ViTMAEForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -8941,9 +8307,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class ViTMSNForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8965,9 +8328,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VITDET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VitDetBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -8989,9 +8349,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VitMatteForImageMatting(metaclass=DummyObject): _backends = ["torch"] @@ -9006,9 +8363,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VITS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VitsModel(metaclass=DummyObject): _backends = ["torch"] @@ -9023,9 +8377,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class VivitForVideoClassification(metaclass=DummyObject): _backends = ["torch"] @@ -9047,9 +8398,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Wav2Vec2ForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -9106,9 +8454,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Wav2Vec2BertForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -9151,9 +8496,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class Wav2Vec2ConformerForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -9203,9 +8545,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class WavLMForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -9248,9 +8587,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class WhisperForAudioClassification(metaclass=DummyObject): _backends = ["torch"] @@ -9286,9 +8622,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XCLIPModel(metaclass=DummyObject): _backends = ["torch"] @@ -9317,9 +8650,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XGLMForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -9341,9 +8671,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -XLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XLMForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -9400,9 +8727,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XLMProphetNetDecoder(metaclass=DummyObject): _backends = ["torch"] @@ -9445,9 +8769,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XLMRobertaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -9504,9 +8825,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XLMRobertaXLForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -9563,9 +8881,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XLNetForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -9626,9 +8941,6 @@ def load_tf_weights_in_xlnet(*args, **kwargs): requires_backends(load_tf_weights_in_xlnet, ["torch"]) -XMOD_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class XmodForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -9685,9 +8997,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class YolosForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -9709,9 +9018,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -YOSO_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class YosoForMaskedLM(metaclass=DummyObject): _backends = ["torch"] diff --git a/src/transformers/utils/dummy_tf_objects.py b/src/transformers/utils/dummy_tf_objects.py index 5441883b85a463..15986b567d4b2b 100644 --- a/src/transformers/utils/dummy_tf_objects.py +++ b/src/transformers/utils/dummy_tf_objects.py @@ -167,9 +167,6 @@ def shape_list(*args, **kwargs): requires_backends(shape_list, ["tf"]) -TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFAlbertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -481,9 +478,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFBertEmbeddings(metaclass=DummyObject): _backends = ["tf"] @@ -610,9 +604,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFBlipForConditionalGeneration(metaclass=DummyObject): _backends = ["tf"] @@ -662,9 +653,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFCamembertForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -721,9 +709,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFCLIPModel(metaclass=DummyObject): _backends = ["tf"] @@ -752,9 +737,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFConvBertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -853,9 +835,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFCTRLForSequenceClassification(metaclass=DummyObject): _backends = ["tf"] @@ -884,9 +863,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFCvtForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -936,9 +912,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFDebertaForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -981,9 +954,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFDebertaV2ForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1033,9 +1003,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFDeiTForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -1071,9 +1038,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFAdaptiveEmbedding(metaclass=DummyObject): _backends = ["tf"] @@ -1116,9 +1080,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFDistilBertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1175,15 +1136,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - -TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFDPRContextEncoder(metaclass=DummyObject): _backends = ["tf"] @@ -1226,9 +1178,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFEfficientFormerForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -1257,9 +1206,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFElectraForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1323,9 +1269,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -ESM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFEsmForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1361,9 +1304,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFFlaubertForMultipleChoice(metaclass=DummyObject): _backends = ["tf"] @@ -1413,9 +1353,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFFunnelBaseModel(metaclass=DummyObject): _backends = ["tf"] @@ -1479,9 +1416,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFGPT2DoubleHeadsModel(metaclass=DummyObject): _backends = ["tf"] @@ -1559,9 +1493,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFGroupViTModel(metaclass=DummyObject): _backends = ["tf"] @@ -1590,9 +1521,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFHubertForCTC(metaclass=DummyObject): _backends = ["tf"] @@ -1614,9 +1542,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFLayoutLMForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1666,9 +1591,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFLayoutLMv3ForQuestionAnswering(metaclass=DummyObject): _backends = ["tf"] @@ -1725,9 +1647,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFLongformerForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1784,9 +1703,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFLxmertForPreTraining(metaclass=DummyObject): _backends = ["tf"] @@ -1864,9 +1780,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFMobileBertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1937,9 +1850,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFMobileViTForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -1968,9 +1878,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFMPNetForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -2048,9 +1955,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFOpenAIGPTDoubleHeadsModel(metaclass=DummyObject): _backends = ["tf"] @@ -2163,9 +2067,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFRegNetForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -2187,9 +2088,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFRemBertForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2253,9 +2151,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFResNetForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -2277,9 +2172,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFRobertaForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2343,9 +2235,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFRobertaPreLayerNormForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2409,9 +2298,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFRoFormerForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2475,9 +2361,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFSamModel(metaclass=DummyObject): _backends = ["tf"] @@ -2492,9 +2375,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFSegformerDecodeHead(metaclass=DummyObject): _backends = ["tf"] @@ -2530,9 +2410,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFSpeech2TextForConditionalGeneration(metaclass=DummyObject): _backends = ["tf"] @@ -2554,9 +2431,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFSwinForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -2585,9 +2459,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFT5EncoderModel(metaclass=DummyObject): _backends = ["tf"] @@ -2616,9 +2487,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFTapasForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -2710,9 +2578,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFWav2Vec2ForCTC(metaclass=DummyObject): _backends = ["tf"] @@ -2741,9 +2606,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFWhisperForConditionalGeneration(metaclass=DummyObject): _backends = ["tf"] @@ -2765,9 +2627,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFXGLMForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2789,9 +2648,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFXLMForMultipleChoice(metaclass=DummyObject): _backends = ["tf"] @@ -2848,9 +2704,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFXLMRobertaForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2907,9 +2760,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) -TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class TFXLNetForMultipleChoice(metaclass=DummyObject): _backends = ["tf"] diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py index 5dd27ef591a180..525893d5962234 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py @@ -33,7 +33,7 @@ {% endif %} _import_structure = { - "configuration_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP", "{{cookiecutter.camelcase_modelname}}Config"], + "configuration_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.camelcase_modelname}}Config"], "tokenization_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.camelcase_modelname}}Tokenizer"], } @@ -54,7 +54,6 @@ pass else: _import_structure["modeling_{{cookiecutter.lowercase_modelname}}"] = [ - "{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "{{cookiecutter.camelcase_modelname}}ForMaskedLM", "{{cookiecutter.camelcase_modelname}}ForCausalLM", "{{cookiecutter.camelcase_modelname}}ForMultipleChoice", @@ -74,7 +73,6 @@ pass else: _import_structure["modeling_{{cookiecutter.lowercase_modelname}}"] = [ - "{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "{{cookiecutter.camelcase_modelname}}ForConditionalGeneration", "{{cookiecutter.camelcase_modelname}}ForQuestionAnswering", "{{cookiecutter.camelcase_modelname}}ForSequenceClassification", @@ -95,7 +93,6 @@ pass else: _import_structure["modeling_tf_{{cookiecutter.lowercase_modelname}}"] = [ - "TF_{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "TF{{cookiecutter.camelcase_modelname}}ForMaskedLM", "TF{{cookiecutter.camelcase_modelname}}ForCausalLM", "TF{{cookiecutter.camelcase_modelname}}ForMultipleChoice", @@ -160,7 +157,7 @@ if TYPE_CHECKING: - from .configuration_{{cookiecutter.lowercase_modelname}} import {{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP, {{cookiecutter.camelcase_modelname}}Config + from .configuration_{{cookiecutter.lowercase_modelname}} import {{cookiecutter.uppercase_modelname}}{{cookiecutter.camelcase_modelname}}Config from .tokenization_{{cookiecutter.lowercase_modelname}} import {{cookiecutter.camelcase_modelname}}Tokenizer try: @@ -180,8 +177,7 @@ pass else: from .modeling_{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, - {{cookiecutter.camelcase_modelname}}ForMaskedLM, + {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForMaskedLM, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForMultipleChoice, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, @@ -200,8 +196,7 @@ pass else: from .modeling_{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, - {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, + {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, {{cookiecutter.camelcase_modelname}}ForSequenceClassification, @@ -219,8 +214,7 @@ pass else: from .modeling_tf_{{cookiecutter.lowercase_modelname}} import ( - TF_{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, - TF{{cookiecutter.camelcase_modelname}}ForMaskedLM, + TF_{{cookiecutter.uppercase_modelname}} TF{{cookiecutter.camelcase_modelname}}ForMaskedLM, TF{{cookiecutter.camelcase_modelname}}ForCausalLM, TF{{cookiecutter.camelcase_modelname}}ForMultipleChoice, TF{{cookiecutter.camelcase_modelname}}ForQuestionAnswering, diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration_{{cookiecutter.lowercase_modelname}}.py index 15dc223595cb2f..61f4e81d744193 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration_{{cookiecutter.lowercase_modelname}}.py @@ -20,11 +20,6 @@ logger = logging.get_logger(__name__) -{{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/config.json", - # See all {{cookiecutter.modelname}} models at https://huggingface.co/models?filter={{cookiecutter.lowercase_modelname}} -} - class {{cookiecutter.camelcase_modelname}}Config(PretrainedConfig): r""" diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py index fdfa32726c34e3..d903c18b2f06f3 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py @@ -64,11 +64,6 @@ _CHECKPOINT_FOR_DOC = "{{cookiecutter.checkpoint_identifier}}" _CONFIG_FOR_DOC = "{{cookiecutter.camelcase_modelname}}Config" -TF_{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "{{cookiecutter.checkpoint_identifier}}", - # See all {{cookiecutter.modelname}} models at https://huggingface.co/models?filter={{cookiecutter.lowercase_modelname}} -] - # Copied from transformers.models.bert.modeling_tf_bert.TFBertEmbeddings with Bert->{{cookiecutter.camelcase_modelname}} class TF{{cookiecutter.camelcase_modelname}}Embeddings(keras.layers.Layer): diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py index 3c4295f71501f7..db109b27fc8aae 100755 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py @@ -57,11 +57,6 @@ _CHECKPOINT_FOR_DOC = "{{cookiecutter.checkpoint_identifier}}" _CONFIG_FOR_DOC = "{{cookiecutter.camelcase_modelname}}Config" -{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "{{cookiecutter.checkpoint_identifier}}", - # See all {{cookiecutter.modelname}} models at https://huggingface.co/models?filter={{cookiecutter.lowercase_modelname}} -] - def load_tf_weights_in_{{cookiecutter.lowercase_modelname}}(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" @@ -1588,11 +1583,6 @@ def forward( _CONFIG_FOR_DOC = "{{cookiecutter.camelcase_modelname}}Config" -{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "{{cookiecutter.checkpoint_identifier}}", - # See all {{cookiecutter.modelname}} models at https://huggingface.co/models?filter={{cookiecutter.lowercase_modelname}} -] - def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py index 6d5b3fe79682ef..cdb5070e3d9955 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py @@ -40,8 +40,7 @@ {{cookiecutter.camelcase_modelname}}Model, ) from transformers.models.{{cookiecutter.lowercase_modelname}}.modeling_{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, - ) + {{cookiecutter.uppercase_modelname}} ) class {{cookiecutter.camelcase_modelname}}ModelTester: @@ -453,9 +452,9 @@ def test_model_as_decoder_with_default_input_mask(self): @slow def test_model_from_pretrained(self): - for model_name in {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = {{cookiecutter.camelcase_modelname}}Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "{{coockiecutter.checkpoint_identifier}}" + model = {{cookiecutter.camelcase_modelname}}Model.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py index 257dda17b4dc3b..04f4f7c2a34d2b 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py @@ -30,7 +30,6 @@ {% if cookiecutter.is_encoder_decoder_model == "False" %} _import_structure["models.{{cookiecutter.lowercase_modelname}}"].extend( [ - "{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "{{cookiecutter.camelcase_modelname}}ForMaskedLM", "{{cookiecutter.camelcase_modelname}}ForCausalLM", "{{cookiecutter.camelcase_modelname}}ForMultipleChoice", @@ -46,7 +45,6 @@ {% else %} _import_structure["models.{{cookiecutter.lowercase_modelname}}"].extend( [ - "{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "{{cookiecutter.camelcase_modelname}}ForCausalLM", "{{cookiecutter.camelcase_modelname}}ForConditionalGeneration", "{{cookiecutter.camelcase_modelname}}ForQuestionAnswering", @@ -63,7 +61,6 @@ {% if cookiecutter.is_encoder_decoder_model == "False" %} _import_structure["models.{{cookiecutter.lowercase_modelname}}"].extend( [ - "TF_{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "TF{{cookiecutter.camelcase_modelname}}ForMaskedLM", "TF{{cookiecutter.camelcase_modelname}}ForCausalLM", "TF{{cookiecutter.camelcase_modelname}}ForMultipleChoice", @@ -122,7 +119,7 @@ # Below: " # Models" # Replace with: - "models.{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP", "{{cookiecutter.camelcase_modelname}}Config", "{{cookiecutter.camelcase_modelname}}Tokenizer"], + "models.{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.camelcase_modelname}}Config", "{{cookiecutter.camelcase_modelname}}Tokenizer"], # End. # To replace in: "src/transformers/__init__.py" @@ -130,8 +127,7 @@ # Replace with: {% if cookiecutter.is_encoder_decoder_model == "False" %} from .models.{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, - {{cookiecutter.camelcase_modelname}}ForMaskedLM, + {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForMaskedLM, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForMultipleChoice, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, @@ -144,8 +140,7 @@ ) {% else %} from .models.{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, - {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, + {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, {{cookiecutter.camelcase_modelname}}ForSequenceClassification, @@ -159,8 +154,7 @@ # Replace with: {% if cookiecutter.is_encoder_decoder_model == "False" %} from .models.{{cookiecutter.lowercase_modelname}} import ( - TF_{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, - TF{{cookiecutter.camelcase_modelname}}ForMaskedLM, + TF_{{cookiecutter.uppercase_modelname}} TF{{cookiecutter.camelcase_modelname}}ForMaskedLM, TF{{cookiecutter.camelcase_modelname}}ForCausalLM, TF{{cookiecutter.camelcase_modelname}}ForMultipleChoice, TF{{cookiecutter.camelcase_modelname}}ForQuestionAnswering, @@ -209,9 +203,9 @@ from .models.{{cookiecutter.lowercase_modelname}} import {{cookiecutter.camelcase_modelname}}TokenizerFast # End. -# Below: " from .models.albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig" +# Below: " from .models.albert import AlbertConfig" # Replace with: - from .models.{{cookiecutter.lowercase_modelname}} import {{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP, {{cookiecutter.camelcase_modelname}}Config, {{cookiecutter.camelcase_modelname}}Tokenizer + from .models.{{cookiecutter.lowercase_modelname}} import {{cookiecutter.uppercase_modelname}}{{cookiecutter.camelcase_modelname}}Config, {{cookiecutter.camelcase_modelname}}Tokenizer # End. @@ -229,11 +223,6 @@ ("{{cookiecutter.lowercase_modelname}}", "{{cookiecutter.camelcase_modelname}}Config"), # End. -# Below: "# Add archive maps here" -# Replace with: - ("{{cookiecutter.lowercase_modelname}}", "{{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP"), -# End. - # Below: "# Add full (and cased) model names here" # Replace with: ("{{cookiecutter.lowercase_modelname}}", "{{cookiecutter.camelcase_modelname}}"), diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_fast_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_fast_{{cookiecutter.lowercase_modelname}}.py index 6e6c93698367fe..3712c970296ea1 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_fast_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_fast_{{cookiecutter.lowercase_modelname}}.py @@ -30,15 +30,6 @@ } } -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "{{cookiecutter.checkpoint_identifier}}": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "{{cookiecutter.checkpoint_identifier}}": {"do_lower_case": False}, -} - class {{cookiecutter.camelcase_modelname}}TokenizerFast(BertTokenizerFast): r""" @@ -53,8 +44,6 @@ class {{cookiecutter.camelcase_modelname}}TokenizerFast(BertTokenizerFast): vocab_files_names = VOCAB_FILES_NAMES pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION slow_tokenizer_class = {{cookiecutter.camelcase_modelname}}Tokenizer {%- elif cookiecutter.tokenizer_type == "Based on BART" %} @@ -67,22 +56,6 @@ class {{cookiecutter.camelcase_modelname}}TokenizerFast(BertTokenizerFast): VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/vocab.json", - }, - "merges_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/merges.txt", - }, - "tokenizer_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "{{cookiecutter.checkpoint_identifier}}": 1024, -} - class {{cookiecutter.camelcase_modelname}}TokenizerFast(BartTokenizerFast): r""" @@ -96,8 +69,6 @@ class {{cookiecutter.camelcase_modelname}}TokenizerFast(BartTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = {{cookiecutter.camelcase_modelname}}Tokenizer {%- elif cookiecutter.tokenizer_type == "Standalone" %} @@ -114,19 +85,6 @@ class {{cookiecutter.camelcase_modelname}}TokenizerFast(BartTokenizerFast): VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/vocab.txt", - }, - "tokenizer_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/tokenizer.json", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "{{cookiecutter.checkpoint_identifier}}": 1024, -} - class {{cookiecutter.camelcase_modelname}}TokenizerFast(PreTrainedTokenizerFast): """ Construct a "fast" {{cookiecutter.modelname}} tokenizer (backed by HuggingFace's *tokenizers* library). @@ -137,8 +95,6 @@ class {{cookiecutter.camelcase_modelname}}TokenizerFast(PreTrainedTokenizerFast) """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES slow_tokenizer_class = {{cookiecutter.camelcase_modelname}}Tokenizer def __init__( diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_{{cookiecutter.lowercase_modelname}}.py index a9c072f977d25f..2f627adeb7df20 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_{{cookiecutter.lowercase_modelname}}.py @@ -29,15 +29,6 @@ } } -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "{{cookiecutter.checkpoint_identifier}}": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "{{cookiecutter.checkpoint_identifier}}": {"do_lower_case": False}, -} - class {{cookiecutter.camelcase_modelname}}Tokenizer(BertTokenizer): r""" @@ -52,8 +43,6 @@ class {{cookiecutter.camelcase_modelname}}Tokenizer(BertTokenizer): vocab_files_names = VOCAB_FILES_NAMES pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES - pretrained_init_configuration = PRETRAINED_INIT_CONFIGURATION {%- elif cookiecutter.tokenizer_type == "Based on BART" %} from ...utils import logging @@ -64,19 +53,6 @@ class {{cookiecutter.camelcase_modelname}}Tokenizer(BertTokenizer): VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/vocab.json", - }, - "merges_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "{{cookiecutter.checkpoint_identifier}}": 1024, -} - class {{cookiecutter.camelcase_modelname}}Tokenizer(BartTokenizer): """ @@ -90,8 +66,6 @@ class {{cookiecutter.camelcase_modelname}}Tokenizer(BartTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES {%- elif cookiecutter.tokenizer_type == "Standalone" %} from typing import List, Optional @@ -107,15 +81,6 @@ class {{cookiecutter.camelcase_modelname}}Tokenizer(BartTokenizer): VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "{{cookiecutter.checkpoint_identifier}}": "https://huggingface.co/{{cookiecutter.checkpoint_identifier}}/resolve/main/vocab.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "{{cookiecutter.checkpoint_identifier}}": 1024, -} class {{cookiecutter.camelcase_modelname}}Tokenizer(PreTrainedTokenizer): """ @@ -127,8 +92,6 @@ class {{cookiecutter.camelcase_modelname}}Tokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( @@ -269,8 +232,6 @@ class {{cookiecutter.camelcase_modelname}}TokenizerFast(PreTrainedTokenizerFast) """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP - max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/tests/models/albert/test_modeling_albert.py b/tests/models/albert/test_modeling_albert.py index 823315bc6785bb..d1e5631b342d33 100644 --- a/tests/models/albert/test_modeling_albert.py +++ b/tests/models/albert/test_modeling_albert.py @@ -38,7 +38,6 @@ AlbertForTokenClassification, AlbertModel, ) - from transformers.models.albert.modeling_albert import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST class AlbertModelTester: @@ -322,9 +321,9 @@ def test_model_various_embeddings(self): @slow def test_model_from_pretrained(self): - for model_name in ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = AlbertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "albert/albert-base-v1" + model = AlbertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/albert/test_modeling_tf_albert.py b/tests/models/albert/test_modeling_tf_albert.py index 7bea29fa9cb1d5..a3dab618eecb4a 100644 --- a/tests/models/albert/test_modeling_tf_albert.py +++ b/tests/models/albert/test_modeling_tf_albert.py @@ -32,7 +32,6 @@ from transformers import TF_MODEL_FOR_PRETRAINING_MAPPING from transformers.models.albert.modeling_tf_albert import ( - TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFAlbertForMaskedLM, TFAlbertForMultipleChoice, TFAlbertForPreTraining, @@ -302,9 +301,9 @@ def test_for_question_answering(self): @slow def test_model_from_pretrained(self): - for model_name in TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFAlbertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "albert/albert-base-v1" + model = TFAlbertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/align/test_modeling_align.py b/tests/models/align/test_modeling_align.py index 2f3297899474c3..ee50a1a74bd2da 100644 --- a/tests/models/align/test_modeling_align.py +++ b/tests/models/align/test_modeling_align.py @@ -51,7 +51,6 @@ AlignTextModel, AlignVisionModel, ) - from transformers.models.align.modeling_align import ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -238,9 +237,9 @@ def test_training_gradient_checkpointing_use_reentrant_false(self): @slow def test_model_from_pretrained(self): - for model_name in ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = AlignVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "kakaobrain/align-base" + model = AlignVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class AlignTextModelTester: @@ -390,9 +389,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = AlignTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "kakaobrain/align-base" + model = AlignTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class AlignModelTester: @@ -599,9 +598,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = AlignModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "kakaobrain/align-base" + model = AlignModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/altclip/test_modeling_altclip.py b/tests/models/altclip/test_modeling_altclip.py index 10b0e167d727b6..8c5be789c02b81 100755 --- a/tests/models/altclip/test_modeling_altclip.py +++ b/tests/models/altclip/test_modeling_altclip.py @@ -43,7 +43,6 @@ import torch.nn as nn from transformers import AltCLIPModel, AltCLIPTextModel, AltCLIPVisionModel - from transformers.models.altclip.modeling_altclip import ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -365,9 +364,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = AltCLIPTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "BAAI/AltCLIP" + model = AltCLIPTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class AltCLIPModelTester: @@ -560,9 +559,9 @@ def _create_and_check_torchscript(self, config, inputs_dict): @slow def test_model_from_pretrained(self): - for model_name in ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = AltCLIPModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "BAAI/AltCLIP" + model = AltCLIPModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_vision diff --git a/tests/models/audio_spectrogram_transformer/test_modeling_audio_spectrogram_transformer.py b/tests/models/audio_spectrogram_transformer/test_modeling_audio_spectrogram_transformer.py index ce596d84e37282..564ca4d48c6a7f 100644 --- a/tests/models/audio_spectrogram_transformer/test_modeling_audio_spectrogram_transformer.py +++ b/tests/models/audio_spectrogram_transformer/test_modeling_audio_spectrogram_transformer.py @@ -33,9 +33,6 @@ from torch import nn from transformers import ASTForAudioClassification, ASTModel - from transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer import ( - AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, - ) if is_torchaudio_available(): @@ -212,9 +209,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ASTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "MIT/ast-finetuned-audioset-10-10-0.4593" + model = ASTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on some audio from AudioSet diff --git a/tests/models/auto/test_modeling_auto.py b/tests/models/auto/test_modeling_auto.py index ab5fa95796eac5..a8e42d77f90e36 100644 --- a/tests/models/auto/test_modeling_auto.py +++ b/tests/models/auto/test_modeling_auto.py @@ -85,10 +85,6 @@ MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING, MODEL_MAPPING, ) - from transformers.models.bert.modeling_bert import BERT_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.gpt2.modeling_gpt2 import GPT2_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.t5.modeling_t5 import T5_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.tapas.modeling_tapas import TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST @require_torch @@ -98,138 +94,134 @@ def setUp(self): @slow def test_model_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) - - model = AutoModel.from_pretrained(model_name) - model, loading_info = AutoModel.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertModel) - - self.assertEqual(len(loading_info["missing_keys"]), 0) - # When using PyTorch checkpoint, the expected value is `8`. With `safetensors` checkpoint (if it is - # installed), the expected value becomes `7`. - EXPECTED_NUM_OF_UNEXPECTED_KEYS = 7 if is_safetensors_available() else 8 - self.assertEqual(len(loading_info["unexpected_keys"]), EXPECTED_NUM_OF_UNEXPECTED_KEYS) - self.assertEqual(len(loading_info["mismatched_keys"]), 0) - self.assertEqual(len(loading_info["error_msgs"]), 0) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) + + model = AutoModel.from_pretrained(model_name) + model, loading_info = AutoModel.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertModel) + + self.assertEqual(len(loading_info["missing_keys"]), 0) + # When using PyTorch checkpoint, the expected value is `8`. With `safetensors` checkpoint (if it is + # installed), the expected value becomes `7`. + EXPECTED_NUM_OF_UNEXPECTED_KEYS = 7 if is_safetensors_available() else 8 + self.assertEqual(len(loading_info["unexpected_keys"]), EXPECTED_NUM_OF_UNEXPECTED_KEYS) + self.assertEqual(len(loading_info["mismatched_keys"]), 0) + self.assertEqual(len(loading_info["error_msgs"]), 0) @slow def test_model_for_pretraining_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) - - model = AutoModelForPreTraining.from_pretrained(model_name) - model, loading_info = AutoModelForPreTraining.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForPreTraining) - # Only one value should not be initialized and in the missing keys. - for key, value in loading_info.items(): - self.assertEqual(len(value), 0) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) + + model = AutoModelForPreTraining.from_pretrained(model_name) + model, loading_info = AutoModelForPreTraining.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForPreTraining) + # Only one value should not be initialized and in the missing keys. + for key, value in loading_info.items(): + self.assertEqual(len(value), 0) @slow def test_lmhead_model_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) - model = AutoModelWithLMHead.from_pretrained(model_name) - model, loading_info = AutoModelWithLMHead.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForMaskedLM) + model = AutoModelWithLMHead.from_pretrained(model_name) + model, loading_info = AutoModelWithLMHead.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForMaskedLM) @slow def test_model_for_causal_lm(self): - for model_name in GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, GPT2Config) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, GPT2Config) - model = AutoModelForCausalLM.from_pretrained(model_name) - model, loading_info = AutoModelForCausalLM.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, GPT2LMHeadModel) + model = AutoModelForCausalLM.from_pretrained(model_name) + model, loading_info = AutoModelForCausalLM.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, GPT2LMHeadModel) @slow def test_model_for_masked_lm(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) - model = AutoModelForMaskedLM.from_pretrained(model_name) - model, loading_info = AutoModelForMaskedLM.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForMaskedLM) + model = AutoModelForMaskedLM.from_pretrained(model_name) + model, loading_info = AutoModelForMaskedLM.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForMaskedLM) @slow def test_model_for_encoder_decoder_lm(self): - for model_name in T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, T5Config) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, T5Config) - model = AutoModelForSeq2SeqLM.from_pretrained(model_name) - model, loading_info = AutoModelForSeq2SeqLM.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, T5ForConditionalGeneration) + model = AutoModelForSeq2SeqLM.from_pretrained(model_name) + model, loading_info = AutoModelForSeq2SeqLM.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, T5ForConditionalGeneration) @slow def test_sequence_classification_model_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) - - model = AutoModelForSequenceClassification.from_pretrained(model_name) - model, loading_info = AutoModelForSequenceClassification.from_pretrained( - model_name, output_loading_info=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForSequenceClassification) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) + + model = AutoModelForSequenceClassification.from_pretrained(model_name) + model, loading_info = AutoModelForSequenceClassification.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForSequenceClassification) @slow def test_question_answering_model_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) - model = AutoModelForQuestionAnswering.from_pretrained(model_name) - model, loading_info = AutoModelForQuestionAnswering.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForQuestionAnswering) + model = AutoModelForQuestionAnswering.from_pretrained(model_name) + model, loading_info = AutoModelForQuestionAnswering.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForQuestionAnswering) @slow def test_table_question_answering_model_from_pretrained(self): - for model_name in TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST[5:6]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, TapasConfig) - - model = AutoModelForTableQuestionAnswering.from_pretrained(model_name) - model, loading_info = AutoModelForTableQuestionAnswering.from_pretrained( - model_name, output_loading_info=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, TapasForQuestionAnswering) + model_name = "google/tapas-base" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, TapasConfig) + + model = AutoModelForTableQuestionAnswering.from_pretrained(model_name) + model, loading_info = AutoModelForTableQuestionAnswering.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, TapasForQuestionAnswering) @slow def test_token_classification_model_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) - - model = AutoModelForTokenClassification.from_pretrained(model_name) - model, loading_info = AutoModelForTokenClassification.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForTokenClassification) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) + + model = AutoModelForTokenClassification.from_pretrained(model_name) + model, loading_info = AutoModelForTokenClassification.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForTokenClassification) @slow def test_auto_backbone_timm_model_from_pretrained(self): diff --git a/tests/models/auto/test_modeling_tf_auto.py b/tests/models/auto/test_modeling_tf_auto.py index e0758610871a86..53a07b197057e7 100644 --- a/tests/models/auto/test_modeling_tf_auto.py +++ b/tests/models/auto/test_modeling_tf_auto.py @@ -65,10 +65,6 @@ TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING, TF_MODEL_MAPPING, ) - from transformers.models.bert.modeling_tf_bert import TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.gpt2.modeling_tf_gpt2 import TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.t5.modeling_tf_t5 import TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.tapas.modeling_tf_tapas import TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST class NewModelConfig(BertConfig): @@ -107,54 +103,54 @@ def test_model_for_pretraining_from_pretrained(self): @slow def test_model_for_causal_lm(self): - for model_name in TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, GPT2Config) + model_name = "openai-community/gpt2" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, GPT2Config) - model = TFAutoModelForCausalLM.from_pretrained(model_name) - model, loading_info = TFAutoModelForCausalLM.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFGPT2LMHeadModel) + model = TFAutoModelForCausalLM.from_pretrained(model_name) + model, loading_info = TFAutoModelForCausalLM.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFGPT2LMHeadModel) @slow def test_lmhead_model_from_pretrained(self): - for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) + model_name = "openai-community/gpt2" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) - model = TFAutoModelWithLMHead.from_pretrained(model_name) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFBertForMaskedLM) + model = TFAutoModelWithLMHead.from_pretrained(model_name) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFBertForMaskedLM) @slow def test_model_for_masked_lm(self): - for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) + model_name = "openai-community/gpt2" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) - model = TFAutoModelForMaskedLM.from_pretrained(model_name) - model, loading_info = TFAutoModelForMaskedLM.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFBertForMaskedLM) + model = TFAutoModelForMaskedLM.from_pretrained(model_name) + model, loading_info = TFAutoModelForMaskedLM.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFBertForMaskedLM) @slow def test_model_for_encoder_decoder_lm(self): - for model_name in TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, T5Config) + model_name = "openai-community/gpt2" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, T5Config) - model = TFAutoModelForSeq2SeqLM.from_pretrained(model_name) - model, loading_info = TFAutoModelForSeq2SeqLM.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFT5ForConditionalGeneration) + model = TFAutoModelForSeq2SeqLM.from_pretrained(model_name) + model, loading_info = TFAutoModelForSeq2SeqLM.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFT5ForConditionalGeneration) @slow def test_sequence_classification_model_from_pretrained(self): - # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'openai-community/gpt2' for model_name in ["google-bert/bert-base-uncased"]: config = AutoConfig.from_pretrained(model_name) self.assertIsNotNone(config) @@ -166,7 +162,7 @@ def test_sequence_classification_model_from_pretrained(self): @slow def test_question_answering_model_from_pretrained(self): - # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'openai-community/gpt2' for model_name in ["google-bert/bert-base-uncased"]: config = AutoConfig.from_pretrained(model_name) self.assertIsNotNone(config) @@ -179,17 +175,17 @@ def test_question_answering_model_from_pretrained(self): @slow @require_tensorflow_probability def test_table_question_answering_model_from_pretrained(self): - for model_name in TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST[5:6]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, TapasConfig) + model_name = "google/tapas-base" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, TapasConfig) - model = TFAutoModelForTableQuestionAnswering.from_pretrained(model_name) - model, loading_info = TFAutoModelForTableQuestionAnswering.from_pretrained( - model_name, output_loading_info=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFTapasForQuestionAnswering) + model = TFAutoModelForTableQuestionAnswering.from_pretrained(model_name) + model, loading_info = TFAutoModelForTableQuestionAnswering.from_pretrained( + model_name, output_loading_info=True + ) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFTapasForQuestionAnswering) def test_from_pretrained_identifier(self): model = TFAutoModelWithLMHead.from_pretrained(SMALL_MODEL_IDENTIFIER) diff --git a/tests/models/auto/test_modeling_tf_pytorch.py b/tests/models/auto/test_modeling_tf_pytorch.py index 77b19a8e3a7976..5b9036cbf1cf18 100644 --- a/tests/models/auto/test_modeling_tf_pytorch.py +++ b/tests/models/auto/test_modeling_tf_pytorch.py @@ -45,9 +45,6 @@ TFRobertaForMaskedLM, TFT5ForConditionalGeneration, ) - from transformers.models.bert.modeling_tf_bert import TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.gpt2.modeling_tf_gpt2 import TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST - from transformers.models.t5.modeling_tf_t5 import TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST if is_torch_available(): from transformers import ( @@ -74,7 +71,7 @@ class TFPTAutoModelTest(unittest.TestCase): @slow def test_model_from_pretrained(self): - # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'google-bert/bert-base-uncased' for model_name in ["google-bert/bert-base-uncased"]: config = AutoConfig.from_pretrained(model_name) self.assertIsNotNone(config) @@ -90,7 +87,7 @@ def test_model_from_pretrained(self): @slow def test_model_for_pretraining_from_pretrained(self): - # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'google-bert/bert-base-uncased' for model_name in ["google-bert/bert-base-uncased"]: config = AutoConfig.from_pretrained(model_name) self.assertIsNotNone(config) @@ -106,85 +103,79 @@ def test_model_for_pretraining_from_pretrained(self): @slow def test_model_for_causal_lm(self): - for model_name in TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, GPT2Config) - - model = TFAutoModelForCausalLM.from_pretrained(model_name, from_pt=True) - model, loading_info = TFAutoModelForCausalLM.from_pretrained( - model_name, output_loading_info=True, from_pt=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFGPT2LMHeadModel) - - model = AutoModelForCausalLM.from_pretrained(model_name, from_tf=True) - model, loading_info = AutoModelForCausalLM.from_pretrained( - model_name, output_loading_info=True, from_tf=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, GPT2LMHeadModel) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, GPT2Config) + + model = TFAutoModelForCausalLM.from_pretrained(model_name, from_pt=True) + model, loading_info = TFAutoModelForCausalLM.from_pretrained( + model_name, output_loading_info=True, from_pt=True + ) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFGPT2LMHeadModel) + + model = AutoModelForCausalLM.from_pretrained(model_name, from_tf=True) + model, loading_info = AutoModelForCausalLM.from_pretrained(model_name, output_loading_info=True, from_tf=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, GPT2LMHeadModel) @slow def test_lmhead_model_from_pretrained(self): - for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) - model = TFAutoModelWithLMHead.from_pretrained(model_name, from_pt=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFBertForMaskedLM) + model = TFAutoModelWithLMHead.from_pretrained(model_name, from_pt=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFBertForMaskedLM) - model = AutoModelWithLMHead.from_pretrained(model_name, from_tf=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForMaskedLM) + model = AutoModelWithLMHead.from_pretrained(model_name, from_tf=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForMaskedLM) @slow def test_model_for_masked_lm(self): - for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, BertConfig) - - model = TFAutoModelForMaskedLM.from_pretrained(model_name, from_pt=True) - model, loading_info = TFAutoModelForMaskedLM.from_pretrained( - model_name, output_loading_info=True, from_pt=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFBertForMaskedLM) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, BertConfig) + + model = TFAutoModelForMaskedLM.from_pretrained(model_name, from_pt=True) + model, loading_info = TFAutoModelForMaskedLM.from_pretrained( + model_name, output_loading_info=True, from_pt=True + ) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFBertForMaskedLM) - model = AutoModelForMaskedLM.from_pretrained(model_name, from_tf=True) - model, loading_info = AutoModelForMaskedLM.from_pretrained( - model_name, output_loading_info=True, from_tf=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, BertForMaskedLM) + model = AutoModelForMaskedLM.from_pretrained(model_name, from_tf=True) + model, loading_info = AutoModelForMaskedLM.from_pretrained(model_name, output_loading_info=True, from_tf=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, BertForMaskedLM) @slow def test_model_for_encoder_decoder_lm(self): - for model_name in TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = AutoConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, T5Config) - - model = TFAutoModelForSeq2SeqLM.from_pretrained(model_name, from_pt=True) - model, loading_info = TFAutoModelForSeq2SeqLM.from_pretrained( - model_name, output_loading_info=True, from_pt=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, TFT5ForConditionalGeneration) - - model = AutoModelForSeq2SeqLM.from_pretrained(model_name, from_tf=True) - model, loading_info = AutoModelForSeq2SeqLM.from_pretrained( - model_name, output_loading_info=True, from_tf=True - ) - self.assertIsNotNone(model) - self.assertIsInstance(model, T5ForConditionalGeneration) + model_name = "google-bert/bert-base-uncased" + config = AutoConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, T5Config) + + model = TFAutoModelForSeq2SeqLM.from_pretrained(model_name, from_pt=True) + model, loading_info = TFAutoModelForSeq2SeqLM.from_pretrained( + model_name, output_loading_info=True, from_pt=True + ) + self.assertIsNotNone(model) + self.assertIsInstance(model, TFT5ForConditionalGeneration) + + model = AutoModelForSeq2SeqLM.from_pretrained(model_name, from_tf=True) + model, loading_info = AutoModelForSeq2SeqLM.from_pretrained(model_name, output_loading_info=True, from_tf=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, T5ForConditionalGeneration) @slow def test_sequence_classification_model_from_pretrained(self): - # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'google-bert/bert-base-uncased' for model_name in ["google-bert/bert-base-uncased"]: config = AutoConfig.from_pretrained(model_name) self.assertIsNotNone(config) @@ -200,7 +191,7 @@ def test_sequence_classification_model_from_pretrained(self): @slow def test_question_answering_model_from_pretrained(self): - # for model_name in TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'google-bert/bert-base-uncased' for model_name in ["google-bert/bert-base-uncased"]: config = AutoConfig.from_pretrained(model_name) self.assertIsNotNone(config) diff --git a/tests/models/auto/test_tokenization_auto.py b/tests/models/auto/test_tokenization_auto.py index 7d4a302e4f02a2..ad96064308ab5c 100644 --- a/tests/models/auto/test_tokenization_auto.py +++ b/tests/models/auto/test_tokenization_auto.py @@ -25,8 +25,6 @@ import transformers from transformers import ( - BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, - GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, AutoTokenizer, BertConfig, BertTokenizer, @@ -72,13 +70,13 @@ def setUp(self): @slow def test_tokenizer_from_pretrained(self): - for model_name in (x for x in BERT_PRETRAINED_CONFIG_ARCHIVE_MAP.keys() if "japanese" not in x): + for model_name in {"google-bert/bert-base-uncased", "google-bert/bert-base-cased"}: tokenizer = AutoTokenizer.from_pretrained(model_name) self.assertIsNotNone(tokenizer) self.assertIsInstance(tokenizer, (BertTokenizer, BertTokenizerFast)) self.assertGreater(len(tokenizer), 0) - for model_name in GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP.keys(): + for model_name in ["openai-community/gpt2", "openai-community/gpt2-medium"]: tokenizer = AutoTokenizer.from_pretrained(model_name) self.assertIsNotNone(tokenizer) self.assertIsInstance(tokenizer, (GPT2Tokenizer, GPT2TokenizerFast)) diff --git a/tests/models/beit/test_modeling_beit.py b/tests/models/beit/test_modeling_beit.py index f82cf40cdadcb4..50287cb7bc948d 100644 --- a/tests/models/beit/test_modeling_beit.py +++ b/tests/models/beit/test_modeling_beit.py @@ -42,7 +42,6 @@ BeitModel, ) from transformers.models.auto.modeling_auto import MODEL_FOR_BACKBONE_MAPPING_NAMES, MODEL_MAPPING_NAMES - from transformers.models.beit.modeling_beit import BEIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -385,9 +384,9 @@ def test_initialization(self): @slow def test_model_from_pretrained(self): - for model_name in BEIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BeitModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/beit-base-patch16-224" + model = BeitModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/bert/test_modeling_bert.py b/tests/models/bert/test_modeling_bert.py index bc38356852935b..bdc812ff27657b 100644 --- a/tests/models/bert/test_modeling_bert.py +++ b/tests/models/bert/test_modeling_bert.py @@ -42,7 +42,6 @@ BertModel, logging, ) - from transformers.models.bert.modeling_bert import BERT_PRETRAINED_MODEL_ARCHIVE_LIST class BertModelTester: @@ -596,9 +595,9 @@ def test_for_warning_if_padding_and_no_attention_mask(self): @slow def test_model_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google-bert/bert-base-uncased" + model = BertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow @require_torch_accelerator diff --git a/tests/models/big_bird/test_modeling_big_bird.py b/tests/models/big_bird/test_modeling_big_bird.py index e3ae650c563402..02af95879a532c 100644 --- a/tests/models/big_bird/test_modeling_big_bird.py +++ b/tests/models/big_bird/test_modeling_big_bird.py @@ -41,7 +41,6 @@ BigBirdForTokenClassification, BigBirdModel, ) - from transformers.models.big_bird.modeling_big_bird import BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST class BigBirdModelTester: @@ -561,9 +560,9 @@ def test_retain_grad_hidden_states_attentions(self): @slow def test_model_from_pretrained(self): - for model_name in BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BigBirdForPreTraining.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/bigbird-roberta-base" + model = BigBirdForPreTraining.from_pretrained(model_name) + self.assertIsNotNone(model) def test_model_various_attn_type(self): config_and_inputs = self.model_tester.prepare_config_and_inputs() diff --git a/tests/models/biogpt/test_modeling_biogpt.py b/tests/models/biogpt/test_modeling_biogpt.py index b74cbdcb0f5652..1055288e5c2d03 100644 --- a/tests/models/biogpt/test_modeling_biogpt.py +++ b/tests/models/biogpt/test_modeling_biogpt.py @@ -36,7 +36,6 @@ BioGptModel, BioGptTokenizer, ) - from transformers.models.biogpt.modeling_biogpt import BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST class BioGptModelTester: @@ -382,9 +381,9 @@ def test_batch_generation(self): @slow def test_model_from_pretrained(self): - for model_name in BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BioGptModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/biogpt" + model = BioGptModel.from_pretrained(model_name) + self.assertIsNotNone(model) # Copied from tests.models.opt.test_modeling_opt.OPTModelTest.test_opt_sequence_classification_model with OPT->BioGpt,opt->biogpt,prepare_config_and_inputs->prepare_config_and_inputs_for_common def test_biogpt_sequence_classification_model(self): diff --git a/tests/models/bit/test_modeling_bit.py b/tests/models/bit/test_modeling_bit.py index 1705aad976c091..dbc4cacdeb970d 100644 --- a/tests/models/bit/test_modeling_bit.py +++ b/tests/models/bit/test_modeling_bit.py @@ -32,7 +32,6 @@ from torch import nn from transformers import BitBackbone, BitForImageClassification, BitImageProcessor, BitModel - from transformers.models.bit.modeling_bit import BIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -269,9 +268,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in BIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BitModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/bit-50" + model = BitModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -285,13 +284,11 @@ def prepare_img(): class BitModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return ( - BitImageProcessor.from_pretrained(BIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]) if is_vision_available() else None - ) + return BitImageProcessor.from_pretrained("google/bit-50") if is_vision_available() else None @slow def test_inference_image_classification_head(self): - model = BitForImageClassification.from_pretrained(BIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]).to(torch_device) + model = BitForImageClassification.from_pretrained("google/bit-50").to(torch_device) image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/blip/test_modeling_blip.py b/tests/models/blip/test_modeling_blip.py index 51f1690ff1f5cc..9529abc2726df5 100644 --- a/tests/models/blip/test_modeling_blip.py +++ b/tests/models/blip/test_modeling_blip.py @@ -57,7 +57,6 @@ BlipTextModel, BlipVisionModel, ) - from transformers.models.blip.modeling_blip import BLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -223,9 +222,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BlipVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = BlipVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class BlipTextModelTester: @@ -369,9 +368,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BlipTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = BlipTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_pt_tf_model_equivalence(self): super().test_pt_tf_model_equivalence(allow_missing_keys=True) @@ -579,9 +578,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BlipModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = BlipModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_pt_tf_model_equivalence(self): super().test_pt_tf_model_equivalence(allow_missing_keys=True) @@ -1038,9 +1037,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BlipModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = BlipModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch @@ -1254,9 +1253,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BlipModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = BlipModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/blip/test_modeling_blip_text.py b/tests/models/blip/test_modeling_blip_text.py index c004a8934ef0a2..3c12a7e9ea428a 100644 --- a/tests/models/blip/test_modeling_blip_text.py +++ b/tests/models/blip/test_modeling_blip_text.py @@ -29,7 +29,6 @@ import torch from transformers import BlipTextModel - from transformers.models.blip.modeling_blip import BLIP_PRETRAINED_MODEL_ARCHIVE_LIST class BlipTextModelTester: @@ -173,9 +172,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BlipTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = BlipTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_pt_tf_model_equivalence(self): super().test_pt_tf_model_equivalence(allow_missing_keys=True) diff --git a/tests/models/blip/test_modeling_tf_blip.py b/tests/models/blip/test_modeling_tf_blip.py index 11e18403dcfa48..a35eb7a1bdee79 100644 --- a/tests/models/blip/test_modeling_tf_blip.py +++ b/tests/models/blip/test_modeling_tf_blip.py @@ -45,7 +45,6 @@ TFBlipVisionModel, ) from transformers.modeling_tf_utils import keras - from transformers.models.blip.modeling_tf_blip import TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -191,9 +190,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFBlipVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = TFBlipVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class TFBlipTextModelTester: @@ -319,9 +318,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFBlipTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = TFBlipTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_pt_tf_model_equivalence(self, allow_missing_keys=True): super().test_pt_tf_model_equivalence(allow_missing_keys=allow_missing_keys) @@ -428,9 +427,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFBlipModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = TFBlipModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_pt_tf_model_equivalence(self, allow_missing_keys=True): super().test_pt_tf_model_equivalence(allow_missing_keys=allow_missing_keys) @@ -716,9 +715,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFBlipModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = TFBlipModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="Tested in individual model tests") def test_compile_tf_model(self): @@ -831,9 +830,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFBlipModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = TFBlipModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/blip/test_modeling_tf_blip_text.py b/tests/models/blip/test_modeling_tf_blip_text.py index a21bdd109f89a1..7583b61b5802a3 100644 --- a/tests/models/blip/test_modeling_tf_blip_text.py +++ b/tests/models/blip/test_modeling_tf_blip_text.py @@ -31,7 +31,6 @@ import tensorflow as tf from transformers import TFBlipTextModel - from transformers.models.blip.modeling_tf_blip import TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST class BlipTextModelTester: @@ -173,9 +172,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFBlipTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip-vqa-base" + model = TFBlipTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_pt_tf_model_equivalence(self, allow_missing_keys=True): super().test_pt_tf_model_equivalence(allow_missing_keys=allow_missing_keys) diff --git a/tests/models/blip_2/test_modeling_blip_2.py b/tests/models/blip_2/test_modeling_blip_2.py index 4abbba22f50f52..ccf3051a170fca 100644 --- a/tests/models/blip_2/test_modeling_blip_2.py +++ b/tests/models/blip_2/test_modeling_blip_2.py @@ -49,7 +49,6 @@ from torch import nn from transformers import Blip2ForConditionalGeneration, Blip2Model, Blip2VisionModel - from transformers.models.blip_2.modeling_blip_2 import BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -217,9 +216,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Blip2VisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip2-opt-2.7b" + model = Blip2VisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class Blip2QFormerModelTester: @@ -504,9 +503,9 @@ def test_load_vision_qformer_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST: - model = Blip2ForConditionalGeneration.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip2-opt-2.7b" + model = Blip2ForConditionalGeneration.from_pretrained(model_name) + self.assertIsNotNone(model) # this class is based on `T5ModelTester` found in tests/models/t5/test_modeling_t5.py @@ -766,9 +765,9 @@ def test_load_vision_qformer_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST: - model = Blip2ForConditionalGeneration.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/blip2-opt-2.7b" + model = Blip2ForConditionalGeneration.from_pretrained(model_name) + self.assertIsNotNone(model) def test_get_text_features(self): config, _ = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/bloom/test_modeling_bloom.py b/tests/models/bloom/test_modeling_bloom.py index 95160179c204a5..d0ee36dc3ca1d9 100644 --- a/tests/models/bloom/test_modeling_bloom.py +++ b/tests/models/bloom/test_modeling_bloom.py @@ -30,7 +30,6 @@ import torch from transformers import ( - BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST, BloomForCausalLM, BloomForQuestionAnswering, BloomForSequenceClassification, @@ -396,9 +395,9 @@ def test_past_key_values_format(self): @slow def test_model_from_pretrained(self): - for model_name in BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BloomModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "bigscience/bigscience-small-testing" + model = BloomModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow @require_torch_accelerator diff --git a/tests/models/bridgetower/test_modeling_bridgetower.py b/tests/models/bridgetower/test_modeling_bridgetower.py index 8c7bd00ee6683a..971ea4f08a815a 100644 --- a/tests/models/bridgetower/test_modeling_bridgetower.py +++ b/tests/models/bridgetower/test_modeling_bridgetower.py @@ -49,7 +49,6 @@ BridgeTowerForMaskedLM, BridgeTowerModel, ) - from transformers.models.bridgetower.modeling_bridgetower import BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -356,9 +355,9 @@ def test_for_masked_language_modeling(self): @slow def test_model_from_pretrained(self): - for model_name in BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BridgeTowerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "BridgeTower/bridgetower-base" + model = BridgeTowerModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_save_load_fast_init_from_base(self): diff --git a/tests/models/bros/test_modeling_bros.py b/tests/models/bros/test_modeling_bros.py index c4fbaa2f98d3df..755deefcb48383 100644 --- a/tests/models/bros/test_modeling_bros.py +++ b/tests/models/bros/test_modeling_bros.py @@ -35,9 +35,6 @@ BrosSpadeEEForTokenClassification, BrosSpadeELForTokenClassification, ) - from transformers.models.bros.modeling_bros import ( - BROS_PRETRAINED_MODEL_ARCHIVE_LIST, - ) class BrosModelTester: @@ -370,9 +367,9 @@ def test_for_spade_el_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in BROS_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = BrosModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "jinho8345/bros-base-uncased" + model = BrosModel.from_pretrained(model_name) + self.assertIsNotNone(model) def prepare_bros_batch_inputs(): diff --git a/tests/models/canine/test_modeling_canine.py b/tests/models/canine/test_modeling_canine.py index f10823fc566499..eeb5aa40dda7df 100644 --- a/tests/models/canine/test_modeling_canine.py +++ b/tests/models/canine/test_modeling_canine.py @@ -36,7 +36,6 @@ CanineForTokenClassification, CanineModel, ) - from transformers.models.canine.modeling_canine import CANINE_PRETRAINED_MODEL_ARCHIVE_LIST class CanineModelTester: @@ -527,9 +526,9 @@ def test_training_gradient_checkpointing_use_reentrant_false(self): @slow def test_model_from_pretrained(self): - for model_name in CANINE_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CanineModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/canine-s" + model = CanineModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/chinese_clip/test_modeling_chinese_clip.py b/tests/models/chinese_clip/test_modeling_chinese_clip.py index 06c946bf107d03..8ee9028eca26d5 100644 --- a/tests/models/chinese_clip/test_modeling_chinese_clip.py +++ b/tests/models/chinese_clip/test_modeling_chinese_clip.py @@ -48,7 +48,6 @@ ChineseCLIPTextModel, ChineseCLIPVisionModel, ) - from transformers.models.chinese_clip.modeling_chinese_clip import CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -385,9 +384,9 @@ def test_model_as_decoder_with_default_input_mask(self): @slow def test_model_from_pretrained(self): - for model_name in CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ChineseCLIPTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "OFA-Sys/chinese-clip-vit-base-patch16" + model = ChineseCLIPTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_training(self): pass @@ -495,9 +494,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ChineseCLIPVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "OFA-Sys/chinese-clip-vit-base-patch16" + model = ChineseCLIPVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class ChineseCLIPModelTester: @@ -693,9 +692,9 @@ def _create_and_check_torchscript(self, config, inputs_dict): @slow def test_model_from_pretrained(self): - for model_name in CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ChineseCLIPModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "OFA-Sys/chinese-clip-vit-base-patch16" + model = ChineseCLIPModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of Pikachu diff --git a/tests/models/clap/test_modeling_clap.py b/tests/models/clap/test_modeling_clap.py index fe3e8b0e547e1e..f06fabf0a23732 100644 --- a/tests/models/clap/test_modeling_clap.py +++ b/tests/models/clap/test_modeling_clap.py @@ -49,7 +49,6 @@ ClapTextModel, ClapTextModelWithProjection, ) - from transformers.models.clap.modeling_clap import CLAP_PRETRAINED_MODEL_ARCHIVE_LIST class ClapAudioModelTester: @@ -275,16 +274,16 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in CLAP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ClapAudioModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "laion/clap-htsat-fused" + model = ClapAudioModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_model_with_projection_from_pretrained(self): - for model_name in CLAP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ClapAudioModelWithProjection.from_pretrained(model_name) - self.assertIsNotNone(model) - self.assertTrue(hasattr(model, "audio_projection")) + model_name = "laion/clap-htsat-fused" + model = ClapAudioModelWithProjection.from_pretrained(model_name) + self.assertIsNotNone(model) + self.assertTrue(hasattr(model, "audio_projection")) class ClapTextModelTester: @@ -444,16 +443,16 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in CLAP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ClapTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "laion/clap-htsat-fused" + model = ClapTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_model_with_projection_from_pretrained(self): - for model_name in CLAP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ClapTextModelWithProjection.from_pretrained(model_name) - self.assertIsNotNone(model) - self.assertTrue(hasattr(model, "text_projection")) + model_name = "laion/clap-htsat-fused" + model = ClapTextModelWithProjection.from_pretrained(model_name) + self.assertIsNotNone(model) + self.assertTrue(hasattr(model, "text_projection")) class ClapModelTester: @@ -650,9 +649,9 @@ def test_load_audio_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in CLAP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ClapModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "laion/clap-htsat-fused" + model = ClapModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow diff --git a/tests/models/clip/test_modeling_clip.py b/tests/models/clip/test_modeling_clip.py index fbcb22575af992..16c8f47b782fad 100644 --- a/tests/models/clip/test_modeling_clip.py +++ b/tests/models/clip/test_modeling_clip.py @@ -58,7 +58,6 @@ CLIPVisionModel, CLIPVisionModelWithProjection, ) - from transformers.models.clip.modeling_clip import CLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -250,16 +249,16 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai/clip-vit-base-patch32" + model = CLIPVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_model_with_projection_from_pretrained(self): - for model_name in CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPVisionModelWithProjection.from_pretrained(model_name) - self.assertIsNotNone(model) - self.assertTrue(hasattr(model, "visual_projection")) + model_name = "openai/clip-vit-base-patch32" + model = CLIPVisionModelWithProjection.from_pretrained(model_name) + self.assertIsNotNone(model) + self.assertTrue(hasattr(model, "visual_projection")) class CLIPTextModelTester: @@ -415,16 +414,16 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai/clip-vit-base-patch32" + model = CLIPTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_model_with_projection_from_pretrained(self): - for model_name in CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPTextModelWithProjection.from_pretrained(model_name) - self.assertIsNotNone(model) - self.assertTrue(hasattr(model, "text_projection")) + model_name = "openai/clip-vit-base-patch32" + model = CLIPTextModelWithProjection.from_pretrained(model_name) + self.assertIsNotNone(model) + self.assertTrue(hasattr(model, "text_projection")) class CLIPModelTester: @@ -741,9 +740,9 @@ def test_equivalence_flax_to_pt(self): @slow def test_model_from_pretrained(self): - for model_name in CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai/clip-vit-base-patch32" + model = CLIPModel.from_pretrained(model_name) + self.assertIsNotNone(model) class CLIPForImageClassificationModelTester(CLIPModelTester): diff --git a/tests/models/clip/test_modeling_tf_clip.py b/tests/models/clip/test_modeling_tf_clip.py index 8feeeebd0d80cb..4e1ec7f88eb706 100644 --- a/tests/models/clip/test_modeling_tf_clip.py +++ b/tests/models/clip/test_modeling_tf_clip.py @@ -39,7 +39,6 @@ from transformers import TFCLIPModel, TFCLIPTextModel, TFCLIPVisionModel, TFSharedEmbeddings from transformers.modeling_tf_utils import keras - from transformers.models.clip.modeling_tf_clip import TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -257,9 +256,9 @@ def check_hidden_states_output(inputs_dict, config, model_class): @slow def test_model_from_pretrained(self): - for model_name in TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFCLIPVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai/clip-vit-base-patch32" + model = TFCLIPVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_saved_model_creation_extended(self): @@ -423,9 +422,9 @@ def test_inputs_embeds(self): @slow def test_model_from_pretrained(self): - for model_name in TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFCLIPTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai/clip-vit-base-patch32" + model = TFCLIPTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_saved_model_creation_extended(self): @@ -607,9 +606,9 @@ def test_keras_save_load(self): @slow def test_model_from_pretrained(self): - for model_name in TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFCLIPModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai/clip-vit-base-patch32" + model = TFCLIPModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="Currently `saved_model` doesn't work with nested outputs.") @slow diff --git a/tests/models/clipseg/test_modeling_clipseg.py b/tests/models/clipseg/test_modeling_clipseg.py index 8f3ab2b04fa2e3..6b82a9af41c3d8 100644 --- a/tests/models/clipseg/test_modeling_clipseg.py +++ b/tests/models/clipseg/test_modeling_clipseg.py @@ -52,7 +52,6 @@ from transformers import CLIPSegForImageSegmentation, CLIPSegModel, CLIPSegTextModel, CLIPSegVisionModel from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.clipseg.modeling_clipseg import CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -224,9 +223,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPSegVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "CIDAS/clipseg-rd64-refined" + model = CLIPSegVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class CLIPSegTextModelTester: @@ -365,9 +364,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPSegTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "CIDAS/clipseg-rd64-refined" + model = CLIPSegTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class CLIPSegModelTester: @@ -768,9 +767,9 @@ def test_training(self): @slow def test_model_from_pretrained(self): - for model_name in CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CLIPSegModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "CIDAS/clipseg-rd64-refined" + model = CLIPSegModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/clvp/test_modeling_clvp.py b/tests/models/clvp/test_modeling_clvp.py index 59e6c1be402cdc..7d5064377f7f76 100644 --- a/tests/models/clvp/test_modeling_clvp.py +++ b/tests/models/clvp/test_modeling_clvp.py @@ -45,7 +45,6 @@ import torch from transformers import ClvpEncoder, ClvpForCausalLM, ClvpModel, ClvpModelForConditionalGeneration - from transformers.models.clvp.modeling_clvp import CLVP_PRETRAINED_MODEL_ARCHIVE_LIST from transformers import ClvpFeatureExtractor, ClvpTokenizer @@ -541,9 +540,9 @@ def test_load_speech_text_decoder_config(self): @slow def test_model_from_pretrained(self): - for model_name in CLVP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ClvpModelForConditionalGeneration.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "susnato/clvp_dev" + model = ClvpModelForConditionalGeneration.from_pretrained(model_name) + self.assertIsNotNone(model) # Since Clvp has a lot of different models connected with each other it's better to test each of them individually along diff --git a/tests/models/codegen/test_modeling_codegen.py b/tests/models/codegen/test_modeling_codegen.py index e042ccac71dab0..9dce2713f53f88 100644 --- a/tests/models/codegen/test_modeling_codegen.py +++ b/tests/models/codegen/test_modeling_codegen.py @@ -30,7 +30,7 @@ if is_torch_available(): import torch - from transformers import CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST, AutoTokenizer, CodeGenForCausalLM, CodeGenModel + from transformers import AutoTokenizer, CodeGenForCausalLM, CodeGenModel class CodeGenModelTester: @@ -456,9 +456,9 @@ def test_batch_generation(self): @slow def test_model_from_pretrained(self): - for model_name in CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CodeGenModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/codegen-350M-nl" + model = CodeGenModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/convbert/test_modeling_convbert.py b/tests/models/convbert/test_modeling_convbert.py index 281a8e477b0b9b..80a31c9bc24a98 100644 --- a/tests/models/convbert/test_modeling_convbert.py +++ b/tests/models/convbert/test_modeling_convbert.py @@ -38,7 +38,6 @@ ConvBertForTokenClassification, ConvBertModel, ) - from transformers.models.convbert.modeling_convbert import CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST class ConvBertModelTester: @@ -307,9 +306,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ConvBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "YituTech/conv-bert-base" + model = ConvBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_attention_outputs(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/convnext/test_modeling_convnext.py b/tests/models/convnext/test_modeling_convnext.py index a56c38e3876b50..9f0789dffcb8aa 100644 --- a/tests/models/convnext/test_modeling_convnext.py +++ b/tests/models/convnext/test_modeling_convnext.py @@ -31,7 +31,6 @@ import torch from transformers import ConvNextBackbone, ConvNextForImageClassification, ConvNextModel - from transformers.models.convnext.modeling_convnext import CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -257,9 +256,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ConvNextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/convnext-tiny-224" + model = ConvNextModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/convnextv2/test_modeling_convnextv2.py b/tests/models/convnextv2/test_modeling_convnextv2.py index b13028dba8045d..5d78d31c3e63dc 100644 --- a/tests/models/convnextv2/test_modeling_convnextv2.py +++ b/tests/models/convnextv2/test_modeling_convnextv2.py @@ -32,7 +32,6 @@ import torch from transformers import ConvNextV2Backbone, ConvNextV2ForImageClassification, ConvNextV2Model - from transformers.models.convnextv2.modeling_convnextv2 import CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -306,9 +305,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ConvNextV2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/convnextv2-tiny-1k-224" + model = ConvNextV2Model.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/ctrl/test_modeling_ctrl.py b/tests/models/ctrl/test_modeling_ctrl.py index 71dcd02ed59f7e..6d44bdfb4ae672 100644 --- a/tests/models/ctrl/test_modeling_ctrl.py +++ b/tests/models/ctrl/test_modeling_ctrl.py @@ -29,7 +29,6 @@ import torch from transformers import ( - CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, CTRLForSequenceClassification, CTRLLMHeadModel, CTRLModel, @@ -245,9 +244,9 @@ def test_ctrl_lm_head_model(self): @slow def test_model_from_pretrained(self): - for model_name in CTRL_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CTRLModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/ctrl" + model = CTRLModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/ctrl/test_modeling_tf_ctrl.py b/tests/models/ctrl/test_modeling_tf_ctrl.py index 29a8b6fb6a36f6..d8317c919d480c 100644 --- a/tests/models/ctrl/test_modeling_tf_ctrl.py +++ b/tests/models/ctrl/test_modeling_tf_ctrl.py @@ -31,7 +31,6 @@ from transformers.modeling_tf_utils import keras from transformers.models.ctrl.modeling_tf_ctrl import ( - TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, TFCTRLForSequenceClassification, TFCTRLLMHeadModel, TFCTRLModel, @@ -249,9 +248,9 @@ def test_model_common_attributes(self): @slow def test_model_from_pretrained(self): - for model_name in TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFCTRLModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/ctrl" + model = TFCTRLModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/cvt/test_modeling_cvt.py b/tests/models/cvt/test_modeling_cvt.py index aef8108e1766c4..8e9376de274ddf 100644 --- a/tests/models/cvt/test_modeling_cvt.py +++ b/tests/models/cvt/test_modeling_cvt.py @@ -31,7 +31,6 @@ import torch from transformers import CvtForImageClassification, CvtModel - from transformers.models.cvt.modeling_cvt import CVT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -236,9 +235,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in CVT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = CvtModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/cvt-13" + model = CvtModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -252,11 +251,11 @@ def prepare_img(): class CvtModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return AutoImageProcessor.from_pretrained(CVT_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + return AutoImageProcessor.from_pretrained("microsoft/cvt-13") @slow def test_inference_image_classification_head(self): - model = CvtForImageClassification.from_pretrained(CVT_PRETRAINED_MODEL_ARCHIVE_LIST[0]).to(torch_device) + model = CvtForImageClassification.from_pretrained("microsoft/cvt-13").to(torch_device) image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/cvt/test_modeling_tf_cvt.py b/tests/models/cvt/test_modeling_tf_cvt.py index 4ec245ad49c3ed..0cae0bbcf23828 100644 --- a/tests/models/cvt/test_modeling_tf_cvt.py +++ b/tests/models/cvt/test_modeling_tf_cvt.py @@ -23,7 +23,6 @@ from transformers import TFCvtForImageClassification, TFCvtModel from transformers.modeling_tf_utils import keras - from transformers.models.cvt.modeling_tf_cvt import TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -251,9 +250,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFCvtModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/cvt-13" + model = TFCvtModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -267,11 +266,11 @@ def prepare_img(): class TFCvtModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return AutoImageProcessor.from_pretrained(TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + return AutoImageProcessor.from_pretrained("microsoft/cvt-13") @slow def test_inference_image_classification_head(self): - model = TFCvtForImageClassification.from_pretrained(TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + model = TFCvtForImageClassification.from_pretrained("microsoft/cvt-13") image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/data2vec/test_modeling_data2vec_text.py b/tests/models/data2vec/test_modeling_data2vec_text.py index afaa8a76addb7b..5a3edaa7ad2d5e 100644 --- a/tests/models/data2vec/test_modeling_data2vec_text.py +++ b/tests/models/data2vec/test_modeling_data2vec_text.py @@ -39,7 +39,6 @@ Data2VecTextModel, ) from transformers.models.data2vec.modeling_data2vec_text import ( - DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecTextForTextEmbeddings, create_position_ids_from_input_ids, ) @@ -470,9 +469,9 @@ def test_for_question_answering(self): @slow def test_model_from_pretrained(self): - for model_name in DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Data2VecTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/data2vec-text-base" + model = Data2VecTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_create_position_ids_respects_padding_index(self): """Ensure that the default position ids only assign a sequential . This is a regression diff --git a/tests/models/data2vec/test_modeling_data2vec_vision.py b/tests/models/data2vec/test_modeling_data2vec_vision.py index 3e00dd0bf314d4..c426a6ca7e98ce 100644 --- a/tests/models/data2vec/test_modeling_data2vec_vision.py +++ b/tests/models/data2vec/test_modeling_data2vec_vision.py @@ -36,7 +36,6 @@ Data2VecVisionModel, ) from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.data2vec.modeling_data2vec_vision import DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -298,9 +297,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Data2VecVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/data2vec-vision-base-ft1k" + model = Data2VecVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/data2vec/test_modeling_tf_data2vec_vision.py b/tests/models/data2vec/test_modeling_tf_data2vec_vision.py index 685a9e46808a2d..bb6e0d5476d576 100644 --- a/tests/models/data2vec/test_modeling_tf_data2vec_vision.py +++ b/tests/models/data2vec/test_modeling_tf_data2vec_vision.py @@ -40,9 +40,6 @@ TFData2VecVisionModel, ) from transformers.modeling_tf_utils import keras - from transformers.models.data2vec.modeling_tf_data2vec_vision import ( - TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST, - ) if is_vision_available(): from PIL import Image @@ -455,9 +452,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFData2VecVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/data2vec-vision-base-ft1k" + model = TFData2VecVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/deberta/test_modeling_deberta.py b/tests/models/deberta/test_modeling_deberta.py index 52758e2222aeaf..d511279c785ba2 100644 --- a/tests/models/deberta/test_modeling_deberta.py +++ b/tests/models/deberta/test_modeling_deberta.py @@ -32,7 +32,6 @@ DebertaForTokenClassification, DebertaModel, ) - from transformers.models.deberta.modeling_deberta import DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST class DebertaModelTester(object): @@ -274,9 +273,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DebertaModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/deberta-base" + model = DebertaModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/deberta_v2/test_modeling_deberta_v2.py b/tests/models/deberta_v2/test_modeling_deberta_v2.py index abfbe7402c93a0..80df003b1efe28 100644 --- a/tests/models/deberta_v2/test_modeling_deberta_v2.py +++ b/tests/models/deberta_v2/test_modeling_deberta_v2.py @@ -33,7 +33,6 @@ DebertaV2ForTokenClassification, DebertaV2Model, ) - from transformers.models.deberta_v2.modeling_deberta_v2 import DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST class DebertaV2ModelTester(object): @@ -292,9 +291,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DebertaV2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/deberta-v2-xlarge" + model = DebertaV2Model.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/decision_transformer/test_modeling_decision_transformer.py b/tests/models/decision_transformer/test_modeling_decision_transformer.py index d99521b2f19eb1..f7f362dce8359a 100644 --- a/tests/models/decision_transformer/test_modeling_decision_transformer.py +++ b/tests/models/decision_transformer/test_modeling_decision_transformer.py @@ -31,9 +31,6 @@ import torch from transformers import DecisionTransformerModel - from transformers.models.decision_transformer.modeling_decision_transformer import ( - DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, - ) class DecisionTransformerModelTester: @@ -164,9 +161,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DecisionTransformerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "edbeeching/decision-transformer-gym-hopper-medium" + model = DecisionTransformerModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_forward_signature(self): config, _ = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/deit/test_modeling_deit.py b/tests/models/deit/test_modeling_deit.py index 07f581bfeb2b9b..9a54f16dab689f 100644 --- a/tests/models/deit/test_modeling_deit.py +++ b/tests/models/deit/test_modeling_deit.py @@ -50,7 +50,6 @@ MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES, MODEL_MAPPING_NAMES, ) - from transformers.models.deit.modeling_deit import DEIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -367,9 +366,9 @@ def test_problem_types(self): @slow def test_model_from_pretrained(self): - for model_name in DEIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DeiTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/deit-base-distilled-patch16-224" + model = DeiTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/deit/test_modeling_tf_deit.py b/tests/models/deit/test_modeling_tf_deit.py index 848370a113297c..26980e84207d50 100644 --- a/tests/models/deit/test_modeling_tf_deit.py +++ b/tests/models/deit/test_modeling_tf_deit.py @@ -41,7 +41,6 @@ TFDeiTModel, ) from transformers.modeling_tf_utils import keras - from transformers.models.deit.modeling_tf_deit import TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -252,9 +251,9 @@ def _prepare_for_class(self, inputs_dict, model_class, return_labels=False): @slow def test_model_from_pretrained(self): - for model_name in TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFDeiTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/deit-base-distilled-patch16-224" + model = TFDeiTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/depth_anything/test_modeling_depth_anything.py b/tests/models/depth_anything/test_modeling_depth_anything.py index 9657fb604453e2..3b807abf714ec7 100644 --- a/tests/models/depth_anything/test_modeling_depth_anything.py +++ b/tests/models/depth_anything/test_modeling_depth_anything.py @@ -30,7 +30,6 @@ import torch from transformers import DepthAnythingForDepthEstimation - from transformers.models.depth_anything.modeling_depth_anything import DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -205,9 +204,9 @@ def test_training_gradient_checkpointing_use_reentrant_false(self): @slow def test_model_from_pretrained(self): - for model_name in DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DepthAnythingForDepthEstimation.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "LiheYoung/depth-anything-small-hf" + model = DepthAnythingForDepthEstimation.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/dinat/test_modeling_dinat.py b/tests/models/dinat/test_modeling_dinat.py index c29339881eb495..158ce7739534ac 100644 --- a/tests/models/dinat/test_modeling_dinat.py +++ b/tests/models/dinat/test_modeling_dinat.py @@ -32,7 +32,6 @@ from torch import nn from transformers import DinatBackbone, DinatForImageClassification, DinatModel - from transformers.models.dinat.modeling_dinat import DINAT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -330,9 +329,9 @@ def test_hidden_states_output(self): @slow def test_model_from_pretrained(self): - for model_name in DINAT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DinatModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "shi-labs/dinat-mini-in1k-224" + model = DinatModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/dinov2/test_modeling_dinov2.py b/tests/models/dinov2/test_modeling_dinov2.py index f0365cac2a59ee..9896f2c2bb5a93 100644 --- a/tests/models/dinov2/test_modeling_dinov2.py +++ b/tests/models/dinov2/test_modeling_dinov2.py @@ -38,7 +38,6 @@ from torch import nn from transformers import Dinov2Backbone, Dinov2ForImageClassification, Dinov2Model - from transformers.models.dinov2.modeling_dinov2 import DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -287,9 +286,9 @@ def test_feed_forward_chunking(self): @slow def test_model_from_pretrained(self): - for model_name in DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Dinov2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dinov2-base" + model = Dinov2Model.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/distilbert/test_modeling_distilbert.py b/tests/models/distilbert/test_modeling_distilbert.py index 9ab9d01577a974..c24eb3096033f9 100644 --- a/tests/models/distilbert/test_modeling_distilbert.py +++ b/tests/models/distilbert/test_modeling_distilbert.py @@ -30,7 +30,6 @@ import torch from transformers import ( - DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, DistilBertForMaskedLM, DistilBertForMultipleChoice, DistilBertForQuestionAnswering, @@ -261,9 +260,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DistilBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "distilbert-base-uncased" + model = DistilBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow @require_torch_accelerator diff --git a/tests/models/distilbert/test_modeling_tf_distilbert.py b/tests/models/distilbert/test_modeling_tf_distilbert.py index 937dd24d6d77b4..270cea00de6e69 100644 --- a/tests/models/distilbert/test_modeling_tf_distilbert.py +++ b/tests/models/distilbert/test_modeling_tf_distilbert.py @@ -30,7 +30,6 @@ import tensorflow as tf from transformers.models.distilbert.modeling_tf_distilbert import ( - TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDistilBertForMaskedLM, TFDistilBertForMultipleChoice, TFDistilBertForQuestionAnswering, @@ -233,9 +232,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in list(TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]): - model = TFDistilBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "distilbert/distilbert-base-cased" + model = TFDistilBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/donut/test_modeling_donut_swin.py b/tests/models/donut/test_modeling_donut_swin.py index 23b7094d9b743f..4d9be165bb9148 100644 --- a/tests/models/donut/test_modeling_donut_swin.py +++ b/tests/models/donut/test_modeling_donut_swin.py @@ -31,7 +31,6 @@ from torch import nn from transformers import DonutSwinModel - from transformers.models.donut.modeling_donut_swin import DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST class DonutSwinModelTester: @@ -334,9 +333,9 @@ def test_hidden_states_output_with_padding(self): @slow def test_model_from_pretrained(self): - for model_name in DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DonutSwinModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "naver-clova-ix/donut-base" + model = DonutSwinModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/dpr/test_modeling_dpr.py b/tests/models/dpr/test_modeling_dpr.py index b6a687a351b0be..7a41820f2d8ea7 100644 --- a/tests/models/dpr/test_modeling_dpr.py +++ b/tests/models/dpr/test_modeling_dpr.py @@ -29,11 +29,6 @@ import torch from transformers import DPRContextEncoder, DPRQuestionEncoder, DPRReader, DPRReaderTokenizer - from transformers.models.dpr.modeling_dpr import ( - DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, - ) class DPRModelTester: @@ -230,21 +225,21 @@ def test_init_changed_config(self): @slow def test_model_from_pretrained(self): - for model_name in DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DPRContextEncoder.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = DPRContextEncoder.from_pretrained(model_name) + self.assertIsNotNone(model) - for model_name in DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DPRContextEncoder.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = DPRContextEncoder.from_pretrained(model_name) + self.assertIsNotNone(model) - for model_name in DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DPRQuestionEncoder.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = DPRQuestionEncoder.from_pretrained(model_name) + self.assertIsNotNone(model) - for model_name in DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DPRReader.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = DPRReader.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/dpr/test_modeling_tf_dpr.py b/tests/models/dpr/test_modeling_tf_dpr.py index 11351408623343..92d74e72e33bd4 100644 --- a/tests/models/dpr/test_modeling_tf_dpr.py +++ b/tests/models/dpr/test_modeling_tf_dpr.py @@ -30,9 +30,6 @@ import tensorflow as tf from transformers import ( - TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, - TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, BertConfig, DPRConfig, TFDPRContextEncoder, @@ -213,21 +210,21 @@ def test_dpr_reader_model(self): @slow def test_model_from_pretrained(self): - for model_name in TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFDPRContextEncoder.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = TFDPRContextEncoder.from_pretrained(model_name) + self.assertIsNotNone(model) - for model_name in TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFDPRContextEncoder.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = TFDPRContextEncoder.from_pretrained(model_name) + self.assertIsNotNone(model) - for model_name in TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFDPRQuestionEncoder.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = TFDPRQuestionEncoder.from_pretrained(model_name) + self.assertIsNotNone(model) - for model_name in TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFDPRReader.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/dpr-ctx_encoder-single-nq-base" + model = TFDPRReader.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/dpt/test_modeling_dpt.py b/tests/models/dpt/test_modeling_dpt.py index ffd6edbad4bff1..a49f8d5d9465bb 100644 --- a/tests/models/dpt/test_modeling_dpt.py +++ b/tests/models/dpt/test_modeling_dpt.py @@ -32,7 +32,6 @@ from transformers import DPTForDepthEstimation, DPTForSemanticSegmentation, DPTModel from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.dpt.modeling_dpt import DPT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -280,9 +279,9 @@ def test_initialization(self): @slow def test_model_from_pretrained(self): - for model_name in DPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DPTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Intel/dpt-large" + model = DPTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/dpt/test_modeling_dpt_auto_backbone.py b/tests/models/dpt/test_modeling_dpt_auto_backbone.py index ea500b47a3c88a..01d5398edd60f1 100644 --- a/tests/models/dpt/test_modeling_dpt_auto_backbone.py +++ b/tests/models/dpt/test_modeling_dpt_auto_backbone.py @@ -31,7 +31,6 @@ from transformers import DPTForDepthEstimation from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.dpt.modeling_dpt import DPT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -244,9 +243,9 @@ def test_training_gradient_checkpointing_use_reentrant_false(self): @slow def test_model_from_pretrained(self): - for model_name in DPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = DPTForDepthEstimation.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Intel/dpt-large" + model = DPTForDepthEstimation.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/dpt/test_modeling_dpt_hybrid.py b/tests/models/dpt/test_modeling_dpt_hybrid.py index 2a6e8429ab5575..a63e736e41dbec 100644 --- a/tests/models/dpt/test_modeling_dpt_hybrid.py +++ b/tests/models/dpt/test_modeling_dpt_hybrid.py @@ -32,7 +32,6 @@ from transformers import DPTForDepthEstimation, DPTForSemanticSegmentation, DPTModel from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.dpt.modeling_dpt import DPT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -295,9 +294,9 @@ def test_initialization(self): @slow def test_model_from_pretrained(self): - for model_name in DPT_PRETRAINED_MODEL_ARCHIVE_LIST[1:]: - model = DPTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Intel/dpt-hybrid-midas" + model = DPTModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_raise_readout_type(self): # We do this test only for DPTForDepthEstimation since it is the only model that uses readout_type diff --git a/tests/models/efficientformer/test_modeling_efficientformer.py b/tests/models/efficientformer/test_modeling_efficientformer.py index 070c7fccae6053..15a4cb0be38d91 100644 --- a/tests/models/efficientformer/test_modeling_efficientformer.py +++ b/tests/models/efficientformer/test_modeling_efficientformer.py @@ -40,9 +40,6 @@ MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_MAPPING_NAMES, ) - from transformers.models.efficientformer.modeling_efficientformer import ( - EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, - ) if is_vision_available(): @@ -371,9 +368,9 @@ def test_problem_types(self): @slow def test_model_from_pretrained(self): - for model_name in EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = EfficientFormerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "snap-research/efficientformer-l1-300" + model = EfficientFormerModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_attention_outputs(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/efficientformer/test_modeling_tf_efficientformer.py b/tests/models/efficientformer/test_modeling_tf_efficientformer.py index 35cbeb75ae0ae5..fcd6958ed3dc70 100644 --- a/tests/models/efficientformer/test_modeling_tf_efficientformer.py +++ b/tests/models/efficientformer/test_modeling_tf_efficientformer.py @@ -38,9 +38,6 @@ TFEfficientFormerModel, ) from transformers.modeling_tf_utils import keras - from transformers.models.efficientformer.modeling_tf_efficientformer import ( - TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, - ) if is_vision_available(): @@ -299,9 +296,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFEfficientFormerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "snap-research/efficientformer-l1-300" + model = TFEfficientFormerModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_attention_outputs(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/efficientnet/test_modeling_efficientnet.py b/tests/models/efficientnet/test_modeling_efficientnet.py index 19d66aca95ae2b..dbca9b31a2f859 100644 --- a/tests/models/efficientnet/test_modeling_efficientnet.py +++ b/tests/models/efficientnet/test_modeling_efficientnet.py @@ -30,7 +30,6 @@ import torch from transformers import EfficientNetForImageClassification, EfficientNetModel - from transformers.models.efficientnet.modeling_efficientnet import EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -212,9 +211,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = EfficientNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/efficientnet-b7" + model = EfficientNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) @is_pipeline_test @require_vision diff --git a/tests/models/electra/test_modeling_electra.py b/tests/models/electra/test_modeling_electra.py index a5d3fa585e1f6e..f6cab710779079 100644 --- a/tests/models/electra/test_modeling_electra.py +++ b/tests/models/electra/test_modeling_electra.py @@ -39,7 +39,6 @@ ElectraForTokenClassification, ElectraModel, ) - from transformers.models.electra.modeling_electra import ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST class ElectraModelTester: @@ -463,9 +462,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ElectraModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/electra-small-generator" + model = ElectraModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_for_causal_lm(self): config_and_inputs = self.model_tester.prepare_config_and_inputs_for_decoder() diff --git a/tests/models/electra/test_modeling_tf_electra.py b/tests/models/electra/test_modeling_tf_electra.py index 537cb1df2f9c51..aba6db1efa1501 100644 --- a/tests/models/electra/test_modeling_tf_electra.py +++ b/tests/models/electra/test_modeling_tf_electra.py @@ -593,7 +593,7 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - # for model_name in TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'google/electra-small-generator' for model_name in ["google/electra-small-discriminator"]: model = TFElectraModel.from_pretrained(model_name) self.assertIsNotNone(model) diff --git a/tests/models/ernie/test_modeling_ernie.py b/tests/models/ernie/test_modeling_ernie.py index 6fc557219c8545..da19d08e466154 100644 --- a/tests/models/ernie/test_modeling_ernie.py +++ b/tests/models/ernie/test_modeling_ernie.py @@ -41,7 +41,6 @@ ErnieForTokenClassification, ErnieModel, ) - from transformers.models.ernie.modeling_ernie import ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST class ErnieModelTester: @@ -569,9 +568,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ErnieModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nghuyong/ernie-1.0-base-zh" + model = ErnieModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow @require_torch_accelerator diff --git a/tests/models/ernie_m/test_modeling_ernie_m.py b/tests/models/ernie_m/test_modeling_ernie_m.py index 1fafcd34bafcf8..e429a12e6e0f64 100644 --- a/tests/models/ernie_m/test_modeling_ernie_m.py +++ b/tests/models/ernie_m/test_modeling_ernie_m.py @@ -36,7 +36,6 @@ ErnieMForTokenClassification, ErnieMModel, ) - from transformers.models.ernie_m.modeling_ernie_m import ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST class ErnieMModelTester: @@ -298,9 +297,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ErnieMModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "susnato/ernie-m-base_pytorch" + model = ErnieMModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/esm/test_modeling_esm.py b/tests/models/esm/test_modeling_esm.py index 7e99f86bbf626b..db3ccd6fd2387e 100644 --- a/tests/models/esm/test_modeling_esm.py +++ b/tests/models/esm/test_modeling_esm.py @@ -30,7 +30,6 @@ from transformers import EsmForMaskedLM, EsmForSequenceClassification, EsmForTokenClassification, EsmModel from transformers.models.esm.modeling_esm import ( - ESM_PRETRAINED_MODEL_ARCHIVE_LIST, EsmEmbeddings, create_position_ids_from_input_ids, ) @@ -243,9 +242,9 @@ def test_esm_gradient_checkpointing(self): @slow def test_model_from_pretrained(self): - for model_name in ESM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = EsmModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/esm2_t6_8M_UR50D" + model = EsmModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_create_position_ids_respects_padding_index(self): """Ensure that the default position ids only assign a sequential . This is a regression diff --git a/tests/models/esm/test_modeling_tf_esm.py b/tests/models/esm/test_modeling_tf_esm.py index 0e92e352fea589..4accc16256dcc6 100644 --- a/tests/models/esm/test_modeling_tf_esm.py +++ b/tests/models/esm/test_modeling_tf_esm.py @@ -32,7 +32,6 @@ from transformers.modeling_tf_utils import keras from transformers.models.esm.modeling_tf_esm import ( - TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST, TFEsmForMaskedLM, TFEsmForSequenceClassification, TFEsmForTokenClassification, @@ -253,9 +252,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFEsmModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/esm2_t6_8M_UR50D" + model = TFEsmModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip("Protein models do not support embedding resizing.") def test_resize_token_embeddings(self): diff --git a/tests/models/flaubert/test_modeling_flaubert.py b/tests/models/flaubert/test_modeling_flaubert.py index fc275bdd8a02ad..8c135887ca7226 100644 --- a/tests/models/flaubert/test_modeling_flaubert.py +++ b/tests/models/flaubert/test_modeling_flaubert.py @@ -36,7 +36,6 @@ FlaubertModel, FlaubertWithLMHeadModel, ) - from transformers.models.flaubert.modeling_flaubert import FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST class FlaubertModelTester(object): @@ -458,9 +457,9 @@ def test_flaubert_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FlaubertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "flaubert/flaubert_small_cased" + model = FlaubertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow @require_torch_accelerator diff --git a/tests/models/flaubert/test_modeling_tf_flaubert.py b/tests/models/flaubert/test_modeling_tf_flaubert.py index 6d74b55ce3448e..534b529935a6b8 100644 --- a/tests/models/flaubert/test_modeling_tf_flaubert.py +++ b/tests/models/flaubert/test_modeling_tf_flaubert.py @@ -30,7 +30,6 @@ import tensorflow as tf from transformers import ( - TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, FlaubertConfig, TFFlaubertForMultipleChoice, TFFlaubertForQuestionAnsweringSimple, @@ -357,9 +356,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFFlaubertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "hf-internal-testing/tiny-random-flaubert" + model = TFFlaubertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/flava/test_modeling_flava.py b/tests/models/flava/test_modeling_flava.py index 48200dd30c9d88..2b628e14134443 100644 --- a/tests/models/flava/test_modeling_flava.py +++ b/tests/models/flava/test_modeling_flava.py @@ -57,10 +57,6 @@ FlavaMultimodalModel, FlavaTextModel, ) - from transformers.models.flava.modeling_flava import ( - FLAVA_CODEBOOK_PRETRAINED_MODEL_ARCHIVE_LIST, - FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, - ) else: FlavaModel = None FlavaForPreTraining = None @@ -335,9 +331,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FlavaImageModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/flava-full" + model = FlavaImageModel.from_pretrained(model_name) + self.assertIsNotNone(model) class FlavaTextModelTester: @@ -498,9 +494,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FlavaTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/flava-full" + model = FlavaTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class FlavaMultimodalModelTester: @@ -662,9 +658,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FlavaMultimodalModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/flava-full" + model = FlavaMultimodalModel.from_pretrained(model_name) + self.assertIsNotNone(model) class FlavaImageCodebookTester: @@ -795,9 +791,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in FLAVA_CODEBOOK_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FlavaImageCodebook.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/flava-full" + model = FlavaImageCodebook.from_pretrained(model_name) + self.assertIsNotNone(model) class FlavaModelTester: @@ -1081,9 +1077,9 @@ def test_load_image_text_config(self): # overwrite from common since FlavaModel/TFFlavaModel return FLAVAOutput/TFFLAVAOutput @slow def test_model_from_pretrained(self): - for model_name in FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FlavaModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/flava-full" + model = FlavaModel.from_pretrained(model_name) + self.assertIsNotNone(model) class FlavaForPreTrainingTester(FlavaModelTester): diff --git a/tests/models/fnet/test_modeling_fnet.py b/tests/models/fnet/test_modeling_fnet.py index 83b84edddccd50..22de68bf15da86 100644 --- a/tests/models/fnet/test_modeling_fnet.py +++ b/tests/models/fnet/test_modeling_fnet.py @@ -43,7 +43,6 @@ FNetTokenizerFast, ) from transformers.models.fnet.modeling_fnet import ( - FNET_PRETRAINED_MODEL_ARCHIVE_LIST, FNetBasicFourierTransform, is_scipy_available, ) @@ -464,9 +463,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in FNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/fnet-base" + model = FNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/focalnet/test_modeling_focalnet.py b/tests/models/focalnet/test_modeling_focalnet.py index 2b6f8cf9ab1522..fb2bb1c2c152fa 100644 --- a/tests/models/focalnet/test_modeling_focalnet.py +++ b/tests/models/focalnet/test_modeling_focalnet.py @@ -37,7 +37,6 @@ FocalNetForMaskedImageModeling, FocalNetModel, ) - from transformers.models.focalnet.modeling_focalnet import FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -387,9 +386,9 @@ def test_hidden_states_output_with_padding(self): @slow def test_model_from_pretrained(self): - for model_name in FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = FocalNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/focalnet-tiny" + model = FocalNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/git/test_modeling_git.py b/tests/models/git/test_modeling_git.py index c503abfb89db1a..6a891f17b06ad3 100644 --- a/tests/models/git/test_modeling_git.py +++ b/tests/models/git/test_modeling_git.py @@ -33,7 +33,6 @@ from torch import nn from transformers import MODEL_FOR_CAUSAL_LM_MAPPING, GitForCausalLM, GitModel, GitVisionModel - from transformers.models.git.modeling_git import GIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -196,9 +195,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in GIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GitVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/git-base" + model = GitVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class GitModelTester: @@ -450,9 +449,9 @@ def test_model_various_embeddings(self): @slow def test_model_from_pretrained(self): - for model_name in GIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GitModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/git-base" + model = GitModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="GIT has pixel values as additional input") def test_beam_search_generate_dict_outputs_use_cache(self): diff --git a/tests/models/glpn/test_modeling_glpn.py b/tests/models/glpn/test_modeling_glpn.py index aab49c849101cd..b733164ec1d43f 100644 --- a/tests/models/glpn/test_modeling_glpn.py +++ b/tests/models/glpn/test_modeling_glpn.py @@ -30,7 +30,6 @@ from transformers import GLPNConfig, GLPNForDepthEstimation, GLPNModel from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.glpn.modeling_glpn import GLPN_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -309,9 +308,9 @@ def test_training(self): @slow def test_model_from_pretrained(self): - for model_name in GLPN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GLPNModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "vinvino02/glpn-kitti" + model = GLPNModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -326,8 +325,8 @@ def prepare_img(): class GLPNModelIntegrationTest(unittest.TestCase): @slow def test_inference_depth_estimation(self): - image_processor = GLPNImageProcessor.from_pretrained(GLPN_PRETRAINED_MODEL_ARCHIVE_LIST[0]) - model = GLPNForDepthEstimation.from_pretrained(GLPN_PRETRAINED_MODEL_ARCHIVE_LIST[0]).to(torch_device) + image_processor = GLPNImageProcessor.from_pretrained("vinvino02/glpn-kitti") + model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-kitti").to(torch_device) image = prepare_img() inputs = image_processor(images=image, return_tensors="pt").to(torch_device) diff --git a/tests/models/gpt2/test_modeling_gpt2.py b/tests/models/gpt2/test_modeling_gpt2.py index c9ecbdde6673a1..d2b9ce8dcf0d16 100644 --- a/tests/models/gpt2/test_modeling_gpt2.py +++ b/tests/models/gpt2/test_modeling_gpt2.py @@ -32,7 +32,6 @@ import torch from transformers import ( - GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, GPT2DoubleHeadsModel, GPT2ForQuestionAnswering, GPT2ForSequenceClassification, @@ -701,9 +700,9 @@ def test_batch_generation_2heads(self): @slow def test_model_from_pretrained(self): - for model_name in GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GPT2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai-community/gpt2" + model = GPT2Model.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/gpt2/test_modeling_tf_gpt2.py b/tests/models/gpt2/test_modeling_tf_gpt2.py index 060d4b71985bc8..c56d837939c598 100644 --- a/tests/models/gpt2/test_modeling_tf_gpt2.py +++ b/tests/models/gpt2/test_modeling_tf_gpt2.py @@ -31,7 +31,6 @@ from transformers import GPT2Tokenizer from transformers.models.gpt2.modeling_tf_gpt2 import ( - TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, TFGPT2DoubleHeadsModel, TFGPT2ForSequenceClassification, TFGPT2LMHeadModel, @@ -422,9 +421,9 @@ def test_gpt2_sequence_classification_model(self): @slow def test_model_from_pretrained(self): - for model_name in TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFGPT2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai-community/gpt2" + model = TFGPT2Model.from_pretrained(model_name) + self.assertIsNotNone(model) # overwrite from common since ONNX runtime optimization doesn't work with tf.gather() when the argument # `batch_dims` > 0" diff --git a/tests/models/gpt_neo/test_modeling_gpt_neo.py b/tests/models/gpt_neo/test_modeling_gpt_neo.py index d4a9dd90eb8022..ce0aeadf16baf7 100644 --- a/tests/models/gpt_neo/test_modeling_gpt_neo.py +++ b/tests/models/gpt_neo/test_modeling_gpt_neo.py @@ -31,7 +31,6 @@ import torch from transformers import ( - GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST, GPT2Tokenizer, GPTNeoForCausalLM, GPTNeoForQuestionAnswering, @@ -601,6 +600,6 @@ def test_batch_generation(self): @slow def test_model_from_pretrained(self): - for model_name in GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GPTNeoModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "EleutherAI/gpt-neo-1.3B" + model = GPTNeoModel.from_pretrained(model_name) + self.assertIsNotNone(model) diff --git a/tests/models/gptj/test_modeling_gptj.py b/tests/models/gptj/test_modeling_gptj.py index fd88b85a13e435..2ef2e391215e7b 100644 --- a/tests/models/gptj/test_modeling_gptj.py +++ b/tests/models/gptj/test_modeling_gptj.py @@ -40,7 +40,6 @@ import torch from transformers import ( - GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST, AutoTokenizer, GPTJForCausalLM, GPTJForQuestionAnswering, @@ -524,9 +523,9 @@ def test_batch_generation(self): @slow def test_model_from_pretrained(self): - for model_name in GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GPTJModel.from_pretrained(model_name, revision="float16", torch_dtype=torch.float16) - self.assertIsNotNone(model) + model_name = "EleutherAI/gpt-j-6B" + model = GPTJModel.from_pretrained(model_name, revision="float16", torch_dtype=torch.float16) + self.assertIsNotNone(model) @require_flash_attn @require_torch_gpu diff --git a/tests/models/graphormer/test_modeling_graphormer.py b/tests/models/graphormer/test_modeling_graphormer.py index b6a994f4597f5c..ddb72543f51a59 100644 --- a/tests/models/graphormer/test_modeling_graphormer.py +++ b/tests/models/graphormer/test_modeling_graphormer.py @@ -34,7 +34,6 @@ from torch import tensor from transformers import GraphormerForGraphClassification, GraphormerModel - from transformers.models.graphormer.modeling_graphormer import GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST class GraphormerModelTester: @@ -472,9 +471,9 @@ def test_for_graph_classification(self): @slow def test_model_from_pretrained(self): - for model_name in GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GraphormerForGraphClassification.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "clefourrier/graphormer-base-pcqm4mv1" + model = GraphormerForGraphClassification.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/groupvit/test_modeling_groupvit.py b/tests/models/groupvit/test_modeling_groupvit.py index 9f44c3d9ee6a21..5ec9bbbf1a8a65 100644 --- a/tests/models/groupvit/test_modeling_groupvit.py +++ b/tests/models/groupvit/test_modeling_groupvit.py @@ -44,7 +44,6 @@ from torch import nn from transformers import GroupViTModel, GroupViTTextModel, GroupViTVisionModel - from transformers.models.groupvit.modeling_groupvit import GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -352,9 +351,9 @@ def test_retain_grad_hidden_states_attentions(self): @slow def test_model_from_pretrained(self): - for model_name in GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GroupViTVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/groupvit-gcc-yfcc" + model = GroupViTVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class GroupViTTextModelTester: @@ -492,9 +491,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GroupViTTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/groupvit-gcc-yfcc" + model = GroupViTTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class GroupViTModelTester: @@ -706,9 +705,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = GroupViTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/groupvit-gcc-yfcc" + model = GroupViTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/groupvit/test_modeling_tf_groupvit.py b/tests/models/groupvit/test_modeling_tf_groupvit.py index 968d955846d8a8..be5ff803d94034 100644 --- a/tests/models/groupvit/test_modeling_tf_groupvit.py +++ b/tests/models/groupvit/test_modeling_tf_groupvit.py @@ -47,7 +47,6 @@ from transformers import TFGroupViTModel, TFGroupViTTextModel, TFGroupViTVisionModel, TFSharedEmbeddings from transformers.modeling_tf_utils import keras - from transformers.models.groupvit.modeling_tf_groupvit import TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -314,9 +313,9 @@ def test_pt_tf_model_equivalence(self): @slow def test_model_from_pretrained(self): - for model_name in TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFGroupViTVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/groupvit-gcc-yfcc" + model = TFGroupViTVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip( "TFGroupViTVisionModel does not convert `hidden_states` and `attentions` to tensors as they are all of" @@ -485,9 +484,9 @@ def test_inputs_embeds(self): @slow def test_model_from_pretrained(self): - for model_name in TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFGroupViTTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/groupvit-gcc-yfcc" + model = TFGroupViTTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_saved_model_creation_extended(self): @@ -697,9 +696,9 @@ def test_keras_save_load(self): @slow def test_model_from_pretrained(self): - for model_name in TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFGroupViTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/groupvit-gcc-yfcc" + model = TFGroupViTModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="Currently `saved_model` doesn't work with nested outputs.") @slow diff --git a/tests/models/ibert/test_modeling_ibert.py b/tests/models/ibert/test_modeling_ibert.py index b552cb75a5a69f..fd3809acff3e73 100644 --- a/tests/models/ibert/test_modeling_ibert.py +++ b/tests/models/ibert/test_modeling_ibert.py @@ -30,7 +30,6 @@ from torch import nn from transformers import ( - IBERT_PRETRAINED_MODEL_ARCHIVE_LIST, IBertForMaskedLM, IBertForMultipleChoice, IBertForQuestionAnswering, @@ -292,9 +291,9 @@ def test_for_question_answering(self): @slow def test_model_from_pretrained(self): - for model_name in IBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = IBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "kssteven/ibert-roberta-base" + model = IBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_create_position_ids_respects_padding_index(self): """Ensure that the default position ids only assign a sequential . This is a regression diff --git a/tests/models/idefics/test_modeling_idefics.py b/tests/models/idefics/test_modeling_idefics.py index 28530c72194585..3059b5a2f542f2 100644 --- a/tests/models/idefics/test_modeling_idefics.py +++ b/tests/models/idefics/test_modeling_idefics.py @@ -40,7 +40,6 @@ from transformers import IdeficsForVisionText2Text, IdeficsModel, IdeficsProcessor from transformers.models.idefics.configuration_idefics import IdeficsPerceiverConfig, IdeficsVisionConfig - from transformers.models.idefics.modeling_idefics import IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST from transformers.pytorch_utils import is_torch_greater_or_equal_than_2_0 else: is_torch_greater_or_equal_than_2_0 = False @@ -562,9 +561,9 @@ def check_hidden_states_output(inputs_dict, config, model_class): @slow def test_model_from_pretrained(self): - for model_name in IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = IdeficsModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "HuggingFaceM4/idefics-9b" + model = IdeficsModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch_sdpa @slow diff --git a/tests/models/imagegpt/test_modeling_imagegpt.py b/tests/models/imagegpt/test_modeling_imagegpt.py index 40ea7ce0f4f559..e18f74533520d6 100644 --- a/tests/models/imagegpt/test_modeling_imagegpt.py +++ b/tests/models/imagegpt/test_modeling_imagegpt.py @@ -40,7 +40,6 @@ import torch from transformers import ( - IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST, ImageGPTForCausalImageModeling, ImageGPTForImageClassification, ImageGPTModel, @@ -336,9 +335,9 @@ def test_training_gradient_checkpointing_use_reentrant_false(self): @slow def test_model_from_pretrained(self): - for model_name in IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ImageGPTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai/imagegpt-small" + model = ImageGPTModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_forward_signature(self): config, _ = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/instructblip/test_modeling_instructblip.py b/tests/models/instructblip/test_modeling_instructblip.py index 9ed95b56b65a93..8cbbde9868b2b2 100644 --- a/tests/models/instructblip/test_modeling_instructblip.py +++ b/tests/models/instructblip/test_modeling_instructblip.py @@ -54,7 +54,6 @@ from torch import nn from transformers import InstructBlipForConditionalGeneration, InstructBlipVisionModel - from transformers.models.instructblip.modeling_instructblip import INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -222,9 +221,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = InstructBlipVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/instructblip-flan-t5-xl" + model = InstructBlipVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class InstructBlipQFormerModelTester: @@ -526,9 +525,9 @@ def test_load_vision_qformer_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST: - model = InstructBlipForConditionalGeneration.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Salesforce/instructblip-flan-t5-xl" + model = InstructBlipForConditionalGeneration.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/kosmos2/test_modeling_kosmos2.py b/tests/models/kosmos2/test_modeling_kosmos2.py index 7fbb40e8289976..9bc95b8bd44cb4 100644 --- a/tests/models/kosmos2/test_modeling_kosmos2.py +++ b/tests/models/kosmos2/test_modeling_kosmos2.py @@ -44,7 +44,6 @@ import torch from transformers import Kosmos2ForConditionalGeneration, Kosmos2Model - from transformers.models.kosmos2.modeling_kosmos2 import KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -425,9 +424,9 @@ def check_same_values(layer_1, layer_2): @slow def test_model_from_pretrained(self): - for model_name in KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Kosmos2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/kosmos-2-patch14-224" + model = Kosmos2Model.from_pretrained(model_name) + self.assertIsNotNone(model) def _create_and_check_torchscript(self, config, inputs_dict): if not self.test_torchscript: diff --git a/tests/models/layoutlm/test_modeling_tf_layoutlm.py b/tests/models/layoutlm/test_modeling_tf_layoutlm.py index 96ce692a668241..14fc59ff713ff7 100644 --- a/tests/models/layoutlm/test_modeling_tf_layoutlm.py +++ b/tests/models/layoutlm/test_modeling_tf_layoutlm.py @@ -31,7 +31,6 @@ import tensorflow as tf from transformers.models.layoutlm.modeling_tf_layoutlm import ( - TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMForMaskedLM, TFLayoutLMForQuestionAnswering, TFLayoutLMForSequenceClassification, @@ -265,9 +264,9 @@ def test_for_question_answering(self): @slow def test_model_from_pretrained(self): - for model_name in TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFLayoutLMModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/layoutlm-base-uncased" + model = TFLayoutLMModel.from_pretrained(model_name) + self.assertIsNotNone(model) # TODO (Joao): fix me @unittest.skip("Onnx compliancy broke with TF 2.10") diff --git a/tests/models/layoutlmv2/test_modeling_layoutlmv2.py b/tests/models/layoutlmv2/test_modeling_layoutlmv2.py index f1a0cc6c43fe96..d70721e04c9108 100644 --- a/tests/models/layoutlmv2/test_modeling_layoutlmv2.py +++ b/tests/models/layoutlmv2/test_modeling_layoutlmv2.py @@ -36,7 +36,6 @@ LayoutLMv2ForTokenClassification, LayoutLMv2Model, ) - from transformers.models.layoutlmv2.modeling_layoutlmv2 import LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST if is_detectron2_available(): from detectron2.structures.image_list import ImageList @@ -422,9 +421,9 @@ def test_model_is_small(self): @slow def test_model_from_pretrained(self): - for model_name in LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = LayoutLMv2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/layoutlmv2-base-uncased" + model = LayoutLMv2Model.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/layoutlmv3/test_modeling_layoutlmv3.py b/tests/models/layoutlmv3/test_modeling_layoutlmv3.py index bf9a0b83144a52..f280633c6ab732 100644 --- a/tests/models/layoutlmv3/test_modeling_layoutlmv3.py +++ b/tests/models/layoutlmv3/test_modeling_layoutlmv3.py @@ -40,7 +40,6 @@ LayoutLMv3ForTokenClassification, LayoutLMv3Model, ) - from transformers.models.layoutlmv3.modeling_layoutlmv3 import LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -368,9 +367,9 @@ def test_for_question_answering(self): @slow def test_model_from_pretrained(self): - for model_name in LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = LayoutLMv3Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/layoutlmv3-base" + model = LayoutLMv3Model.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py b/tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py index 5ea4cb625c46d9..6ae2e5090ea109 100644 --- a/tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py +++ b/tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py @@ -36,7 +36,6 @@ import tensorflow as tf from transformers import ( - TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING, TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING, TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING, @@ -468,9 +467,9 @@ def test_for_question_answering(self): @slow def test_model_from_pretrained(self): - for model_name in TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFLayoutLMv3Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/layoutlmv3-base" + model = TFLayoutLMv3Model.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/levit/test_modeling_levit.py b/tests/models/levit/test_modeling_levit.py index fee3eaa086bd73..38c9c885944b4e 100644 --- a/tests/models/levit/test_modeling_levit.py +++ b/tests/models/levit/test_modeling_levit.py @@ -40,7 +40,6 @@ MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES, MODEL_MAPPING_NAMES, ) - from transformers.models.levit.modeling_levit import LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -382,9 +381,9 @@ def test_problem_types(self): @slow def test_model_from_pretrained(self): - for model_name in LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = LevitModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/levit-128S" + model = LevitModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -398,13 +397,11 @@ def prepare_img(): class LevitModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return LevitImageProcessor.from_pretrained(LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + return LevitImageProcessor.from_pretrained("facebook/levit-128S") @slow def test_inference_image_classification_head(self): - model = LevitForImageClassificationWithTeacher.from_pretrained(LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]).to( - torch_device - ) + model = LevitForImageClassificationWithTeacher.from_pretrained("facebook/levit-128S").to(torch_device) image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/lilt/test_modeling_lilt.py b/tests/models/lilt/test_modeling_lilt.py index 653178e2ad66db..0d0ed720c53a2f 100644 --- a/tests/models/lilt/test_modeling_lilt.py +++ b/tests/models/lilt/test_modeling_lilt.py @@ -34,7 +34,6 @@ LiltForTokenClassification, LiltModel, ) - from transformers.models.lilt.modeling_lilt import LILT_PRETRAINED_MODEL_ARCHIVE_LIST class LiltModelTester: @@ -295,9 +294,9 @@ def test_training_gradient_checkpointing_use_reentrant_false(self): @slow def test_model_from_pretrained(self): - for model_name in LILT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = LiltModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "SCUT-DLVCLab/lilt-roberta-en-base" + model = LiltModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/longt5/test_modeling_longt5.py b/tests/models/longt5/test_modeling_longt5.py index 5a8075c2dbe7ea..c65af001e103f1 100644 --- a/tests/models/longt5/test_modeling_longt5.py +++ b/tests/models/longt5/test_modeling_longt5.py @@ -39,7 +39,6 @@ LongT5ForConditionalGeneration, LongT5Model, ) - from transformers.models.longt5.modeling_longt5 import LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST class LongT5ModelTester: @@ -590,9 +589,9 @@ def test_encoder_decoder_shared_weights(self): @slow def test_model_from_pretrained(self): - for model_name in LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = LongT5Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/long-t5-local-base" + model = LongT5Model.from_pretrained(model_name) + self.assertIsNotNone(model) @slow def test_export_to_onnx(self): diff --git a/tests/models/luke/test_modeling_luke.py b/tests/models/luke/test_modeling_luke.py index 4f1ed2e2e3d38b..a35d5ec3dc9daa 100644 --- a/tests/models/luke/test_modeling_luke.py +++ b/tests/models/luke/test_modeling_luke.py @@ -38,7 +38,6 @@ LukeModel, LukeTokenizer, ) - from transformers.models.luke.modeling_luke import LUKE_PRETRAINED_MODEL_ARCHIVE_LIST class LukeModelTester: @@ -699,9 +698,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in LUKE_PRETRAINED_MODEL_ARCHIVE_LIST: - model = LukeModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "studio-ousia/luke-base" + model = LukeModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_for_masked_lm(self): config_and_inputs = self.model_tester.prepare_config_and_inputs() diff --git a/tests/models/lxmert/test_modeling_lxmert.py b/tests/models/lxmert/test_modeling_lxmert.py index 63d83de36b7546..723fef6061b3e4 100644 --- a/tests/models/lxmert/test_modeling_lxmert.py +++ b/tests/models/lxmert/test_modeling_lxmert.py @@ -38,7 +38,6 @@ LxmertForQuestionAnswering, LxmertModel, ) - from transformers.models.lxmert.modeling_lxmert import LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST if is_tf_available(): @@ -584,10 +583,10 @@ def test_lxmert_question_answering_labels_resize(self): @slow def test_model_from_pretrained(self): - for model_name in LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = LxmertModel.from_pretrained(model_name) - model.to(torch_device) - self.assertIsNotNone(model) + model_name = "unc-nlp/lxmert-base-uncased" + model = LxmertModel.from_pretrained(model_name) + model.to(torch_device) + self.assertIsNotNone(model) def test_attention_outputs(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() @@ -772,7 +771,7 @@ def prepare_tf_inputs_from_pt_inputs(self, pt_inputs_dict): class LxmertModelIntegrationTest(unittest.TestCase): @slow def test_inference_no_head_absolute_embedding(self): - model = LxmertModel.from_pretrained(LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + model = LxmertModel.from_pretrained("unc-nlp/lxmert-base-uncased") input_ids = torch.tensor([[101, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 102]]) num_visual_features = 10 _, visual_feats = np.random.seed(0), np.random.rand(1, num_visual_features, model.config.visual_feat_dim) diff --git a/tests/models/mega/test_modeling_mega.py b/tests/models/mega/test_modeling_mega.py index e07f4efedd7b48..872f0a38af8e8f 100644 --- a/tests/models/mega/test_modeling_mega.py +++ b/tests/models/mega/test_modeling_mega.py @@ -44,7 +44,6 @@ MegaForTokenClassification, MegaModel, ) - from transformers.models.mega.modeling_mega import MEGA_PRETRAINED_MODEL_ARCHIVE_LIST class MegaModelTester: @@ -672,9 +671,9 @@ def test_sequence_classification_model_for_multi_label(self): @slow def test_model_from_pretrained(self): - for model_name in MEGA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MegaModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "mnaylor/mega-base-wikitext" + model = MegaModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="Does not work on the tiny model as we keep hitting edge cases.") def test_cpu_offload(self): diff --git a/tests/models/mobilebert/test_modeling_tf_mobilebert.py b/tests/models/mobilebert/test_modeling_tf_mobilebert.py index b2b1e58ec0b3b5..c6c7d00da0fb29 100644 --- a/tests/models/mobilebert/test_modeling_tf_mobilebert.py +++ b/tests/models/mobilebert/test_modeling_tf_mobilebert.py @@ -313,7 +313,7 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - # for model_name in TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: + # model_name = 'google/mobilebert-uncased' for model_name in ["google/mobilebert-uncased"]: model = TFMobileBertModel.from_pretrained(model_name) self.assertIsNotNone(model) diff --git a/tests/models/mobilenet_v1/test_modeling_mobilenet_v1.py b/tests/models/mobilenet_v1/test_modeling_mobilenet_v1.py index 6262475b8d0c71..3be955a729b0b7 100644 --- a/tests/models/mobilenet_v1/test_modeling_mobilenet_v1.py +++ b/tests/models/mobilenet_v1/test_modeling_mobilenet_v1.py @@ -30,7 +30,6 @@ import torch from transformers import MobileNetV1ForImageClassification, MobileNetV1Model - from transformers.models.mobilenet_v1.modeling_mobilenet_v1 import MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -212,9 +211,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MobileNetV1Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/mobilenet_v1_1.0_224" + model = MobileNetV1Model.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/mobilenet_v2/test_modeling_mobilenet_v2.py b/tests/models/mobilenet_v2/test_modeling_mobilenet_v2.py index 17dfe452c2672d..f8a1ce8d26c820 100644 --- a/tests/models/mobilenet_v2/test_modeling_mobilenet_v2.py +++ b/tests/models/mobilenet_v2/test_modeling_mobilenet_v2.py @@ -30,7 +30,6 @@ import torch from transformers import MobileNetV2ForImageClassification, MobileNetV2ForSemanticSegmentation, MobileNetV2Model - from transformers.models.mobilenet_v2.modeling_mobilenet_v2 import MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -267,9 +266,9 @@ def test_for_semantic_segmentation(self): @slow def test_model_from_pretrained(self): - for model_name in MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MobileNetV2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/mobilenet_v2_1.4_224" + model = MobileNetV2Model.from_pretrained(model_name) + self.assertIsNotNone(model) @is_flaky(description="is_flaky https://github.com/huggingface/transformers/issues/29516") def test_batching_equivalence(self): diff --git a/tests/models/mobilevit/test_modeling_mobilevit.py b/tests/models/mobilevit/test_modeling_mobilevit.py index fc2ea5eba38321..0fb94f38d6e3db 100644 --- a/tests/models/mobilevit/test_modeling_mobilevit.py +++ b/tests/models/mobilevit/test_modeling_mobilevit.py @@ -30,7 +30,6 @@ import torch from transformers import MobileViTForImageClassification, MobileViTForSemanticSegmentation, MobileViTModel - from transformers.models.mobilevit.modeling_mobilevit import MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -272,9 +271,9 @@ def test_for_semantic_segmentation(self): @slow def test_model_from_pretrained(self): - for model_name in MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MobileViTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "apple/mobilevit-small" + model = MobileViTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/mobilevit/test_modeling_tf_mobilevit.py b/tests/models/mobilevit/test_modeling_tf_mobilevit.py index 289d739774abd8..3132b93649ddff 100644 --- a/tests/models/mobilevit/test_modeling_tf_mobilevit.py +++ b/tests/models/mobilevit/test_modeling_tf_mobilevit.py @@ -34,7 +34,6 @@ import tensorflow as tf from transformers import TFMobileViTForImageClassification, TFMobileViTForSemanticSegmentation, TFMobileViTModel - from transformers.models.mobilevit.modeling_tf_mobilevit import TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -366,9 +365,9 @@ def test_loss_computation(self): @slow def test_model_from_pretrained(self): - for model_name in TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFMobileViTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "apple/mobilevit-small" + model = TFMobileViTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/mobilevitv2/test_modeling_mobilevitv2.py b/tests/models/mobilevitv2/test_modeling_mobilevitv2.py index 1fb6be94a2400c..ff45a8c0b69f6e 100644 --- a/tests/models/mobilevitv2/test_modeling_mobilevitv2.py +++ b/tests/models/mobilevitv2/test_modeling_mobilevitv2.py @@ -31,7 +31,6 @@ from transformers import MobileViTV2ForImageClassification, MobileViTV2ForSemanticSegmentation, MobileViTV2Model from transformers.models.mobilevitv2.modeling_mobilevitv2 import ( - MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST, make_divisible, ) @@ -279,9 +278,9 @@ def test_for_semantic_segmentation(self): @slow def test_model_from_pretrained(self): - for model_name in MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MobileViTV2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "apple/mobilevitv2-1.0-imagenet1k-256" + model = MobileViTV2Model.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/mpt/test_modeling_mpt.py b/tests/models/mpt/test_modeling_mpt.py index e70b344d8c95a7..40385fc3fd8e71 100644 --- a/tests/models/mpt/test_modeling_mpt.py +++ b/tests/models/mpt/test_modeling_mpt.py @@ -30,7 +30,6 @@ import torch from transformers import ( - MPT_PRETRAINED_MODEL_ARCHIVE_LIST, AutoTokenizer, MptForCausalLM, MptForQuestionAnswering, @@ -429,9 +428,9 @@ def test_model_weights_reload_no_missing_tied_weights(self): @slow def test_model_from_pretrained(self): - for model_name in MPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MptModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "mosaicml/mpt-7b" + model = MptModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow diff --git a/tests/models/mra/test_modeling_mra.py b/tests/models/mra/test_modeling_mra.py index a1b4b4464ce63f..a0bf0ec65e2d7a 100644 --- a/tests/models/mra/test_modeling_mra.py +++ b/tests/models/mra/test_modeling_mra.py @@ -36,7 +36,6 @@ MraForTokenClassification, MraModel, ) - from transformers.models.mra.modeling_mra import MRA_PRETRAINED_MODEL_ARCHIVE_LIST class MraModelTester: @@ -352,9 +351,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in MRA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MraModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "uw-madison/mra-base-512-4" + model = MraModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="MRA does not output attentions") def test_attention_outputs(self): diff --git a/tests/models/mt5/test_modeling_mt5.py b/tests/models/mt5/test_modeling_mt5.py index 9e7dd443e2b8c2..f6f138cb331032 100644 --- a/tests/models/mt5/test_modeling_mt5.py +++ b/tests/models/mt5/test_modeling_mt5.py @@ -51,7 +51,6 @@ MT5ForTokenClassification, MT5Model, ) - from transformers.models.mt5.modeling_mt5 import MT5_PRETRAINED_MODEL_ARCHIVE_LIST # Copied from tests.models.t5.test_modeling_t5.T5ModelTester with T5->MT5 @@ -546,7 +545,7 @@ def prepare_config_and_inputs_for_common(self): @require_torch -# Copied from tests.models.t5.test_modeling_t5.T5ModelTest with T5->MT5 +# Copied from tests.models.t5.test_modeling_t5.T5ModelTest with T5->MT5, google-t5/t5-small->google/mt5-small class MT5ModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMixin, unittest.TestCase): all_model_classes = ( (MT5Model, MT5ForConditionalGeneration, MT5ForSequenceClassification, MT5ForQuestionAnswering) @@ -835,9 +834,9 @@ def test_v1_1_resize_embeddings(self): @slow def test_model_from_pretrained(self): - for model_name in MT5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = MT5Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/mt5-small" + model = MT5Model.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip("Test has a segmentation fault on torch 1.8.0") def test_export_to_onnx(self): diff --git a/tests/models/nat/test_modeling_nat.py b/tests/models/nat/test_modeling_nat.py index cbdbfc83c5e0ad..6a68311cc6b9e9 100644 --- a/tests/models/nat/test_modeling_nat.py +++ b/tests/models/nat/test_modeling_nat.py @@ -32,7 +32,6 @@ from torch import nn from transformers import NatBackbone, NatForImageClassification, NatModel - from transformers.models.nat.modeling_nat import NAT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -327,9 +326,9 @@ def test_hidden_states_output(self): @slow def test_model_from_pretrained(self): - for model_name in NAT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = NatModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "shi-labs/nat-mini-in1k-224" + model = NatModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/nezha/test_modeling_nezha.py b/tests/models/nezha/test_modeling_nezha.py index a71823d8a5f62a..311866758be65e 100644 --- a/tests/models/nezha/test_modeling_nezha.py +++ b/tests/models/nezha/test_modeling_nezha.py @@ -40,7 +40,6 @@ NezhaForTokenClassification, NezhaModel, ) - from transformers.models.nezha.modeling_nezha import NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST class NezhaModelTester: @@ -432,9 +431,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = NezhaModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "sijunhe/nezha-cn-base" + model = NezhaModel.from_pretrained(model_name) + self.assertIsNotNone(model) @slow @require_torch_gpu diff --git a/tests/models/nystromformer/test_modeling_nystromformer.py b/tests/models/nystromformer/test_modeling_nystromformer.py index ae06670103c88f..f5bcb0ba5fe600 100644 --- a/tests/models/nystromformer/test_modeling_nystromformer.py +++ b/tests/models/nystromformer/test_modeling_nystromformer.py @@ -36,7 +36,6 @@ NystromformerForTokenClassification, NystromformerModel, ) - from transformers.models.nystromformer.modeling_nystromformer import NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST class NystromformerModelTester: @@ -284,9 +283,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = NystromformerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "uw-madison/nystromformer-512" + model = NystromformerModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/openai/test_modeling_openai.py b/tests/models/openai/test_modeling_openai.py index 718c224bf04895..49e6d50bc4287a 100644 --- a/tests/models/openai/test_modeling_openai.py +++ b/tests/models/openai/test_modeling_openai.py @@ -29,7 +29,6 @@ import torch from transformers import ( - OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, OpenAIGPTConfig, OpenAIGPTDoubleHeadsModel, OpenAIGPTForSequenceClassification, @@ -270,9 +269,9 @@ def test_openai_gpt_classification_model(self): @slow def test_model_from_pretrained(self): - for model_name in OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = OpenAIGPTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai-community/openai-gpt" + model = OpenAIGPTModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/openai/test_modeling_tf_openai.py b/tests/models/openai/test_modeling_tf_openai.py index 6704ec97532b33..f6bf7c521765a3 100644 --- a/tests/models/openai/test_modeling_tf_openai.py +++ b/tests/models/openai/test_modeling_tf_openai.py @@ -30,7 +30,6 @@ import tensorflow as tf from transformers.models.openai.modeling_tf_openai import ( - TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, TFOpenAIGPTDoubleHeadsModel, TFOpenAIGPTForSequenceClassification, TFOpenAIGPTLMHeadModel, @@ -253,9 +252,9 @@ def test_openai_gpt_sequence_classification_model(self): @slow def test_model_from_pretrained(self): - for model_name in TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFOpenAIGPTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openai-community/openai-gpt" + model = TFOpenAIGPTModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/owlv2/test_modeling_owlv2.py b/tests/models/owlv2/test_modeling_owlv2.py index 74fbaa58d0e40b..d29f8c08c0a091 100644 --- a/tests/models/owlv2/test_modeling_owlv2.py +++ b/tests/models/owlv2/test_modeling_owlv2.py @@ -50,7 +50,6 @@ from torch import nn from transformers import Owlv2ForObjectDetection, Owlv2Model, Owlv2TextModel, Owlv2VisionModel - from transformers.models.owlv2.modeling_owlv2 import OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -138,7 +137,7 @@ def prepare_config_and_inputs_for_common(self): @require_torch -# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTVisionModelTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2 +# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTVisionModelTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2, owlvit-base-patch32->owlv2-base-patch16-ensemble class Owlv2VisionModelTest(ModelTesterMixin, unittest.TestCase): """ Here we also overwrite some of the tests of test_modeling_common.py, as OWLV2 does not use input_ids, inputs_embeds, @@ -219,9 +218,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Owlv2VisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlv2-base-patch16-ensemble" + model = Owlv2VisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) # Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTTextModelTester with OwlViT->Owlv2 @@ -315,7 +314,7 @@ def prepare_config_and_inputs_for_common(self): @require_torch -# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTTextModelTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2 +# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTTextModelTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2, owlvit-base-patch32->owlv2-base-patch16-ensemble class Owlv2TextModelTest(ModelTesterMixin, unittest.TestCase): all_model_classes = (Owlv2TextModel,) if is_torch_available() else () fx_compatible = False @@ -367,9 +366,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Owlv2TextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlv2-base-patch16-ensemble" + model = Owlv2TextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class Owlv2ModelTester: @@ -430,7 +429,7 @@ def prepare_config_and_inputs_for_common(self): @require_torch -# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTModelTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2 +# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTModelTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2, owlvit-base-patch32->owlv2-base-patch16-ensemble class Owlv2ModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase): all_model_classes = (Owlv2Model,) if is_torch_available() else () pipeline_model_mapping = ( @@ -578,9 +577,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Owlv2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlv2-base-patch16-ensemble" + model = Owlv2Model.from_pretrained(model_name) + self.assertIsNotNone(model) # Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTForObjectDetectionTester with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2 @@ -644,7 +643,7 @@ def prepare_config_and_inputs_for_common(self): @require_torch -# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTForObjectDetectionTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2 +# Copied from tests.models.owlvit.test_modeling_owlvit.OwlViTForObjectDetectionTest with OwlViT->Owlv2, OWL-ViT->OwlV2, OWLVIT->OWLV2, owlvit-base-patch32->owlv2-base-patch16-ensemble class Owlv2ForObjectDetectionTest(ModelTesterMixin, unittest.TestCase): all_model_classes = (Owlv2ForObjectDetection,) if is_torch_available() else () fx_compatible = False @@ -777,9 +776,9 @@ def _create_and_check_torchscript(self, config, inputs_dict): @slow def test_model_from_pretrained(self): - for model_name in OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Owlv2ForObjectDetection.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlv2-base-patch16-ensemble" + model = Owlv2ForObjectDetection.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/owlvit/test_modeling_owlvit.py b/tests/models/owlvit/test_modeling_owlvit.py index 1966aaeda2501c..370de654471179 100644 --- a/tests/models/owlvit/test_modeling_owlvit.py +++ b/tests/models/owlvit/test_modeling_owlvit.py @@ -50,7 +50,6 @@ from torch import nn from transformers import OwlViTForObjectDetection, OwlViTModel, OwlViTTextModel, OwlViTVisionModel - from transformers.models.owlvit.modeling_owlvit import OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -217,9 +216,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = OwlViTVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlvit-base-patch32" + model = OwlViTVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class OwlViTTextModelTester: @@ -363,9 +362,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = OwlViTTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlvit-base-patch32" + model = OwlViTTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class OwlViTModelTester: @@ -573,9 +572,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = OwlViTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlvit-base-patch32" + model = OwlViTModel.from_pretrained(model_name) + self.assertIsNotNone(model) class OwlViTForObjectDetectionTester: @@ -770,9 +769,9 @@ def _create_and_check_torchscript(self, config, inputs_dict): @slow def test_model_from_pretrained(self): - for model_name in OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = OwlViTForObjectDetection.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/owlvit-base-patch32" + model = OwlViTForObjectDetection.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/perceiver/test_modeling_perceiver.py b/tests/models/perceiver/test_modeling_perceiver.py index a529c4430ff312..fbd237bc105874 100644 --- a/tests/models/perceiver/test_modeling_perceiver.py +++ b/tests/models/perceiver/test_modeling_perceiver.py @@ -56,7 +56,6 @@ MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES, MODEL_MAPPING_NAMES, ) - from transformers.models.perceiver.modeling_perceiver import PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -832,9 +831,9 @@ def test_load_with_mismatched_shapes(self): @slow def test_model_from_pretrained(self): - for model_name in PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = PerceiverModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "deepmind/language-perceiver" + model = PerceiverModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/pix2struct/test_modeling_pix2struct.py b/tests/models/pix2struct/test_modeling_pix2struct.py index 0745362272966c..abc29bfbb71929 100644 --- a/tests/models/pix2struct/test_modeling_pix2struct.py +++ b/tests/models/pix2struct/test_modeling_pix2struct.py @@ -48,7 +48,6 @@ Pix2StructTextModel, Pix2StructVisionModel, ) - from transformers.models.pix2struct.modeling_pix2struct import PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -222,9 +221,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Pix2StructVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/pix2struct-textcaps-base" + model = Pix2StructVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class Pix2StructTextModelTester: @@ -371,9 +370,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Pix2StructTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/pix2struct-textcaps-base" + model = Pix2StructTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class Pix2StructModelTester: diff --git a/tests/models/poolformer/test_modeling_poolformer.py b/tests/models/poolformer/test_modeling_poolformer.py index e387053f110ada..ca5c3015a7dff5 100644 --- a/tests/models/poolformer/test_modeling_poolformer.py +++ b/tests/models/poolformer/test_modeling_poolformer.py @@ -30,7 +30,6 @@ import torch from transformers import MODEL_MAPPING, PoolFormerConfig, PoolFormerForImageClassification, PoolFormerModel - from transformers.models.poolformer.modeling_poolformer import POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -209,9 +208,9 @@ def test_training(self): @slow def test_model_from_pretrained(self): - for model_name in POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = PoolFormerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "sail/poolformer_s12" + model = PoolFormerModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/pop2piano/test_modeling_pop2piano.py b/tests/models/pop2piano/test_modeling_pop2piano.py index a99f713a7bd098..594f79b08378e9 100644 --- a/tests/models/pop2piano/test_modeling_pop2piano.py +++ b/tests/models/pop2piano/test_modeling_pop2piano.py @@ -44,7 +44,6 @@ import torch from transformers import Pop2PianoForConditionalGeneration - from transformers.models.pop2piano.modeling_pop2piano import POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST @require_torch @@ -607,9 +606,9 @@ def test_v1_1_resize_embeddings(self): @slow def test_model_from_pretrained(self): - for model_name in POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Pop2PianoForConditionalGeneration.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "sweetcocoa/pop2piano" + model = Pop2PianoForConditionalGeneration.from_pretrained(model_name) + self.assertIsNotNone(model) @require_onnx def test_export_to_onnx(self): diff --git a/tests/models/pvt/test_modeling_pvt.py b/tests/models/pvt/test_modeling_pvt.py index 3b8c917f1d7592..d18a336a4a950f 100644 --- a/tests/models/pvt/test_modeling_pvt.py +++ b/tests/models/pvt/test_modeling_pvt.py @@ -37,7 +37,6 @@ from transformers import PvtConfig, PvtForImageClassification, PvtImageProcessor, PvtModel from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.pvt.modeling_pvt import PVT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -254,9 +253,9 @@ def test_training(self): @slow def test_model_from_pretrained(self): - for model_name in PVT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = PvtModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "Zetatech/pvt-tiny-224" + model = PvtModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/qdqbert/test_modeling_qdqbert.py b/tests/models/qdqbert/test_modeling_qdqbert.py index e8c6d17986d2d5..ed7f5a32391420 100644 --- a/tests/models/qdqbert/test_modeling_qdqbert.py +++ b/tests/models/qdqbert/test_modeling_qdqbert.py @@ -39,7 +39,6 @@ QDQBertLMHeadModel, QDQBertModel, ) - from transformers.models.qdqbert.modeling_qdqbert import QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST class QDQBertModelTester: @@ -537,9 +536,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = QDQBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google-bert/bert-base-uncased" + model = QDQBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) # Override def test_feed_forward_chunking(self): diff --git a/tests/models/reformer/test_modeling_reformer.py b/tests/models/reformer/test_modeling_reformer.py index 11cd7e1a33b45a..d3996a31c6a9eb 100644 --- a/tests/models/reformer/test_modeling_reformer.py +++ b/tests/models/reformer/test_modeling_reformer.py @@ -37,7 +37,6 @@ from torch import nn from transformers import ( - REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ReformerForMaskedLM, ReformerForQuestionAnswering, ReformerForSequenceClassification, @@ -616,9 +615,9 @@ def setUp(self): @slow def test_model_from_pretrained(self): - for model_name in REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ReformerModelWithLMHead.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/reformer-crime-and-punishment" + model = ReformerModelWithLMHead.from_pretrained(model_name) + self.assertIsNotNone(model) def _check_attentions_for_generate( self, batch_size, attentions, min_length, max_length, config, use_cache=False, num_beam_groups=1 diff --git a/tests/models/regnet/test_modeling_regnet.py b/tests/models/regnet/test_modeling_regnet.py index 420609bf0300f0..8840a141fa40e8 100644 --- a/tests/models/regnet/test_modeling_regnet.py +++ b/tests/models/regnet/test_modeling_regnet.py @@ -31,7 +31,6 @@ from torch import nn from transformers import RegNetForImageClassification, RegNetModel - from transformers.models.regnet.modeling_regnet import REGNET_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -220,9 +219,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = RegNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/regnet-y-040" + model = RegNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -236,15 +235,11 @@ def prepare_img(): class RegNetModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return ( - AutoImageProcessor.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]) - if is_vision_available() - else None - ) + return AutoImageProcessor.from_pretrained("facebook/regnet-y-040") if is_vision_available() else None @slow def test_inference_image_classification_head(self): - model = RegNetForImageClassification.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]).to(torch_device) + model = RegNetForImageClassification.from_pretrained("facebook/regnet-y-040").to(torch_device) image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/regnet/test_modeling_tf_regnet.py b/tests/models/regnet/test_modeling_tf_regnet.py index a2f2bf92ef46c4..70adc9c8756170 100644 --- a/tests/models/regnet/test_modeling_tf_regnet.py +++ b/tests/models/regnet/test_modeling_tf_regnet.py @@ -32,7 +32,7 @@ if is_tf_available(): import tensorflow as tf - from transformers import TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFRegNetForImageClassification, TFRegNetModel + from transformers import TFRegNetForImageClassification, TFRegNetModel if is_vision_available(): @@ -252,9 +252,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFRegNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/regnet-y-040" + model = TFRegNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -268,15 +268,11 @@ def prepare_img(): class RegNetModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return ( - AutoImageProcessor.from_pretrained(TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]) - if is_vision_available() - else None - ) + return AutoImageProcessor.from_pretrained("facebook/regnet-y-040") if is_vision_available() else None @slow def test_inference_image_classification_head(self): - model = TFRegNetForImageClassification.from_pretrained(TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + model = TFRegNetForImageClassification.from_pretrained("facebook/regnet-y-040") image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/rembert/test_modeling_rembert.py b/tests/models/rembert/test_modeling_rembert.py index 557a42243df861..fe21ae2ecf4907 100644 --- a/tests/models/rembert/test_modeling_rembert.py +++ b/tests/models/rembert/test_modeling_rembert.py @@ -38,7 +38,6 @@ RemBertForTokenClassification, RemBertModel, ) - from transformers.models.rembert.modeling_rembert import REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST class RemBertModelTester: @@ -465,9 +464,9 @@ def test_model_as_decoder_with_default_input_mask(self): @slow def test_model_from_pretrained(self): - for model_name in REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = RemBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/rembert" + model = RemBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/resnet/test_modeling_resnet.py b/tests/models/resnet/test_modeling_resnet.py index 543013bc41b063..0fd32bc72f018f 100644 --- a/tests/models/resnet/test_modeling_resnet.py +++ b/tests/models/resnet/test_modeling_resnet.py @@ -32,7 +32,6 @@ from torch import nn from transformers import ResNetBackbone, ResNetForImageClassification, ResNetModel - from transformers.models.resnet.modeling_resnet import RESNET_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -273,9 +272,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in RESNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ResNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/resnet-50" + model = ResNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -289,15 +288,11 @@ def prepare_img(): class ResNetModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return ( - AutoImageProcessor.from_pretrained(RESNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]) - if is_vision_available() - else None - ) + return AutoImageProcessor.from_pretrained("microsoft/resnet-50") if is_vision_available() else None @slow def test_inference_image_classification_head(self): - model = ResNetForImageClassification.from_pretrained(RESNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]).to(torch_device) + model = ResNetForImageClassification.from_pretrained("microsoft/resnet-50").to(torch_device) image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/resnet/test_modeling_tf_resnet.py b/tests/models/resnet/test_modeling_tf_resnet.py index 827fc807dfe5ab..a8e2ce93ee3bb9 100644 --- a/tests/models/resnet/test_modeling_tf_resnet.py +++ b/tests/models/resnet/test_modeling_tf_resnet.py @@ -35,7 +35,6 @@ import tensorflow as tf from transformers import TFResNetForImageClassification, TFResNetModel - from transformers.models.resnet.modeling_tf_resnet import TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -214,9 +213,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFResNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/resnet-50" + model = TFResNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats @@ -230,15 +229,11 @@ def prepare_img(): class TFResNetModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): - return ( - AutoImageProcessor.from_pretrained(TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]) - if is_vision_available() - else None - ) + return AutoImageProcessor.from_pretrained("microsoft/resnet-50") if is_vision_available() else None @slow def test_inference_image_classification_head(self): - model = TFResNetForImageClassification.from_pretrained(TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + model = TFResNetForImageClassification.from_pretrained("microsoft/resnet-50") image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/roberta/test_modeling_roberta.py b/tests/models/roberta/test_modeling_roberta.py index 402d60d37a42a4..700f0d1cf71bcf 100644 --- a/tests/models/roberta/test_modeling_roberta.py +++ b/tests/models/roberta/test_modeling_roberta.py @@ -38,7 +38,6 @@ RobertaModel, ) from transformers.models.roberta.modeling_roberta import ( - ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaEmbeddings, create_position_ids_from_input_ids, ) @@ -477,9 +476,9 @@ def test_for_question_answering(self): @slow def test_model_from_pretrained(self): - for model_name in ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = RobertaModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "FacebookAI/roberta-base" + model = RobertaModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_create_position_ids_respects_padding_index(self): """Ensure that the default position ids only assign a sequential . This is a regression diff --git a/tests/models/roberta/test_modeling_tf_roberta.py b/tests/models/roberta/test_modeling_tf_roberta.py index 37377ab5ba52e6..8125a7f0a07a98 100644 --- a/tests/models/roberta/test_modeling_tf_roberta.py +++ b/tests/models/roberta/test_modeling_tf_roberta.py @@ -31,7 +31,6 @@ import tensorflow as tf from transformers.models.roberta.modeling_tf_roberta import ( - TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaForCausalLM, TFRobertaForMaskedLM, TFRobertaForMultipleChoice, @@ -655,9 +654,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFRobertaModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "FacebookAI/roberta-base" + model = TFRobertaModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/roberta_prelayernorm/test_modeling_roberta_prelayernorm.py b/tests/models/roberta_prelayernorm/test_modeling_roberta_prelayernorm.py index c975718778daf4..3536ccc87106b6 100644 --- a/tests/models/roberta_prelayernorm/test_modeling_roberta_prelayernorm.py +++ b/tests/models/roberta_prelayernorm/test_modeling_roberta_prelayernorm.py @@ -38,7 +38,6 @@ RobertaPreLayerNormModel, ) from transformers.models.roberta_prelayernorm.modeling_roberta_prelayernorm import ( - ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaPreLayerNormEmbeddings, create_position_ids_from_input_ids, ) @@ -482,11 +481,10 @@ def test_for_question_answering(self): self.model_tester.create_and_check_for_question_answering(*config_and_inputs) @slow - # Copied from tests.models.roberta.test_modeling_roberta.RobertaModelTest.test_model_from_pretrained with ROBERTA->ROBERTA_PRELAYERNORM,Roberta->RobertaPreLayerNorm def test_model_from_pretrained(self): - for model_name in ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = RobertaPreLayerNormModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "andreasmadsen/efficient_mlm_m0.15" + model = RobertaPreLayerNormModel.from_pretrained(model_name) + self.assertIsNotNone(model) # Copied from tests.models.roberta.test_modeling_roberta.RobertaModelTest.test_create_position_ids_respects_padding_index with Roberta->RobertaPreLayerNorm def test_create_position_ids_respects_padding_index(self): diff --git a/tests/models/roberta_prelayernorm/test_modeling_tf_roberta_prelayernorm.py b/tests/models/roberta_prelayernorm/test_modeling_tf_roberta_prelayernorm.py index 384fa2e9e40013..2138541603dd5a 100644 --- a/tests/models/roberta_prelayernorm/test_modeling_tf_roberta_prelayernorm.py +++ b/tests/models/roberta_prelayernorm/test_modeling_tf_roberta_prelayernorm.py @@ -31,7 +31,6 @@ import tensorflow as tf from transformers.models.roberta_prelayernorm.modeling_tf_roberta_prelayernorm import ( - TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaPreLayerNormForCausalLM, TFRobertaPreLayerNormForMaskedLM, TFRobertaPreLayerNormForMultipleChoice, @@ -551,7 +550,7 @@ def prepare_config_and_inputs_for_common(self): @require_tf -# Copied from tests.models.roberta.test_modeling_tf_roberta.TFRobertaModelTest with ROBERTA->ROBERTA_PRELAYERNORM,Roberta->RobertaPreLayerNorm +# Copied from tests.models.roberta.test_modeling_tf_roberta.TFRobertaModelTest with ROBERTA->ROBERTA_PRELAYERNORM,Roberta->RobertaPreLayerNorm,FacebookAI/roberta-base->andreasmadsen/efficient_mlm_m0.15 class TFRobertaPreLayerNormModelTest(TFModelTesterMixin, PipelineTesterMixin, unittest.TestCase): all_model_classes = ( ( @@ -657,9 +656,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFRobertaPreLayerNormModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "andreasmadsen/efficient_mlm_m0.15" + model = TFRobertaPreLayerNormModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/roc_bert/test_modeling_roc_bert.py b/tests/models/roc_bert/test_modeling_roc_bert.py index d1caca6b6f9417..d52304ade90a79 100644 --- a/tests/models/roc_bert/test_modeling_roc_bert.py +++ b/tests/models/roc_bert/test_modeling_roc_bert.py @@ -39,7 +39,6 @@ RoCBertForTokenClassification, RoCBertModel, ) - from transformers.models.roc_bert.modeling_roc_bert import ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST class RoCBertModelTester: @@ -718,9 +717,9 @@ def test_model_as_decoder_with_default_input_mask(self): @slow def test_model_from_pretrained(self): - for model_name in ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = RoCBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "weiweishi/roc-bert-base-zh" + model = RoCBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/roformer/test_modeling_roformer.py b/tests/models/roformer/test_modeling_roformer.py index 6c130ae1746c03..64ce38c5152541 100644 --- a/tests/models/roformer/test_modeling_roformer.py +++ b/tests/models/roformer/test_modeling_roformer.py @@ -38,7 +38,6 @@ RoFormerModel, ) from transformers.models.roformer.modeling_roformer import ( - ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, RoFormerSelfAttention, RoFormerSinusoidalPositionalEmbedding, ) @@ -482,9 +481,9 @@ def test_model_as_decoder_with_default_input_mask(self): @slow def test_model_from_pretrained(self): - for model_name in ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = RoFormerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "junnyu/roformer_chinese_small" + model = RoFormerModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip( reason="This architecure seem to not compute gradients properly when using GC, check: https://github.com/huggingface/transformers/pull/27124" diff --git a/tests/models/rwkv/test_modeling_rwkv.py b/tests/models/rwkv/test_modeling_rwkv.py index 4ca5cfdf9e130b..d2a41a863d22d1 100644 --- a/tests/models/rwkv/test_modeling_rwkv.py +++ b/tests/models/rwkv/test_modeling_rwkv.py @@ -30,7 +30,6 @@ import torch from transformers import ( - RWKV_PRETRAINED_MODEL_ARCHIVE_LIST, RwkvForCausalLM, RwkvModel, ) @@ -419,9 +418,9 @@ def test_attention_outputs(self): @slow def test_model_from_pretrained(self): - for model_name in RWKV_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = RwkvModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "RWKV/rwkv-4-169m-pile" + model = RwkvModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skipIf( diff --git a/tests/models/sam/test_modeling_sam.py b/tests/models/sam/test_modeling_sam.py index 3e63edb23a0c6d..a10365d3690511 100644 --- a/tests/models/sam/test_modeling_sam.py +++ b/tests/models/sam/test_modeling_sam.py @@ -34,7 +34,6 @@ from torch import nn from transformers import SamModel, SamProcessor - from transformers.models.sam.modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -442,9 +441,9 @@ def check_pt_tf_outputs(self, tf_outputs, pt_outputs, model_class, tol=5e-5, nam @slow def test_model_from_pretrained(self): - for model_name in SAM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SamModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/sam-vit-huge" + model = SamModel.from_pretrained(model_name) + self.assertIsNotNone(model) def prepare_image(): diff --git a/tests/models/seamless_m4t/test_modeling_seamless_m4t.py b/tests/models/seamless_m4t/test_modeling_seamless_m4t.py index 365775171e8c52..c08e559057021e 100644 --- a/tests/models/seamless_m4t/test_modeling_seamless_m4t.py +++ b/tests/models/seamless_m4t/test_modeling_seamless_m4t.py @@ -46,9 +46,6 @@ SeamlessM4TForTextToText, SeamlessM4TModel, ) - from transformers.models.seamless_m4t.modeling_seamless_m4t import ( - SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST, - ) if is_speech_available(): from transformers import SeamlessM4TProcessor @@ -379,9 +376,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SeamlessM4TModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/hf-seamless-m4t-medium" + model = SeamlessM4TModel.from_pretrained(model_name) + self.assertIsNotNone(model) def _get_input_ids_and_config(self, batch_size=2): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() @@ -667,9 +664,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SeamlessM4TModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/hf-seamless-m4t-medium" + model = SeamlessM4TModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/seamless_m4t_v2/test_modeling_seamless_m4t_v2.py b/tests/models/seamless_m4t_v2/test_modeling_seamless_m4t_v2.py index 795f3d80422b2e..699641fcfd7526 100644 --- a/tests/models/seamless_m4t_v2/test_modeling_seamless_m4t_v2.py +++ b/tests/models/seamless_m4t_v2/test_modeling_seamless_m4t_v2.py @@ -45,9 +45,6 @@ SeamlessM4Tv2ForTextToText, SeamlessM4Tv2Model, ) - from transformers.models.seamless_m4t_v2.modeling_seamless_m4t_v2 import ( - SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST, - ) if is_speech_available(): from transformers import SeamlessM4TProcessor @@ -395,9 +392,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST: - model = SeamlessM4Tv2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/seamless-m4t-v2-large" + model = SeamlessM4Tv2Model.from_pretrained(model_name) + self.assertIsNotNone(model) def _get_input_ids_and_config(self, batch_size=2): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() @@ -662,9 +659,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST: - model = SeamlessM4Tv2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/seamless-m4t-v2-large" + model = SeamlessM4Tv2Model.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/segformer/test_modeling_segformer.py b/tests/models/segformer/test_modeling_segformer.py index de64de5ad1b976..fb383385131415 100644 --- a/tests/models/segformer/test_modeling_segformer.py +++ b/tests/models/segformer/test_modeling_segformer.py @@ -34,7 +34,6 @@ SegformerModel, ) from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.segformer.modeling_segformer import SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -335,9 +334,9 @@ def test_training(self): @slow def test_model_from_pretrained(self): - for model_name in SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SegformerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/segformer-b0-finetuned-ade-512-512" + model = SegformerModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/segformer/test_modeling_tf_segformer.py b/tests/models/segformer/test_modeling_tf_segformer.py index aca621f5097dd0..16b5740a081807 100644 --- a/tests/models/segformer/test_modeling_tf_segformer.py +++ b/tests/models/segformer/test_modeling_tf_segformer.py @@ -34,7 +34,6 @@ import tensorflow as tf from transformers import TFSegformerForImageClassification, TFSegformerForSemanticSegmentation, TFSegformerModel - from transformers.models.segformer.modeling_tf_segformer import TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -438,9 +437,9 @@ def check_pt_tf_outputs(self, tf_outputs, pt_outputs, model_class, tol=2e-4, nam @slow def test_model_from_pretrained(self): - for model_name in TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFSegformerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "nvidia/segformer-b0-finetuned-ade-512-512" + model = TFSegformerModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/seggpt/test_modeling_seggpt.py b/tests/models/seggpt/test_modeling_seggpt.py index 5f7920f9a3a5fd..d4a8a46f037851 100644 --- a/tests/models/seggpt/test_modeling_seggpt.py +++ b/tests/models/seggpt/test_modeling_seggpt.py @@ -39,7 +39,6 @@ from torch import nn from transformers import SegGptForImageSegmentation, SegGptModel - from transformers.models.seggpt.modeling_seggpt import SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -301,9 +300,9 @@ def recursive_check(batched_object, single_row_object, model_name, key): @slow def test_model_from_pretrained(self): - for model_name in SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SegGptModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "BAAI/seggpt-vit-large" + model = SegGptModel.from_pretrained(model_name) + self.assertIsNotNone(model) def prepare_img(): diff --git a/tests/models/siglip/test_modeling_siglip.py b/tests/models/siglip/test_modeling_siglip.py index 45212751a85d65..8880168484eced 100644 --- a/tests/models/siglip/test_modeling_siglip.py +++ b/tests/models/siglip/test_modeling_siglip.py @@ -48,7 +48,6 @@ from torch import nn from transformers import SiglipForImageClassification, SiglipModel, SiglipTextModel, SiglipVisionModel - from transformers.models.siglip.modeling_siglip import SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -217,9 +216,9 @@ def test_initialization(self): @slow def test_model_from_pretrained(self): - for model_name in SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SiglipVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/siglip-base-patch16-224" + model = SiglipVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) class SiglipTextModelTester: @@ -374,9 +373,9 @@ def test_initialization(self): @slow def test_model_from_pretrained(self): - for model_name in SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SiglipTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/siglip-base-patch16-224" + model = SiglipTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class SiglipModelTester: @@ -578,11 +577,10 @@ def test_load_vision_text_config(self): self.assertDictEqual(config.text_config.to_dict(), text_config.to_dict()) @slow - # Copied from tests.models.clip.test_modeling_clip.CLIPModelTest.test_model_from_pretrained with CLIPModel->SiglipModel, CLIP->SIGLIP def test_model_from_pretrained(self): - for model_name in SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SiglipModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/siglip-base-patch16-224" + model = SiglipModel.from_pretrained(model_name) + self.assertIsNotNone(model) class SiglipForImageClassificationModelTester(SiglipModelTester): diff --git a/tests/models/splinter/test_modeling_splinter.py b/tests/models/splinter/test_modeling_splinter.py index 90ee07c354588b..b6a2588c87052a 100644 --- a/tests/models/splinter/test_modeling_splinter.py +++ b/tests/models/splinter/test_modeling_splinter.py @@ -29,7 +29,6 @@ import torch from transformers import SplinterConfig, SplinterForPreTraining, SplinterForQuestionAnswering, SplinterModel - from transformers.models.splinter.modeling_splinter import SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST class SplinterModelTester: @@ -328,9 +327,9 @@ def test_inputs_embeds(self): @slow def test_model_from_pretrained(self): - for model_name in SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SplinterModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "tau/splinter-base" + model = SplinterModel.from_pretrained(model_name) + self.assertIsNotNone(model) # overwrite from common since `SplinterForPreTraining` could contain different number of question tokens in inputs. # When the batch is distributed to multiple devices, each replica could get different values for the maximal number diff --git a/tests/models/squeezebert/test_modeling_squeezebert.py b/tests/models/squeezebert/test_modeling_squeezebert.py index bf86792f57f1ef..1682146e1ad884 100644 --- a/tests/models/squeezebert/test_modeling_squeezebert.py +++ b/tests/models/squeezebert/test_modeling_squeezebert.py @@ -28,7 +28,6 @@ import torch from transformers import ( - SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, SqueezeBertForMaskedLM, SqueezeBertForMultipleChoice, SqueezeBertForQuestionAnswering, @@ -277,9 +276,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SqueezeBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "squeezebert/squeezebert-uncased" + model = SqueezeBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_sentencepiece diff --git a/tests/models/swiftformer/test_modeling_swiftformer.py b/tests/models/swiftformer/test_modeling_swiftformer.py index a1e6229d5a6e81..c54e092809a009 100644 --- a/tests/models/swiftformer/test_modeling_swiftformer.py +++ b/tests/models/swiftformer/test_modeling_swiftformer.py @@ -37,7 +37,6 @@ from torch import nn from transformers import SwiftFormerForImageClassification, SwiftFormerModel - from transformers.models.swiftformer.modeling_swiftformer import SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -186,9 +185,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SwiftFormerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "MBZUAI/swiftformer-xs" + model = SwiftFormerModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="SwiftFormer does not output attentions") def test_attention_outputs(self): diff --git a/tests/models/swin/test_modeling_swin.py b/tests/models/swin/test_modeling_swin.py index cd0b99fdc986a2..9220784e23029a 100644 --- a/tests/models/swin/test_modeling_swin.py +++ b/tests/models/swin/test_modeling_swin.py @@ -32,7 +32,6 @@ from torch import nn from transformers import SwinBackbone, SwinForImageClassification, SwinForMaskedImageModeling, SwinModel - from transformers.models.swin.modeling_swin import SWIN_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -446,9 +445,9 @@ def test_hidden_states_output_with_padding(self): @slow def test_model_from_pretrained(self): - for model_name in SWIN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SwinModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/swin-tiny-patch4-window7-224" + model = SwinModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_initialization(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/swin/test_modeling_tf_swin.py b/tests/models/swin/test_modeling_tf_swin.py index e15ecbc41dbec0..f05ef7a434316b 100644 --- a/tests/models/swin/test_modeling_tf_swin.py +++ b/tests/models/swin/test_modeling_tf_swin.py @@ -36,7 +36,6 @@ from transformers.modeling_tf_utils import keras from transformers.models.swin.modeling_tf_swin import ( - TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, TFSwinForImageClassification, TFSwinForMaskedImageModeling, TFSwinModel, @@ -374,9 +373,9 @@ def test_inputs_requiring_padding(self): @slow def test_model_from_pretrained(self): - for model_name in TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFSwinModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/swin-tiny-patch4-window7-224" + model = TFSwinModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_vision diff --git a/tests/models/swin2sr/test_modeling_swin2sr.py b/tests/models/swin2sr/test_modeling_swin2sr.py index 556b65a249a22f..44ca7b92492be2 100644 --- a/tests/models/swin2sr/test_modeling_swin2sr.py +++ b/tests/models/swin2sr/test_modeling_swin2sr.py @@ -29,7 +29,6 @@ from torch import nn from transformers import Swin2SRForImageSuperResolution, Swin2SRModel - from transformers.models.swin2sr.modeling_swin2sr import SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -233,9 +232,9 @@ def test_model_common_attributes(self): @slow def test_model_from_pretrained(self): - for model_name in SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Swin2SRModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "caidas/swin2SR-classical-sr-x2-64" + model = Swin2SRModel.from_pretrained(model_name) + self.assertIsNotNone(model) # overwriting because of `logit_scale` parameter def test_initialization(self): diff --git a/tests/models/swinv2/test_modeling_swinv2.py b/tests/models/swinv2/test_modeling_swinv2.py index 73f731cd60abbb..b8f97ee7c23bc6 100644 --- a/tests/models/swinv2/test_modeling_swinv2.py +++ b/tests/models/swinv2/test_modeling_swinv2.py @@ -32,7 +32,6 @@ from torch import nn from transformers import Swinv2Backbone, Swinv2ForImageClassification, Swinv2ForMaskedImageModeling, Swinv2Model - from transformers.models.swinv2.modeling_swinv2 import SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): from PIL import Image @@ -432,9 +431,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = Swinv2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/swinv2-tiny-patch4-window8-256" + model = Swinv2Model.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="Swinv2 does not support feedforward chunking yet") def test_feed_forward_chunking(self): diff --git a/tests/models/switch_transformers/test_modeling_switch_transformers.py b/tests/models/switch_transformers/test_modeling_switch_transformers.py index b21fa405c39f9c..f8c3afc1ed7338 100644 --- a/tests/models/switch_transformers/test_modeling_switch_transformers.py +++ b/tests/models/switch_transformers/test_modeling_switch_transformers.py @@ -45,7 +45,6 @@ SwitchTransformersTop1Router, ) from transformers.models.switch_transformers.modeling_switch_transformers import ( - SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST, load_balancing_loss_func, router_z_loss_func, ) @@ -670,9 +669,9 @@ def test_v1_1_resize_embeddings(self): @slow def test_model_from_pretrained(self): - for model_name in SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = SwitchTransformersModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/switch-base-8" + model = SwitchTransformersModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip("Test has a segmentation fault on torch 1.8.0") def test_export_to_onnx(self): diff --git a/tests/models/t5/test_modeling_t5.py b/tests/models/t5/test_modeling_t5.py index c0a43dfeab69cc..c215bda5e1de7d 100644 --- a/tests/models/t5/test_modeling_t5.py +++ b/tests/models/t5/test_modeling_t5.py @@ -56,7 +56,6 @@ T5Model, T5Tokenizer, ) - from transformers.models.t5.modeling_t5 import T5_PRETRAINED_MODEL_ARCHIVE_LIST class T5ModelTester: @@ -838,9 +837,9 @@ def test_v1_1_resize_embeddings(self): @slow def test_model_from_pretrained(self): - for model_name in T5_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = T5Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google-t5/t5-small" + model = T5Model.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip("Test has a segmentation fault on torch 1.8.0") def test_export_to_onnx(self): diff --git a/tests/models/timesformer/test_modeling_timesformer.py b/tests/models/timesformer/test_modeling_timesformer.py index d4e71c8c599967..3d97d2c0f67099 100644 --- a/tests/models/timesformer/test_modeling_timesformer.py +++ b/tests/models/timesformer/test_modeling_timesformer.py @@ -40,7 +40,6 @@ TimesformerForVideoClassification, TimesformerModel, ) - from transformers.models.timesformer.modeling_timesformer import TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -213,9 +212,9 @@ def test_for_video_classification(self): @slow def test_model_from_pretrained(self): - for model_name in TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TimesformerModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/timesformer-base-finetuned-k400" + model = TimesformerModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_attention_outputs(self): if not self.has_attentions: diff --git a/tests/models/tvlt/test_modeling_tvlt.py b/tests/models/tvlt/test_modeling_tvlt.py index 3ee7f7adc7ffd5..ce27946ee72173 100644 --- a/tests/models/tvlt/test_modeling_tvlt.py +++ b/tests/models/tvlt/test_modeling_tvlt.py @@ -41,7 +41,6 @@ import torch.nn as nn from transformers import TvltForAudioVisualClassification, TvltForPreTraining, TvltModel - from transformers.models.tvlt.modeling_tvlt import TVLT_PRETRAINED_MODEL_ARCHIVE_LIST if is_datasets_available(): @@ -414,9 +413,9 @@ def test_for_pretraining(self): @slow def test_model_from_pretrained(self): - for model_name in TVLT_PRETRAINED_MODEL_ARCHIVE_LIST: - model = TvltModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "ZinengTang/tvlt-base" + model = TvltModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_training(self): if not self.model_tester.is_training: diff --git a/tests/models/udop/test_modeling_udop.py b/tests/models/udop/test_modeling_udop.py index 3947da62cc6fe6..7041f25f4e73b9 100644 --- a/tests/models/udop/test_modeling_udop.py +++ b/tests/models/udop/test_modeling_udop.py @@ -39,7 +39,6 @@ import torch from transformers import UdopEncoderModel, UdopForConditionalGeneration, UdopModel, UdopProcessor - from transformers.models.udop.modeling_udop import UDOP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -359,9 +358,9 @@ def test_save_load_low_cpu_mem_usage(self): @slow def test_model_from_pretrained(self): - for model_name in UDOP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = UdopForConditionalGeneration.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/udop-large" + model = UdopForConditionalGeneration.from_pretrained(model_name) + self.assertIsNotNone(model) class UdopEncoderOnlyModelTester: diff --git a/tests/models/upernet/test_modeling_upernet.py b/tests/models/upernet/test_modeling_upernet.py index c51b254ed52a04..234cd8af09b8c5 100644 --- a/tests/models/upernet/test_modeling_upernet.py +++ b/tests/models/upernet/test_modeling_upernet.py @@ -32,7 +32,6 @@ import torch from transformers import UperNetForSemanticSegmentation - from transformers.models.upernet.modeling_upernet import UPERNET_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -248,9 +247,9 @@ def test_tied_model_weights_key_ignore(self): @slow def test_model_from_pretrained(self): - for model_name in UPERNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = UperNetForSemanticSegmentation.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "openmmlab/upernet-convnext-tiny" + model = UperNetForSemanticSegmentation.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of ADE20k diff --git a/tests/models/videomae/test_modeling_videomae.py b/tests/models/videomae/test_modeling_videomae.py index 2fd9f90c308558..e5b1c6b78e40dd 100644 --- a/tests/models/videomae/test_modeling_videomae.py +++ b/tests/models/videomae/test_modeling_videomae.py @@ -41,7 +41,6 @@ VideoMAEForVideoClassification, VideoMAEModel, ) - from transformers.models.videomae.modeling_videomae import VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -237,9 +236,9 @@ def test_for_pretraining(self): @slow def test_model_from_pretrained(self): - for model_name in VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = VideoMAEModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "MCG-NJU/videomae-base" + model = VideoMAEModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_attention_outputs(self): if not self.has_attentions: diff --git a/tests/models/vilt/test_modeling_vilt.py b/tests/models/vilt/test_modeling_vilt.py index afc883ef8f3e79..4c877c2e185215 100644 --- a/tests/models/vilt/test_modeling_vilt.py +++ b/tests/models/vilt/test_modeling_vilt.py @@ -40,7 +40,6 @@ ViltModel, ) from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.vilt.modeling_vilt import VILT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): import PIL @@ -528,9 +527,9 @@ def test_retain_grad_hidden_states_attentions(self): @slow def test_model_from_pretrained(self): - for model_name in VILT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ViltModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "dandelin/vilt-b32-mlm" + model = ViltModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/visual_bert/test_modeling_visual_bert.py b/tests/models/visual_bert/test_modeling_visual_bert.py index c366e9145ea7c1..249ccdd84b01d4 100644 --- a/tests/models/visual_bert/test_modeling_visual_bert.py +++ b/tests/models/visual_bert/test_modeling_visual_bert.py @@ -36,7 +36,6 @@ VisualBertForVisualReasoning, VisualBertModel, ) - from transformers.models.visual_bert.modeling_visual_bert import VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST class VisualBertModelTester: @@ -551,9 +550,9 @@ def test_model_for_flickr(self): @slow def test_model_from_pretrained(self): - for model_name in VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = VisualBertModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "uclanlp/visualbert-vqa" + model = VisualBertModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip( reason="This architecure seem to not compute gradients properly when using GC, check: https://github.com/huggingface/transformers/pull/27124" diff --git a/tests/models/vit/test_modeling_vit.py b/tests/models/vit/test_modeling_vit.py index c8181d2c2b5a2e..7298543a563438 100644 --- a/tests/models/vit/test_modeling_vit.py +++ b/tests/models/vit/test_modeling_vit.py @@ -39,7 +39,6 @@ from torch import nn from transformers import ViTForImageClassification, ViTForMaskedImageModeling, ViTModel - from transformers.models.vit.modeling_vit import VIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -237,9 +236,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in VIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ViTModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/vit-base-patch16-224" + model = ViTModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/vit_hybrid/test_modeling_vit_hybrid.py b/tests/models/vit_hybrid/test_modeling_vit_hybrid.py index e9fc3de258689b..d48a8853921649 100644 --- a/tests/models/vit_hybrid/test_modeling_vit_hybrid.py +++ b/tests/models/vit_hybrid/test_modeling_vit_hybrid.py @@ -31,7 +31,6 @@ from torch import nn from transformers import ViTHybridForImageClassification, ViTHybridImageProcessor, ViTHybridModel - from transformers.models.vit_hybrid.modeling_vit_hybrid import VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -217,9 +216,9 @@ def test_initialization(self): @slow def test_model_from_pretrained(self): - for model_name in VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ViTHybridModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/vit-hybrid-base-bit-384" + model = ViTHybridModel.from_pretrained(model_name) + self.assertIsNotNone(model) @is_flaky(description="is_flaky https://github.com/huggingface/transformers/issues/29516") def test_batching_equivalence(self): @@ -238,16 +237,14 @@ class ViTModelIntegrationTest(unittest.TestCase): @cached_property def default_image_processor(self): return ( - ViTHybridImageProcessor.from_pretrained(VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST[0]) + ViTHybridImageProcessor.from_pretrained("google/vit-hybrid-base-bit-384") if is_vision_available() else None ) @slow def test_inference_image_classification_head(self): - model = ViTHybridForImageClassification.from_pretrained(VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST[0]).to( - torch_device - ) + model = ViTHybridForImageClassification.from_pretrained("google/vit-hybrid-base-bit-384").to(torch_device) image_processor = self.default_image_processor image = prepare_img() diff --git a/tests/models/vit_mae/test_modeling_vit_mae.py b/tests/models/vit_mae/test_modeling_vit_mae.py index b5196f12bb4ecc..ffb679d646ffda 100644 --- a/tests/models/vit_mae/test_modeling_vit_mae.py +++ b/tests/models/vit_mae/test_modeling_vit_mae.py @@ -35,7 +35,6 @@ from torch import nn from transformers import ViTMAEForPreTraining, ViTMAEModel - from transformers.models.vit.modeling_vit import VIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -276,9 +275,9 @@ def test_batching_equivalence(self): @slow def test_model_from_pretrained(self): - for model_name in VIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ViTMAEModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/vit-base-patch16-224" + model = ViTMAEModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/vit_msn/test_modeling_vit_msn.py b/tests/models/vit_msn/test_modeling_vit_msn.py index a4cc370ec21c7a..5fe494c105cb62 100644 --- a/tests/models/vit_msn/test_modeling_vit_msn.py +++ b/tests/models/vit_msn/test_modeling_vit_msn.py @@ -31,7 +31,6 @@ from torch import nn from transformers import ViTMSNForImageClassification, ViTMSNModel - from transformers.models.vit_msn.modeling_vit_msn import VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -192,9 +191,9 @@ def test_for_image_classification(self): @slow def test_model_from_pretrained(self): - for model_name in VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = ViTMSNModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/vit-msn-small" + model = ViTMSNModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/vitmatte/test_modeling_vitmatte.py b/tests/models/vitmatte/test_modeling_vitmatte.py index c93e82bafbc65b..4a8e85160bcb51 100644 --- a/tests/models/vitmatte/test_modeling_vitmatte.py +++ b/tests/models/vitmatte/test_modeling_vitmatte.py @@ -36,7 +36,6 @@ import torch from transformers import VitDetConfig, VitMatteForImageMatting - from transformers.models.vitmatte.modeling_vitmatte import VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -195,9 +194,9 @@ def test_model(self): @slow def test_model_from_pretrained(self): - for model_name in VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = VitMatteForImageMatting.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "hustvl/vitmatte-small-composition-1k" + model = VitMatteForImageMatting.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="ViTMatte does not support retaining gradient on attention logits") def test_retain_grad_hidden_states_attentions(self): diff --git a/tests/models/vivit/test_modeling_vivit.py b/tests/models/vivit/test_modeling_vivit.py index 152cfac155b8a1..9b299c9afa40ce 100644 --- a/tests/models/vivit/test_modeling_vivit.py +++ b/tests/models/vivit/test_modeling_vivit.py @@ -37,7 +37,6 @@ from torch import nn from transformers import MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING, VivitForVideoClassification, VivitModel - from transformers.models.vivit.modeling_vivit import VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -225,9 +224,9 @@ def test_for_video_classification(self): @slow def test_model_from_pretrained(self): - for model_name in VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = VivitModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "google/vivit-b-16x2-kinetics400" + model = VivitModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_attention_outputs(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() diff --git a/tests/models/wav2vec2/test_feature_extraction_wav2vec2.py b/tests/models/wav2vec2/test_feature_extraction_wav2vec2.py index c4ab09b6069a2b..29e4bf3e28701a 100644 --- a/tests/models/wav2vec2/test_feature_extraction_wav2vec2.py +++ b/tests/models/wav2vec2/test_feature_extraction_wav2vec2.py @@ -20,7 +20,7 @@ import numpy as np -from transformers import WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2Config, Wav2Vec2FeatureExtractor +from transformers import Wav2Vec2Config, Wav2Vec2FeatureExtractor from transformers.testing_utils import require_torch, slow from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin @@ -224,10 +224,10 @@ def test_pretrained_checkpoints_are_set_correctly(self): # this test makes sure that models that are using # group norm don't have their feature extractor return the # attention_mask - for model_id in WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST: - config = Wav2Vec2Config.from_pretrained(model_id) - feat_extract = Wav2Vec2FeatureExtractor.from_pretrained(model_id) + model_id = "facebook/wav2vec2-base-960h" + config = Wav2Vec2Config.from_pretrained(model_id) + feat_extract = Wav2Vec2FeatureExtractor.from_pretrained(model_id) - # only "layer" feature extraction norm should make use of - # attention_mask - self.assertEqual(feat_extract.return_attention_mask, config.feat_extract_norm == "layer") + # only "layer" feature extraction norm should make use of + # attention_mask + self.assertEqual(feat_extract.return_attention_mask, config.feat_extract_norm == "layer") diff --git a/tests/models/wav2vec2/test_tokenization_wav2vec2.py b/tests/models/wav2vec2/test_tokenization_wav2vec2.py index 7310b1484841d9..44e328ac80325f 100644 --- a/tests/models/wav2vec2/test_tokenization_wav2vec2.py +++ b/tests/models/wav2vec2/test_tokenization_wav2vec2.py @@ -24,7 +24,6 @@ import numpy as np from transformers import ( - WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, AddedToken, Wav2Vec2Config, Wav2Vec2CTCTokenizer, @@ -357,13 +356,13 @@ def test_pretrained_checkpoints_are_set_correctly(self): # this test makes sure that models that are using # group norm don't have their tokenizer return the # attention_mask - for model_id in WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST: - config = Wav2Vec2Config.from_pretrained(model_id) - tokenizer = Wav2Vec2Tokenizer.from_pretrained(model_id) + model_id = "facebook/wav2vec2-base-960h" + config = Wav2Vec2Config.from_pretrained(model_id) + tokenizer = Wav2Vec2Tokenizer.from_pretrained(model_id) - # only "layer" feature extraction norm should make use of - # attention_mask - self.assertEqual(tokenizer.return_attention_mask, config.feat_extract_norm == "layer") + # only "layer" feature extraction norm should make use of + # attention_mask + self.assertEqual(tokenizer.return_attention_mask, config.feat_extract_norm == "layer") class Wav2Vec2CTCTokenizerTest(TokenizerTesterMixin, unittest.TestCase): diff --git a/tests/models/x_clip/test_modeling_x_clip.py b/tests/models/x_clip/test_modeling_x_clip.py index bf8339c93e45c0..fc5c1679a65976 100644 --- a/tests/models/x_clip/test_modeling_x_clip.py +++ b/tests/models/x_clip/test_modeling_x_clip.py @@ -43,7 +43,6 @@ from torch import nn from transformers import XCLIPModel, XCLIPTextModel, XCLIPVisionModel - from transformers.models.x_clip.modeling_x_clip import XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -216,9 +215,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = XCLIPVisionModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/xclip-base-patch32" + model = XCLIPVisionModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_gradient_checkpointing_backward_compatibility(self): config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() @@ -454,9 +453,9 @@ def test_save_load_fast_init_to_base(self): @slow def test_model_from_pretrained(self): - for model_name in XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = XCLIPTextModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/xclip-base-patch32" + model = XCLIPTextModel.from_pretrained(model_name) + self.assertIsNotNone(model) class XCLIPModelTester: @@ -684,9 +683,9 @@ def test_load_vision_text_config(self): @slow def test_model_from_pretrained(self): - for model_name in XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = XCLIPModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "microsoft/xclip-base-patch32" + model = XCLIPModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on a spaghetti video diff --git a/tests/models/xglm/test_modeling_tf_xglm.py b/tests/models/xglm/test_modeling_tf_xglm.py index 3950ccf6524f1f..e651d274232725 100644 --- a/tests/models/xglm/test_modeling_tf_xglm.py +++ b/tests/models/xglm/test_modeling_tf_xglm.py @@ -29,7 +29,6 @@ import tensorflow as tf from transformers.models.xglm.modeling_tf_xglm import ( - TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXGLMForCausalLM, TFXGLMModel, ) @@ -161,9 +160,9 @@ def test_config(self): @slow def test_model_from_pretrained(self): - for model_name in TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFXGLMModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/xglm-564M" + model = TFXGLMModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip(reason="Currently, model embeddings are going to undergo a major refactor.") def test_resize_token_embeddings(self): diff --git a/tests/models/xglm/test_modeling_xglm.py b/tests/models/xglm/test_modeling_xglm.py index e482b1b384f3ee..5669da7e2638da 100644 --- a/tests/models/xglm/test_modeling_xglm.py +++ b/tests/models/xglm/test_modeling_xglm.py @@ -36,7 +36,7 @@ if is_torch_available(): import torch - from transformers import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMTokenizer + from transformers import XGLMForCausalLM, XGLMModel, XGLMTokenizer class XGLMModelTester: @@ -349,9 +349,9 @@ def test_xglm_weight_initialization(self): @slow def test_model_from_pretrained(self): - for model_name in XGLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = XGLMModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "facebook/xglm-564M" + model = XGLMModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip("Does not work on the tiny model as we keep hitting edge cases.") def test_model_parallelism(self): diff --git a/tests/models/xlm/test_modeling_tf_xlm.py b/tests/models/xlm/test_modeling_tf_xlm.py index 51ba6c2476b180..139f29db007b4a 100644 --- a/tests/models/xlm/test_modeling_tf_xlm.py +++ b/tests/models/xlm/test_modeling_tf_xlm.py @@ -30,7 +30,6 @@ import tensorflow as tf from transformers import ( - TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMForMultipleChoice, TFXLMForQuestionAnsweringSimple, TFXLMForSequenceClassification, @@ -360,9 +359,9 @@ def test_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFXLMModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "FacebookAI/xlm-mlm-en-2048" + model = TFXLMModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_tf diff --git a/tests/models/xlm/test_modeling_xlm.py b/tests/models/xlm/test_modeling_xlm.py index 09ad95e81ac822..ac0577bd8229c5 100644 --- a/tests/models/xlm/test_modeling_xlm.py +++ b/tests/models/xlm/test_modeling_xlm.py @@ -36,7 +36,6 @@ XLMModel, XLMWithLMHeadModel, ) - from transformers.models.xlm.modeling_xlm import XLM_PRETRAINED_MODEL_ARCHIVE_LIST class XLMModelTester: @@ -505,9 +504,9 @@ def _check_hidden_states_for_generate( @slow def test_model_from_pretrained(self): - for model_name in XLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = XLMModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "FacebookAI/xlm-mlm-en-2048" + model = XLMModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/xlnet/test_modeling_tf_xlnet.py b/tests/models/xlnet/test_modeling_tf_xlnet.py index 5d17299f9b3926..ea223914a35976 100644 --- a/tests/models/xlnet/test_modeling_tf_xlnet.py +++ b/tests/models/xlnet/test_modeling_tf_xlnet.py @@ -32,7 +32,6 @@ import tensorflow as tf from transformers.models.xlnet.modeling_tf_xlnet import ( - TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLNetForMultipleChoice, TFXLNetForQuestionAnsweringSimple, TFXLNetForSequenceClassification, @@ -415,9 +414,9 @@ def test_xlnet_for_multiple_choice(self): @slow def test_model_from_pretrained(self): - for model_name in TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = TFXLNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "xlnet/xlnet-base-cased" + model = TFXLNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) @unittest.skip("Some of the XLNet models misbehave with flexible input shapes.") def test_compile_tf_model(self): diff --git a/tests/models/xlnet/test_modeling_xlnet.py b/tests/models/xlnet/test_modeling_xlnet.py index cd5a3d52b34801..ff89a9aca3eca2 100644 --- a/tests/models/xlnet/test_modeling_xlnet.py +++ b/tests/models/xlnet/test_modeling_xlnet.py @@ -37,7 +37,6 @@ XLNetLMHeadModel, XLNetModel, ) - from transformers.models.xlnet.modeling_xlnet import XLNET_PRETRAINED_MODEL_ARCHIVE_LIST class XLNetModelTester: @@ -685,9 +684,9 @@ def _check_attentions_for_generate( @slow def test_model_from_pretrained(self): - for model_name in XLNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = XLNetModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "xlnet/xlnet-base-cased" + model = XLNetModel.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch diff --git a/tests/models/yolos/test_modeling_yolos.py b/tests/models/yolos/test_modeling_yolos.py index 4b2aff30948767..64a439f27a4e45 100644 --- a/tests/models/yolos/test_modeling_yolos.py +++ b/tests/models/yolos/test_modeling_yolos.py @@ -31,7 +31,6 @@ from torch import nn from transformers import YolosForObjectDetection, YolosModel - from transformers.models.yolos.modeling_yolos import YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST if is_vision_available(): @@ -319,9 +318,9 @@ def test_for_object_detection(self): @slow def test_model_from_pretrained(self): - for model_name in YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = YolosModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "hustvl/yolos-small" + model = YolosModel.from_pretrained(model_name) + self.assertIsNotNone(model) # We will verify our results on an image of cute cats diff --git a/tests/models/yoso/test_modeling_yoso.py b/tests/models/yoso/test_modeling_yoso.py index 67d7b9edc4e4c3..ca41b074bc3dd9 100644 --- a/tests/models/yoso/test_modeling_yoso.py +++ b/tests/models/yoso/test_modeling_yoso.py @@ -36,7 +36,6 @@ YosoForTokenClassification, YosoModel, ) - from transformers.models.yoso.modeling_yoso import YOSO_PRETRAINED_MODEL_ARCHIVE_LIST class YosoModelTester: @@ -351,9 +350,9 @@ def test_for_token_classification(self): @slow def test_model_from_pretrained(self): - for model_name in YOSO_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = YosoModel.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "uw-madison/yoso-4096" + model = YosoModel.from_pretrained(model_name) + self.assertIsNotNone(model) def test_attention_outputs(self): return diff --git a/tests/test_modeling_utils.py b/tests/test_modeling_utils.py index 46df1feae92785..4e68fad8ef7fc9 100755 --- a/tests/test_modeling_utils.py +++ b/tests/test_modeling_utils.py @@ -85,7 +85,6 @@ from torch import nn from transformers import ( - BERT_PRETRAINED_MODEL_ARCHIVE_LIST, AutoModelForCausalLM, AutoTokenizer, BertConfig, @@ -217,29 +216,29 @@ def check_models_equal(model1, model2): class ModelUtilsTest(TestCasePlus): @slow def test_model_from_pretrained(self): - for model_name in BERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - config = BertConfig.from_pretrained(model_name) - self.assertIsNotNone(config) - self.assertIsInstance(config, PretrainedConfig) + model_name = "google-bert/bert-base-uncased" + config = BertConfig.from_pretrained(model_name) + self.assertIsNotNone(config) + self.assertIsInstance(config, PretrainedConfig) - model = BertModel.from_pretrained(model_name) - model, loading_info = BertModel.from_pretrained(model_name, output_loading_info=True) - self.assertIsNotNone(model) - self.assertIsInstance(model, PreTrainedModel) + model = BertModel.from_pretrained(model_name) + model, loading_info = BertModel.from_pretrained(model_name, output_loading_info=True) + self.assertIsNotNone(model) + self.assertIsInstance(model, PreTrainedModel) - self.assertEqual(len(loading_info["missing_keys"]), 0) - self.assertEqual(len(loading_info["unexpected_keys"]), 8) - self.assertEqual(len(loading_info["mismatched_keys"]), 0) - self.assertEqual(len(loading_info["error_msgs"]), 0) + self.assertEqual(len(loading_info["missing_keys"]), 0) + self.assertEqual(len(loading_info["unexpected_keys"]), 8) + self.assertEqual(len(loading_info["mismatched_keys"]), 0) + self.assertEqual(len(loading_info["error_msgs"]), 0) - config = BertConfig.from_pretrained(model_name, output_attentions=True, output_hidden_states=True) + config = BertConfig.from_pretrained(model_name, output_attentions=True, output_hidden_states=True) - # Not sure this is the intended behavior. TODO fix Lysandre & Thom - config.name_or_path = model_name + # Not sure this is the intended behavior. TODO fix Lysandre & Thom + config.name_or_path = model_name - model = BertModel.from_pretrained(model_name, output_attentions=True, output_hidden_states=True) - self.assertEqual(model.config.output_hidden_states, True) - self.assertEqual(model.config, config) + model = BertModel.from_pretrained(model_name, output_attentions=True, output_hidden_states=True) + self.assertEqual(model.config.output_hidden_states, True) + self.assertEqual(model.config, config) def test_model_from_pretrained_subfolder(self): config = BertConfig.from_pretrained("hf-internal-testing/tiny-random-bert") diff --git a/tests/utils/test_add_new_model_like.py b/tests/utils/test_add_new_model_like.py index b7eceb6e76c34c..9c150b32bd70d9 100644 --- a/tests/utils/test_add_new_model_like.py +++ b/tests/utils/test_add_new_model_like.py @@ -883,7 +883,7 @@ def test_clean_frameworks_in_init_with_gpt(self): from ...utils import _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available _import_structure = { - "configuration_gpt2": ["GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2OnnxConfig"], + "configuration_gpt2": ["GPT2Config", "GPT2OnnxConfig"], "tokenization_gpt2": ["GPT2Tokenizer"], } @@ -920,7 +920,7 @@ def test_clean_frameworks_in_init_with_gpt(self): _import_structure["modeling_flax_gpt2"] = ["FlaxGPT2Model"] if TYPE_CHECKING: - from .configuration_gpt2 import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2OnnxConfig + from .configuration_gpt2 import GPT2Config, GPT2OnnxConfig from .tokenization_gpt2 import GPT2Tokenizer try: @@ -967,7 +967,7 @@ def test_clean_frameworks_in_init_with_gpt(self): from ...utils import _LazyModule, is_flax_available, is_tf_available, is_torch_available _import_structure = { - "configuration_gpt2": ["GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2OnnxConfig"], + "configuration_gpt2": ["GPT2Config", "GPT2OnnxConfig"], } try: @@ -995,7 +995,7 @@ def test_clean_frameworks_in_init_with_gpt(self): _import_structure["modeling_flax_gpt2"] = ["FlaxGPT2Model"] if TYPE_CHECKING: - from .configuration_gpt2 import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2OnnxConfig + from .configuration_gpt2 import GPT2Config, GPT2OnnxConfig try: if not is_torch_available(): @@ -1033,7 +1033,7 @@ def test_clean_frameworks_in_init_with_gpt(self): from ...utils import _LazyModule, is_tokenizers_available, is_torch_available _import_structure = { - "configuration_gpt2": ["GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2OnnxConfig"], + "configuration_gpt2": ["GPT2Config", "GPT2OnnxConfig"], "tokenization_gpt2": ["GPT2Tokenizer"], } @@ -1054,7 +1054,7 @@ def test_clean_frameworks_in_init_with_gpt(self): _import_structure["modeling_gpt2"] = ["GPT2Model"] if TYPE_CHECKING: - from .configuration_gpt2 import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2OnnxConfig + from .configuration_gpt2 import GPT2Config, GPT2OnnxConfig from .tokenization_gpt2 import GPT2Tokenizer try: @@ -1085,7 +1085,7 @@ def test_clean_frameworks_in_init_with_gpt(self): from ...utils import _LazyModule, is_torch_available _import_structure = { - "configuration_gpt2": ["GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2OnnxConfig"], + "configuration_gpt2": ["GPT2Config", "GPT2OnnxConfig"], } try: @@ -1097,7 +1097,7 @@ def test_clean_frameworks_in_init_with_gpt(self): _import_structure["modeling_gpt2"] = ["GPT2Model"] if TYPE_CHECKING: - from .configuration_gpt2 import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2OnnxConfig + from .configuration_gpt2 import GPT2Config, GPT2OnnxConfig try: if not is_torch_available(): @@ -1135,7 +1135,7 @@ def test_clean_frameworks_in_init_with_vit(self): from ...utils import _LazyModule, is_flax_available, is_tf_available, is_torch_available, is_vision_available _import_structure = { - "configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig"], + "configuration_vit": ["ViTConfig"], } try: @@ -1171,7 +1171,7 @@ def test_clean_frameworks_in_init_with_vit(self): _import_structure["modeling_flax_vit"] = ["FlaxViTModel"] if TYPE_CHECKING: - from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig + from .configuration_vit import ViTConfig try: if not is_vision_available(): @@ -1217,7 +1217,7 @@ def test_clean_frameworks_in_init_with_vit(self): from ...utils import _LazyModule, is_flax_available, is_tf_available, is_torch_available _import_structure = { - "configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig"], + "configuration_vit": ["ViTConfig"], } try: @@ -1245,7 +1245,7 @@ def test_clean_frameworks_in_init_with_vit(self): _import_structure["modeling_flax_vit"] = ["FlaxViTModel"] if TYPE_CHECKING: - from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig + from .configuration_vit import ViTConfig try: if not is_torch_available(): @@ -1283,7 +1283,7 @@ def test_clean_frameworks_in_init_with_vit(self): from ...utils import _LazyModule, is_torch_available, is_vision_available _import_structure = { - "configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig"], + "configuration_vit": ["ViTConfig"], } try: @@ -1303,7 +1303,7 @@ def test_clean_frameworks_in_init_with_vit(self): _import_structure["modeling_vit"] = ["ViTModel"] if TYPE_CHECKING: - from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig + from .configuration_vit import ViTConfig try: if not is_vision_available(): @@ -1333,7 +1333,7 @@ def test_clean_frameworks_in_init_with_vit(self): from ...utils import _LazyModule, is_torch_available _import_structure = { - "configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig"], + "configuration_vit": ["ViTConfig"], } try: @@ -1345,7 +1345,7 @@ def test_clean_frameworks_in_init_with_vit(self): _import_structure["modeling_vit"] = ["ViTModel"] if TYPE_CHECKING: - from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig + from .configuration_vit import ViTConfig try: if not is_torch_available(): From 4ee334284c6578a1557da42c1e017bbac20d9a83 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Wed, 13 Mar 2024 15:41:45 +0100 Subject: [PATCH 02/13] Deprecate archive maps instead of removing them --- src/transformers/__init__.py | 2 + .../models/deprecated/_archive_maps.py | 2602 +++++++++++++++++ 2 files changed, 2604 insertions(+) create mode 100644 src/transformers/models/deprecated/_archive_maps.py diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py index 3fb0bbaaaf09a2..34b80caf7e1567 100644 --- a/src/transformers/__init__.py +++ b/src/transformers/__init__.py @@ -48,6 +48,8 @@ logging, ) +from .models.deprecated._archive_maps import * + logger = logging.get_logger(__name__) # pylint: disable=invalid-name diff --git a/src/transformers/models/deprecated/_archive_maps.py b/src/transformers/models/deprecated/_archive_maps.py new file mode 100644 index 00000000000000..87c4d64fb304a3 --- /dev/null +++ b/src/transformers/models/deprecated/_archive_maps.py @@ -0,0 +1,2602 @@ +from ... import logging +logger = logging.get_logger(__name__) + +class DeprecatedDict(dict): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def __getitem__(self, item): + logger.warning( + "Archive maps are deprecated and will be removed in version v4.39.0 as they are no longer relevant. " + "If looking to get all checkpoints for a given architecture, we recommend using `huggingface_hub` " + "with the list_models method." + ) + return self[item] + + +class DeprecatedList(list): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def __getitem__(self, item): + logger.warning_once( + "Archive maps are deprecated and will be removed in version v4.39.0 as they are no longer relevant. " + "If looking to get all checkpoints for a given architecture, we recommend using `huggingface_hub` " + "with the `list_models` method." + ) + return super().__getitem__(item) + + +ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "albert/albert-base-v1": "https://huggingface.co/albert/albert-base-v1/resolve/main/config.json", + "albert/albert-large-v1": "https://huggingface.co/albert/albert-large-v1/resolve/main/config.json", + "albert/albert-xlarge-v1": "https://huggingface.co/albert/albert-xlarge-v1/resolve/main/config.json", + "albert/albert-xxlarge-v1": "https://huggingface.co/albert/albert-xxlarge-v1/resolve/main/config.json", + "albert/albert-base-v2": "https://huggingface.co/albert/albert-base-v2/resolve/main/config.json", + "albert/albert-large-v2": "https://huggingface.co/albert/albert-large-v2/resolve/main/config.json", + "albert/albert-xlarge-v2": "https://huggingface.co/albert/albert-xlarge-v2/resolve/main/config.json", + "albert/albert-xxlarge-v2": "https://huggingface.co/albert/albert-xxlarge-v2/resolve/main/config.json" +}) + +ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "albert/albert-base-v1", + "albert/albert-large-v1", + "albert/albert-xlarge-v1", + "albert/albert-xxlarge-v1", + "albert/albert-base-v2", + "albert/albert-large-v2", + "albert/albert-xlarge-v2", + "albert/albert-xxlarge-v2" +]) + +TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "albert/albert-base-v1", + "albert/albert-large-v1", + "albert/albert-xlarge-v1", + "albert/albert-xxlarge-v1", + "albert/albert-base-v2", + "albert/albert-large-v2", + "albert/albert-xlarge-v2", + "albert/albert-xxlarge-v2" +]) + +ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "kakaobrain/align-base": "https://huggingface.co/kakaobrain/align-base/resolve/main/config.json" +}) + +ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "kakaobrain/align-base" +]) + +ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "BAAI/AltCLIP": "https://huggingface.co/BAAI/AltCLIP/resolve/main/config.json" +}) + +ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "BAAI/AltCLIP" +]) + +AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "MIT/ast-finetuned-audioset-10-10-0.4593": "https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json" +}) + +AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "MIT/ast-finetuned-audioset-10-10-0.4593" +]) + +AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "huggingface/autoformer-tourism-monthly": "https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json" +}) + +AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "huggingface/autoformer-tourism-monthly" +]) + +BARK_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "suno/bark-small", + "suno/bark" +]) + +BART_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/bart-large" +]) + +BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/beit-base-patch16-224-pt22k": "https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json" +}) + +BEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/beit-base-patch16-224" +]) + +BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json", + "google-bert/bert-large-uncased": "https://huggingface.co/google-bert/bert-large-uncased/resolve/main/config.json", + "google-bert/bert-base-cased": "https://huggingface.co/google-bert/bert-base-cased/resolve/main/config.json", + "google-bert/bert-large-cased": "https://huggingface.co/google-bert/bert-large-cased/resolve/main/config.json", + "google-bert/bert-base-multilingual-uncased": "https://huggingface.co/google-bert/bert-base-multilingual-uncased/resolve/main/config.json", + "google-bert/bert-base-multilingual-cased": "https://huggingface.co/google-bert/bert-base-multilingual-cased/resolve/main/config.json", + "google-bert/bert-base-chinese": "https://huggingface.co/google-bert/bert-base-chinese/resolve/main/config.json", + "google-bert/bert-base-german-cased": "https://huggingface.co/google-bert/bert-base-german-cased/resolve/main/config.json", + "google-bert/bert-large-uncased-whole-word-masking": "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking/resolve/main/config.json", + "google-bert/bert-large-cased-whole-word-masking": "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking/resolve/main/config.json", + "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json", + "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/config.json", + "google-bert/bert-base-cased-finetuned-mrpc": "https://huggingface.co/google-bert/bert-base-cased-finetuned-mrpc/resolve/main/config.json", + "google-bert/bert-base-german-dbmdz-cased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-cased/resolve/main/config.json", + "google-bert/bert-base-german-dbmdz-uncased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-uncased/resolve/main/config.json", + "cl-tohoku/bert-base-japanese": "https://huggingface.co/cl-tohoku/bert-base-japanese/resolve/main/config.json", + "cl-tohoku/bert-base-japanese-whole-word-masking": "https://huggingface.co/cl-tohoku/bert-base-japanese-whole-word-masking/resolve/main/config.json", + "cl-tohoku/bert-base-japanese-char": "https://huggingface.co/cl-tohoku/bert-base-japanese-char/resolve/main/config.json", + "cl-tohoku/bert-base-japanese-char-whole-word-masking": "https://huggingface.co/cl-tohoku/bert-base-japanese-char-whole-word-masking/resolve/main/config.json", + "TurkuNLP/bert-base-finnish-cased-v1": "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/config.json", + "TurkuNLP/bert-base-finnish-uncased-v1": "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/config.json", + "wietsedv/bert-base-dutch-cased": "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/config.json" +}) + +BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google-bert/bert-base-uncased", + "google-bert/bert-large-uncased", + "google-bert/bert-base-cased", + "google-bert/bert-large-cased", + "google-bert/bert-base-multilingual-uncased", + "google-bert/bert-base-multilingual-cased", + "google-bert/bert-base-chinese", + "google-bert/bert-base-german-cased", + "google-bert/bert-large-uncased-whole-word-masking", + "google-bert/bert-large-cased-whole-word-masking", + "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", + "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", + "google-bert/bert-base-cased-finetuned-mrpc", + "google-bert/bert-base-german-dbmdz-cased", + "google-bert/bert-base-german-dbmdz-uncased", + "cl-tohoku/bert-base-japanese", + "cl-tohoku/bert-base-japanese-whole-word-masking", + "cl-tohoku/bert-base-japanese-char", + "cl-tohoku/bert-base-japanese-char-whole-word-masking", + "TurkuNLP/bert-base-finnish-cased-v1", + "TurkuNLP/bert-base-finnish-uncased-v1", + "wietsedv/bert-base-dutch-cased" +]) + +TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google-bert/bert-base-uncased", + "google-bert/bert-large-uncased", + "google-bert/bert-base-cased", + "google-bert/bert-large-cased", + "google-bert/bert-base-multilingual-uncased", + "google-bert/bert-base-multilingual-cased", + "google-bert/bert-base-chinese", + "google-bert/bert-base-german-cased", + "google-bert/bert-large-uncased-whole-word-masking", + "google-bert/bert-large-cased-whole-word-masking", + "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", + "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", + "google-bert/bert-base-cased-finetuned-mrpc", + "cl-tohoku/bert-base-japanese", + "cl-tohoku/bert-base-japanese-whole-word-masking", + "cl-tohoku/bert-base-japanese-char", + "cl-tohoku/bert-base-japanese-char-whole-word-masking", + "TurkuNLP/bert-base-finnish-cased-v1", + "TurkuNLP/bert-base-finnish-uncased-v1", + "wietsedv/bert-base-dutch-cased" +]) + +BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json", + "google/bigbird-roberta-large": "https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json", + "google/bigbird-base-trivia-itc": "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json" +}) + +BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/bigbird-roberta-base", + "google/bigbird-roberta-large", + "google/bigbird-base-trivia-itc" +]) + +BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/bigbird-pegasus-large-arxiv": "https://huggingface.co/google/bigbird-pegasus-large-arxiv/resolve/main/config.json", + "google/bigbird-pegasus-large-pubmed": "https://huggingface.co/google/bigbird-pegasus-large-pubmed/resolve/main/config.json", + "google/bigbird-pegasus-large-bigpatent": "https://huggingface.co/google/bigbird-pegasus-large-bigpatent/resolve/main/config.json" +}) + +BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/bigbird-pegasus-large-arxiv", + "google/bigbird-pegasus-large-pubmed", + "google/bigbird-pegasus-large-bigpatent" +]) + +BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/biogpt": "https://huggingface.co/microsoft/biogpt/resolve/main/config.json" +}) + +BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/biogpt", + "microsoft/BioGPT-Large" +]) + +BIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/bit-50": "https://huggingface.co/google/bit-50/resolve/main/config.json" +}) + +BIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/bit-50" +]) + +BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/config.json" +}) + +BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/blenderbot-3B" +]) + +BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/blenderbot_small-90M" +]) + +BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Salesforce/blip-vqa-base": "https://huggingface.co/Salesforce/blip-vqa-base/resolve/main/config.json", + "Salesforce/blip-vqa-capfit-large": "https://huggingface.co/Salesforce/blip-vqa-base-capfit/resolve/main/config.json", + "Salesforce/blip-image-captioning-base": "https://huggingface.co/Salesforce/blip-image-captioning-base/resolve/main/config.json", + "Salesforce/blip-image-captioning-large": "https://huggingface.co/Salesforce/blip-image-captioning-large/resolve/main/config.json", + "Salesforce/blip-itm-base-coco": "https://huggingface.co/Salesforce/blip-itm-base-coco/resolve/main/config.json", + "Salesforce/blip-itm-large-coco": "https://huggingface.co/Salesforce/blip-itm-large-coco/resolve/main/config.json", + "Salesforce/blip-itm-base-flikr": "https://huggingface.co/Salesforce/blip-itm-base-flikr/resolve/main/config.json", + "Salesforce/blip-itm-large-flikr": "https://huggingface.co/Salesforce/blip-itm-large-flikr/resolve/main/config.json" +}) + +BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Salesforce/blip-vqa-base", + "Salesforce/blip-vqa-capfilt-large", + "Salesforce/blip-image-captioning-base", + "Salesforce/blip-image-captioning-large", + "Salesforce/blip-itm-base-coco", + "Salesforce/blip-itm-large-coco", + "Salesforce/blip-itm-base-flickr", + "Salesforce/blip-itm-large-flickr" +]) + +TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Salesforce/blip-vqa-base", + "Salesforce/blip-vqa-capfilt-large", + "Salesforce/blip-image-captioning-base", + "Salesforce/blip-image-captioning-large", + "Salesforce/blip-itm-base-coco", + "Salesforce/blip-itm-large-coco", + "Salesforce/blip-itm-base-flickr", + "Salesforce/blip-itm-large-flickr" +]) + +BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "salesforce/blip2-opt-2.7b": "https://huggingface.co/salesforce/blip2-opt-2.7b/resolve/main/config.json" +}) + +BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Salesforce/blip2-opt-2.7b" +]) + +BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "bigscience/bloom": "https://huggingface.co/bigscience/bloom/resolve/main/config.json", + "bigscience/bloom-560m": "https://huggingface.co/bigscience/bloom-560m/blob/main/config.json", + "bigscience/bloom-1b1": "https://huggingface.co/bigscience/bloom-1b1/blob/main/config.json", + "bigscience/bloom-1b7": "https://huggingface.co/bigscience/bloom-1b7/blob/main/config.json", + "bigscience/bloom-3b": "https://huggingface.co/bigscience/bloom-3b/blob/main/config.json", + "bigscience/bloom-7b1": "https://huggingface.co/bigscience/bloom-7b1/blob/main/config.json" +}) + +BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "bigscience/bigscience-small-testing", + "bigscience/bloom-560m", + "bigscience/bloom-1b1", + "bigscience/bloom-1b7", + "bigscience/bloom-3b", + "bigscience/bloom-7b1", + "bigscience/bloom" +]) + +BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "BridgeTower/bridgetower-base": "https://huggingface.co/BridgeTower/bridgetower-base/blob/main/config.json", + "BridgeTower/bridgetower-base-itm-mlm": "https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm/blob/main/config.json" +}) + +BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "BridgeTower/bridgetower-base", + "BridgeTower/bridgetower-base-itm-mlm" +]) + +BROS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "jinho8345/bros-base-uncased": "https://huggingface.co/jinho8345/bros-base-uncased/blob/main/config.json", + "jinho8345/bros-large-uncased": "https://huggingface.co/jinho8345/bros-large-uncased/blob/main/config.json" +}) + +BROS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "jinho8345/bros-base-uncased", + "jinho8345/bros-large-uncased" +]) + +CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "almanach/camembert-base": "https://huggingface.co/almanach/camembert-base/resolve/main/config.json", + "umberto-commoncrawl-cased-v1": "https://huggingface.co/Musixmatch/umberto-commoncrawl-cased-v1/resolve/main/config.json", + "umberto-wikipedia-uncased-v1": "https://huggingface.co/Musixmatch/umberto-wikipedia-uncased-v1/resolve/main/config.json" +}) + +CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "almanach/camembert-base", + "Musixmatch/umberto-commoncrawl-cased-v1", + "Musixmatch/umberto-wikipedia-uncased-v1" +]) + +TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) + +CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/canine-s": "https://huggingface.co/google/canine-s/resolve/main/config.json" +}) + +CANINE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/canine-s", + "google/canine-r" +]) + +CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "OFA-Sys/chinese-clip-vit-base-patch16": "https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16/resolve/main/config.json" +}) + +CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "OFA-Sys/chinese-clip-vit-base-patch16" +]) + +CLAP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "laion/clap-htsat-fused", + "laion/clap-htsat-unfused" +]) + +CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/config.json" +}) + +CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai/clip-vit-base-patch32" +]) + +TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai/clip-vit-base-patch32" +]) + +CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "CIDAS/clipseg-rd64": "https://huggingface.co/CIDAS/clipseg-rd64/resolve/main/config.json" +}) + +CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "CIDAS/clipseg-rd64-refined" +]) + +CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "susnato/clvp_dev": "https://huggingface.co/susnato/clvp_dev/resolve/main/config.json" +}) + +CLVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "susnato/clvp_dev" +]) + +CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Salesforce/codegen-350M-nl": "https://huggingface.co/Salesforce/codegen-350M-nl/resolve/main/config.json", + "Salesforce/codegen-350M-multi": "https://huggingface.co/Salesforce/codegen-350M-multi/resolve/main/config.json", + "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/config.json", + "Salesforce/codegen-2B-nl": "https://huggingface.co/Salesforce/codegen-2B-nl/resolve/main/config.json", + "Salesforce/codegen-2B-multi": "https://huggingface.co/Salesforce/codegen-2B-multi/resolve/main/config.json", + "Salesforce/codegen-2B-mono": "https://huggingface.co/Salesforce/codegen-2B-mono/resolve/main/config.json", + "Salesforce/codegen-6B-nl": "https://huggingface.co/Salesforce/codegen-6B-nl/resolve/main/config.json", + "Salesforce/codegen-6B-multi": "https://huggingface.co/Salesforce/codegen-6B-multi/resolve/main/config.json", + "Salesforce/codegen-6B-mono": "https://huggingface.co/Salesforce/codegen-6B-mono/resolve/main/config.json", + "Salesforce/codegen-16B-nl": "https://huggingface.co/Salesforce/codegen-16B-nl/resolve/main/config.json", + "Salesforce/codegen-16B-multi": "https://huggingface.co/Salesforce/codegen-16B-multi/resolve/main/config.json", + "Salesforce/codegen-16B-mono": "https://huggingface.co/Salesforce/codegen-16B-mono/resolve/main/config.json" +}) + +CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Salesforce/codegen-350M-nl", + "Salesforce/codegen-350M-multi", + "Salesforce/codegen-350M-mono", + "Salesforce/codegen-2B-nl", + "Salesforce/codegen-2B-multi", + "Salesforce/codegen-2B-mono", + "Salesforce/codegen-6B-nl", + "Salesforce/codegen-6B-multi", + "Salesforce/codegen-6B-mono", + "Salesforce/codegen-16B-nl", + "Salesforce/codegen-16B-multi", + "Salesforce/codegen-16B-mono" +]) + +CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/conditional-detr-resnet-50": "https://huggingface.co/microsoft/conditional-detr-resnet-50/resolve/main/config.json" +}) + +CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/conditional-detr-resnet-50" +]) + +CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "YituTech/conv-bert-base": "https://huggingface.co/YituTech/conv-bert-base/resolve/main/config.json", + "YituTech/conv-bert-medium-small": "https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/config.json", + "YituTech/conv-bert-small": "https://huggingface.co/YituTech/conv-bert-small/resolve/main/config.json" +}) + +CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "YituTech/conv-bert-base", + "YituTech/conv-bert-medium-small", + "YituTech/conv-bert-small" +]) + +TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "YituTech/conv-bert-base", + "YituTech/conv-bert-medium-small", + "YituTech/conv-bert-small" +]) + +CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/convnext-tiny-224": "https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json" +}) + +CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/convnext-tiny-224" +]) + +CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json" +}) + +CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/convnextv2-tiny-1k-224" +]) + +CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "openbmb/cpm-ant-10b": "https://huggingface.co/openbmb/cpm-ant-10b/blob/main/config.json" +}) + +CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openbmb/cpm-ant-10b" +]) + +CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Salesforce/ctrl": "https://huggingface.co/Salesforce/ctrl/resolve/main/config.json" +}) + +CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Salesforce/ctrl" +]) + +TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Salesforce/ctrl" +]) + +CVT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/cvt-13": "https://huggingface.co/microsoft/cvt-13/resolve/main/config.json" +}) + +CVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/cvt-13", + "microsoft/cvt-13-384", + "microsoft/cvt-13-384-22k", + "microsoft/cvt-21", + "microsoft/cvt-21-384", + "microsoft/cvt-21-384-22k" +]) + +TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/cvt-13", + "microsoft/cvt-13-384", + "microsoft/cvt-13-384-22k", + "microsoft/cvt-21", + "microsoft/cvt-21-384", + "microsoft/cvt-21-384-22k" +]) + +DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/data2vec-text-base": "https://huggingface.co/data2vec/resolve/main/config.json" +}) + +DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/data2vec-vision-base-ft": "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json" +}) + +DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/data2vec-audio-base", + "facebook/data2vec-audio-base-10m", + "facebook/data2vec-audio-base-100h", + "facebook/data2vec-audio-base-960h" +]) + +DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/data2vec-text-base" +]) + +DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/data2vec-vision-base-ft1k" +]) + +DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/config.json", + "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/config.json", + "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/config.json", + "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/config.json", + "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/config.json", + "microsoft/deberta-xlarge-mnli": "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/config.json" +}) + +DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/deberta-base", + "microsoft/deberta-large", + "microsoft/deberta-xlarge", + "microsoft/deberta-base-mnli", + "microsoft/deberta-large-mnli", + "microsoft/deberta-xlarge-mnli" +]) + +TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "kamalkraj/deberta-base" +]) + +DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json", + "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json", + "microsoft/deberta-v2-xlarge-mnli": "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json", + "microsoft/deberta-v2-xxlarge-mnli": "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json" +}) + +DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/deberta-v2-xlarge", + "microsoft/deberta-v2-xxlarge", + "microsoft/deberta-v2-xlarge-mnli", + "microsoft/deberta-v2-xxlarge-mnli" +]) + +TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "kamalkraj/deberta-v2-xlarge" +]) + +DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "edbeeching/decision-transformer-gym-hopper-medium": "https://huggingface.co/edbeeching/decision-transformer-gym-hopper-medium/resolve/main/config.json" +}) + +DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "edbeeching/decision-transformer-gym-hopper-medium" +]) + +DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "SenseTime/deformable-detr": "https://huggingface.co/sensetime/deformable-detr/resolve/main/config.json" +}) + +DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "sensetime/deformable-detr" +]) + +DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/deit-base-distilled-patch16-224": "https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json" +}) + +DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/deit-base-distilled-patch16-224" +]) + +TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/deit-base-distilled-patch16-224" +]) + +MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json" +}) + +MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "speechbrain/m-ctc-t-large" +]) + +OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "s-JoL/Open-Llama-V1": "https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json" +}) + +RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "yjernite/retribert-base-uncased": "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/config.json" +}) + +RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "yjernite/retribert-base-uncased" +]) + +TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "CarlCochet/trajectory-transformer-halfcheetah-medium-v2": "https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2/resolve/main/config.json" +}) + +TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "CarlCochet/trajectory-transformer-halfcheetah-medium-v2" +]) + +TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "transfo-xl/transfo-xl-wt103": "https://huggingface.co/transfo-xl/transfo-xl-wt103/resolve/main/config.json" +}) + +TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "transfo-xl/transfo-xl-wt103" +]) + +TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "transfo-xl/transfo-xl-wt103" +]) + +VAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Visual-Attention-Network/van-base": "https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json" +}) + +VAN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Visual-Attention-Network/van-base" +]) + +DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "LiheYoung/depth-anything-small-hf": "https://huggingface.co/LiheYoung/depth-anything-small-hf/resolve/main/config.json" +}) + +DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "LiheYoung/depth-anything-small-hf" +]) + +DETA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "ut/deta": "https://huggingface.co/ut/deta/resolve/main/config.json" +}) + +DETA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "jozhang97/deta-swin-large-o365" +]) + +DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/detr-resnet-50": "https://huggingface.co/facebook/detr-resnet-50/resolve/main/config.json" +}) + +DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/detr-resnet-50" +]) + +DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "shi-labs/dinat-mini-in1k-224": "https://huggingface.co/shi-labs/dinat-mini-in1k-224/resolve/main/config.json" +}) + +DINAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "shi-labs/dinat-mini-in1k-224" +]) + +DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/dinov2-base": "https://huggingface.co/facebook/dinov2-base/resolve/main/config.json" +}) + +DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/dinov2-base" +]) + +DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/config.json", + "distilbert-base-uncased-distilled-squad": "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json", + "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/config.json", + "distilbert-base-cased-distilled-squad": "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json", + "distilbert-base-german-cased": "https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json", + "distilbert-base-multilingual-cased": "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json", + "distilbert-base-uncased-finetuned-sst-2-english": "https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json" +}) + +DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "distilbert-base-uncased", + "distilbert-base-uncased-distilled-squad", + "distilbert-base-cased", + "distilbert-base-cased-distilled-squad", + "distilbert-base-german-cased", + "distilbert-base-multilingual-cased", + "distilbert-base-uncased-finetuned-sst-2-english" +]) + +TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "distilbert-base-uncased", + "distilbert-base-uncased-distilled-squad", + "distilbert-base-cased", + "distilbert-base-cased-distilled-squad", + "distilbert-base-multilingual-cased", + "distilbert-base-uncased-finetuned-sst-2-english" +]) + +DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "naver-clova-ix/donut-base": "https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json" +}) + +DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "naver-clova-ix/donut-base" +]) + +DPR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/dpr-ctx_encoder-single-nq-base": "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json", + "facebook/dpr-question_encoder-single-nq-base": "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json", + "facebook/dpr-reader-single-nq-base": "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json", + "facebook/dpr-ctx_encoder-multiset-base": "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json", + "facebook/dpr-question_encoder-multiset-base": "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json", + "facebook/dpr-reader-multiset-base": "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json" +}) + +DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/dpr-ctx_encoder-single-nq-base", + "facebook/dpr-ctx_encoder-multiset-base" +]) + +DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/dpr-question_encoder-single-nq-base", + "facebook/dpr-question_encoder-multiset-base" +]) + +DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/dpr-reader-single-nq-base", + "facebook/dpr-reader-multiset-base" +]) + +TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/dpr-ctx_encoder-single-nq-base", + "facebook/dpr-ctx_encoder-multiset-base" +]) + +TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/dpr-question_encoder-single-nq-base", + "facebook/dpr-question_encoder-multiset-base" +]) + +TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/dpr-reader-single-nq-base", + "facebook/dpr-reader-multiset-base" +]) + +DPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Intel/dpt-large": "https://huggingface.co/Intel/dpt-large/resolve/main/config.json" +}) + +DPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Intel/dpt-large", + "Intel/dpt-hybrid-midas" +]) + +EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "snap-research/efficientformer-l1-300": "https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json" +}) + +EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "snap-research/efficientformer-l1-300" +]) + +TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "snap-research/efficientformer-l1-300" +]) + +EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/efficientnet-b7": "https://huggingface.co/google/efficientnet-b7/resolve/main/config.json" +}) + +EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/efficientnet-b7" +]) + +ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/electra-small-generator": "https://huggingface.co/google/electra-small-generator/resolve/main/config.json", + "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/config.json", + "google/electra-large-generator": "https://huggingface.co/google/electra-large-generator/resolve/main/config.json", + "google/electra-small-discriminator": "https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json", + "google/electra-base-discriminator": "https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json", + "google/electra-large-discriminator": "https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json" +}) + +ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/electra-small-generator", + "google/electra-base-generator", + "google/electra-large-generator", + "google/electra-small-discriminator", + "google/electra-base-discriminator", + "google/electra-large-discriminator" +]) + +TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/electra-small-generator", + "google/electra-base-generator", + "google/electra-large-generator", + "google/electra-small-discriminator", + "google/electra-base-discriminator", + "google/electra-large-discriminator" +]) + +ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/encodec_24khz": "https://huggingface.co/facebook/encodec_24khz/resolve/main/config.json", + "facebook/encodec_48khz": "https://huggingface.co/facebook/encodec_48khz/resolve/main/config.json" +}) + +ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/encodec_24khz", + "facebook/encodec_48khz" +]) + +ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "nghuyong/ernie-1.0-base-zh": "https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json", + "nghuyong/ernie-2.0-base-en": "https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json", + "nghuyong/ernie-2.0-large-en": "https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json", + "nghuyong/ernie-3.0-base-zh": "https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-medium-zh": "https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-mini-zh": "https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-micro-zh": "https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-nano-zh": "https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json", + "nghuyong/ernie-gram-zh": "https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json", + "nghuyong/ernie-health-zh": "https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json" +}) + +ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "nghuyong/ernie-1.0-base-zh", + "nghuyong/ernie-2.0-base-en", + "nghuyong/ernie-2.0-large-en", + "nghuyong/ernie-3.0-base-zh", + "nghuyong/ernie-3.0-medium-zh", + "nghuyong/ernie-3.0-mini-zh", + "nghuyong/ernie-3.0-micro-zh", + "nghuyong/ernie-3.0-nano-zh", + "nghuyong/ernie-gram-zh", + "nghuyong/ernie-health-zh" +]) + +ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "susnato/ernie-m-base_pytorch": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json", + "susnato/ernie-m-large_pytorch": "https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json" +}) + +ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "susnato/ernie-m-base_pytorch", + "susnato/ernie-m-large_pytorch" +]) + +ESM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/esm-1b": "https://huggingface.co/facebook/esm-1b/resolve/main/config.json" +}) + +ESM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/esm2_t6_8M_UR50D", + "facebook/esm2_t12_35M_UR50D" +]) + +FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "tiiuae/falcon-40b": "https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json", + "tiiuae/falcon-7b": "https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json" +}) + +FALCON_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "tiiuae/falcon-40b", + "tiiuae/falcon-40b-instruct", + "tiiuae/falcon-7b", + "tiiuae/falcon-7b-instruct", + "tiiuae/falcon-rw-7b", + "tiiuae/falcon-rw-1b" +]) + +FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "espnet/fastspeech2_conformer_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_hifigan/raw/main/config.json" +}) + +FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "espnet/fastspeech2_conformer": "https://huggingface.co/espnet/fastspeech2_conformer/raw/main/config.json" +}) + +FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "espnet/fastspeech2_conformer_with_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_with_hifigan/raw/main/config.json" +}) + +FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "espnet/fastspeech2_conformer" +]) + +FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "flaubert/flaubert_small_cased": "https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/config.json", + "flaubert/flaubert_base_uncased": "https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/config.json", + "flaubert/flaubert_base_cased": "https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/config.json", + "flaubert/flaubert_large_cased": "https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/config.json" +}) + +FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "flaubert/flaubert_small_cased", + "flaubert/flaubert_base_uncased", + "flaubert/flaubert_base_cased", + "flaubert/flaubert_large_cased" +]) + +TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) + +FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/flava-full": "https://huggingface.co/facebook/flava-full/resolve/main/config.json" +}) + +FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/flava-full" +]) + +FNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/config.json", + "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/config.json" +}) + +FNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/fnet-base", + "google/fnet-large" +]) + +FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json" +}) + +FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/focalnet-tiny" +]) + +FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) + +FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/config.json", + "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json", + "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/config.json", + "funnel-transformer/medium-base": "https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json", + "funnel-transformer/intermediate": "https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json", + "funnel-transformer/intermediate-base": "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json", + "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/config.json", + "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json", + "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json", + "funnel-transformer/xlarge-base": "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json" +}) + +FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "funnel-transformer/small", + "funnel-transformer/small-base", + "funnel-transformer/medium", + "funnel-transformer/medium-base", + "funnel-transformer/intermediate", + "funnel-transformer/intermediate-base", + "funnel-transformer/large", + "funnel-transformer/large-base", + "funnel-transformer/xlarge-base", + "funnel-transformer/xlarge" +]) + +TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "funnel-transformer/small", + "funnel-transformer/small-base", + "funnel-transformer/medium", + "funnel-transformer/medium-base", + "funnel-transformer/intermediate", + "funnel-transformer/intermediate-base", + "funnel-transformer/large", + "funnel-transformer/large-base", + "funnel-transformer/xlarge-base", + "funnel-transformer/xlarge" +]) + +FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "adept/fuyu-8b": "https://huggingface.co/adept/fuyu-8b/resolve/main/config.json" +}) + +GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) + +GIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/git-base": "https://huggingface.co/microsoft/git-base/resolve/main/config.json" +}) + +GIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/git-base" +]) + +GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "vinvino02/glpn-kitti": "https://huggingface.co/vinvino02/glpn-kitti/resolve/main/config.json" +}) + +GLPN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "vinvino02/glpn-kitti" +]) + +GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/config.json", + "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/config.json", + "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/config.json", + "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/config.json", + "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/config.json" +}) + +GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai-community/gpt2", + "openai-community/gpt2-medium", + "openai-community/gpt2-large", + "openai-community/gpt2-xl", + "distilbert/distilgpt2" +]) + +TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai-community/gpt2", + "openai-community/gpt2-medium", + "openai-community/gpt2-large", + "openai-community/gpt2-xl", + "distilbert/distilgpt2" +]) + +GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json" +}) + +GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "bigcode/gpt_bigcode-santacoder" +]) + +GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "EleutherAI/gpt-neo-1.3B": "https://huggingface.co/EleutherAI/gpt-neo-1.3B/resolve/main/config.json" +}) + +GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "EleutherAI/gpt-neo-1.3B" +]) + +GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "EleutherAI/gpt-neox-20b": "https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/config.json" +}) + +GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "EleutherAI/gpt-neox-20b" +]) + +GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "abeja/gpt-neox-japanese-2.7b": "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json" +}) + +GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json" +]) + +GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "EleutherAI/gpt-j-6B": "https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json" +}) + +GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "EleutherAI/gpt-j-6B" +]) + +GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "tanreinama/GPTSAN-2.8B-spout_is_uniform": "https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json" +}) + +GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Tanrei/GPTSAN-japanese" +]) + +GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "graphormer-base": "https://huggingface.co/clefourrier/graphormer-base-pcqm4mv2/resolve/main/config.json" +}) + +GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "clefourrier/graphormer-base-pcqm4mv1", + "clefourrier/graphormer-base-pcqm4mv2" +]) + +GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "nvidia/groupvit-gcc-yfcc": "https://huggingface.co/nvidia/groupvit-gcc-yfcc/resolve/main/config.json" +}) + +GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "nvidia/groupvit-gcc-yfcc" +]) + +TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "nvidia/groupvit-gcc-yfcc" +]) + +HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/hubert-base-ls960": "https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json" +}) + +HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/hubert-base-ls960" +]) + +TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/hubert-base-ls960" +]) + +IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "kssteven/ibert-roberta-base": "https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json", + "kssteven/ibert-roberta-large": "https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json", + "kssteven/ibert-roberta-large-mnli": "https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json" +}) + +IBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "kssteven/ibert-roberta-base", + "kssteven/ibert-roberta-large", + "kssteven/ibert-roberta-large-mnli" +]) + +IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "HuggingFaceM4/idefics-9b": "https://huggingface.co/HuggingFaceM4/idefics-9b/blob/main/config.json", + "HuggingFaceM4/idefics-80b": "https://huggingface.co/HuggingFaceM4/idefics-80b/blob/main/config.json" +}) + +IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "HuggingFaceM4/idefics-9b", + "HuggingFaceM4/idefics-80b" +]) + +IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "openai/imagegpt-small": "", + "openai/imagegpt-medium": "", + "openai/imagegpt-large": "" +}) + +IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai/imagegpt-small", + "openai/imagegpt-medium", + "openai/imagegpt-large" +]) + +INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "huggingface/informer-tourism-monthly": "https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json" +}) + +INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "huggingface/informer-tourism-monthly" +]) + +INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Salesforce/instruct-blip-flan-t5": "https://huggingface.co/Salesforce/instruct-blip-flan-t5/resolve/main/config.json" +}) + +INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Salesforce/instructblip-flan-t5-xl" +]) + +JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "openai/jukebox-5b-lyrics": "https://huggingface.co/openai/jukebox-5b-lyrics/blob/main/config.json", + "openai/jukebox-1b-lyrics": "https://huggingface.co/openai/jukebox-1b-lyrics/blob/main/config.json" +}) + +JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai/jukebox-1b-lyrics", + "openai/jukebox-5b-lyrics" +]) + +KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/kosmos-2-patch14-224": "https://huggingface.co/microsoft/kosmos-2-patch14-224/resolve/main/config.json" +}) + +KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/kosmos-2-patch14-224" +]) + +LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/layoutlm-base-uncased": "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/config.json", + "microsoft/layoutlm-large-uncased": "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/config.json" +}) + +LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "layoutlm-base-uncased", + "layoutlm-large-uncased" +]) + +TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/layoutlm-base-uncased", + "microsoft/layoutlm-large-uncased" +]) + +LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "layoutlmv2-base-uncased": "https://huggingface.co/microsoft/layoutlmv2-base-uncased/resolve/main/config.json", + "layoutlmv2-large-uncased": "https://huggingface.co/microsoft/layoutlmv2-large-uncased/resolve/main/config.json" +}) + +LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/layoutlmv2-base-uncased", + "microsoft/layoutlmv2-large-uncased" +]) + +LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/resolve/main/config.json" +}) + +LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/layoutlmv3-base", + "microsoft/layoutlmv3-large" +]) + +TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/layoutlmv3-base", + "microsoft/layoutlmv3-large" +]) + +LED_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/config.json" +}) + +LED_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "allenai/led-base-16384" +]) + +LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/levit-128S": "https://huggingface.co/facebook/levit-128S/resolve/main/config.json" +}) + +LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/levit-128S" +]) + +LILT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "SCUT-DLVCLab/lilt-roberta-en-base": "https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base/resolve/main/config.json" +}) + +LILT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "SCUT-DLVCLab/lilt-roberta-en-base" +]) + +LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) + +LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "llava-hf/llava-v1.5-7b": "https://huggingface.co/llava-hf/llava-v1.5-7b/resolve/main/config.json" +}) + +LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "llava-hf/llava-1.5-7b-hf", + "llava-hf/llava-1.5-13b-hf", + "llava-hf/bakLlava-v1-hf" +]) + +LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/config.json", + "allenai/longformer-large-4096": "https://huggingface.co/allenai/longformer-large-4096/resolve/main/config.json", + "allenai/longformer-large-4096-finetuned-triviaqa": "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/config.json", + "allenai/longformer-base-4096-extra.pos.embd.only": "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/config.json", + "allenai/longformer-large-4096-extra.pos.embd.only": "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/config.json" +}) + +LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "allenai/longformer-base-4096", + "allenai/longformer-large-4096", + "allenai/longformer-large-4096-finetuned-triviaqa", + "allenai/longformer-base-4096-extra.pos.embd.only", + "allenai/longformer-large-4096-extra.pos.embd.only" +]) + +TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "allenai/longformer-base-4096", + "allenai/longformer-large-4096", + "allenai/longformer-large-4096-finetuned-triviaqa", + "allenai/longformer-base-4096-extra.pos.embd.only", + "allenai/longformer-large-4096-extra.pos.embd.only" +]) + +LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/long-t5-local-base": "https://huggingface.co/google/long-t5-local-base/blob/main/config.json", + "google/long-t5-local-large": "https://huggingface.co/google/long-t5-local-large/blob/main/config.json", + "google/long-t5-tglobal-base": "https://huggingface.co/google/long-t5-tglobal-base/blob/main/config.json", + "google/long-t5-tglobal-large": "https://huggingface.co/google/long-t5-tglobal-large/blob/main/config.json" +}) + +LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/long-t5-local-base", + "google/long-t5-local-large", + "google/long-t5-tglobal-base", + "google/long-t5-tglobal-large" +]) + +LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/config.json", + "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/config.json" +}) + +LUKE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "studio-ousia/luke-base", + "studio-ousia/luke-large" +]) + +LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json" +}) + +TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "unc-nlp/lxmert-base-uncased" +]) + +M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/m2m100_418M": "https://huggingface.co/facebook/m2m100_418M/resolve/main/config.json" +}) + +M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/m2m100_418M" +]) + +MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "state-spaces/mamba-2.8b": "https://huggingface.co/state-spaces/mamba-2.8b/resolve/main/config.json" +}) + +MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) + +MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/config.json", + "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/config.json" +}) + +MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/markuplm-base", + "microsoft/markuplm-large" +]) + +MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/mask2former-swin-small-coco-instance": "https://huggingface.co/facebook/mask2former-swin-small-coco-instance/blob/main/config.json" +}) + +MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/mask2former-swin-small-coco-instance" +]) + +MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/maskformer-swin-base-ade": "https://huggingface.co/facebook/maskformer-swin-base-ade/blob/main/config.json" +}) + +MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/maskformer-swin-base-ade" +]) + +MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "mnaylor/mega-base-wikitext": "https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json" +}) + +MEGA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "mnaylor/mega-base-wikitext" +]) + +MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) + +MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "nvidia/megatron-bert-cased-345m" +]) + +MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "alibaba-damo/mgp-str-base": "https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json" +}) + +MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "alibaba-damo/mgp-str-base" +]) + +MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "mistralai/Mistral-7B-v0.1": "https://huggingface.co/mistralai/Mistral-7B-v0.1/resolve/main/config.json", + "mistralai/Mistral-7B-Instruct-v0.1": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1/resolve/main/config.json" +}) + +MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "mistral-ai/Mixtral-8x7B": "https://huggingface.co/mistral-ai/Mixtral-8x7B/resolve/main/config.json" +}) + +MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/config.json" +}) + +MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/mobilebert-uncased" +]) + +TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/mobilebert-uncased" +]) + +MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/mobilenet_v1_1.0_224": "https://huggingface.co/google/mobilenet_v1_1.0_224/resolve/main/config.json", + "google/mobilenet_v1_0.75_192": "https://huggingface.co/google/mobilenet_v1_0.75_192/resolve/main/config.json" +}) + +MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/mobilenet_v1_1.0_224", + "google/mobilenet_v1_0.75_192" +]) + +MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/mobilenet_v2_1.4_224": "https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json", + "google/mobilenet_v2_1.0_224": "https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json", + "google/mobilenet_v2_0.75_160": "https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json", + "google/mobilenet_v2_0.35_96": "https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json" +}) + +MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/mobilenet_v2_1.4_224", + "google/mobilenet_v2_1.0_224", + "google/mobilenet_v2_0.37_160", + "google/mobilenet_v2_0.35_96" +]) + +MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "apple/mobilevit-small": "https://huggingface.co/apple/mobilevit-small/resolve/main/config.json", + "apple/mobilevit-x-small": "https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json", + "apple/mobilevit-xx-small": "https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json", + "apple/deeplabv3-mobilevit-small": "https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json", + "apple/deeplabv3-mobilevit-x-small": "https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json", + "apple/deeplabv3-mobilevit-xx-small": "https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json" +}) + +MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "apple/mobilevit-small", + "apple/mobilevit-x-small", + "apple/mobilevit-xx-small", + "apple/deeplabv3-mobilevit-small", + "apple/deeplabv3-mobilevit-x-small", + "apple/deeplabv3-mobilevit-xx-small" +]) + +TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "apple/mobilevit-small", + "apple/mobilevit-x-small", + "apple/mobilevit-xx-small", + "apple/deeplabv3-mobilevit-small", + "apple/deeplabv3-mobilevit-x-small", + "apple/deeplabv3-mobilevit-xx-small" +]) + +MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "apple/mobilevitv2-1.0": "https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json" +}) + +MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "apple/mobilevitv2-1.0-imagenet1k-256" +]) + +MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/config.json" +}) + +MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/mpnet-base" +]) + +TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/mpnet-base" +]) + +MPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "mosaicml/mpt-7b": "https://huggingface.co/mosaicml/mpt-7b/resolve/main/config.json" +}) + +MPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "mosaicml/mpt-7b", + "mosaicml/mpt-7b-storywriter", + "mosaicml/mpt-7b-instruct", + "mosaicml/mpt-7b-8k", + "mosaicml/mpt-7b-8k-instruct", + "mosaicml/mpt-7b-8k-chat", + "mosaicml/mpt-30b", + "mosaicml/mpt-30b-instruct", + "mosaicml/mpt-30b-chat" +]) + +MRA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "uw-madison/mra-base-512-4": "https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json" +}) + +MRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "uw-madison/mra-base-512-4" +]) + +MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/musicgen-small": "https://huggingface.co/facebook/musicgen-small/resolve/main/config.json" +}) + +MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/musicgen-small" +]) + +MVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "RUCAIBox/mvp", + "RUCAIBox/mvp-data-to-text", + "RUCAIBox/mvp-open-dialog", + "RUCAIBox/mvp-question-answering", + "RUCAIBox/mvp-question-generation", + "RUCAIBox/mvp-story", + "RUCAIBox/mvp-summarization", + "RUCAIBox/mvp-task-dialog", + "RUCAIBox/mtl-data-to-text", + "RUCAIBox/mtl-multi-task", + "RUCAIBox/mtl-open-dialog", + "RUCAIBox/mtl-question-answering", + "RUCAIBox/mtl-question-generation", + "RUCAIBox/mtl-story", + "RUCAIBox/mtl-summarization" +]) + +NAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "shi-labs/nat-mini-in1k-224": "https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json" +}) + +NAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "shi-labs/nat-mini-in1k-224" +]) + +NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "sijunhe/nezha-cn-base": "https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json" +}) + +NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "sijunhe/nezha-cn-base", + "sijunhe/nezha-cn-large", + "sijunhe/nezha-base-wwm", + "sijunhe/nezha-large-wwm" +]) + +NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/nllb-moe-54B": "https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json" +}) + +NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/nllb-moe-54b" +]) + +NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "uw-madison/nystromformer-512": "https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json" +}) + +NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "uw-madison/nystromformer-512" +]) + +ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "shi-labs/oneformer_ade20k_swin_tiny": "https://huggingface.co/shi-labs/oneformer_ade20k_swin_tiny/blob/main/config.json" +}) + +ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "shi-labs/oneformer_ade20k_swin_tiny" +]) + +OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/config.json" +}) + +OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai-community/openai-gpt" +]) + +TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai-community/openai-gpt" +]) + +OPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/opt-125m", + "facebook/opt-350m", + "facebook/opt-1.3b", + "facebook/opt-2.7b", + "facebook/opt-6.7b", + "facebook/opt-13b", + "facebook/opt-30b" +]) + +OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/owlv2-base-patch16": "https://huggingface.co/google/owlv2-base-patch16/resolve/main/config.json" +}) + +OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/owlv2-base-patch16-ensemble" +]) + +OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/owlvit-base-patch32": "https://huggingface.co/google/owlvit-base-patch32/resolve/main/config.json", + "google/owlvit-base-patch16": "https://huggingface.co/google/owlvit-base-patch16/resolve/main/config.json", + "google/owlvit-large-patch14": "https://huggingface.co/google/owlvit-large-patch14/resolve/main/config.json" +}) + +OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/owlvit-base-patch32", + "google/owlvit-base-patch16", + "google/owlvit-large-patch14" +]) + +PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "ibm/patchtsmixer-etth1-pretrain": "https://huggingface.co/ibm/patchtsmixer-etth1-pretrain/resolve/main/config.json" +}) + +PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "ibm/patchtsmixer-etth1-pretrain" +]) + +PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "ibm/patchtst-base": "https://huggingface.co/ibm/patchtst-base/resolve/main/config.json" +}) + +PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "ibm/patchtst-etth1-pretrain" +]) + +PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/pegasus-large": "https://huggingface.co/google/pegasus-large/resolve/main/config.json" +}) + +PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/pegasus-x-base": "https://huggingface.co/google/pegasus-x-base/resolve/main/config.json", + "google/pegasus-x-large": "https://huggingface.co/google/pegasus-x-large/resolve/main/config.json" +}) + +PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/pegasus-x-base", + "google/pegasus-x-large" +]) + +PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "deepmind/language-perceiver": "https://huggingface.co/deepmind/language-perceiver/resolve/main/config.json" +}) + +PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "deepmind/language-perceiver" +]) + +PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "adept/persimmon-8b-base": "https://huggingface.co/adept/persimmon-8b-base/resolve/main/config.json" +}) + +PHI_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/phi-1": "https://huggingface.co/microsoft/phi-1/resolve/main/config.json", + "microsoft/phi-1_5": "https://huggingface.co/microsoft/phi-1_5/resolve/main/config.json", + "microsoft/phi-2": "https://huggingface.co/microsoft/phi-2/resolve/main/config.json" +}) + +PHI_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/phi-1", + "microsoft/phi-1_5", + "microsoft/phi-2" +]) + +PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/pix2struct-textcaps-base": "https://huggingface.co/google/pix2struct-textcaps-base/resolve/main/config.json" +}) + +PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/pix2struct-textcaps-base", + "google/pix2struct-textcaps-large", + "google/pix2struct-base", + "google/pix2struct-large", + "google/pix2struct-ai2d-base", + "google/pix2struct-ai2d-large", + "google/pix2struct-widget-captioning-base", + "google/pix2struct-widget-captioning-large", + "google/pix2struct-screen2words-base", + "google/pix2struct-screen2words-large", + "google/pix2struct-docvqa-base", + "google/pix2struct-docvqa-large", + "google/pix2struct-ocrvqa-base", + "google/pix2struct-ocrvqa-large", + "google/pix2struct-chartqa-base", + "google/pix2struct-inforgraphics-vqa-base", + "google/pix2struct-inforgraphics-vqa-large" +]) + +PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "uclanlp/plbart-base": "https://huggingface.co/uclanlp/plbart-base/resolve/main/config.json" +}) + +PLBART_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "uclanlp/plbart-base", + "uclanlp/plbart-cs-java", + "uclanlp/plbart-multi_task-all" +]) + +POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "sail/poolformer_s12": "https://huggingface.co/sail/poolformer_s12/resolve/main/config.json" +}) + +POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "sail/poolformer_s12" +]) + +POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "sweetcocoa/pop2piano": "https://huggingface.co/sweetcocoa/pop2piano/blob/main/config.json" +}) + +POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "sweetcocoa/pop2piano" +]) + +PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/prophetnet-large-uncased": "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json" +}) + +PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/prophetnet-large-uncased" +]) + +PVT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "pvt-tiny-224": "https://huggingface.co/Zetatech/pvt-tiny-224" +}) + +PVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Zetatech/pvt-tiny-224" +]) + +QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json" +}) + +QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google-bert/bert-base-uncased" +]) + +QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Qwen/Qwen2-7B-beta": "https://huggingface.co/Qwen/Qwen2-7B-beta/resolve/main/config.json" +}) + +REALM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/realm-cc-news-pretrained-embedder": "https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json", + "google/realm-cc-news-pretrained-encoder": "https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json", + "google/realm-cc-news-pretrained-scorer": "https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json", + "google/realm-cc-news-pretrained-openqa": "https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json", + "google/realm-orqa-nq-openqa": "https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json", + "google/realm-orqa-nq-reader": "https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json", + "google/realm-orqa-wq-openqa": "https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json", + "google/realm-orqa-wq-reader": "https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json" +}) + +REALM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/realm-cc-news-pretrained-embedder", + "google/realm-cc-news-pretrained-encoder", + "google/realm-cc-news-pretrained-scorer", + "google/realm-cc-news-pretrained-openqa", + "google/realm-orqa-nq-openqa", + "google/realm-orqa-nq-reader", + "google/realm-orqa-wq-openqa", + "google/realm-orqa-wq-reader" +]) + +REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/reformer-crime-and-punishment": "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json", + "google/reformer-enwik8": "https://huggingface.co/google/reformer-enwik8/resolve/main/config.json" +}) + +REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/reformer-crime-and-punishment", + "google/reformer-enwik8" +]) + +REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/regnet-y-040": "https://huggingface.co/facebook/regnet-y-040/blob/main/config.json" +}) + +REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/regnet-y-040" +]) + +TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/regnet-y-040" +]) + +REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/rembert": "https://huggingface.co/google/rembert/resolve/main/config.json" +}) + +REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/rembert" +]) + +TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/rembert" +]) + +RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/resnet-50": "https://huggingface.co/microsoft/resnet-50/blob/main/config.json" +}) + +RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/resnet-50" +]) + +TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/resnet-50" +]) + +ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/config.json", + "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/config.json", + "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/config.json", + "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/config.json", + "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/config.json", + "openai-community/roberta-large-openai-detector": "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/config.json" +}) + +ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "FacebookAI/roberta-base", + "FacebookAI/roberta-large", + "FacebookAI/roberta-large-mnli", + "distilbert/distilroberta-base", + "openai-community/roberta-base-openai-detector", + "openai-community/roberta-large-openai-detector" +]) + +TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "FacebookAI/roberta-base", + "FacebookAI/roberta-large", + "FacebookAI/roberta-large-mnli", + "distilbert/distilroberta-base" +]) + +ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "andreasmadsen/efficient_mlm_m0.40": "https://huggingface.co/andreasmadsen/efficient_mlm_m0.40/resolve/main/config.json" +}) + +ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "andreasmadsen/efficient_mlm_m0.15", + "andreasmadsen/efficient_mlm_m0.20", + "andreasmadsen/efficient_mlm_m0.30", + "andreasmadsen/efficient_mlm_m0.40", + "andreasmadsen/efficient_mlm_m0.50", + "andreasmadsen/efficient_mlm_m0.60", + "andreasmadsen/efficient_mlm_m0.70", + "andreasmadsen/efficient_mlm_m0.80" +]) + +TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "andreasmadsen/efficient_mlm_m0.15", + "andreasmadsen/efficient_mlm_m0.20", + "andreasmadsen/efficient_mlm_m0.30", + "andreasmadsen/efficient_mlm_m0.40", + "andreasmadsen/efficient_mlm_m0.50", + "andreasmadsen/efficient_mlm_m0.60", + "andreasmadsen/efficient_mlm_m0.70", + "andreasmadsen/efficient_mlm_m0.80" +]) + +ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "weiweishi/roc-bert-base-zh": "https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json" +}) + +ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "weiweishi/roc-bert-base-zh" +]) + +ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/config.json", + "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/config.json", + "junnyu/roformer_chinese_char_small": "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/config.json", + "junnyu/roformer_chinese_char_base": "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/config.json", + "junnyu/roformer_small_discriminator": "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/config.json", + "junnyu/roformer_small_generator": "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/config.json" +}) + +ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "junnyu/roformer_chinese_small", + "junnyu/roformer_chinese_base", + "junnyu/roformer_chinese_char_small", + "junnyu/roformer_chinese_char_base", + "junnyu/roformer_small_discriminator", + "junnyu/roformer_small_generator" +]) + +TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "junnyu/roformer_chinese_small", + "junnyu/roformer_chinese_base", + "junnyu/roformer_chinese_char_small", + "junnyu/roformer_chinese_char_base", + "junnyu/roformer_small_discriminator", + "junnyu/roformer_small_generator" +]) + +RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "RWKV/rwkv-4-169m-pile": "https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json", + "RWKV/rwkv-4-430m-pile": "https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json", + "RWKV/rwkv-4-1b5-pile": "https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json", + "RWKV/rwkv-4-3b-pile": "https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json", + "RWKV/rwkv-4-7b-pile": "https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json", + "RWKV/rwkv-4-14b-pile": "https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json", + "RWKV/rwkv-raven-1b5": "https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json", + "RWKV/rwkv-raven-3b": "https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json", + "RWKV/rwkv-raven-7b": "https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json", + "RWKV/rwkv-raven-14b": "https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json" +}) + +RWKV_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "RWKV/rwkv-4-169m-pile", + "RWKV/rwkv-4-430m-pile", + "RWKV/rwkv-4-1b5-pile", + "RWKV/rwkv-4-3b-pile", + "RWKV/rwkv-4-7b-pile", + "RWKV/rwkv-4-14b-pile", + "RWKV/rwkv-raven-1b5", + "RWKV/rwkv-raven-3b", + "RWKV/rwkv-raven-7b", + "RWKV/rwkv-raven-14b" +]) + +SAM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/sam-vit-huge": "https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json", + "facebook/sam-vit-large": "https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json", + "facebook/sam-vit-base": "https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json" +}) + +SAM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/sam-vit-huge", + "facebook/sam-vit-large", + "facebook/sam-vit-base" +]) + +TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/sam-vit-huge", + "facebook/sam-vit-large", + "facebook/sam-vit-base" +]) + +SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/hf-seamless-m4t-medium": "https://huggingface.co/facebook/hf-seamless-m4t-medium/resolve/main/config.json" +}) + +SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/hf-seamless-m4t-medium" +]) + +SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "": "https://huggingface.co//resolve/main/config.json" +}) + +SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/seamless-m4t-v2-large" +]) + +SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "nvidia/segformer-b0-finetuned-ade-512-512": "https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json" +}) + +SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "nvidia/segformer-b0-finetuned-ade-512-512" +]) + +TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "nvidia/segformer-b0-finetuned-ade-512-512" +]) + +SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "BAAI/seggpt-vit-large": "https://huggingface.co/BAAI/seggpt-vit-large/resolve/main/config.json" +}) + +SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "BAAI/seggpt-vit-large" +]) + +SEW_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "asapp/sew-tiny-100k": "https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json" +}) + +SEW_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "asapp/sew-tiny-100k", + "asapp/sew-small-100k", + "asapp/sew-mid-100k" +]) + +SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "asapp/sew-d-tiny-100k": "https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json" +}) + +SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "asapp/sew-d-tiny-100k", + "asapp/sew-d-small-100k", + "asapp/sew-d-mid-100k", + "asapp/sew-d-mid-k127-100k", + "asapp/sew-d-base-100k", + "asapp/sew-d-base-plus-100k", + "asapp/sew-d-mid-400k", + "asapp/sew-d-mid-k127-400k", + "asapp/sew-d-base-plus-400k" +]) + +SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/siglip-base-patch16-224": "https://huggingface.co/google/siglip-base-patch16-224/resolve/main/config.json" +}) + +SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/siglip-base-patch16-224" +]) + +SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/s2t-small-librispeech-asr": "https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json" +}) + +SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/s2t-small-librispeech-asr" +]) + +TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/s2t-small-librispeech-asr" +]) + +SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/s2t-wav2vec2-large-en-de": "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json" +}) + +SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/speecht5_asr": "https://huggingface.co/microsoft/speecht5_asr/resolve/main/config.json", + "microsoft/speecht5_tts": "https://huggingface.co/microsoft/speecht5_tts/resolve/main/config.json", + "microsoft/speecht5_vc": "https://huggingface.co/microsoft/speecht5_vc/resolve/main/config.json" +}) + +SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json" +}) + +SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/speecht5_asr", + "microsoft/speecht5_tts", + "microsoft/speecht5_vc" +]) + +SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "tau/splinter-base": "https://huggingface.co/tau/splinter-base/resolve/main/config.json", + "tau/splinter-base-qass": "https://huggingface.co/tau/splinter-base-qass/resolve/main/config.json", + "tau/splinter-large": "https://huggingface.co/tau/splinter-large/resolve/main/config.json", + "tau/splinter-large-qass": "https://huggingface.co/tau/splinter-large-qass/resolve/main/config.json" +}) + +SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "tau/splinter-base", + "tau/splinter-base-qass", + "tau/splinter-large", + "tau/splinter-large-qass" +]) + +SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "squeezebert/squeezebert-uncased": "https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/config.json", + "squeezebert/squeezebert-mnli": "https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/config.json", + "squeezebert/squeezebert-mnli-headless": "https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/config.json" +}) + +SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "squeezebert/squeezebert-uncased", + "squeezebert/squeezebert-mnli", + "squeezebert/squeezebert-mnli-headless" +]) + +STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "stabilityai/stablelm-3b-4e1t": "https://huggingface.co/stabilityai/stablelm-3b-4e1t/resolve/main/config.json" +}) + +STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) + +SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "MBZUAI/swiftformer-xs": "https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json" +}) + +SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "MBZUAI/swiftformer-xs" +]) + +SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/swin-tiny-patch4-window7-224": "https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json" +}) + +SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/swin-tiny-patch4-window7-224" +]) + +TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/swin-tiny-patch4-window7-224" +]) + +SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "caidas/swin2sr-classicalsr-x2-64": "https://huggingface.co/caidas/swin2sr-classicalsr-x2-64/resolve/main/config.json" +}) + +SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "caidas/swin2SR-classical-sr-x2-64" +]) + +SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/swinv2-tiny-patch4-window8-256": "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json" +}) + +SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/swinv2-tiny-patch4-window8-256" +]) + +SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/switch-base-8": "https://huggingface.co/google/switch-base-8/blob/main/config.json" +}) + +SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/switch-base-8", + "google/switch-base-16", + "google/switch-base-32", + "google/switch-base-64", + "google/switch-base-128", + "google/switch-base-256", + "google/switch-large-128", + "google/switch-xxl-128", + "google/switch-c-2048" +]) + +T5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google-t5/t5-small": "https://huggingface.co/google-t5/t5-small/resolve/main/config.json", + "google-t5/t5-base": "https://huggingface.co/google-t5/t5-base/resolve/main/config.json", + "google-t5/t5-large": "https://huggingface.co/google-t5/t5-large/resolve/main/config.json", + "google-t5/t5-3b": "https://huggingface.co/google-t5/t5-3b/resolve/main/config.json", + "google-t5/t5-11b": "https://huggingface.co/google-t5/t5-11b/resolve/main/config.json" +}) + +T5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google-t5/t5-small", + "google-t5/t5-base", + "google-t5/t5-large", + "google-t5/t5-3b", + "google-t5/t5-11b" +]) + +TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google-t5/t5-small", + "google-t5/t5-base", + "google-t5/t5-large", + "google-t5/t5-3b", + "google-t5/t5-11b" +]) + +TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/table-transformer-detection": "https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json" +}) + +TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/table-transformer-detection" +]) + +TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/tapas-base-finetuned-sqa": "https://huggingface.co/google/tapas-base-finetuned-sqa/resolve/main/config.json", + "google/tapas-base-finetuned-wtq": "https://huggingface.co/google/tapas-base-finetuned-wtq/resolve/main/config.json", + "google/tapas-base-finetuned-wikisql-supervised": "https://huggingface.co/google/tapas-base-finetuned-wikisql-supervised/resolve/main/config.json", + "google/tapas-base-finetuned-tabfact": "https://huggingface.co/google/tapas-base-finetuned-tabfact/resolve/main/config.json" +}) + +TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/tapas-large", + "google/tapas-large-finetuned-sqa", + "google/tapas-large-finetuned-wtq", + "google/tapas-large-finetuned-wikisql-supervised", + "google/tapas-large-finetuned-tabfact", + "google/tapas-base", + "google/tapas-base-finetuned-sqa", + "google/tapas-base-finetuned-wtq", + "google/tapas-base-finetuned-wikisql-supervised", + "google/tapas-base-finetuned-tabfact", + "google/tapas-small", + "google/tapas-small-finetuned-sqa", + "google/tapas-small-finetuned-wtq", + "google/tapas-small-finetuned-wikisql-supervised", + "google/tapas-small-finetuned-tabfact", + "google/tapas-mini", + "google/tapas-mini-finetuned-sqa", + "google/tapas-mini-finetuned-wtq", + "google/tapas-mini-finetuned-wikisql-supervised", + "google/tapas-mini-finetuned-tabfact", + "google/tapas-tiny", + "google/tapas-tiny-finetuned-sqa", + "google/tapas-tiny-finetuned-wtq", + "google/tapas-tiny-finetuned-wikisql-supervised", + "google/tapas-tiny-finetuned-tabfact" +]) + +TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/tapas-large", + "google/tapas-large-finetuned-sqa", + "google/tapas-large-finetuned-wtq", + "google/tapas-large-finetuned-wikisql-supervised", + "google/tapas-large-finetuned-tabfact", + "google/tapas-base", + "google/tapas-base-finetuned-sqa", + "google/tapas-base-finetuned-wtq", + "google/tapas-base-finetuned-wikisql-supervised", + "google/tapas-base-finetuned-tabfact", + "google/tapas-small", + "google/tapas-small-finetuned-sqa", + "google/tapas-small-finetuned-wtq", + "google/tapas-small-finetuned-wikisql-supervised", + "google/tapas-small-finetuned-tabfact", + "google/tapas-mini", + "google/tapas-mini-finetuned-sqa", + "google/tapas-mini-finetuned-wtq", + "google/tapas-mini-finetuned-wikisql-supervised", + "google/tapas-mini-finetuned-tabfact", + "google/tapas-tiny", + "google/tapas-tiny-finetuned-sqa", + "google/tapas-tiny-finetuned-wtq", + "google/tapas-tiny-finetuned-wikisql-supervised", + "google/tapas-tiny-finetuned-tabfact" +]) + +TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "huggingface/time-series-transformer-tourism-monthly": "https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json" +}) + +TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "huggingface/time-series-transformer-tourism-monthly" +]) + +TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/timesformer": "https://huggingface.co/facebook/timesformer/resolve/main/config.json" +}) + +TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/timesformer-base-finetuned-k400" +]) + +TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/trocr-base-handwritten": "https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json" +}) + +TROCR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/trocr-base-handwritten" +]) + +TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "ZinengTang/tvlt-base": "https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json" +}) + +TVLT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "ZinengTang/tvlt-base" +]) + +TVP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "Intel/tvp-base": "https://huggingface.co/Intel/tvp-base/resolve/main/config.json" +}) + +TVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "Intel/tvp-base", + "Intel/tvp-base-ANet" +]) + +UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/udop-large": "https://huggingface.co/microsoft/udop-large/resolve/main/config.json" +}) + +UDOP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/udop-large" +]) + +UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/unispeech-large-1500h-cv": "https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json" +}) + +UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/unispeech-large-1500h-cv", + "microsoft/unispeech-large-multi-lingual-1500h-cv" +]) + +UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/unispeech-sat-base-100h-libri-ft": "https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json" +}) + +UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) + +UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "dg845/univnet-dev": "https://huggingface.co/dg845/univnet-dev/resolve/main/config.json" +}) + +UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "dg845/univnet-dev" +]) + +VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "MCG-NJU/videomae-base": "https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json" +}) + +VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "MCG-NJU/videomae-base" +]) + +VILT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "dandelin/vilt-b32-mlm": "https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json" +}) + +VILT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "dandelin/vilt-b32-mlm" +]) + +VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "ybelkada/vip-llava-7b-hf": "https://huggingface.co/llava-hf/vip-llava-7b-hf/resolve/main/config.json" +}) + +VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "llava-hf/vip-llava-7b-hf" +]) + +VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "uclanlp/visualbert-vqa": "https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json", + "uclanlp/visualbert-vqa-pre": "https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json", + "uclanlp/visualbert-vqa-coco-pre": "https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json", + "uclanlp/visualbert-vcr": "https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json", + "uclanlp/visualbert-vcr-pre": "https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json", + "uclanlp/visualbert-vcr-coco-pre": "https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json", + "uclanlp/visualbert-nlvr2": "https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json", + "uclanlp/visualbert-nlvr2-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json", + "uclanlp/visualbert-nlvr2-coco-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json" +}) + +VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "uclanlp/visualbert-vqa", + "uclanlp/visualbert-vqa-pre", + "uclanlp/visualbert-vqa-coco-pre", + "uclanlp/visualbert-vcr", + "uclanlp/visualbert-vcr-pre", + "uclanlp/visualbert-vcr-coco-pre", + "uclanlp/visualbert-nlvr2", + "uclanlp/visualbert-nlvr2-pre", + "uclanlp/visualbert-nlvr2-coco-pre" +]) + +VIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/vit-base-patch16-224": "https://huggingface.co/vit-base-patch16-224/resolve/main/config.json" +}) + +VIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/vit-base-patch16-224" +]) + +VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/vit-hybrid-base-bit-384": "https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json" +}) + +VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/vit-hybrid-base-bit-384" +]) + +VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/vit-mae-base": "https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json" +}) + +VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/vit-mae-base" +]) + +VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "sayakpaul/vit-msn-base": "https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json" +}) + +VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/vit-msn-small" +]) + +VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/vit-det-base": "https://huggingface.co/facebook/vit-det-base/resolve/main/config.json" +}) + +VITDET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/vit-det-base" +]) + +VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "hustvl/vitmatte-small-composition-1k": "https://huggingface.co/hustvl/vitmatte-small-composition-1k/resolve/main/config.json" +}) + +VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "hustvl/vitmatte-small-composition-1k" +]) + +VITS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/mms-tts-eng": "https://huggingface.co/facebook/mms-tts-eng/resolve/main/config.json" +}) + +VITS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/mms-tts-eng" +]) + +VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "google/vivit-b-16x2-kinetics400": "https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json" +}) + +VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "google/vivit-b-16x2-kinetics400" +]) + +WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/wav2vec2-base-960h": "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json" +}) + +WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/wav2vec2-base-960h", + "facebook/wav2vec2-large-960h", + "facebook/wav2vec2-large-960h-lv60", + "facebook/wav2vec2-large-960h-lv60-self" +]) + +TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/wav2vec2-base-960h", + "facebook/wav2vec2-large-960h", + "facebook/wav2vec2-large-960h-lv60", + "facebook/wav2vec2-large-960h-lv60-self" +]) + +WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/w2v-bert-2.0": "https://huggingface.co/facebook/w2v-bert-2.0/resolve/main/config.json" +}) + +WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/w2v-bert-2.0" +]) + +WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/wav2vec2-conformer-rel-pos-large": "https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large/resolve/main/config.json" +}) + +WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/wav2vec2-conformer-rel-pos-large" +]) + +WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/wavlm-base": "https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json" +}) + +WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/wavlm-base", + "microsoft/wavlm-base-plus", + "microsoft/wavlm-large" +]) + +WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/config.json" +}) + +WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai/whisper-base" +]) + +TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "openai/whisper-base" +]) + +XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/xclip-base-patch32": "https://huggingface.co/microsoft/xclip-base-patch32/resolve/main/config.json" +}) + +XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/xclip-base-patch32" +]) + +XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/xglm-564M": "https://huggingface.co/facebook/xglm-564M/resolve/main/config.json" +}) + +XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/xglm-564M" +]) + +TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/xglm-564M" +]) + +XLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "FacebookAI/xlm-mlm-en-2048": "https://huggingface.co/FacebookAI/xlm-mlm-en-2048/resolve/main/config.json", + "FacebookAI/xlm-mlm-ende-1024": "https://huggingface.co/FacebookAI/xlm-mlm-ende-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enfr-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-enro-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enro-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-xnli15-1024/resolve/main/config.json", + "FacebookAI/xlm-clm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-clm-enfr-1024/resolve/main/config.json", + "FacebookAI/xlm-clm-ende-1024": "https://huggingface.co/FacebookAI/xlm-clm-ende-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-17-1280": "https://huggingface.co/FacebookAI/xlm-mlm-17-1280/resolve/main/config.json", + "FacebookAI/xlm-mlm-100-1280": "https://huggingface.co/FacebookAI/xlm-mlm-100-1280/resolve/main/config.json" +}) + +XLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "FacebookAI/xlm-mlm-en-2048", + "FacebookAI/xlm-mlm-ende-1024", + "FacebookAI/xlm-mlm-enfr-1024", + "FacebookAI/xlm-mlm-enro-1024", + "FacebookAI/xlm-mlm-tlm-xnli15-1024", + "FacebookAI/xlm-mlm-xnli15-1024", + "FacebookAI/xlm-clm-enfr-1024", + "FacebookAI/xlm-clm-ende-1024", + "FacebookAI/xlm-mlm-17-1280", + "FacebookAI/xlm-mlm-100-1280" +]) + +TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "FacebookAI/xlm-mlm-en-2048", + "FacebookAI/xlm-mlm-ende-1024", + "FacebookAI/xlm-mlm-enfr-1024", + "FacebookAI/xlm-mlm-enro-1024", + "FacebookAI/xlm-mlm-tlm-xnli15-1024", + "FacebookAI/xlm-mlm-xnli15-1024", + "FacebookAI/xlm-clm-enfr-1024", + "FacebookAI/xlm-clm-ende-1024", + "FacebookAI/xlm-mlm-17-1280", + "FacebookAI/xlm-mlm-100-1280" +]) + +XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "microsoft/xprophetnet-large-wiki100-cased": "https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json" +}) + +XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "microsoft/xprophetnet-large-wiki100-cased" +]) + +XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "FacebookAI/xlm-roberta-base": "https://huggingface.co/FacebookAI/xlm-roberta-base/resolve/main/config.json", + "FacebookAI/xlm-roberta-large": "https://huggingface.co/FacebookAI/xlm-roberta-large/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll03-english": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll03-german": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json" +}) + +XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "FacebookAI/xlm-roberta-base", + "FacebookAI/xlm-roberta-large", + "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch", + "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish", + "FacebookAI/xlm-roberta-large-finetuned-conll03-english", + "FacebookAI/xlm-roberta-large-finetuned-conll03-german" +]) + +TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "FacebookAI/xlm-roberta-base", + "FacebookAI/xlm-roberta-large", + "joeddav/xlm-roberta-large-xnli", + "cardiffnlp/twitter-xlm-roberta-base-sentiment" +]) + +FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "FacebookAI/xlm-roberta-base", + "FacebookAI/xlm-roberta-large" +]) + +XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/xlm-roberta-xl": "https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json", + "facebook/xlm-roberta-xxl": "https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json" +}) + +XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/xlm-roberta-xl", + "facebook/xlm-roberta-xxl" +]) + +XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "xlnet/xlnet-base-cased": "https://huggingface.co/xlnet/xlnet-base-cased/resolve/main/config.json", + "xlnet/xlnet-large-cased": "https://huggingface.co/xlnet/xlnet-large-cased/resolve/main/config.json" +}) + +XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "xlnet/xlnet-base-cased", + "xlnet/xlnet-large-cased" +]) + +TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "xlnet/xlnet-base-cased", + "xlnet/xlnet-large-cased" +]) + +XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "facebook/xmod-base": "https://huggingface.co/facebook/xmod-base/resolve/main/config.json", + "facebook/xmod-large-prenorm": "https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json", + "facebook/xmod-base-13-125k": "https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json", + "facebook/xmod-base-30-125k": "https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json", + "facebook/xmod-base-30-195k": "https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json", + "facebook/xmod-base-60-125k": "https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json", + "facebook/xmod-base-60-265k": "https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json", + "facebook/xmod-base-75-125k": "https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json", + "facebook/xmod-base-75-269k": "https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json" +}) + +XMOD_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "facebook/xmod-base", + "facebook/xmod-large-prenorm", + "facebook/xmod-base-13-125k", + "facebook/xmod-base-30-125k", + "facebook/xmod-base-30-195k", + "facebook/xmod-base-60-125k", + "facebook/xmod-base-60-265k", + "facebook/xmod-base-75-125k", + "facebook/xmod-base-75-269k" +]) + +YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json" +}) + +YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "hustvl/yolos-small" +]) + +YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ + "uw-madison/yoso-4096": "https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json" +}) + +YOSO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ + "uw-madison/yoso-4096" +]) + From baa78b11635a9a967027807fcdf4fdf0297f45f1 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Wed, 13 Mar 2024 15:49:55 +0100 Subject: [PATCH 03/13] Revert init changes --- src/transformers/__init__.py | 1235 ++++++++++++++--- src/transformers/models/albert/__init__.py | 8 +- src/transformers/models/align/__init__.py | 4 + src/transformers/models/altclip/__init__.py | 4 + .../audio_spectrogram_transformer/__init__.py | 8 +- src/transformers/models/auto/__init__.py | 4 +- .../models/autoformer/__init__.py | 8 +- src/transformers/models/bark/__init__.py | 4 + src/transformers/models/bart/__init__.py | 6 +- src/transformers/models/beit/__init__.py | 6 +- src/transformers/models/bert/__init__.py | 8 +- src/transformers/models/big_bird/__init__.py | 6 +- .../models/bigbird_pegasus/__init__.py | 4 + src/transformers/models/biogpt/__init__.py | 6 +- src/transformers/models/bit/__init__.py | 6 +- .../models/blenderbot/__init__.py | 4 + .../models/blenderbot_small/__init__.py | 4 + src/transformers/models/blip/__init__.py | 7 +- src/transformers/models/blip_2/__init__.py | 4 + src/transformers/models/bloom/__init__.py | 6 +- .../models/bridgetower/__init__.py | 4 + src/transformers/models/bros/__init__.py | 6 +- src/transformers/models/camembert/__init__.py | 8 +- src/transformers/models/canine/__init__.py | 6 +- .../models/chinese_clip/__init__.py | 4 + src/transformers/models/clap/__init__.py | 4 + src/transformers/models/clip/__init__.py | 6 + src/transformers/models/clipseg/__init__.py | 4 + src/transformers/models/clvp/__init__.py | 4 + src/transformers/models/codegen/__init__.py | 6 +- .../models/conditional_detr/__init__.py | 4 + src/transformers/models/convbert/__init__.py | 8 +- src/transformers/models/convnext/__init__.py | 8 +- .../models/convnextv2/__init__.py | 10 +- src/transformers/models/cpmant/__init__.py | 6 +- src/transformers/models/ctrl/__init__.py | 8 +- src/transformers/models/cvt/__init__.py | 8 +- src/transformers/models/data2vec/__init__.py | 14 +- src/transformers/models/deberta/__init__.py | 8 +- .../models/deberta_v2/__init__.py | 7 +- .../models/decision_transformer/__init__.py | 8 +- .../models/deformable_detr/__init__.py | 6 +- src/transformers/models/deit/__init__.py | 8 +- .../models/deprecated/mctct/__init__.py | 7 +- .../models/deprecated/open_llama/__init__.py | 4 +- .../models/deprecated/retribert/__init__.py | 6 +- .../trajectory_transformer/__init__.py | 8 +- .../models/deprecated/transfo_xl/__init__.py | 8 +- .../models/deprecated/van/__init__.py | 6 +- .../models/depth_anything/__init__.py | 8 +- src/transformers/models/deta/__init__.py | 6 +- src/transformers/models/detr/__init__.py | 6 +- src/transformers/models/dinat/__init__.py | 6 +- src/transformers/models/dinov2/__init__.py | 8 +- .../models/distilbert/__init__.py | 6 + src/transformers/models/donut/__init__.py | 6 +- src/transformers/models/dpr/__init__.py | 16 +- src/transformers/models/dpt/__init__.py | 6 +- .../models/efficientformer/__init__.py | 13 +- .../models/efficientnet/__init__.py | 4 + src/transformers/models/electra/__init__.py | 8 +- src/transformers/models/encodec/__init__.py | 8 +- src/transformers/models/ernie/__init__.py | 6 +- src/transformers/models/ernie_m/__init__.py | 6 +- src/transformers/models/esm/__init__.py | 8 +- src/transformers/models/falcon/__init__.py | 6 +- .../models/fastspeech2_conformer/__init__.py | 8 + src/transformers/models/flaubert/__init__.py | 8 +- src/transformers/models/flava/__init__.py | 4 + src/transformers/models/fnet/__init__.py | 6 +- src/transformers/models/focalnet/__init__.py | 6 +- src/transformers/models/fsmt/__init__.py | 4 +- src/transformers/models/funnel/__init__.py | 8 +- src/transformers/models/fuyu/__init__.py | 4 +- src/transformers/models/gemma/__init__.py | 4 +- src/transformers/models/git/__init__.py | 6 +- src/transformers/models/glpn/__init__.py | 6 +- src/transformers/models/gpt2/__init__.py | 8 +- .../models/gpt_bigcode/__init__.py | 6 +- src/transformers/models/gpt_neo/__init__.py | 6 +- src/transformers/models/gpt_neox/__init__.py | 6 +- .../models/gpt_neox_japanese/__init__.py | 6 +- src/transformers/models/gptj/__init__.py | 6 +- .../models/gptsan_japanese/__init__.py | 6 +- .../models/graphormer/__init__.py | 6 +- src/transformers/models/groupvit/__init__.py | 6 + src/transformers/models/hubert/__init__.py | 8 +- src/transformers/models/ibert/__init__.py | 6 +- src/transformers/models/idefics/__init__.py | 6 +- src/transformers/models/imagegpt/__init__.py | 8 +- src/transformers/models/informer/__init__.py | 9 +- .../models/instructblip/__init__.py | 4 + src/transformers/models/jukebox/__init__.py | 4 + src/transformers/models/kosmos2/__init__.py | 6 +- src/transformers/models/layoutlm/__init__.py | 8 +- .../models/layoutlmv2/__init__.py | 6 +- .../models/layoutlmv3/__init__.py | 6 + src/transformers/models/led/__init__.py | 6 +- src/transformers/models/levit/__init__.py | 6 +- src/transformers/models/lilt/__init__.py | 6 +- src/transformers/models/llama/__init__.py | 4 +- src/transformers/models/llava/__init__.py | 6 +- .../models/longformer/__init__.py | 6 + src/transformers/models/longt5/__init__.py | 6 +- src/transformers/models/luke/__init__.py | 6 +- src/transformers/models/lxmert/__init__.py | 6 +- src/transformers/models/m2m_100/__init__.py | 6 +- src/transformers/models/mamba/__init__.py | 6 +- src/transformers/models/marian/__init__.py | 6 +- src/transformers/models/markuplm/__init__.py | 6 +- .../models/mask2former/__init__.py | 9 +- .../models/maskformer/__init__.py | 6 +- src/transformers/models/mbart/__init__.py | 6 +- src/transformers/models/mega/__init__.py | 6 +- .../models/megatron_bert/__init__.py | 6 +- src/transformers/models/mgp_str/__init__.py | 6 +- src/transformers/models/mistral/__init__.py | 4 +- src/transformers/models/mixtral/__init__.py | 4 +- .../models/mobilebert/__init__.py | 6 + .../models/mobilenet_v1/__init__.py | 4 + .../models/mobilenet_v2/__init__.py | 4 + src/transformers/models/mobilevit/__init__.py | 8 +- .../models/mobilevitv2/__init__.py | 4 + src/transformers/models/mpnet/__init__.py | 8 +- src/transformers/models/mpt/__init__.py | 6 +- src/transformers/models/mra/__init__.py | 6 +- src/transformers/models/musicgen/__init__.py | 4 + src/transformers/models/mvp/__init__.py | 6 +- src/transformers/models/nat/__init__.py | 6 +- src/transformers/models/nezha/__init__.py | 6 +- src/transformers/models/nllb_moe/__init__.py | 10 +- .../models/nystromformer/__init__.py | 6 +- src/transformers/models/oneformer/__init__.py | 6 +- src/transformers/models/openai/__init__.py | 8 +- src/transformers/models/opt/__init__.py | 6 +- src/transformers/models/owlv2/__init__.py | 4 + src/transformers/models/owlvit/__init__.py | 4 + .../models/patchtsmixer/__init__.py | 8 +- src/transformers/models/patchtst/__init__.py | 9 +- src/transformers/models/pegasus/__init__.py | 6 +- src/transformers/models/pegasus_x/__init__.py | 6 +- src/transformers/models/perceiver/__init__.py | 6 +- src/transformers/models/persimmon/__init__.py | 4 +- src/transformers/models/phi/__init__.py | 6 +- .../models/pix2struct/__init__.py | 4 + src/transformers/models/plbart/__init__.py | 6 +- .../models/poolformer/__init__.py | 4 + src/transformers/models/pop2piano/__init__.py | 6 +- .../models/prophetnet/__init__.py | 6 +- src/transformers/models/pvt/__init__.py | 6 +- src/transformers/models/qdqbert/__init__.py | 6 +- src/transformers/models/qwen2/__init__.py | 4 +- src/transformers/models/realm/__init__.py | 6 +- src/transformers/models/reformer/__init__.py | 6 +- src/transformers/models/regnet/__init__.py | 8 +- src/transformers/models/rembert/__init__.py | 10 +- src/transformers/models/resnet/__init__.py | 10 +- src/transformers/models/roberta/__init__.py | 8 +- .../models/roberta_prelayernorm/__init__.py | 6 + src/transformers/models/roc_bert/__init__.py | 6 +- src/transformers/models/roformer/__init__.py | 10 +- src/transformers/models/rwkv/__init__.py | 6 +- src/transformers/models/sam/__init__.py | 8 +- .../models/seamless_m4t/__init__.py | 6 +- .../models/seamless_m4t_v2/__init__.py | 6 +- src/transformers/models/segformer/__init__.py | 10 +- src/transformers/models/seggpt/__init__.py | 8 +- src/transformers/models/sew/__init__.py | 6 +- src/transformers/models/sew_d/__init__.py | 6 +- src/transformers/models/siglip/__init__.py | 4 + .../models/speech_to_text/__init__.py | 8 +- .../models/speech_to_text_2/__init__.py | 6 +- src/transformers/models/speecht5/__init__.py | 6 + src/transformers/models/splinter/__init__.py | 6 +- .../models/squeezebert/__init__.py | 4 + src/transformers/models/stablelm/__init__.py | 4 +- .../models/starcoder2/__init__.py | 4 +- .../models/swiftformer/__init__.py | 4 + src/transformers/models/swin/__init__.py | 8 +- src/transformers/models/swin2sr/__init__.py | 6 +- src/transformers/models/swinv2/__init__.py | 6 +- .../models/switch_transformers/__init__.py | 4 + src/transformers/models/t5/__init__.py | 8 +- .../models/table_transformer/__init__.py | 4 + src/transformers/models/tapas/__init__.py | 8 +- .../time_series_transformer/__init__.py | 8 +- .../models/timesformer/__init__.py | 6 +- src/transformers/models/trocr/__init__.py | 7 +- src/transformers/models/tvlt/__init__.py | 6 +- src/transformers/models/tvp/__init__.py | 8 +- src/transformers/models/udop/__init__.py | 6 +- src/transformers/models/unispeech/__init__.py | 6 +- .../models/unispeech_sat/__init__.py | 6 +- src/transformers/models/univnet/__init__.py | 8 +- src/transformers/models/videomae/__init__.py | 6 +- src/transformers/models/vilt/__init__.py | 6 +- src/transformers/models/vipllava/__init__.py | 6 +- .../models/visual_bert/__init__.py | 6 +- src/transformers/models/vit/__init__.py | 6 +- .../models/vit_hybrid/__init__.py | 6 +- src/transformers/models/vit_mae/__init__.py | 6 +- src/transformers/models/vit_msn/__init__.py | 6 +- src/transformers/models/vitdet/__init__.py | 6 +- src/transformers/models/vitmatte/__init__.py | 6 +- src/transformers/models/vits/__init__.py | 8 +- src/transformers/models/vivit/__init__.py | 6 +- src/transformers/models/wav2vec2/__init__.py | 8 +- .../models/wav2vec2_bert/__init__.py | 8 +- .../models/wav2vec2_conformer/__init__.py | 8 +- src/transformers/models/wavlm/__init__.py | 6 +- src/transformers/models/whisper/__init__.py | 8 +- src/transformers/models/x_clip/__init__.py | 4 + src/transformers/models/xglm/__init__.py | 9 +- src/transformers/models/xlm/__init__.py | 8 +- .../models/xlm_prophetnet/__init__.py | 6 +- .../models/xlm_roberta/__init__.py | 8 + .../models/xlm_roberta_xl/__init__.py | 4 + src/transformers/models/xlnet/__init__.py | 8 +- src/transformers/models/xmod/__init__.py | 5 +- src/transformers/models/yolos/__init__.py | 6 +- src/transformers/models/yoso/__init__.py | 6 +- .../__init__.py | 16 +- 222 files changed, 2110 insertions(+), 535 deletions(-) diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py index 34b80caf7e1567..3e0f73f30356fc 100644 --- a/src/transformers/__init__.py +++ b/src/transformers/__init__.py @@ -133,24 +133,28 @@ ], "models": [], # Models - "models.albert": ["AlbertConfig"], + "models.albert": ["ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlbertConfig"], "models.align": [ + "ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlignConfig", "AlignProcessor", "AlignTextConfig", "AlignVisionConfig", ], "models.altclip": [ + "ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "AltCLIPConfig", "AltCLIPProcessor", "AltCLIPTextConfig", "AltCLIPVisionConfig", ], "models.audio_spectrogram_transformer": [ + "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ASTConfig", "ASTFeatureExtractor", ], "models.auto": [ + "ALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CONFIG_MAPPING", "FEATURE_EXTRACTOR_MAPPING", "IMAGE_PROCESSOR_MAPPING", @@ -163,7 +167,10 @@ "AutoProcessor", "AutoTokenizer", ], - "models.autoformer": ["AutoformerConfig"], + "models.autoformer": [ + "AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "AutoformerConfig", + ], "models.bark": [ "BarkCoarseConfig", "BarkConfig", @@ -174,8 +181,9 @@ "models.bart": ["BartConfig", "BartTokenizer"], "models.barthez": [], "models.bartpho": [], - "models.beit": ["BeitConfig"], + "models.beit": ["BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BeitConfig"], "models.bert": [ + "BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BasicTokenizer", "BertConfig", "BertTokenizer", @@ -188,63 +196,77 @@ "MecabTokenizer", ], "models.bertweet": ["BertweetTokenizer"], - "models.big_bird": ["BigBirdConfig"], - "models.bigbird_pegasus": ["BigBirdPegasusConfig"], + "models.big_bird": ["BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP", "BigBirdConfig"], + "models.bigbird_pegasus": [ + "BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", + "BigBirdPegasusConfig", + ], "models.biogpt": [ + "BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BioGptConfig", "BioGptTokenizer", ], - "models.bit": ["BitConfig"], + "models.bit": ["BIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BitConfig"], "models.blenderbot": [ + "BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotConfig", "BlenderbotTokenizer", ], "models.blenderbot_small": [ + "BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotSmallConfig", "BlenderbotSmallTokenizer", ], "models.blip": [ + "BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlipConfig", "BlipProcessor", "BlipTextConfig", "BlipVisionConfig", ], "models.blip_2": [ + "BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Blip2Config", "Blip2Processor", "Blip2QFormerConfig", "Blip2VisionConfig", ], - "models.bloom": ["BloomConfig"], + "models.bloom": ["BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP", "BloomConfig"], "models.bridgetower": [ + "BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP", "BridgeTowerConfig", "BridgeTowerProcessor", "BridgeTowerTextConfig", "BridgeTowerVisionConfig", ], "models.bros": [ + "BROS_PRETRAINED_CONFIG_ARCHIVE_MAP", "BrosConfig", "BrosProcessor", ], "models.byt5": ["ByT5Tokenizer"], - "models.camembert": ["CamembertConfig"], + "models.camembert": ["CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CamembertConfig"], "models.canine": [ + "CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP", "CanineConfig", "CanineTokenizer", ], "models.chinese_clip": [ + "CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ChineseCLIPConfig", "ChineseCLIPProcessor", "ChineseCLIPTextConfig", "ChineseCLIPVisionConfig", ], "models.clap": [ + "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapAudioConfig", "ClapConfig", "ClapProcessor", "ClapTextConfig", ], "models.clip": [ + "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPConfig", "CLIPProcessor", "CLIPTextConfig", @@ -252,12 +274,14 @@ "CLIPVisionConfig", ], "models.clipseg": [ + "CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPSegConfig", "CLIPSegProcessor", "CLIPSegTextConfig", "CLIPSegVisionConfig", ], "models.clvp": [ + "CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ClvpConfig", "ClvpDecoderConfig", "ClvpEncoderConfig", @@ -267,6 +291,7 @@ ], "models.code_llama": [], "models.codegen": [ + "CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "CodeGenConfig", "CodeGenTokenizer", ], @@ -276,172 +301,240 @@ "ConditionalDetrConfig", ], "models.convbert": [ + "CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvBertConfig", "ConvBertTokenizer", ], - "models.convnext": ["ConvNextConfig"], - "models.convnextv2": ["ConvNextV2Config"], + "models.convnext": ["CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvNextConfig"], + "models.convnextv2": [ + "CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP", + "ConvNextV2Config", + ], "models.cpm": [], "models.cpmant": [ + "CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CpmAntConfig", "CpmAntTokenizer", ], "models.ctrl": [ + "CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CTRLConfig", "CTRLTokenizer", ], - "models.cvt": ["CvtConfig"], + "models.cvt": ["CVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CvtConfig"], "models.data2vec": [ + "DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", + "DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecAudioConfig", "Data2VecTextConfig", "Data2VecVisionConfig", ], "models.deberta": [ + "DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaTokenizer", ], - "models.deberta_v2": ["DebertaV2Config"], - "models.decision_transformer": ["DecisionTransformerConfig"], - "models.deformable_detr": ["DeformableDetrConfig"], - "models.deit": ["DeiTConfig"], + "models.deberta_v2": [ + "DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", + "DebertaV2Config", + ], + "models.decision_transformer": [ + "DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "DecisionTransformerConfig", + ], + "models.deformable_detr": [ + "DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", + "DeformableDetrConfig", + ], + "models.deit": ["DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeiTConfig"], "models.deprecated": [], "models.deprecated.bort": [], "models.deprecated.mctct": [ + "MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MCTCTConfig", "MCTCTFeatureExtractor", "MCTCTProcessor", ], "models.deprecated.mmbt": ["MMBTConfig"], - "models.deprecated.open_llama": ["OpenLlamaConfig"], + "models.deprecated.open_llama": [ + "OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", + "OpenLlamaConfig", + ], "models.deprecated.retribert": [ + "RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RetriBertConfig", "RetriBertTokenizer", ], "models.deprecated.tapex": ["TapexTokenizer"], - "models.deprecated.trajectory_transformer": ["TrajectoryTransformerConfig"], + "models.deprecated.trajectory_transformer": [ + "TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "TrajectoryTransformerConfig", + ], "models.deprecated.transfo_xl": [ + "TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", "TransfoXLConfig", "TransfoXLCorpus", "TransfoXLTokenizer", ], - "models.deprecated.van": ["VanConfig"], - "models.depth_anything": ["DepthAnythingConfig"], - "models.deta": ["DetaConfig"], - "models.detr": ["DetrConfig"], + "models.deprecated.van": ["VAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "VanConfig"], + "models.depth_anything": ["DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP", "DepthAnythingConfig"], + "models.deta": ["DETA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetaConfig"], + "models.detr": ["DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetrConfig"], "models.dialogpt": [], - "models.dinat": ["DinatConfig"], - "models.dinov2": ["Dinov2Config"], + "models.dinat": ["DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DinatConfig"], + "models.dinov2": ["DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Dinov2Config"], "models.distilbert": [ + "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DistilBertConfig", "DistilBertTokenizer", ], "models.dit": [], "models.donut": [ + "DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "DonutProcessor", "DonutSwinConfig", ], "models.dpr": [ + "DPR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPRConfig", "DPRContextEncoderTokenizer", "DPRQuestionEncoderTokenizer", "DPRReaderOutput", "DPRReaderTokenizer", ], - "models.dpt": ["DPTConfig"], - "models.efficientformer": ["EfficientFormerConfig"], - "models.efficientnet": ["EfficientNetConfig"], + "models.dpt": ["DPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPTConfig"], + "models.efficientformer": [ + "EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "EfficientFormerConfig", + ], + "models.efficientnet": [ + "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP", + "EfficientNetConfig", + ], "models.electra": [ + "ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "ElectraConfig", "ElectraTokenizer", ], "models.encodec": [ + "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", "EncodecConfig", "EncodecFeatureExtractor", ], "models.encoder_decoder": ["EncoderDecoderConfig"], - "models.ernie": ["ErnieConfig"], - "models.ernie_m": ["ErnieMConfig"], - "models.esm": ["EsmConfig", "EsmTokenizer"], - "models.falcon": ["FalconConfig"], + "models.ernie": [ + "ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP", + "ErnieConfig", + ], + "models.ernie_m": ["ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieMConfig"], + "models.esm": ["ESM_PRETRAINED_CONFIG_ARCHIVE_MAP", "EsmConfig", "EsmTokenizer"], + "models.falcon": ["FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP", "FalconConfig"], "models.fastspeech2_conformer": [ + "FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", + "FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "FastSpeech2ConformerConfig", "FastSpeech2ConformerHifiGanConfig", "FastSpeech2ConformerTokenizer", "FastSpeech2ConformerWithHifiGanConfig", ], - "models.flaubert": ["FlaubertConfig", "FlaubertTokenizer"], + "models.flaubert": ["FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlaubertConfig", "FlaubertTokenizer"], "models.flava": [ + "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlavaConfig", "FlavaImageCodebookConfig", "FlavaImageConfig", "FlavaMultimodalConfig", "FlavaTextConfig", ], - "models.fnet": ["FNetConfig"], - "models.focalnet": ["FocalNetConfig"], + "models.fnet": ["FNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FNetConfig"], + "models.focalnet": ["FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FocalNetConfig"], "models.fsmt": [ + "FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FSMTConfig", "FSMTTokenizer", ], "models.funnel": [ + "FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig", "FunnelTokenizer", ], - "models.fuyu": ["FuyuConfig"], - "models.gemma": ["GemmaConfig"], + "models.fuyu": ["FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP", "FuyuConfig"], + "models.gemma": ["GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "GemmaConfig"], "models.git": [ + "GIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GitConfig", "GitProcessor", "GitVisionConfig", ], - "models.glpn": ["GLPNConfig"], + "models.glpn": ["GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP", "GLPNConfig"], "models.gpt2": [ + "GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2Tokenizer", ], - "models.gpt_bigcode": ["GPTBigCodeConfig"], - "models.gpt_neo": ["GPTNeoConfig"], - "models.gpt_neox": ["GPTNeoXConfig"], - "models.gpt_neox_japanese": ["GPTNeoXJapaneseConfig"], + "models.gpt_bigcode": [ + "GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP", + "GPTBigCodeConfig", + ], + "models.gpt_neo": ["GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoConfig"], + "models.gpt_neox": ["GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXConfig"], + "models.gpt_neox_japanese": [ + "GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", + "GPTNeoXJapaneseConfig", + ], "models.gpt_sw3": [], - "models.gptj": ["GPTJConfig"], + "models.gptj": ["GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTJConfig"], "models.gptsan_japanese": [ + "GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTSanJapaneseConfig", "GPTSanJapaneseTokenizer", ], - "models.graphormer": ["GraphormerConfig"], + "models.graphormer": [ + "GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "GraphormerConfig", + ], "models.groupvit": [ + "GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GroupViTConfig", "GroupViTTextConfig", "GroupViTVisionConfig", ], "models.herbert": ["HerbertTokenizer"], - "models.hubert": ["HubertConfig"], - "models.ibert": ["IBertConfig"], - "models.idefics": ["IdeficsConfig"], - "models.imagegpt": ["ImageGPTConfig"], - "models.informer": ["InformerConfig"], + "models.hubert": ["HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "HubertConfig"], + "models.ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig"], + "models.idefics": [ + "IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP", + "IdeficsConfig", + ], + "models.imagegpt": ["IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ImageGPTConfig"], + "models.informer": ["INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "InformerConfig"], "models.instructblip": [ + "INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "InstructBlipConfig", "InstructBlipProcessor", "InstructBlipQFormerConfig", "InstructBlipVisionConfig", ], "models.jukebox": [ + "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "JukeboxConfig", "JukeboxPriorConfig", "JukeboxTokenizer", "JukeboxVQVAEConfig", ], "models.kosmos2": [ + "KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Kosmos2Config", "Kosmos2Processor", ], "models.layoutlm": [ + "LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMConfig", "LayoutLMTokenizer", ], "models.layoutlmv2": [ + "LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv2Config", "LayoutLMv2FeatureExtractor", "LayoutLMv2ImageProcessor", @@ -449,6 +542,7 @@ "LayoutLMv2Tokenizer", ], "models.layoutlmv3": [ + "LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv3Config", "LayoutLMv3FeatureExtractor", "LayoutLMv3ImageProcessor", @@ -471,61 +565,85 @@ "LlavaNextProcessor", ], "models.longformer": [ + "LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongformerConfig", "LongformerTokenizer", ], - "models.longt5": ["LongT5Config"], + "models.longt5": ["LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongT5Config"], "models.luke": [ + "LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP", "LukeConfig", "LukeTokenizer", ], "models.lxmert": [ + "LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LxmertConfig", "LxmertTokenizer", ], - "models.m2m_100": ["M2M100Config"], - "models.mamba": ["MambaConfig"], + "models.m2m_100": ["M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP", "M2M100Config"], + "models.mamba": ["MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MambaConfig"], "models.marian": ["MarianConfig"], "models.markuplm": [ + "MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "MarkupLMConfig", "MarkupLMFeatureExtractor", "MarkupLMProcessor", "MarkupLMTokenizer", ], - "models.mask2former": ["Mask2FormerConfig"], + "models.mask2former": [ + "MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "Mask2FormerConfig", + ], "models.maskformer": [ + "MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "MaskFormerConfig", "MaskFormerSwinConfig", ], "models.mbart": ["MBartConfig"], "models.mbart50": [], - "models.mega": ["MegaConfig"], - "models.megatron_bert": ["MegatronBertConfig"], + "models.mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig"], + "models.megatron_bert": [ + "MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", + "MegatronBertConfig", + ], "models.megatron_gpt2": [], "models.mgp_str": [ + "MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP", "MgpstrConfig", "MgpstrProcessor", "MgpstrTokenizer", ], - "models.mistral": ["MistralConfig"], - "models.mixtral": ["MixtralConfig"], + "models.mistral": ["MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MistralConfig"], + "models.mixtral": ["MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MixtralConfig"], "models.mluke": [], "models.mobilebert": [ + "MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileBertConfig", "MobileBertTokenizer", ], - "models.mobilenet_v1": ["MobileNetV1Config"], - "models.mobilenet_v2": ["MobileNetV2Config"], - "models.mobilevit": ["MobileViTConfig"], - "models.mobilevitv2": ["MobileViTV2Config"], + "models.mobilenet_v1": [ + "MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP", + "MobileNetV1Config", + ], + "models.mobilenet_v2": [ + "MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", + "MobileNetV2Config", + ], + "models.mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTConfig"], + "models.mobilevitv2": [ + "MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP", + "MobileViTV2Config", + ], "models.mpnet": [ + "MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "MPNetConfig", "MPNetTokenizer", ], - "models.mpt": ["MptConfig"], - "models.mra": ["MraConfig"], + "models.mpt": ["MPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MptConfig"], + "models.mra": ["MRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MraConfig"], "models.mt5": ["MT5Config"], "models.musicgen": [ + "MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "MusicgenConfig", "MusicgenDecoderConfig", ], @@ -535,57 +653,77 @@ "MusicgenMelodyDecoderConfig", ], "models.mvp": ["MvpConfig", "MvpTokenizer"], - "models.nat": ["NatConfig"], - "models.nezha": ["NezhaConfig"], + "models.nat": ["NAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "NatConfig"], + "models.nezha": ["NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP", "NezhaConfig"], "models.nllb": [], - "models.nllb_moe": ["NllbMoeConfig"], + "models.nllb_moe": ["NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP", "NllbMoeConfig"], "models.nougat": ["NougatProcessor"], - "models.nystromformer": ["NystromformerConfig"], + "models.nystromformer": [ + "NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "NystromformerConfig", + ], "models.oneformer": [ + "ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "OneFormerConfig", "OneFormerProcessor", ], "models.openai": [ + "OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenAIGPTConfig", "OpenAIGPTTokenizer", ], "models.opt": ["OPTConfig"], "models.owlv2": [ + "OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Owlv2Config", "Owlv2Processor", "Owlv2TextConfig", "Owlv2VisionConfig", ], "models.owlvit": [ + "OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OwlViTConfig", "OwlViTProcessor", "OwlViTTextConfig", "OwlViTVisionConfig", ], - "models.patchtsmixer": ["PatchTSMixerConfig"], - "models.patchtst": ["PatchTSTConfig"], + "models.patchtsmixer": [ + "PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "PatchTSMixerConfig", + ], + "models.patchtst": ["PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP", "PatchTSTConfig"], "models.pegasus": [ + "PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusConfig", "PegasusTokenizer", ], - "models.pegasus_x": ["PegasusXConfig"], + "models.pegasus_x": ["PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusXConfig"], "models.perceiver": [ + "PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PerceiverConfig", "PerceiverTokenizer", ], - "models.persimmon": ["PersimmonConfig"], - "models.phi": ["PhiConfig"], + "models.persimmon": ["PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP", "PersimmonConfig"], + "models.phi": ["PHI_PRETRAINED_CONFIG_ARCHIVE_MAP", "PhiConfig"], "models.phobert": ["PhobertTokenizer"], "models.pix2struct": [ + "PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Pix2StructConfig", "Pix2StructProcessor", "Pix2StructTextConfig", "Pix2StructVisionConfig", ], - "models.plbart": ["PLBartConfig"], - "models.poolformer": ["PoolFormerConfig"], - "models.pop2piano": ["Pop2PianoConfig"], + "models.plbart": ["PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP", "PLBartConfig"], + "models.poolformer": [ + "POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "PoolFormerConfig", + ], + "models.pop2piano": [ + "POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP", + "Pop2PianoConfig", + ], "models.prophetnet": [ + "PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ProphetNetConfig", "ProphetNetTokenizer", ], @@ -593,33 +731,42 @@ "models.pvt_v2": ["PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtV2Config"], "models.qdqbert": ["QDQBertConfig"], "models.qwen2": [ + "QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Qwen2Config", "Qwen2Tokenizer", ], "models.rag": ["RagConfig", "RagRetriever", "RagTokenizer"], "models.realm": [ + "REALM_PRETRAINED_CONFIG_ARCHIVE_MAP", "RealmConfig", "RealmTokenizer", ], - "models.reformer": ["ReformerConfig"], - "models.regnet": ["RegNetConfig"], - "models.rembert": ["RemBertConfig"], - "models.resnet": ["ResNetConfig"], + "models.reformer": ["REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ReformerConfig"], + "models.regnet": ["REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "RegNetConfig"], + "models.rembert": ["REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RemBertConfig"], + "models.resnet": ["RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ResNetConfig"], "models.roberta": [ + "ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "RobertaConfig", "RobertaTokenizer", ], - "models.roberta_prelayernorm": ["RobertaPreLayerNormConfig"], + "models.roberta_prelayernorm": [ + "ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP", + "RobertaPreLayerNormConfig", + ], "models.roc_bert": [ + "ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoCBertConfig", "RoCBertTokenizer", ], "models.roformer": [ + "ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoFormerConfig", "RoFormerTokenizer", ], - "models.rwkv": ["RwkvConfig"], + "models.rwkv": ["RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP", "RwkvConfig"], "models.sam": [ + "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP", "SamConfig", "SamMaskDecoderConfig", "SamProcessor", @@ -627,16 +774,21 @@ "SamVisionConfig", ], "models.seamless_m4t": [ + "SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP", "SeamlessM4TConfig", "SeamlessM4TFeatureExtractor", "SeamlessM4TProcessor", ], - "models.seamless_m4t_v2": ["SeamlessM4Tv2Config"], - "models.segformer": ["SegformerConfig"], - "models.seggpt": ["SegGptConfig"], - "models.sew": ["SEWConfig"], - "models.sew_d": ["SEWDConfig"], + "models.seamless_m4t_v2": [ + "SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", + "SeamlessM4Tv2Config", + ], + "models.segformer": ["SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegformerConfig"], + "models.seggpt": ["SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegGptConfig"], + "models.sew": ["SEW_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWConfig"], + "models.sew_d": ["SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWDConfig"], "models.siglip": [ + "SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "SiglipConfig", "SiglipProcessor", "SiglipTextConfig", @@ -644,26 +796,32 @@ ], "models.speech_encoder_decoder": ["SpeechEncoderDecoderConfig"], "models.speech_to_text": [ + "SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2TextConfig", "Speech2TextFeatureExtractor", "Speech2TextProcessor", ], "models.speech_to_text_2": [ + "SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2Text2Config", "Speech2Text2Processor", "Speech2Text2Tokenizer", ], "models.speecht5": [ + "SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP", + "SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP", "SpeechT5Config", "SpeechT5FeatureExtractor", "SpeechT5HifiGanConfig", "SpeechT5Processor", ], "models.splinter": [ + "SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SplinterConfig", "SplinterTokenizer", ], "models.squeezebert": [ + "SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SqueezeBertConfig", "SqueezeBertTokenizer", ], @@ -687,63 +845,96 @@ "TableTransformerConfig", ], "models.tapas": [ + "TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig", "TapasTokenizer", ], - "models.time_series_transformer": ["TimeSeriesTransformerConfig"], - "models.timesformer": ["TimesformerConfig"], + "models.time_series_transformer": [ + "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "TimeSeriesTransformerConfig", + ], + "models.timesformer": [ + "TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "TimesformerConfig", + ], "models.timm_backbone": ["TimmBackboneConfig"], "models.trocr": [ + "TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP", "TrOCRConfig", "TrOCRProcessor", ], "models.tvlt": [ + "TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP", "TvltConfig", "TvltFeatureExtractor", "TvltProcessor", ], "models.tvp": [ + "TVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "TvpConfig", "TvpProcessor", ], "models.udop": [ + "UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP", "UdopConfig", "UdopProcessor", ], "models.umt5": ["UMT5Config"], - "models.unispeech": ["UniSpeechConfig"], - "models.unispeech_sat": ["UniSpeechSatConfig"], + "models.unispeech": [ + "UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP", + "UniSpeechConfig", + ], + "models.unispeech_sat": [ + "UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP", + "UniSpeechSatConfig", + ], "models.univnet": [ + "UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "UnivNetConfig", "UnivNetFeatureExtractor", ], "models.upernet": ["UperNetConfig"], - "models.videomae": ["VideoMAEConfig"], + "models.videomae": ["VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VideoMAEConfig"], "models.vilt": [ + "VILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViltConfig", "ViltFeatureExtractor", "ViltImageProcessor", "ViltProcessor", ], - "models.vipllava": ["VipLlavaConfig"], + "models.vipllava": [ + "VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", + "VipLlavaConfig", + ], "models.vision_encoder_decoder": ["VisionEncoderDecoderConfig"], "models.vision_text_dual_encoder": [ "VisionTextDualEncoderConfig", "VisionTextDualEncoderProcessor", ], - "models.visual_bert": ["VisualBertConfig"], - "models.vit": ["ViTConfig"], - "models.vit_hybrid": ["ViTHybridConfig"], - "models.vit_mae": ["ViTMAEConfig"], - "models.vit_msn": ["ViTMSNConfig"], - "models.vitdet": ["VitDetConfig"], - "models.vitmatte": ["VitMatteConfig"], + "models.visual_bert": [ + "VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", + "VisualBertConfig", + ], + "models.vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig"], + "models.vit_hybrid": [ + "VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP", + "ViTHybridConfig", + ], + "models.vit_mae": ["VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMAEConfig"], + "models.vit_msn": ["VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMSNConfig"], + "models.vitdet": ["VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitDetConfig"], + "models.vitmatte": ["VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitMatteConfig"], "models.vits": [ + "VITS_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitsConfig", "VitsTokenizer", ], - "models.vivit": ["VivitConfig"], + "models.vivit": [ + "VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", + "VivitConfig", + ], "models.wav2vec2": [ + "WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Wav2Vec2Config", "Wav2Vec2CTCTokenizer", "Wav2Vec2FeatureExtractor", @@ -751,34 +942,52 @@ "Wav2Vec2Tokenizer", ], "models.wav2vec2_bert": [ + "WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Wav2Vec2BertConfig", "Wav2Vec2BertProcessor", ], - "models.wav2vec2_conformer": ["Wav2Vec2ConformerConfig"], + "models.wav2vec2_conformer": [ + "WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "Wav2Vec2ConformerConfig", + ], "models.wav2vec2_phoneme": ["Wav2Vec2PhonemeCTCTokenizer"], "models.wav2vec2_with_lm": ["Wav2Vec2ProcessorWithLM"], - "models.wavlm": ["WavLMConfig"], + "models.wavlm": [ + "WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP", + "WavLMConfig", + ], "models.whisper": [ + "WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP", "WhisperConfig", "WhisperFeatureExtractor", "WhisperProcessor", "WhisperTokenizer", ], "models.x_clip": [ + "XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "XCLIPConfig", "XCLIPProcessor", "XCLIPTextConfig", "XCLIPVisionConfig", ], - "models.xglm": ["XGLMConfig"], - "models.xlm": ["XLMConfig", "XLMTokenizer"], - "models.xlm_prophetnet": ["XLMProphetNetConfig"], - "models.xlm_roberta": ["XLMRobertaConfig"], - "models.xlm_roberta_xl": ["XLMRobertaXLConfig"], - "models.xlnet": ["XLNetConfig"], - "models.xmod": ["XmodConfig"], - "models.yolos": ["YolosConfig"], - "models.yoso": ["YosoConfig"], + "models.xglm": ["XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XGLMConfig"], + "models.xlm": ["XLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMConfig", "XLMTokenizer"], + "models.xlm_prophetnet": [ + "XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", + "XLMProphetNetConfig", + ], + "models.xlm_roberta": [ + "XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", + "XLMRobertaConfig", + ], + "models.xlm_roberta_xl": [ + "XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", + "XLMRobertaXLConfig", + ], + "models.xlnet": ["XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLNetConfig"], + "models.xmod": ["XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP", "XmodConfig"], + "models.yolos": ["YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP", "YolosConfig"], + "models.yoso": ["YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP", "YosoConfig"], "onnx": [], "pipelines": [ "AudioClassificationPipeline", @@ -1231,6 +1440,7 @@ _import_structure["models.albert"].extend( [ + "ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "AlbertForMaskedLM", "AlbertForMultipleChoice", "AlbertForPreTraining", @@ -1245,6 +1455,7 @@ _import_structure["models.align"].extend( [ + "ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST", "AlignModel", "AlignPreTrainedModel", "AlignTextModel", @@ -1253,6 +1464,7 @@ ) _import_structure["models.altclip"].extend( [ + "ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "AltCLIPModel", "AltCLIPPreTrainedModel", "AltCLIPTextModel", @@ -1261,6 +1473,7 @@ ) _import_structure["models.audio_spectrogram_transformer"].extend( [ + "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ASTForAudioClassification", "ASTModel", "ASTPreTrainedModel", @@ -1352,6 +1565,7 @@ ) _import_structure["models.autoformer"].extend( [ + "AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "AutoformerForPrediction", "AutoformerModel", "AutoformerPreTrainedModel", @@ -1359,6 +1573,7 @@ ) _import_structure["models.bark"].extend( [ + "BARK_PRETRAINED_MODEL_ARCHIVE_LIST", "BarkCausalModel", "BarkCoarseModel", "BarkFineModel", @@ -1369,6 +1584,7 @@ ) _import_structure["models.bart"].extend( [ + "BART_PRETRAINED_MODEL_ARCHIVE_LIST", "BartForCausalLM", "BartForConditionalGeneration", "BartForQuestionAnswering", @@ -1381,6 +1597,7 @@ ) _import_structure["models.beit"].extend( [ + "BEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BeitBackbone", "BeitForImageClassification", "BeitForMaskedImageModeling", @@ -1391,6 +1608,7 @@ ) _import_structure["models.bert"].extend( [ + "BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "BertForMaskedLM", "BertForMultipleChoice", "BertForNextSentencePrediction", @@ -1415,6 +1633,7 @@ ) _import_structure["models.big_bird"].extend( [ + "BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdForCausalLM", "BigBirdForMaskedLM", "BigBirdForMultipleChoice", @@ -1430,6 +1649,7 @@ ) _import_structure["models.bigbird_pegasus"].extend( [ + "BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdPegasusForCausalLM", "BigBirdPegasusForConditionalGeneration", "BigBirdPegasusForQuestionAnswering", @@ -1440,6 +1660,7 @@ ) _import_structure["models.biogpt"].extend( [ + "BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "BioGptForCausalLM", "BioGptForSequenceClassification", "BioGptForTokenClassification", @@ -1449,6 +1670,7 @@ ) _import_structure["models.bit"].extend( [ + "BIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BitBackbone", "BitForImageClassification", "BitModel", @@ -1457,6 +1679,7 @@ ) _import_structure["models.blenderbot"].extend( [ + "BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotForCausalLM", "BlenderbotForConditionalGeneration", "BlenderbotModel", @@ -1465,6 +1688,7 @@ ) _import_structure["models.blenderbot_small"].extend( [ + "BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotSmallForCausalLM", "BlenderbotSmallForConditionalGeneration", "BlenderbotSmallModel", @@ -1473,6 +1697,7 @@ ) _import_structure["models.blip"].extend( [ + "BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "BlipForConditionalGeneration", "BlipForImageTextRetrieval", "BlipForQuestionAnswering", @@ -1484,6 +1709,7 @@ ) _import_structure["models.blip_2"].extend( [ + "BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Blip2ForConditionalGeneration", "Blip2Model", "Blip2PreTrainedModel", @@ -1493,6 +1719,7 @@ ) _import_structure["models.bloom"].extend( [ + "BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST", "BloomForCausalLM", "BloomForQuestionAnswering", "BloomForSequenceClassification", @@ -1503,6 +1730,7 @@ ) _import_structure["models.bridgetower"].extend( [ + "BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST", "BridgeTowerForContrastiveLearning", "BridgeTowerForImageAndTextRetrieval", "BridgeTowerForMaskedLM", @@ -1512,6 +1740,7 @@ ) _import_structure["models.bros"].extend( [ + "BROS_PRETRAINED_MODEL_ARCHIVE_LIST", "BrosForTokenClassification", "BrosModel", "BrosPreTrainedModel", @@ -1522,6 +1751,7 @@ ) _import_structure["models.camembert"].extend( [ + "CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "CamembertForCausalLM", "CamembertForMaskedLM", "CamembertForMultipleChoice", @@ -1534,6 +1764,7 @@ ) _import_structure["models.canine"].extend( [ + "CANINE_PRETRAINED_MODEL_ARCHIVE_LIST", "CanineForMultipleChoice", "CanineForQuestionAnswering", "CanineForSequenceClassification", @@ -1546,6 +1777,7 @@ ) _import_structure["models.chinese_clip"].extend( [ + "CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "ChineseCLIPModel", "ChineseCLIPPreTrainedModel", "ChineseCLIPTextModel", @@ -1554,6 +1786,7 @@ ) _import_structure["models.clap"].extend( [ + "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapAudioModel", "ClapAudioModelWithProjection", "ClapFeatureExtractor", @@ -1565,6 +1798,7 @@ ) _import_structure["models.clip"].extend( [ + "CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPForImageClassification", "CLIPModel", "CLIPPreTrainedModel", @@ -1576,6 +1810,7 @@ ) _import_structure["models.clipseg"].extend( [ + "CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPSegForImageSegmentation", "CLIPSegModel", "CLIPSegPreTrainedModel", @@ -1585,6 +1820,7 @@ ) _import_structure["models.clvp"].extend( [ + "CLVP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClvpDecoder", "ClvpEncoder", "ClvpForCausalLM", @@ -1595,6 +1831,7 @@ ) _import_structure["models.codegen"].extend( [ + "CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "CodeGenForCausalLM", "CodeGenModel", "CodeGenPreTrainedModel", @@ -1603,6 +1840,7 @@ _import_structure["models.cohere"].extend(["CohereForCausalLM", "CohereModel", "CoherePreTrainedModel"]) _import_structure["models.conditional_detr"].extend( [ + "CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "ConditionalDetrForObjectDetection", "ConditionalDetrForSegmentation", "ConditionalDetrModel", @@ -1611,6 +1849,7 @@ ) _import_structure["models.convbert"].extend( [ + "CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvBertForMaskedLM", "ConvBertForMultipleChoice", "ConvBertForQuestionAnswering", @@ -1624,6 +1863,7 @@ ) _import_structure["models.convnext"].extend( [ + "CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextBackbone", "ConvNextForImageClassification", "ConvNextModel", @@ -1632,6 +1872,7 @@ ) _import_structure["models.convnextv2"].extend( [ + "CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextV2Backbone", "ConvNextV2ForImageClassification", "ConvNextV2Model", @@ -1640,6 +1881,7 @@ ) _import_structure["models.cpmant"].extend( [ + "CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST", "CpmAntForCausalLM", "CpmAntModel", "CpmAntPreTrainedModel", @@ -1647,6 +1889,7 @@ ) _import_structure["models.ctrl"].extend( [ + "CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "CTRLForSequenceClassification", "CTRLLMHeadModel", "CTRLModel", @@ -1655,6 +1898,7 @@ ) _import_structure["models.cvt"].extend( [ + "CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "CvtForImageClassification", "CvtModel", "CvtPreTrainedModel", @@ -1662,6 +1906,9 @@ ) _import_structure["models.data2vec"].extend( [ + "DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST", + "DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", + "DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecAudioForAudioFrameClassification", "Data2VecAudioForCTC", "Data2VecAudioForSequenceClassification", @@ -1684,6 +1931,7 @@ ) _import_structure["models.deberta"].extend( [ + "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaForMaskedLM", "DebertaForQuestionAnswering", "DebertaForSequenceClassification", @@ -1694,6 +1942,7 @@ ) _import_structure["models.deberta_v2"].extend( [ + "DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaV2ForMaskedLM", "DebertaV2ForMultipleChoice", "DebertaV2ForQuestionAnswering", @@ -1705,6 +1954,7 @@ ) _import_structure["models.decision_transformer"].extend( [ + "DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "DecisionTransformerGPT2Model", "DecisionTransformerGPT2PreTrainedModel", "DecisionTransformerModel", @@ -1713,6 +1963,7 @@ ) _import_structure["models.deformable_detr"].extend( [ + "DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DeformableDetrForObjectDetection", "DeformableDetrModel", "DeformableDetrPreTrainedModel", @@ -1720,6 +1971,7 @@ ) _import_structure["models.deit"].extend( [ + "DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "DeiTForImageClassification", "DeiTForImageClassificationWithTeacher", "DeiTForMaskedImageModeling", @@ -1729,6 +1981,7 @@ ) _import_structure["models.deprecated.mctct"].extend( [ + "MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST", "MCTCTForCTC", "MCTCTModel", "MCTCTPreTrainedModel", @@ -1745,18 +1998,21 @@ ) _import_structure["models.deprecated.retribert"].extend( [ + "RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RetriBertModel", "RetriBertPreTrainedModel", ] ) _import_structure["models.deprecated.trajectory_transformer"].extend( [ + "TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TrajectoryTransformerModel", "TrajectoryTransformerPreTrainedModel", ] ) _import_structure["models.deprecated.transfo_xl"].extend( [ + "TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "AdaptiveEmbedding", "TransfoXLForSequenceClassification", "TransfoXLLMHeadModel", @@ -1767,6 +2023,7 @@ ) _import_structure["models.deprecated.van"].extend( [ + "VAN_PRETRAINED_MODEL_ARCHIVE_LIST", "VanForImageClassification", "VanModel", "VanPreTrainedModel", @@ -1774,12 +2031,14 @@ ) _import_structure["models.depth_anything"].extend( [ + "DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST", "DepthAnythingForDepthEstimation", "DepthAnythingPreTrainedModel", ] ) _import_structure["models.deta"].extend( [ + "DETA_PRETRAINED_MODEL_ARCHIVE_LIST", "DetaForObjectDetection", "DetaModel", "DetaPreTrainedModel", @@ -1787,6 +2046,7 @@ ) _import_structure["models.detr"].extend( [ + "DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DetrForObjectDetection", "DetrForSegmentation", "DetrModel", @@ -1795,6 +2055,7 @@ ) _import_structure["models.dinat"].extend( [ + "DINAT_PRETRAINED_MODEL_ARCHIVE_LIST", "DinatBackbone", "DinatForImageClassification", "DinatModel", @@ -1803,6 +2064,7 @@ ) _import_structure["models.dinov2"].extend( [ + "DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Dinov2Backbone", "Dinov2ForImageClassification", "Dinov2Model", @@ -1811,6 +2073,7 @@ ) _import_structure["models.distilbert"].extend( [ + "DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "DistilBertForMaskedLM", "DistilBertForMultipleChoice", "DistilBertForQuestionAnswering", @@ -1822,12 +2085,16 @@ ) _import_structure["models.donut"].extend( [ + "DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "DonutSwinModel", "DonutSwinPreTrainedModel", ] ) _import_structure["models.dpr"].extend( [ + "DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "DPRContextEncoder", "DPRPretrainedContextEncoder", "DPRPreTrainedModel", @@ -1839,6 +2106,7 @@ ) _import_structure["models.dpt"].extend( [ + "DPT_PRETRAINED_MODEL_ARCHIVE_LIST", "DPTForDepthEstimation", "DPTForSemanticSegmentation", "DPTModel", @@ -1847,6 +2115,7 @@ ) _import_structure["models.efficientformer"].extend( [ + "EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientFormerForImageClassification", "EfficientFormerForImageClassificationWithTeacher", "EfficientFormerModel", @@ -1855,6 +2124,7 @@ ) _import_structure["models.efficientnet"].extend( [ + "EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientNetForImageClassification", "EfficientNetModel", "EfficientNetPreTrainedModel", @@ -1862,6 +2132,7 @@ ) _import_structure["models.electra"].extend( [ + "ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "ElectraForCausalLM", "ElectraForMaskedLM", "ElectraForMultipleChoice", @@ -1876,6 +2147,7 @@ ) _import_structure["models.encodec"].extend( [ + "ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST", "EncodecModel", "EncodecPreTrainedModel", ] @@ -1883,6 +2155,7 @@ _import_structure["models.encoder_decoder"].append("EncoderDecoderModel") _import_structure["models.ernie"].extend( [ + "ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieForCausalLM", "ErnieForMaskedLM", "ErnieForMultipleChoice", @@ -1897,6 +2170,7 @@ ) _import_structure["models.ernie_m"].extend( [ + "ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieMForInformationExtraction", "ErnieMForMultipleChoice", "ErnieMForQuestionAnswering", @@ -1908,6 +2182,7 @@ ) _import_structure["models.esm"].extend( [ + "ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "EsmFoldPreTrainedModel", "EsmForMaskedLM", "EsmForProteinFolding", @@ -1919,6 +2194,7 @@ ) _import_structure["models.falcon"].extend( [ + "FALCON_PRETRAINED_MODEL_ARCHIVE_LIST", "FalconForCausalLM", "FalconForQuestionAnswering", "FalconForSequenceClassification", @@ -1929,6 +2205,7 @@ ) _import_structure["models.fastspeech2_conformer"].extend( [ + "FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "FastSpeech2ConformerHifiGan", "FastSpeech2ConformerModel", "FastSpeech2ConformerPreTrainedModel", @@ -1937,6 +2214,7 @@ ) _import_structure["models.flaubert"].extend( [ + "FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaubertForMultipleChoice", "FlaubertForQuestionAnswering", "FlaubertForQuestionAnsweringSimple", @@ -1949,6 +2227,7 @@ ) _import_structure["models.flava"].extend( [ + "FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlavaForPreTraining", "FlavaImageCodebook", "FlavaImageModel", @@ -1960,6 +2239,7 @@ ) _import_structure["models.fnet"].extend( [ + "FNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FNetForMaskedLM", "FNetForMultipleChoice", "FNetForNextSentencePrediction", @@ -1974,6 +2254,7 @@ ) _import_structure["models.focalnet"].extend( [ + "FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FocalNetBackbone", "FocalNetForImageClassification", "FocalNetForMaskedImageModeling", @@ -1984,6 +2265,7 @@ _import_structure["models.fsmt"].extend(["FSMTForConditionalGeneration", "FSMTModel", "PretrainedFSMTModel"]) _import_structure["models.funnel"].extend( [ + "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "FunnelBaseModel", "FunnelForMaskedLM", "FunnelForMultipleChoice", @@ -2007,6 +2289,7 @@ ) _import_structure["models.git"].extend( [ + "GIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GitForCausalLM", "GitModel", "GitPreTrainedModel", @@ -2015,6 +2298,7 @@ ) _import_structure["models.glpn"].extend( [ + "GLPN_PRETRAINED_MODEL_ARCHIVE_LIST", "GLPNForDepthEstimation", "GLPNModel", "GLPNPreTrainedModel", @@ -2022,6 +2306,7 @@ ) _import_structure["models.gpt2"].extend( [ + "GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "GPT2DoubleHeadsModel", "GPT2ForQuestionAnswering", "GPT2ForSequenceClassification", @@ -2034,6 +2319,7 @@ ) _import_structure["models.gpt_bigcode"].extend( [ + "GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTBigCodeForCausalLM", "GPTBigCodeForSequenceClassification", "GPTBigCodeForTokenClassification", @@ -2043,6 +2329,7 @@ ) _import_structure["models.gpt_neo"].extend( [ + "GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoForCausalLM", "GPTNeoForQuestionAnswering", "GPTNeoForSequenceClassification", @@ -2054,6 +2341,7 @@ ) _import_structure["models.gpt_neox"].extend( [ + "GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXForCausalLM", "GPTNeoXForQuestionAnswering", "GPTNeoXForSequenceClassification", @@ -2065,6 +2353,7 @@ ) _import_structure["models.gpt_neox_japanese"].extend( [ + "GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXJapaneseForCausalLM", "GPTNeoXJapaneseLayer", "GPTNeoXJapaneseModel", @@ -2073,6 +2362,7 @@ ) _import_structure["models.gptj"].extend( [ + "GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTJForCausalLM", "GPTJForQuestionAnswering", "GPTJForSequenceClassification", @@ -2082,6 +2372,7 @@ ) _import_structure["models.gptsan_japanese"].extend( [ + "GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTSanJapaneseForConditionalGeneration", "GPTSanJapaneseModel", "GPTSanJapanesePreTrainedModel", @@ -2089,6 +2380,7 @@ ) _import_structure["models.graphormer"].extend( [ + "GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "GraphormerForGraphClassification", "GraphormerModel", "GraphormerPreTrainedModel", @@ -2096,6 +2388,7 @@ ) _import_structure["models.groupvit"].extend( [ + "GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GroupViTModel", "GroupViTPreTrainedModel", "GroupViTTextModel", @@ -2104,6 +2397,7 @@ ) _import_structure["models.hubert"].extend( [ + "HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "HubertForCTC", "HubertForSequenceClassification", "HubertModel", @@ -2112,6 +2406,7 @@ ) _import_structure["models.ibert"].extend( [ + "IBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "IBertForMaskedLM", "IBertForMultipleChoice", "IBertForQuestionAnswering", @@ -2123,6 +2418,7 @@ ) _import_structure["models.idefics"].extend( [ + "IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST", "IdeficsForVisionText2Text", "IdeficsModel", "IdeficsPreTrainedModel", @@ -2131,6 +2427,7 @@ ) _import_structure["models.imagegpt"].extend( [ + "IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "ImageGPTForCausalImageModeling", "ImageGPTForImageClassification", "ImageGPTModel", @@ -2140,6 +2437,7 @@ ) _import_structure["models.informer"].extend( [ + "INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "InformerForPrediction", "InformerModel", "InformerPreTrainedModel", @@ -2147,6 +2445,7 @@ ) _import_structure["models.instructblip"].extend( [ + "INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "InstructBlipForConditionalGeneration", "InstructBlipPreTrainedModel", "InstructBlipQFormerModel", @@ -2155,6 +2454,7 @@ ) _import_structure["models.jukebox"].extend( [ + "JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST", "JukeboxModel", "JukeboxPreTrainedModel", "JukeboxPrior", @@ -2163,6 +2463,7 @@ ) _import_structure["models.kosmos2"].extend( [ + "KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST", "Kosmos2ForConditionalGeneration", "Kosmos2Model", "Kosmos2PreTrainedModel", @@ -2170,6 +2471,7 @@ ) _import_structure["models.layoutlm"].extend( [ + "LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMForMaskedLM", "LayoutLMForQuestionAnswering", "LayoutLMForSequenceClassification", @@ -2180,6 +2482,7 @@ ) _import_structure["models.layoutlmv2"].extend( [ + "LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv2ForQuestionAnswering", "LayoutLMv2ForSequenceClassification", "LayoutLMv2ForTokenClassification", @@ -2189,6 +2492,7 @@ ) _import_structure["models.layoutlmv3"].extend( [ + "LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv3ForQuestionAnswering", "LayoutLMv3ForSequenceClassification", "LayoutLMv3ForTokenClassification", @@ -2198,6 +2502,7 @@ ) _import_structure["models.led"].extend( [ + "LED_PRETRAINED_MODEL_ARCHIVE_LIST", "LEDForConditionalGeneration", "LEDForQuestionAnswering", "LEDForSequenceClassification", @@ -2207,6 +2512,7 @@ ) _import_structure["models.levit"].extend( [ + "LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "LevitForImageClassification", "LevitForImageClassificationWithTeacher", "LevitModel", @@ -2215,6 +2521,7 @@ ) _import_structure["models.lilt"].extend( [ + "LILT_PRETRAINED_MODEL_ARCHIVE_LIST", "LiltForQuestionAnswering", "LiltForSequenceClassification", "LiltForTokenClassification", @@ -2233,6 +2540,7 @@ ) _import_structure["models.llava"].extend( [ + "LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "LlavaForConditionalGeneration", "LlavaPreTrainedModel", ] @@ -2246,6 +2554,7 @@ ) _import_structure["models.longformer"].extend( [ + "LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "LongformerForMaskedLM", "LongformerForMultipleChoice", "LongformerForQuestionAnswering", @@ -2258,6 +2567,7 @@ ) _import_structure["models.longt5"].extend( [ + "LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST", "LongT5EncoderModel", "LongT5ForConditionalGeneration", "LongT5Model", @@ -2266,6 +2576,7 @@ ) _import_structure["models.luke"].extend( [ + "LUKE_PRETRAINED_MODEL_ARCHIVE_LIST", "LukeForEntityClassification", "LukeForEntityPairClassification", "LukeForEntitySpanClassification", @@ -2291,6 +2602,7 @@ ) _import_structure["models.m2m_100"].extend( [ + "M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST", "M2M100ForConditionalGeneration", "M2M100Model", "M2M100PreTrainedModel", @@ -2298,6 +2610,7 @@ ) _import_structure["models.mamba"].extend( [ + "MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST", "MambaForCausalLM", "MambaModel", "MambaPreTrainedModel", @@ -2306,6 +2619,7 @@ _import_structure["models.marian"].extend(["MarianForCausalLM", "MarianModel", "MarianMTModel"]) _import_structure["models.markuplm"].extend( [ + "MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST", "MarkupLMForQuestionAnswering", "MarkupLMForSequenceClassification", "MarkupLMForTokenClassification", @@ -2315,6 +2629,7 @@ ) _import_structure["models.mask2former"].extend( [ + "MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Mask2FormerForUniversalSegmentation", "Mask2FormerModel", "Mask2FormerPreTrainedModel", @@ -2322,6 +2637,7 @@ ) _import_structure["models.maskformer"].extend( [ + "MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "MaskFormerForInstanceSegmentation", "MaskFormerModel", "MaskFormerPreTrainedModel", @@ -2340,6 +2656,7 @@ ) _import_structure["models.mega"].extend( [ + "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST", "MegaForCausalLM", "MegaForMaskedLM", "MegaForMultipleChoice", @@ -2352,6 +2669,7 @@ ) _import_structure["models.megatron_bert"].extend( [ + "MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MegatronBertForCausalLM", "MegatronBertForMaskedLM", "MegatronBertForMultipleChoice", @@ -2366,6 +2684,7 @@ ) _import_structure["models.mgp_str"].extend( [ + "MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST", "MgpstrForSceneTextRecognition", "MgpstrModel", "MgpstrPreTrainedModel", @@ -2384,6 +2703,7 @@ ) _import_structure["models.mobilebert"].extend( [ + "MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileBertForMaskedLM", "MobileBertForMultipleChoice", "MobileBertForNextSentencePrediction", @@ -2399,6 +2719,7 @@ ) _import_structure["models.mobilenet_v1"].extend( [ + "MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV1ForImageClassification", "MobileNetV1Model", "MobileNetV1PreTrainedModel", @@ -2407,6 +2728,7 @@ ) _import_structure["models.mobilenet_v2"].extend( [ + "MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV2ForImageClassification", "MobileNetV2ForSemanticSegmentation", "MobileNetV2Model", @@ -2416,6 +2738,7 @@ ) _import_structure["models.mobilevit"].extend( [ + "MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTForImageClassification", "MobileViTForSemanticSegmentation", "MobileViTModel", @@ -2424,6 +2747,7 @@ ) _import_structure["models.mobilevitv2"].extend( [ + "MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTV2ForImageClassification", "MobileViTV2ForSemanticSegmentation", "MobileViTV2Model", @@ -2432,6 +2756,7 @@ ) _import_structure["models.mpnet"].extend( [ + "MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "MPNetForMaskedLM", "MPNetForMultipleChoice", "MPNetForQuestionAnswering", @@ -2444,6 +2769,7 @@ ) _import_structure["models.mpt"].extend( [ + "MPT_PRETRAINED_MODEL_ARCHIVE_LIST", "MptForCausalLM", "MptForQuestionAnswering", "MptForSequenceClassification", @@ -2454,6 +2780,7 @@ ) _import_structure["models.mra"].extend( [ + "MRA_PRETRAINED_MODEL_ARCHIVE_LIST", "MraForMaskedLM", "MraForMultipleChoice", "MraForQuestionAnswering", @@ -2476,6 +2803,7 @@ ) _import_structure["models.musicgen"].extend( [ + "MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "MusicgenForCausalLM", "MusicgenForConditionalGeneration", "MusicgenModel", @@ -2494,6 +2822,7 @@ ) _import_structure["models.mvp"].extend( [ + "MVP_PRETRAINED_MODEL_ARCHIVE_LIST", "MvpForCausalLM", "MvpForConditionalGeneration", "MvpForQuestionAnswering", @@ -2504,6 +2833,7 @@ ) _import_structure["models.nat"].extend( [ + "NAT_PRETRAINED_MODEL_ARCHIVE_LIST", "NatBackbone", "NatForImageClassification", "NatModel", @@ -2512,6 +2842,7 @@ ) _import_structure["models.nezha"].extend( [ + "NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST", "NezhaForMaskedLM", "NezhaForMultipleChoice", "NezhaForNextSentencePrediction", @@ -2525,6 +2856,7 @@ ) _import_structure["models.nllb_moe"].extend( [ + "NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST", "NllbMoeForConditionalGeneration", "NllbMoeModel", "NllbMoePreTrainedModel", @@ -2534,6 +2866,7 @@ ) _import_structure["models.nystromformer"].extend( [ + "NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "NystromformerForMaskedLM", "NystromformerForMultipleChoice", "NystromformerForQuestionAnswering", @@ -2546,6 +2879,7 @@ ) _import_structure["models.oneformer"].extend( [ + "ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "OneFormerForUniversalSegmentation", "OneFormerModel", "OneFormerPreTrainedModel", @@ -2553,6 +2887,7 @@ ) _import_structure["models.openai"].extend( [ + "OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OpenAIGPTDoubleHeadsModel", "OpenAIGPTForSequenceClassification", "OpenAIGPTLMHeadModel", @@ -2563,6 +2898,7 @@ ) _import_structure["models.opt"].extend( [ + "OPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OPTForCausalLM", "OPTForQuestionAnswering", "OPTForSequenceClassification", @@ -2572,6 +2908,7 @@ ) _import_structure["models.owlv2"].extend( [ + "OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Owlv2ForObjectDetection", "Owlv2Model", "Owlv2PreTrainedModel", @@ -2581,6 +2918,7 @@ ) _import_structure["models.owlvit"].extend( [ + "OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "OwlViTForObjectDetection", "OwlViTModel", "OwlViTPreTrainedModel", @@ -2590,6 +2928,7 @@ ) _import_structure["models.patchtsmixer"].extend( [ + "PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSMixerForPrediction", "PatchTSMixerForPretraining", "PatchTSMixerForRegression", @@ -2600,6 +2939,7 @@ ) _import_structure["models.patchtst"].extend( [ + "PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSTForClassification", "PatchTSTForPrediction", "PatchTSTForPretraining", @@ -2618,6 +2958,7 @@ ) _import_structure["models.pegasus_x"].extend( [ + "PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST", "PegasusXForConditionalGeneration", "PegasusXModel", "PegasusXPreTrainedModel", @@ -2625,6 +2966,7 @@ ) _import_structure["models.perceiver"].extend( [ + "PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST", "PerceiverForImageClassificationConvProcessing", "PerceiverForImageClassificationFourier", "PerceiverForImageClassificationLearned", @@ -2647,6 +2989,7 @@ ) _import_structure["models.phi"].extend( [ + "PHI_PRETRAINED_MODEL_ARCHIVE_LIST", "PhiForCausalLM", "PhiForSequenceClassification", "PhiForTokenClassification", @@ -2656,6 +2999,7 @@ ) _import_structure["models.pix2struct"].extend( [ + "PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST", "Pix2StructForConditionalGeneration", "Pix2StructPreTrainedModel", "Pix2StructTextModel", @@ -2664,6 +3008,7 @@ ) _import_structure["models.plbart"].extend( [ + "PLBART_PRETRAINED_MODEL_ARCHIVE_LIST", "PLBartForCausalLM", "PLBartForConditionalGeneration", "PLBartForSequenceClassification", @@ -2673,6 +3018,7 @@ ) _import_structure["models.poolformer"].extend( [ + "POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "PoolFormerForImageClassification", "PoolFormerModel", "PoolFormerPreTrainedModel", @@ -2680,12 +3026,14 @@ ) _import_structure["models.pop2piano"].extend( [ + "POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST", "Pop2PianoForConditionalGeneration", "Pop2PianoPreTrainedModel", ] ) _import_structure["models.prophetnet"].extend( [ + "PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ProphetNetDecoder", "ProphetNetEncoder", "ProphetNetForCausalLM", @@ -2696,6 +3044,7 @@ ) _import_structure["models.pvt"].extend( [ + "PVT_PRETRAINED_MODEL_ARCHIVE_LIST", "PvtForImageClassification", "PvtModel", "PvtPreTrainedModel", @@ -2712,6 +3061,7 @@ ) _import_structure["models.qdqbert"].extend( [ + "QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "QDQBertForMaskedLM", "QDQBertForMultipleChoice", "QDQBertForNextSentencePrediction", @@ -2743,6 +3093,7 @@ ) _import_structure["models.realm"].extend( [ + "REALM_PRETRAINED_MODEL_ARCHIVE_LIST", "RealmEmbedder", "RealmForOpenQA", "RealmKnowledgeAugEncoder", @@ -2755,6 +3106,7 @@ ) _import_structure["models.reformer"].extend( [ + "REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ReformerAttention", "ReformerForMaskedLM", "ReformerForQuestionAnswering", @@ -2767,6 +3119,7 @@ ) _import_structure["models.regnet"].extend( [ + "REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "RegNetForImageClassification", "RegNetModel", "RegNetPreTrainedModel", @@ -2774,6 +3127,7 @@ ) _import_structure["models.rembert"].extend( [ + "REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RemBertForCausalLM", "RemBertForMaskedLM", "RemBertForMultipleChoice", @@ -2788,6 +3142,7 @@ ) _import_structure["models.resnet"].extend( [ + "RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ResNetBackbone", "ResNetForImageClassification", "ResNetModel", @@ -2796,6 +3151,7 @@ ) _import_structure["models.roberta"].extend( [ + "ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaForCausalLM", "RobertaForMaskedLM", "RobertaForMultipleChoice", @@ -2808,6 +3164,7 @@ ) _import_structure["models.roberta_prelayernorm"].extend( [ + "ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaPreLayerNormForCausalLM", "RobertaPreLayerNormForMaskedLM", "RobertaPreLayerNormForMultipleChoice", @@ -2820,6 +3177,7 @@ ) _import_structure["models.roc_bert"].extend( [ + "ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RoCBertForCausalLM", "RoCBertForMaskedLM", "RoCBertForMultipleChoice", @@ -2835,6 +3193,7 @@ ) _import_structure["models.roformer"].extend( [ + "ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "RoFormerForCausalLM", "RoFormerForMaskedLM", "RoFormerForMultipleChoice", @@ -2849,6 +3208,7 @@ ) _import_structure["models.rwkv"].extend( [ + "RWKV_PRETRAINED_MODEL_ARCHIVE_LIST", "RwkvForCausalLM", "RwkvModel", "RwkvPreTrainedModel", @@ -2856,12 +3216,14 @@ ) _import_structure["models.sam"].extend( [ + "SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "SamModel", "SamPreTrainedModel", ] ) _import_structure["models.seamless_m4t"].extend( [ + "SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4TCodeHifiGan", "SeamlessM4TForSpeechToSpeech", "SeamlessM4TForSpeechToText", @@ -2876,6 +3238,7 @@ ) _import_structure["models.seamless_m4t_v2"].extend( [ + "SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4Tv2ForSpeechToSpeech", "SeamlessM4Tv2ForSpeechToText", "SeamlessM4Tv2ForTextToSpeech", @@ -2886,6 +3249,7 @@ ) _import_structure["models.segformer"].extend( [ + "SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SegformerDecodeHead", "SegformerForImageClassification", "SegformerForSemanticSegmentation", @@ -2896,6 +3260,7 @@ ) _import_structure["models.seggpt"].extend( [ + "SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "SegGptForImageSegmentation", "SegGptModel", "SegGptPreTrainedModel", @@ -2903,6 +3268,7 @@ ) _import_structure["models.sew"].extend( [ + "SEW_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWForCTC", "SEWForSequenceClassification", "SEWModel", @@ -2911,6 +3277,7 @@ ) _import_structure["models.sew_d"].extend( [ + "SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWDForCTC", "SEWDForSequenceClassification", "SEWDModel", @@ -2919,6 +3286,7 @@ ) _import_structure["models.siglip"].extend( [ + "SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "SiglipForImageClassification", "SiglipModel", "SiglipPreTrainedModel", @@ -2929,6 +3297,7 @@ _import_structure["models.speech_encoder_decoder"].extend(["SpeechEncoderDecoderModel"]) _import_structure["models.speech_to_text"].extend( [ + "SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "Speech2TextForConditionalGeneration", "Speech2TextModel", "Speech2TextPreTrainedModel", @@ -2937,6 +3306,7 @@ _import_structure["models.speech_to_text_2"].extend(["Speech2Text2ForCausalLM", "Speech2Text2PreTrainedModel"]) _import_structure["models.speecht5"].extend( [ + "SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST", "SpeechT5ForSpeechToSpeech", "SpeechT5ForSpeechToText", "SpeechT5ForTextToSpeech", @@ -2947,6 +3317,7 @@ ) _import_structure["models.splinter"].extend( [ + "SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST", "SplinterForPreTraining", "SplinterForQuestionAnswering", "SplinterLayer", @@ -2956,6 +3327,7 @@ ) _import_structure["models.squeezebert"].extend( [ + "SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "SqueezeBertForMaskedLM", "SqueezeBertForMultipleChoice", "SqueezeBertForQuestionAnswering", @@ -2991,6 +3363,7 @@ ) _import_structure["models.swiftformer"].extend( [ + "SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SwiftFormerForImageClassification", "SwiftFormerModel", "SwiftFormerPreTrainedModel", @@ -2998,6 +3371,7 @@ ) _import_structure["models.swin"].extend( [ + "SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "SwinBackbone", "SwinForImageClassification", "SwinForMaskedImageModeling", @@ -3007,6 +3381,7 @@ ) _import_structure["models.swin2sr"].extend( [ + "SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST", "Swin2SRForImageSuperResolution", "Swin2SRModel", "Swin2SRPreTrainedModel", @@ -3014,6 +3389,7 @@ ) _import_structure["models.swinv2"].extend( [ + "SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Swinv2Backbone", "Swinv2ForImageClassification", "Swinv2ForMaskedImageModeling", @@ -3023,6 +3399,7 @@ ) _import_structure["models.switch_transformers"].extend( [ + "SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST", "SwitchTransformersEncoderModel", "SwitchTransformersForConditionalGeneration", "SwitchTransformersModel", @@ -3033,6 +3410,7 @@ ) _import_structure["models.t5"].extend( [ + "T5_PRETRAINED_MODEL_ARCHIVE_LIST", "T5EncoderModel", "T5ForConditionalGeneration", "T5ForQuestionAnswering", @@ -3045,6 +3423,7 @@ ) _import_structure["models.table_transformer"].extend( [ + "TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TableTransformerForObjectDetection", "TableTransformerModel", "TableTransformerPreTrainedModel", @@ -3052,6 +3431,7 @@ ) _import_structure["models.tapas"].extend( [ + "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TapasForMaskedLM", "TapasForQuestionAnswering", "TapasForSequenceClassification", @@ -3062,6 +3442,7 @@ ) _import_structure["models.time_series_transformer"].extend( [ + "TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimeSeriesTransformerForPrediction", "TimeSeriesTransformerModel", "TimeSeriesTransformerPreTrainedModel", @@ -3069,6 +3450,7 @@ ) _import_structure["models.timesformer"].extend( [ + "TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimesformerForVideoClassification", "TimesformerModel", "TimesformerPreTrainedModel", @@ -3077,12 +3459,14 @@ _import_structure["models.timm_backbone"].extend(["TimmBackbone"]) _import_structure["models.trocr"].extend( [ + "TROCR_PRETRAINED_MODEL_ARCHIVE_LIST", "TrOCRForCausalLM", "TrOCRPreTrainedModel", ] ) _import_structure["models.tvlt"].extend( [ + "TVLT_PRETRAINED_MODEL_ARCHIVE_LIST", "TvltForAudioVisualClassification", "TvltForPreTraining", "TvltModel", @@ -3091,6 +3475,7 @@ ) _import_structure["models.tvp"].extend( [ + "TVP_PRETRAINED_MODEL_ARCHIVE_LIST", "TvpForVideoGrounding", "TvpModel", "TvpPreTrainedModel", @@ -3098,6 +3483,7 @@ ) _import_structure["models.udop"].extend( [ + "UDOP_PRETRAINED_MODEL_ARCHIVE_LIST", "UdopEncoderModel", "UdopForConditionalGeneration", "UdopModel", @@ -3117,6 +3503,7 @@ ) _import_structure["models.unispeech"].extend( [ + "UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechForCTC", "UniSpeechForPreTraining", "UniSpeechForSequenceClassification", @@ -3126,6 +3513,7 @@ ) _import_structure["models.unispeech_sat"].extend( [ + "UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechSatForAudioFrameClassification", "UniSpeechSatForCTC", "UniSpeechSatForPreTraining", @@ -3137,6 +3525,7 @@ ) _import_structure["models.univnet"].extend( [ + "UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST", "UnivNetModel", ] ) @@ -3148,6 +3537,7 @@ ) _import_structure["models.videomae"].extend( [ + "VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST", "VideoMAEForPreTraining", "VideoMAEForVideoClassification", "VideoMAEModel", @@ -3156,6 +3546,7 @@ ) _import_structure["models.vilt"].extend( [ + "VILT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViltForImageAndTextRetrieval", "ViltForImagesAndTextClassification", "ViltForMaskedLM", @@ -3168,6 +3559,7 @@ ) _import_structure["models.vipllava"].extend( [ + "VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "VipLlavaForConditionalGeneration", "VipLlavaPreTrainedModel", ] @@ -3176,6 +3568,7 @@ _import_structure["models.vision_text_dual_encoder"].extend(["VisionTextDualEncoderModel"]) _import_structure["models.visual_bert"].extend( [ + "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "VisualBertForMultipleChoice", "VisualBertForPreTraining", "VisualBertForQuestionAnswering", @@ -3188,6 +3581,7 @@ ) _import_structure["models.vit"].extend( [ + "VIT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTForImageClassification", "ViTForMaskedImageModeling", "ViTModel", @@ -3196,6 +3590,7 @@ ) _import_structure["models.vit_hybrid"].extend( [ + "VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTHybridForImageClassification", "ViTHybridModel", "ViTHybridPreTrainedModel", @@ -3203,6 +3598,7 @@ ) _import_structure["models.vit_mae"].extend( [ + "VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMAEForPreTraining", "ViTMAELayer", "ViTMAEModel", @@ -3211,6 +3607,7 @@ ) _import_structure["models.vit_msn"].extend( [ + "VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMSNForImageClassification", "ViTMSNModel", "ViTMSNPreTrainedModel", @@ -3218,6 +3615,7 @@ ) _import_structure["models.vitdet"].extend( [ + "VITDET_PRETRAINED_MODEL_ARCHIVE_LIST", "VitDetBackbone", "VitDetModel", "VitDetPreTrainedModel", @@ -3225,18 +3623,21 @@ ) _import_structure["models.vitmatte"].extend( [ + "VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST", "VitMatteForImageMatting", "VitMattePreTrainedModel", ] ) _import_structure["models.vits"].extend( [ + "VITS_PRETRAINED_MODEL_ARCHIVE_LIST", "VitsModel", "VitsPreTrainedModel", ] ) _import_structure["models.vivit"].extend( [ + "VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "VivitForVideoClassification", "VivitModel", "VivitPreTrainedModel", @@ -3244,6 +3645,7 @@ ) _import_structure["models.wav2vec2"].extend( [ + "WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ForAudioFrameClassification", "Wav2Vec2ForCTC", "Wav2Vec2ForMaskedLM", @@ -3256,6 +3658,7 @@ ) _import_structure["models.wav2vec2_bert"].extend( [ + "WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2BertForAudioFrameClassification", "Wav2Vec2BertForCTC", "Wav2Vec2BertForSequenceClassification", @@ -3266,6 +3669,7 @@ ) _import_structure["models.wav2vec2_conformer"].extend( [ + "WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ConformerForAudioFrameClassification", "Wav2Vec2ConformerForCTC", "Wav2Vec2ConformerForPreTraining", @@ -3277,6 +3681,7 @@ ) _import_structure["models.wavlm"].extend( [ + "WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST", "WavLMForAudioFrameClassification", "WavLMForCTC", "WavLMForSequenceClassification", @@ -3287,6 +3692,7 @@ ) _import_structure["models.whisper"].extend( [ + "WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "WhisperForAudioClassification", "WhisperForCausalLM", "WhisperForConditionalGeneration", @@ -3296,6 +3702,7 @@ ) _import_structure["models.x_clip"].extend( [ + "XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "XCLIPModel", "XCLIPPreTrainedModel", "XCLIPTextModel", @@ -3304,6 +3711,7 @@ ) _import_structure["models.xglm"].extend( [ + "XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XGLMForCausalLM", "XGLMModel", "XGLMPreTrainedModel", @@ -3311,6 +3719,7 @@ ) _import_structure["models.xlm"].extend( [ + "XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMForMultipleChoice", "XLMForQuestionAnswering", "XLMForQuestionAnsweringSimple", @@ -3323,6 +3732,7 @@ ) _import_structure["models.xlm_prophetnet"].extend( [ + "XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMProphetNetDecoder", "XLMProphetNetEncoder", "XLMProphetNetForCausalLM", @@ -3333,6 +3743,7 @@ ) _import_structure["models.xlm_roberta"].extend( [ + "XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaForCausalLM", "XLMRobertaForMaskedLM", "XLMRobertaForMultipleChoice", @@ -3345,6 +3756,7 @@ ) _import_structure["models.xlm_roberta_xl"].extend( [ + "XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaXLForCausalLM", "XLMRobertaXLForMaskedLM", "XLMRobertaXLForMultipleChoice", @@ -3357,6 +3769,7 @@ ) _import_structure["models.xlnet"].extend( [ + "XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLNetForMultipleChoice", "XLNetForQuestionAnswering", "XLNetForQuestionAnsweringSimple", @@ -3370,6 +3783,7 @@ ) _import_structure["models.xmod"].extend( [ + "XMOD_PRETRAINED_MODEL_ARCHIVE_LIST", "XmodForCausalLM", "XmodForMaskedLM", "XmodForMultipleChoice", @@ -3382,6 +3796,7 @@ ) _import_structure["models.yolos"].extend( [ + "YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST", "YolosForObjectDetection", "YolosModel", "YolosPreTrainedModel", @@ -3389,6 +3804,7 @@ ) _import_structure["models.yoso"].extend( [ + "YOSO_PRETRAINED_MODEL_ARCHIVE_LIST", "YosoForMaskedLM", "YosoForMultipleChoice", "YosoForQuestionAnswering", @@ -3465,6 +3881,7 @@ # TensorFlow models structure _import_structure["models.albert"].extend( [ + "TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAlbertForMaskedLM", "TFAlbertForMultipleChoice", "TFAlbertForPreTraining", @@ -3534,6 +3951,7 @@ ) _import_structure["models.bert"].extend( [ + "TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBertEmbeddings", "TFBertForMaskedLM", "TFBertForMultipleChoice", @@ -3564,6 +3982,7 @@ ) _import_structure["models.blip"].extend( [ + "TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBlipForConditionalGeneration", "TFBlipForImageTextRetrieval", "TFBlipForQuestionAnswering", @@ -3575,6 +3994,7 @@ ) _import_structure["models.camembert"].extend( [ + "TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCamembertForCausalLM", "TFCamembertForMaskedLM", "TFCamembertForMultipleChoice", @@ -3587,6 +4007,7 @@ ) _import_structure["models.clip"].extend( [ + "TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCLIPModel", "TFCLIPPreTrainedModel", "TFCLIPTextModel", @@ -3595,6 +4016,7 @@ ) _import_structure["models.convbert"].extend( [ + "TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFConvBertForMaskedLM", "TFConvBertForMultipleChoice", "TFConvBertForQuestionAnswering", @@ -3621,6 +4043,7 @@ ) _import_structure["models.ctrl"].extend( [ + "TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCTRLForSequenceClassification", "TFCTRLLMHeadModel", "TFCTRLModel", @@ -3629,6 +4052,7 @@ ) _import_structure["models.cvt"].extend( [ + "TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCvtForImageClassification", "TFCvtModel", "TFCvtPreTrainedModel", @@ -3644,6 +4068,7 @@ ) _import_structure["models.deberta"].extend( [ + "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaForMaskedLM", "TFDebertaForQuestionAnswering", "TFDebertaForSequenceClassification", @@ -3654,6 +4079,7 @@ ) _import_structure["models.deberta_v2"].extend( [ + "TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaV2ForMaskedLM", "TFDebertaV2ForMultipleChoice", "TFDebertaV2ForQuestionAnswering", @@ -3665,6 +4091,7 @@ ) _import_structure["models.deit"].extend( [ + "TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDeiTForImageClassification", "TFDeiTForImageClassificationWithTeacher", "TFDeiTForMaskedImageModeling", @@ -3674,6 +4101,7 @@ ) _import_structure["models.deprecated.transfo_xl"].extend( [ + "TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAdaptiveEmbedding", "TFTransfoXLForSequenceClassification", "TFTransfoXLLMHeadModel", @@ -3684,6 +4112,7 @@ ) _import_structure["models.distilbert"].extend( [ + "TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDistilBertForMaskedLM", "TFDistilBertForMultipleChoice", "TFDistilBertForQuestionAnswering", @@ -3696,6 +4125,9 @@ ) _import_structure["models.dpr"].extend( [ + "TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDPRContextEncoder", "TFDPRPretrainedContextEncoder", "TFDPRPretrainedQuestionEncoder", @@ -3706,6 +4138,7 @@ ) _import_structure["models.efficientformer"].extend( [ + "TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEfficientFormerForImageClassification", "TFEfficientFormerForImageClassificationWithTeacher", "TFEfficientFormerModel", @@ -3714,6 +4147,7 @@ ) _import_structure["models.electra"].extend( [ + "TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFElectraForMaskedLM", "TFElectraForMultipleChoice", "TFElectraForPreTraining", @@ -3727,6 +4161,7 @@ _import_structure["models.encoder_decoder"].append("TFEncoderDecoderModel") _import_structure["models.esm"].extend( [ + "ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEsmForMaskedLM", "TFEsmForSequenceClassification", "TFEsmForTokenClassification", @@ -3736,6 +4171,7 @@ ) _import_structure["models.flaubert"].extend( [ + "TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFlaubertForMultipleChoice", "TFFlaubertForQuestionAnsweringSimple", "TFFlaubertForSequenceClassification", @@ -3747,6 +4183,7 @@ ) _import_structure["models.funnel"].extend( [ + "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFunnelBaseModel", "TFFunnelForMaskedLM", "TFFunnelForMultipleChoice", @@ -3760,6 +4197,7 @@ ) _import_structure["models.gpt2"].extend( [ + "TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGPT2DoubleHeadsModel", "TFGPT2ForSequenceClassification", "TFGPT2LMHeadModel", @@ -3779,6 +4217,7 @@ ) _import_structure["models.groupvit"].extend( [ + "TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGroupViTModel", "TFGroupViTPreTrainedModel", "TFGroupViTTextModel", @@ -3787,6 +4226,7 @@ ) _import_structure["models.hubert"].extend( [ + "TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFHubertForCTC", "TFHubertModel", "TFHubertPreTrainedModel", @@ -3794,6 +4234,7 @@ ) _import_structure["models.layoutlm"].extend( [ + "TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMForMaskedLM", "TFLayoutLMForQuestionAnswering", "TFLayoutLMForSequenceClassification", @@ -3805,6 +4246,7 @@ ) _import_structure["models.layoutlmv3"].extend( [ + "TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMv3ForQuestionAnswering", "TFLayoutLMv3ForSequenceClassification", "TFLayoutLMv3ForTokenClassification", @@ -3815,6 +4257,7 @@ _import_structure["models.led"].extend(["TFLEDForConditionalGeneration", "TFLEDModel", "TFLEDPreTrainedModel"]) _import_structure["models.longformer"].extend( [ + "TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLongformerForMaskedLM", "TFLongformerForMultipleChoice", "TFLongformerForQuestionAnswering", @@ -3827,6 +4270,7 @@ ) _import_structure["models.lxmert"].extend( [ + "TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLxmertForPreTraining", "TFLxmertMainLayer", "TFLxmertModel", @@ -3840,6 +4284,7 @@ ) _import_structure["models.mobilebert"].extend( [ + "TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileBertForMaskedLM", "TFMobileBertForMultipleChoice", "TFMobileBertForNextSentencePrediction", @@ -3854,6 +4299,7 @@ ) _import_structure["models.mobilevit"].extend( [ + "TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileViTForImageClassification", "TFMobileViTForSemanticSegmentation", "TFMobileViTModel", @@ -3862,6 +4308,7 @@ ) _import_structure["models.mpnet"].extend( [ + "TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMPNetForMaskedLM", "TFMPNetForMultipleChoice", "TFMPNetForQuestionAnswering", @@ -3875,6 +4322,7 @@ _import_structure["models.mt5"].extend(["TFMT5EncoderModel", "TFMT5ForConditionalGeneration", "TFMT5Model"]) _import_structure["models.openai"].extend( [ + "TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFOpenAIGPTDoubleHeadsModel", "TFOpenAIGPTForSequenceClassification", "TFOpenAIGPTLMHeadModel", @@ -3907,6 +4355,7 @@ ) _import_structure["models.regnet"].extend( [ + "TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRegNetForImageClassification", "TFRegNetModel", "TFRegNetPreTrainedModel", @@ -3914,6 +4363,7 @@ ) _import_structure["models.rembert"].extend( [ + "TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRemBertForCausalLM", "TFRemBertForMaskedLM", "TFRemBertForMultipleChoice", @@ -3927,6 +4377,7 @@ ) _import_structure["models.resnet"].extend( [ + "TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFResNetForImageClassification", "TFResNetModel", "TFResNetPreTrainedModel", @@ -3934,6 +4385,7 @@ ) _import_structure["models.roberta"].extend( [ + "TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaForCausalLM", "TFRobertaForMaskedLM", "TFRobertaForMultipleChoice", @@ -3947,6 +4399,7 @@ ) _import_structure["models.roberta_prelayernorm"].extend( [ + "TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaPreLayerNormForCausalLM", "TFRobertaPreLayerNormForMaskedLM", "TFRobertaPreLayerNormForMultipleChoice", @@ -3960,6 +4413,7 @@ ) _import_structure["models.roformer"].extend( [ + "TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRoFormerForCausalLM", "TFRoFormerForMaskedLM", "TFRoFormerForMultipleChoice", @@ -3973,12 +4427,14 @@ ) _import_structure["models.sam"].extend( [ + "TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSamModel", "TFSamPreTrainedModel", ] ) _import_structure["models.segformer"].extend( [ + "TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSegformerDecodeHead", "TFSegformerForImageClassification", "TFSegformerForSemanticSegmentation", @@ -3988,6 +4444,7 @@ ) _import_structure["models.speech_to_text"].extend( [ + "TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSpeech2TextForConditionalGeneration", "TFSpeech2TextModel", "TFSpeech2TextPreTrainedModel", @@ -3995,6 +4452,7 @@ ) _import_structure["models.swin"].extend( [ + "TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSwinForImageClassification", "TFSwinForMaskedImageModeling", "TFSwinModel", @@ -4003,6 +4461,7 @@ ) _import_structure["models.t5"].extend( [ + "TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST", "TFT5EncoderModel", "TFT5ForConditionalGeneration", "TFT5Model", @@ -4011,6 +4470,7 @@ ) _import_structure["models.tapas"].extend( [ + "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TFTapasForMaskedLM", "TFTapasForQuestionAnswering", "TFTapasForSequenceClassification", @@ -4036,6 +4496,7 @@ ) _import_structure["models.wav2vec2"].extend( [ + "TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWav2Vec2ForCTC", "TFWav2Vec2ForSequenceClassification", "TFWav2Vec2Model", @@ -4044,6 +4505,7 @@ ) _import_structure["models.whisper"].extend( [ + "TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWhisperForConditionalGeneration", "TFWhisperModel", "TFWhisperPreTrainedModel", @@ -4051,6 +4513,7 @@ ) _import_structure["models.xglm"].extend( [ + "TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXGLMForCausalLM", "TFXGLMModel", "TFXGLMPreTrainedModel", @@ -4058,6 +4521,7 @@ ) _import_structure["models.xlm"].extend( [ + "TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMForMultipleChoice", "TFXLMForQuestionAnsweringSimple", "TFXLMForSequenceClassification", @@ -4070,6 +4534,7 @@ ) _import_structure["models.xlm_roberta"].extend( [ + "TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMRobertaForCausalLM", "TFXLMRobertaForMaskedLM", "TFXLMRobertaForMultipleChoice", @@ -4082,6 +4547,7 @@ ) _import_structure["models.xlnet"].extend( [ + "TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLNetForMultipleChoice", "TFXLNetForQuestionAnsweringSimple", "TFXLNetForSequenceClassification", @@ -4460,6 +4926,7 @@ ) _import_structure["models.xlm_roberta"].extend( [ + "FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaxXLMRobertaForMaskedLM", "FlaxXLMRobertaForMultipleChoice", "FlaxXLMRobertaForQuestionAnswering", @@ -4546,24 +5013,28 @@ load_tf2_model_in_pytorch_model, load_tf2_weights_in_pytorch_model, ) - from .models.albert import AlbertConfig + from .models.albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig from .models.align import ( + ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP, AlignConfig, AlignProcessor, AlignTextConfig, AlignVisionConfig, ) from .models.altclip import ( + ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, AltCLIPConfig, AltCLIPProcessor, AltCLIPTextConfig, AltCLIPVisionConfig, ) from .models.audio_spectrogram_transformer import ( + AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ASTConfig, ASTFeatureExtractor, ) from .models.auto import ( + ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, CONFIG_MAPPING, FEATURE_EXTRACTOR_MAPPING, IMAGE_PROCESSOR_MAPPING, @@ -4577,6 +5048,7 @@ AutoTokenizer, ) from .models.autoformer import ( + AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, AutoformerConfig, ) from .models.bark import ( @@ -4587,8 +5059,9 @@ BarkSemanticConfig, ) from .models.bart import BartConfig, BartTokenizer - from .models.beit import BeitConfig + from .models.beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig from .models.bert import ( + BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, BasicTokenizer, BertConfig, BertTokenizer, @@ -4601,67 +5074,80 @@ MecabTokenizer, ) from .models.bertweet import BertweetTokenizer - from .models.big_bird import BigBirdConfig + from .models.big_bird import BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdConfig from .models.bigbird_pegasus import ( + BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdPegasusConfig, ) from .models.biogpt import ( + BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, BioGptConfig, BioGptTokenizer, ) - from .models.bit import BitConfig + from .models.bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig from .models.blenderbot import ( + BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotConfig, BlenderbotTokenizer, ) from .models.blenderbot_small import ( + BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotSmallConfig, BlenderbotSmallTokenizer, ) from .models.blip import ( + BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, BlipConfig, BlipProcessor, BlipTextConfig, BlipVisionConfig, ) from .models.blip_2 import ( + BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Blip2Config, Blip2Processor, Blip2QFormerConfig, Blip2VisionConfig, ) - from .models.bloom import BloomConfig + from .models.bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig from .models.bridgetower import ( + BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP, BridgeTowerConfig, BridgeTowerProcessor, BridgeTowerTextConfig, BridgeTowerVisionConfig, ) from .models.bros import ( + BROS_PRETRAINED_CONFIG_ARCHIVE_MAP, BrosConfig, BrosProcessor, ) from .models.byt5 import ByT5Tokenizer from .models.camembert import ( + CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, CamembertConfig, ) from .models.canine import ( + CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP, CanineConfig, CanineTokenizer, ) from .models.chinese_clip import ( + CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, ChineseCLIPConfig, ChineseCLIPProcessor, ChineseCLIPTextConfig, ChineseCLIPVisionConfig, ) from .models.clap import ( + CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioConfig, ClapConfig, ClapProcessor, ClapTextConfig, ) from .models.clip import ( + CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPConfig, CLIPProcessor, CLIPTextConfig, @@ -4669,12 +5155,14 @@ CLIPVisionConfig, ) from .models.clipseg import ( + CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPSegConfig, CLIPSegProcessor, CLIPSegTextConfig, CLIPSegVisionConfig, ) from .models.clvp import ( + CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP, ClvpConfig, ClvpDecoderConfig, ClvpEncoderConfig, @@ -4683,198 +5171,241 @@ ClvpTokenizer, ) from .models.codegen import ( + CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, CodeGenConfig, CodeGenTokenizer, ) from .models.cohere import COHERE_PRETRAINED_CONFIG_ARCHIVE_MAP, CohereConfig from .models.conditional_detr import ( + CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, ConditionalDetrConfig, ) from .models.convbert import ( + CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertTokenizer, ) - from .models.convnext import ConvNextConfig + from .models.convnext import CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextConfig from .models.convnextv2 import ( + CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextV2Config, ) from .models.cpmant import ( + CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP, CpmAntConfig, CpmAntTokenizer, ) from .models.ctrl import ( + CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig, CTRLTokenizer, ) - from .models.cvt import CvtConfig + from .models.cvt import CVT_PRETRAINED_CONFIG_ARCHIVE_MAP, CvtConfig from .models.data2vec import ( + DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, + DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecAudioConfig, Data2VecTextConfig, Data2VecVisionConfig, ) from .models.deberta import ( + DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaTokenizer, ) from .models.deberta_v2 import ( + DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaV2Config, ) from .models.decision_transformer import ( + DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, DecisionTransformerConfig, ) from .models.deformable_detr import ( + DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DeformableDetrConfig, ) - from .models.deit import DeiTConfig + from .models.deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig from .models.deprecated.mctct import ( + MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig, MCTCTFeatureExtractor, MCTCTProcessor, ) from .models.deprecated.mmbt import MMBTConfig from .models.deprecated.open_llama import ( + OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenLlamaConfig, ) from .models.deprecated.retribert import ( + RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RetriBertConfig, RetriBertTokenizer, ) from .models.deprecated.tapex import TapexTokenizer from .models.deprecated.trajectory_transformer import ( + TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TrajectoryTransformerConfig, ) from .models.deprecated.transfo_xl import ( + TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig, TransfoXLCorpus, TransfoXLTokenizer, ) - from .models.deprecated.van import VanConfig - from .models.depth_anything import DepthAnythingConfig - from .models.deta import DetaConfig - from .models.detr import DetrConfig - from .models.dinat import DinatConfig - from .models.dinov2 import Dinov2Config + from .models.deprecated.van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig + from .models.depth_anything import DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP, DepthAnythingConfig + from .models.deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig + from .models.detr import DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DetrConfig + from .models.dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig + from .models.dinov2 import DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Dinov2Config from .models.distilbert import ( + DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, DistilBertConfig, DistilBertTokenizer, ) from .models.donut import ( + DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutProcessor, DonutSwinConfig, ) from .models.dpr import ( + DPR_PRETRAINED_CONFIG_ARCHIVE_MAP, DPRConfig, DPRContextEncoderTokenizer, DPRQuestionEncoderTokenizer, DPRReaderOutput, DPRReaderTokenizer, ) - from .models.dpt import DPTConfig + from .models.dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig from .models.efficientformer import ( + EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientFormerConfig, ) from .models.efficientnet import ( + EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientNetConfig, ) from .models.electra import ( + ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraTokenizer, ) from .models.encodec import ( + ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP, EncodecConfig, EncodecFeatureExtractor, ) from .models.encoder_decoder import EncoderDecoderConfig - from .models.ernie import ErnieConfig - from .models.ernie_m import ErnieMConfig - from .models.esm import EsmConfig, EsmTokenizer - from .models.falcon import FalconConfig + from .models.ernie import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieConfig + from .models.ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig + from .models.esm import ESM_PRETRAINED_CONFIG_ARCHIVE_MAP, EsmConfig, EsmTokenizer + from .models.falcon import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP, FalconConfig from .models.fastspeech2_conformer import ( + FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, + FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, + FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, FastSpeech2ConformerConfig, FastSpeech2ConformerHifiGanConfig, FastSpeech2ConformerTokenizer, FastSpeech2ConformerWithHifiGanConfig, ) - from .models.flaubert import FlaubertConfig, FlaubertTokenizer + from .models.flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertTokenizer from .models.flava import ( + FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, FlavaConfig, FlavaImageCodebookConfig, FlavaImageConfig, FlavaMultimodalConfig, FlavaTextConfig, ) - from .models.fnet import FNetConfig - from .models.focalnet import FocalNetConfig + from .models.fnet import FNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FNetConfig + from .models.focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig from .models.fsmt import ( + FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP, FSMTConfig, FSMTTokenizer, ) from .models.funnel import ( + FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig, FunnelTokenizer, ) - from .models.fuyu import FuyuConfig - from .models.gemma import GemmaConfig + from .models.fuyu import FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP, FuyuConfig + from .models.gemma import GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP, GemmaConfig from .models.git import ( + GIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GitConfig, GitProcessor, GitVisionConfig, ) - from .models.glpn import GLPNConfig + from .models.glpn import GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP, GLPNConfig from .models.gpt2 import ( + GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2Tokenizer, ) from .models.gpt_bigcode import ( + GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig, ) - from .models.gpt_neo import GPTNeoConfig - from .models.gpt_neox import GPTNeoXConfig + from .models.gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig + from .models.gpt_neox import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXConfig from .models.gpt_neox_japanese import ( + GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig, ) - from .models.gptj import GPTJConfig + from .models.gptj import GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTJConfig from .models.gptsan_japanese import ( + GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTSanJapaneseConfig, GPTSanJapaneseTokenizer, ) from .models.graphormer import ( + GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, GraphormerConfig, ) from .models.groupvit import ( + GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GroupViTConfig, GroupViTTextConfig, GroupViTVisionConfig, ) from .models.herbert import HerbertTokenizer - from .models.hubert import HubertConfig - from .models.ibert import IBertConfig + from .models.hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig + from .models.ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig from .models.idefics import ( + IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP, IdeficsConfig, ) - from .models.imagegpt import ImageGPTConfig - from .models.informer import InformerConfig + from .models.imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig + from .models.informer import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, InformerConfig from .models.instructblip import ( + INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, InstructBlipConfig, InstructBlipProcessor, InstructBlipQFormerConfig, InstructBlipVisionConfig, ) from .models.jukebox import ( + JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP, JukeboxConfig, JukeboxPriorConfig, JukeboxTokenizer, JukeboxVQVAEConfig, ) from .models.kosmos2 import ( + KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP, Kosmos2Config, Kosmos2Processor, ) from .models.layoutlm import ( + LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig, LayoutLMTokenizer, ) from .models.layoutlmv2 import ( + LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv2Config, LayoutLMv2FeatureExtractor, LayoutLMv2ImageProcessor, @@ -4882,6 +5413,7 @@ LayoutLMv2Tokenizer, ) from .models.layoutlmv3 import ( + LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv3Config, LayoutLMv3FeatureExtractor, LayoutLMv3ImageProcessor, @@ -4889,11 +5421,12 @@ LayoutLMv3Tokenizer, ) from .models.layoutxlm import LayoutXLMProcessor - from .models.led import LEDConfig, LEDTokenizer - from .models.levit import LevitConfig - from .models.lilt import LiltConfig - from .models.llama import LlamaConfig + from .models.led import LED_PRETRAINED_CONFIG_ARCHIVE_MAP, LEDConfig, LEDTokenizer + from .models.levit import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, LevitConfig + from .models.lilt import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP, LiltConfig + from .models.llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig from .models.llava import ( + LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlavaConfig, LlavaProcessor, ) @@ -4903,70 +5436,85 @@ LlavaNextProcessor, ) from .models.longformer import ( + LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, LongformerConfig, LongformerTokenizer, ) - from .models.longt5 import LongT5Config + from .models.longt5 import LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP, LongT5Config from .models.luke import ( + LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig, LukeTokenizer, ) from .models.lxmert import ( + LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, LxmertConfig, LxmertTokenizer, ) - from .models.m2m_100 import M2M100Config - from .models.mamba import MambaConfig + from .models.m2m_100 import M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP, M2M100Config + from .models.mamba import MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP, MambaConfig from .models.marian import MarianConfig from .models.markuplm import ( + MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig, MarkupLMFeatureExtractor, MarkupLMProcessor, MarkupLMTokenizer, ) from .models.mask2former import ( + MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Mask2FormerConfig, ) from .models.maskformer import ( + MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, MaskFormerConfig, MaskFormerSwinConfig, ) from .models.mbart import MBartConfig - from .models.mega import MegaConfig + from .models.mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig from .models.megatron_bert import ( + MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig, ) from .models.mgp_str import ( + MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig, MgpstrProcessor, MgpstrTokenizer, ) - from .models.mistral import MistralConfig - from .models.mixtral import MixtralConfig + from .models.mistral import MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MistralConfig + from .models.mixtral import MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MixtralConfig from .models.mobilebert import ( + MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileBertConfig, MobileBertTokenizer, ) from .models.mobilenet_v1 import ( + MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV1Config, ) from .models.mobilenet_v2 import ( + MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV2Config, ) from .models.mobilevit import ( + MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTConfig, ) from .models.mobilevitv2 import ( + MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTV2Config, ) from .models.mpnet import ( + MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig, MPNetTokenizer, ) - from .models.mpt import MptConfig - from .models.mra import MraConfig + from .models.mpt import MPT_PRETRAINED_CONFIG_ARCHIVE_MAP, MptConfig + from .models.mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig from .models.mt5 import MT5Config from .models.musicgen import ( + MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, MusicgenConfig, MusicgenDecoderConfig, ) @@ -4976,68 +5524,82 @@ MusicgenMelodyDecoderConfig, ) from .models.mvp import MvpConfig, MvpTokenizer - from .models.nat import NatConfig - from .models.nezha import NezhaConfig - from .models.nllb_moe import NllbMoeConfig + from .models.nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig + from .models.nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig + from .models.nllb_moe import NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP, NllbMoeConfig from .models.nougat import NougatProcessor from .models.nystromformer import ( + NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, NystromformerConfig, ) from .models.oneformer import ( + ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, OneFormerConfig, OneFormerProcessor, ) from .models.openai import ( + OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig, OpenAIGPTTokenizer, ) from .models.opt import OPTConfig from .models.owlv2 import ( + OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Owlv2Config, Owlv2Processor, Owlv2TextConfig, Owlv2VisionConfig, ) from .models.owlvit import ( + OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, OwlViTConfig, OwlViTProcessor, OwlViTTextConfig, OwlViTVisionConfig, ) from .models.patchtsmixer import ( + PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSMixerConfig, ) - from .models.patchtst import PatchTSTConfig + from .models.patchtst import PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSTConfig from .models.pegasus import ( + PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig, PegasusTokenizer, ) from .models.pegasus_x import ( + PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig, ) from .models.perceiver import ( + PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverTokenizer, ) from .models.persimmon import ( + PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP, PersimmonConfig, ) - from .models.phi import PhiConfig + from .models.phi import PHI_PRETRAINED_CONFIG_ARCHIVE_MAP, PhiConfig from .models.phobert import PhobertTokenizer from .models.pix2struct import ( + PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP, Pix2StructConfig, Pix2StructProcessor, Pix2StructTextConfig, Pix2StructVisionConfig, ) - from .models.plbart import PLBartConfig + from .models.plbart import PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP, PLBartConfig from .models.poolformer import ( + POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, PoolFormerConfig, ) from .models.pop2piano import ( + POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP, Pop2PianoConfig, ) from .models.prophetnet import ( + PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ProphetNetConfig, ProphetNetTokenizer, ) @@ -5047,30 +5609,36 @@ from .models.qwen2 import Qwen2Config, Qwen2Tokenizer from .models.rag import RagConfig, RagRetriever, RagTokenizer from .models.realm import ( + REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, RealmConfig, RealmTokenizer, ) - from .models.reformer import ReformerConfig - from .models.regnet import RegNetConfig - from .models.rembert import RemBertConfig - from .models.resnet import ResNetConfig + from .models.reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig + from .models.regnet import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP, RegNetConfig + from .models.rembert import REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RemBertConfig + from .models.resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig from .models.roberta import ( + ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaConfig, RobertaTokenizer, ) from .models.roberta_prelayernorm import ( + ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaPreLayerNormConfig, ) from .models.roc_bert import ( + ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RoCBertConfig, RoCBertTokenizer, ) from .models.roformer import ( + ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, RoFormerConfig, RoFormerTokenizer, ) - from .models.rwkv import RwkvConfig + from .models.rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig from .models.sam import ( + SAM_PRETRAINED_CONFIG_ARCHIVE_MAP, SamConfig, SamMaskDecoderConfig, SamProcessor, @@ -5078,18 +5646,21 @@ SamVisionConfig, ) from .models.seamless_m4t import ( + SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4TConfig, SeamlessM4TFeatureExtractor, SeamlessM4TProcessor, ) from .models.seamless_m4t_v2 import ( + SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4Tv2Config, ) - from .models.segformer import SegformerConfig - from .models.seggpt import SegGptConfig - from .models.sew import SEWConfig - from .models.sew_d import SEWDConfig + from .models.segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig + from .models.seggpt import SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, SegGptConfig + from .models.sew import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWConfig + from .models.sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig from .models.siglip import ( + SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, SiglipConfig, SiglipProcessor, SiglipTextConfig, @@ -5097,26 +5668,32 @@ ) from .models.speech_encoder_decoder import SpeechEncoderDecoderConfig from .models.speech_to_text import ( + SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2TextConfig, Speech2TextFeatureExtractor, Speech2TextProcessor, ) from .models.speech_to_text_2 import ( + SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2Text2Config, Speech2Text2Processor, Speech2Text2Tokenizer, ) from .models.speecht5 import ( + SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP, + SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP, SpeechT5Config, SpeechT5FeatureExtractor, SpeechT5HifiGanConfig, SpeechT5Processor, ) from .models.splinter import ( + SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig, SplinterTokenizer, ) from .models.squeezebert import ( + SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, SqueezeBertConfig, SqueezeBertTokenizer, ) @@ -5124,63 +5701,77 @@ from .models.starcoder2 import STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP, Starcoder2Config from .models.superpoint import SUPERPOINT_PRETRAINED_CONFIG_ARCHIVE_MAP, SuperPointConfig from .models.swiftformer import ( + SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SwiftFormerConfig, ) - from .models.swin import SwinConfig - from .models.swin2sr import Swin2SRConfig - from .models.swinv2 import Swinv2Config + from .models.swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig + from .models.swin2sr import SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP, Swin2SRConfig + from .models.swinv2 import SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Swinv2Config from .models.switch_transformers import ( + SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP, SwitchTransformersConfig, ) - from .models.t5 import T5Config + from .models.t5 import T5_PRETRAINED_CONFIG_ARCHIVE_MAP, T5Config from .models.table_transformer import ( + TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TableTransformerConfig, ) from .models.tapas import ( + TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig, TapasTokenizer, ) from .models.time_series_transformer import ( + TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimeSeriesTransformerConfig, ) from .models.timesformer import ( + TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig, ) from .models.timm_backbone import TimmBackboneConfig from .models.trocr import ( + TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig, TrOCRProcessor, ) from .models.tvlt import ( + TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP, TvltConfig, TvltFeatureExtractor, TvltProcessor, ) from .models.tvp import ( + TVP_PRETRAINED_CONFIG_ARCHIVE_MAP, TvpConfig, TvpProcessor, ) - from .models.udop import UdopConfig, UdopProcessor + from .models.udop import UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP, UdopConfig, UdopProcessor from .models.umt5 import UMT5Config from .models.unispeech import ( + UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechConfig, ) from .models.unispeech_sat import ( + UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig, ) from .models.univnet import ( + UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP, UnivNetConfig, UnivNetFeatureExtractor, ) from .models.upernet import UperNetConfig - from .models.videomae import VideoMAEConfig + from .models.videomae import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP, VideoMAEConfig from .models.vilt import ( + VILT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViltConfig, ViltFeatureExtractor, ViltImageProcessor, ViltProcessor, ) from .models.vipllava import ( + VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, VipLlavaConfig, ) from .models.vision_encoder_decoder import VisionEncoderDecoderConfig @@ -5189,22 +5780,26 @@ VisionTextDualEncoderProcessor, ) from .models.visual_bert import ( + VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig, ) - from .models.vit import ViTConfig + from .models.vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig from .models.vit_hybrid import ( + VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTHybridConfig, ) - from .models.vit_mae import ViTMAEConfig - from .models.vit_msn import ViTMSNConfig - from .models.vitdet import VitDetConfig - from .models.vitmatte import VitMatteConfig + from .models.vit_mae import VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMAEConfig + from .models.vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig + from .models.vitdet import VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP, VitDetConfig + from .models.vitmatte import VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP, VitMatteConfig from .models.vits import ( + VITS_PRETRAINED_CONFIG_ARCHIVE_MAP, VitsConfig, VitsTokenizer, ) - from .models.vivit import VivitConfig + from .models.vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig from .models.wav2vec2 import ( + WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2Config, Wav2Vec2CTCTokenizer, Wav2Vec2FeatureExtractor, @@ -5212,42 +5807,49 @@ Wav2Vec2Tokenizer, ) from .models.wav2vec2_bert import ( + WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2BertConfig, Wav2Vec2BertProcessor, ) from .models.wav2vec2_conformer import ( + WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2ConformerConfig, ) from .models.wav2vec2_phoneme import Wav2Vec2PhonemeCTCTokenizer from .models.wav2vec2_with_lm import Wav2Vec2ProcessorWithLM - from .models.wavlm import WavLMConfig + from .models.wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig from .models.whisper import ( + WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperFeatureExtractor, WhisperProcessor, WhisperTokenizer, ) from .models.x_clip import ( + XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, XCLIPConfig, XCLIPProcessor, XCLIPTextConfig, XCLIPVisionConfig, ) - from .models.xglm import XGLMConfig - from .models.xlm import XLMConfig, XLMTokenizer + from .models.xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig + from .models.xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMTokenizer from .models.xlm_prophetnet import ( + XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig, ) from .models.xlm_roberta import ( + XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaConfig, ) from .models.xlm_roberta_xl import ( + XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaXLConfig, ) - from .models.xlnet import XLNetConfig - from .models.xmod import XmodConfig - from .models.yolos import YolosConfig - from .models.yoso import YosoConfig + from .models.xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig + from .models.xmod import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP, XmodConfig + from .models.yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig + from .models.yoso import YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP, YosoConfig # Pipelines from .pipelines import ( @@ -5692,6 +6294,7 @@ ) from .modeling_utils import PreTrainedModel from .models.albert import ( + ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, AlbertForMaskedLM, AlbertForMultipleChoice, AlbertForPreTraining, @@ -5703,18 +6306,21 @@ load_tf_weights_in_albert, ) from .models.align import ( + ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST, AlignModel, AlignPreTrainedModel, AlignTextModel, AlignVisionModel, ) from .models.altclip import ( + ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, AltCLIPModel, AltCLIPPreTrainedModel, AltCLIPTextModel, AltCLIPVisionModel, ) from .models.audio_spectrogram_transformer import ( + AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ASTForAudioClassification, ASTModel, ASTPreTrainedModel, @@ -5802,11 +6408,13 @@ AutoModelWithLMHead, ) from .models.autoformer import ( + AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, AutoformerForPrediction, AutoformerModel, AutoformerPreTrainedModel, ) from .models.bark import ( + BARK_PRETRAINED_MODEL_ARCHIVE_LIST, BarkCausalModel, BarkCoarseModel, BarkFineModel, @@ -5815,6 +6423,7 @@ BarkSemanticModel, ) from .models.bart import ( + BART_PRETRAINED_MODEL_ARCHIVE_LIST, BartForCausalLM, BartForConditionalGeneration, BartForQuestionAnswering, @@ -5825,6 +6434,7 @@ PretrainedBartModel, ) from .models.beit import ( + BEIT_PRETRAINED_MODEL_ARCHIVE_LIST, BeitBackbone, BeitForImageClassification, BeitForMaskedImageModeling, @@ -5833,6 +6443,7 @@ BeitPreTrainedModel, ) from .models.bert import ( + BERT_PRETRAINED_MODEL_ARCHIVE_LIST, BertForMaskedLM, BertForMultipleChoice, BertForNextSentencePrediction, @@ -5853,6 +6464,7 @@ load_tf_weights_in_bert_generation, ) from .models.big_bird import ( + BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdForCausalLM, BigBirdForMaskedLM, BigBirdForMultipleChoice, @@ -5866,6 +6478,7 @@ load_tf_weights_in_big_bird, ) from .models.bigbird_pegasus import ( + BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdPegasusForCausalLM, BigBirdPegasusForConditionalGeneration, BigBirdPegasusForQuestionAnswering, @@ -5874,6 +6487,7 @@ BigBirdPegasusPreTrainedModel, ) from .models.biogpt import ( + BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST, BioGptForCausalLM, BioGptForSequenceClassification, BioGptForTokenClassification, @@ -5881,24 +6495,28 @@ BioGptPreTrainedModel, ) from .models.bit import ( + BIT_PRETRAINED_MODEL_ARCHIVE_LIST, BitBackbone, BitForImageClassification, BitModel, BitPreTrainedModel, ) from .models.blenderbot import ( + BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotForCausalLM, BlenderbotForConditionalGeneration, BlenderbotModel, BlenderbotPreTrainedModel, ) from .models.blenderbot_small import ( + BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotSmallForCausalLM, BlenderbotSmallForConditionalGeneration, BlenderbotSmallModel, BlenderbotSmallPreTrainedModel, ) from .models.blip import ( + BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, BlipForConditionalGeneration, BlipForImageTextRetrieval, BlipForQuestionAnswering, @@ -5908,6 +6526,7 @@ BlipVisionModel, ) from .models.blip_2 import ( + BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST, Blip2ForConditionalGeneration, Blip2Model, Blip2PreTrainedModel, @@ -5915,6 +6534,7 @@ Blip2VisionModel, ) from .models.bloom import ( + BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST, BloomForCausalLM, BloomForQuestionAnswering, BloomForSequenceClassification, @@ -5923,6 +6543,7 @@ BloomPreTrainedModel, ) from .models.bridgetower import ( + BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST, BridgeTowerForContrastiveLearning, BridgeTowerForImageAndTextRetrieval, BridgeTowerForMaskedLM, @@ -5930,6 +6551,7 @@ BridgeTowerPreTrainedModel, ) from .models.bros import ( + BROS_PRETRAINED_MODEL_ARCHIVE_LIST, BrosForTokenClassification, BrosModel, BrosPreTrainedModel, @@ -5938,6 +6560,7 @@ BrosSpadeELForTokenClassification, ) from .models.camembert import ( + CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, CamembertForCausalLM, CamembertForMaskedLM, CamembertForMultipleChoice, @@ -5948,6 +6571,7 @@ CamembertPreTrainedModel, ) from .models.canine import ( + CANINE_PRETRAINED_MODEL_ARCHIVE_LIST, CanineForMultipleChoice, CanineForQuestionAnswering, CanineForSequenceClassification, @@ -5958,12 +6582,14 @@ load_tf_weights_in_canine, ) from .models.chinese_clip import ( + CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, ChineseCLIPModel, ChineseCLIPPreTrainedModel, ChineseCLIPTextModel, ChineseCLIPVisionModel, ) from .models.clap import ( + CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioModel, ClapAudioModelWithProjection, ClapFeatureExtractor, @@ -5973,6 +6599,7 @@ ClapTextModelWithProjection, ) from .models.clip import ( + CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPForImageClassification, CLIPModel, CLIPPreTrainedModel, @@ -5982,6 +6609,7 @@ CLIPVisionModelWithProjection, ) from .models.clipseg import ( + CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPSegForImageSegmentation, CLIPSegModel, CLIPSegPreTrainedModel, @@ -5989,6 +6617,7 @@ CLIPSegVisionModel, ) from .models.clvp import ( + CLVP_PRETRAINED_MODEL_ARCHIVE_LIST, ClvpDecoder, ClvpEncoder, ClvpForCausalLM, @@ -5997,6 +6626,7 @@ ClvpPreTrainedModel, ) from .models.codegen import ( + CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST, CodeGenForCausalLM, CodeGenModel, CodeGenPreTrainedModel, @@ -6007,12 +6637,14 @@ CoherePreTrainedModel, ) from .models.conditional_detr import ( + CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, ConditionalDetrForObjectDetection, ConditionalDetrForSegmentation, ConditionalDetrModel, ConditionalDetrPreTrainedModel, ) from .models.convbert import ( + CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvBertForMaskedLM, ConvBertForMultipleChoice, ConvBertForQuestionAnswering, @@ -6024,34 +6656,42 @@ load_tf_weights_in_convbert, ) from .models.convnext import ( + CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextBackbone, ConvNextForImageClassification, ConvNextModel, ConvNextPreTrainedModel, ) from .models.convnextv2 import ( + CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextV2Backbone, ConvNextV2ForImageClassification, ConvNextV2Model, ConvNextV2PreTrainedModel, ) from .models.cpmant import ( + CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST, CpmAntForCausalLM, CpmAntModel, CpmAntPreTrainedModel, ) from .models.ctrl import ( + CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, CTRLForSequenceClassification, CTRLLMHeadModel, CTRLModel, CTRLPreTrainedModel, ) from .models.cvt import ( + CVT_PRETRAINED_MODEL_ARCHIVE_LIST, CvtForImageClassification, CvtModel, CvtPreTrainedModel, ) from .models.data2vec import ( + DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST, + DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, + DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecAudioForAudioFrameClassification, Data2VecAudioForCTC, Data2VecAudioForSequenceClassification, @@ -6072,6 +6712,7 @@ Data2VecVisionPreTrainedModel, ) from .models.deberta import ( + DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaForMaskedLM, DebertaForQuestionAnswering, DebertaForSequenceClassification, @@ -6080,6 +6721,7 @@ DebertaPreTrainedModel, ) from .models.deberta_v2 import ( + DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaV2ForMaskedLM, DebertaV2ForMultipleChoice, DebertaV2ForQuestionAnswering, @@ -6089,17 +6731,20 @@ DebertaV2PreTrainedModel, ) from .models.decision_transformer import ( + DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, DecisionTransformerGPT2Model, DecisionTransformerGPT2PreTrainedModel, DecisionTransformerModel, DecisionTransformerPreTrainedModel, ) from .models.deformable_detr import ( + DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DeformableDetrForObjectDetection, DeformableDetrModel, DeformableDetrPreTrainedModel, ) from .models.deit import ( + DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, DeiTForImageClassification, DeiTForImageClassificationWithTeacher, DeiTForMaskedImageModeling, @@ -6107,6 +6752,7 @@ DeiTPreTrainedModel, ) from .models.deprecated.mctct import ( + MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel, @@ -6123,14 +6769,17 @@ OpenLlamaPreTrainedModel, ) from .models.deprecated.retribert import ( + RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RetriBertModel, RetriBertPreTrainedModel, ) from .models.deprecated.trajectory_transformer import ( + TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TrajectoryTransformerModel, TrajectoryTransformerPreTrainedModel, ) from .models.deprecated.transfo_xl import ( + TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, AdaptiveEmbedding, TransfoXLForSequenceClassification, TransfoXLLMHeadModel, @@ -6139,38 +6788,45 @@ load_tf_weights_in_transfo_xl, ) from .models.deprecated.van import ( + VAN_PRETRAINED_MODEL_ARCHIVE_LIST, VanForImageClassification, VanModel, VanPreTrainedModel, ) from .models.depth_anything import ( + DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST, DepthAnythingForDepthEstimation, DepthAnythingPreTrainedModel, ) from .models.deta import ( + DETA_PRETRAINED_MODEL_ARCHIVE_LIST, DetaForObjectDetection, DetaModel, DetaPreTrainedModel, ) from .models.detr import ( + DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DetrForObjectDetection, DetrForSegmentation, DetrModel, DetrPreTrainedModel, ) from .models.dinat import ( + DINAT_PRETRAINED_MODEL_ARCHIVE_LIST, DinatBackbone, DinatForImageClassification, DinatModel, DinatPreTrainedModel, ) from .models.dinov2 import ( + DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST, Dinov2Backbone, Dinov2ForImageClassification, Dinov2Model, Dinov2PreTrainedModel, ) from .models.distilbert import ( + DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, DistilBertForMaskedLM, DistilBertForMultipleChoice, DistilBertForQuestionAnswering, @@ -6180,10 +6836,14 @@ DistilBertPreTrainedModel, ) from .models.donut import ( + DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, DonutSwinModel, DonutSwinPreTrainedModel, ) from .models.dpr import ( + DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, DPRContextEncoder, DPRPretrainedContextEncoder, DPRPreTrainedModel, @@ -6193,23 +6853,27 @@ DPRReader, ) from .models.dpt import ( + DPT_PRETRAINED_MODEL_ARCHIVE_LIST, DPTForDepthEstimation, DPTForSemanticSegmentation, DPTModel, DPTPreTrainedModel, ) from .models.efficientformer import ( + EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientFormerForImageClassification, EfficientFormerForImageClassificationWithTeacher, EfficientFormerModel, EfficientFormerPreTrainedModel, ) from .models.efficientnet import ( + EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientNetForImageClassification, EfficientNetModel, EfficientNetPreTrainedModel, ) from .models.electra import ( + ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, ElectraForCausalLM, ElectraForMaskedLM, ElectraForMultipleChoice, @@ -6222,11 +6886,13 @@ load_tf_weights_in_electra, ) from .models.encodec import ( + ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST, EncodecModel, EncodecPreTrainedModel, ) from .models.encoder_decoder import EncoderDecoderModel from .models.ernie import ( + ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieForCausalLM, ErnieForMaskedLM, ErnieForMultipleChoice, @@ -6239,6 +6905,7 @@ ErniePreTrainedModel, ) from .models.ernie_m import ( + ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieMForInformationExtraction, ErnieMForMultipleChoice, ErnieMForQuestionAnswering, @@ -6248,6 +6915,7 @@ ErnieMPreTrainedModel, ) from .models.esm import ( + ESM_PRETRAINED_MODEL_ARCHIVE_LIST, EsmFoldPreTrainedModel, EsmForMaskedLM, EsmForProteinFolding, @@ -6257,6 +6925,7 @@ EsmPreTrainedModel, ) from .models.falcon import ( + FALCON_PRETRAINED_MODEL_ARCHIVE_LIST, FalconForCausalLM, FalconForQuestionAnswering, FalconForSequenceClassification, @@ -6265,12 +6934,14 @@ FalconPreTrainedModel, ) from .models.fastspeech2_conformer import ( + FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, FastSpeech2ConformerHifiGan, FastSpeech2ConformerModel, FastSpeech2ConformerPreTrainedModel, FastSpeech2ConformerWithHifiGan, ) from .models.flaubert import ( + FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, FlaubertForMultipleChoice, FlaubertForQuestionAnswering, FlaubertForQuestionAnsweringSimple, @@ -6281,6 +6952,7 @@ FlaubertWithLMHeadModel, ) from .models.flava import ( + FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, FlavaForPreTraining, FlavaImageCodebook, FlavaImageModel, @@ -6290,6 +6962,7 @@ FlavaTextModel, ) from .models.fnet import ( + FNET_PRETRAINED_MODEL_ARCHIVE_LIST, FNetForMaskedLM, FNetForMultipleChoice, FNetForNextSentencePrediction, @@ -6302,6 +6975,7 @@ FNetPreTrainedModel, ) from .models.focalnet import ( + FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST, FocalNetBackbone, FocalNetForImageClassification, FocalNetForMaskedImageModeling, @@ -6314,6 +6988,7 @@ PretrainedFSMTModel, ) from .models.funnel import ( + FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, FunnelBaseModel, FunnelForMaskedLM, FunnelForMultipleChoice, @@ -6336,17 +7011,20 @@ GemmaPreTrainedModel, ) from .models.git import ( + GIT_PRETRAINED_MODEL_ARCHIVE_LIST, GitForCausalLM, GitModel, GitPreTrainedModel, GitVisionModel, ) from .models.glpn import ( + GLPN_PRETRAINED_MODEL_ARCHIVE_LIST, GLPNForDepthEstimation, GLPNModel, GLPNPreTrainedModel, ) from .models.gpt2 import ( + GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, GPT2DoubleHeadsModel, GPT2ForQuestionAnswering, GPT2ForSequenceClassification, @@ -6357,6 +7035,7 @@ load_tf_weights_in_gpt2, ) from .models.gpt_bigcode import ( + GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTBigCodeForCausalLM, GPTBigCodeForSequenceClassification, GPTBigCodeForTokenClassification, @@ -6364,6 +7043,7 @@ GPTBigCodePreTrainedModel, ) from .models.gpt_neo import ( + GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoForCausalLM, GPTNeoForQuestionAnswering, GPTNeoForSequenceClassification, @@ -6373,6 +7053,7 @@ load_tf_weights_in_gpt_neo, ) from .models.gpt_neox import ( + GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXForCausalLM, GPTNeoXForQuestionAnswering, GPTNeoXForSequenceClassification, @@ -6382,12 +7063,14 @@ GPTNeoXPreTrainedModel, ) from .models.gpt_neox_japanese import ( + GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseLayer, GPTNeoXJapaneseModel, GPTNeoXJapanesePreTrainedModel, ) from .models.gptj import ( + GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST, GPTJForCausalLM, GPTJForQuestionAnswering, GPTJForSequenceClassification, @@ -6395,28 +7078,33 @@ GPTJPreTrainedModel, ) from .models.gptsan_japanese import ( + GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTSanJapaneseForConditionalGeneration, GPTSanJapaneseModel, GPTSanJapanesePreTrainedModel, ) from .models.graphormer import ( + GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST, GraphormerForGraphClassification, GraphormerModel, GraphormerPreTrainedModel, ) from .models.groupvit import ( + GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, GroupViTModel, GroupViTPreTrainedModel, GroupViTTextModel, GroupViTVisionModel, ) from .models.hubert import ( + HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, HubertForCTC, HubertForSequenceClassification, HubertModel, HubertPreTrainedModel, ) from .models.ibert import ( + IBERT_PRETRAINED_MODEL_ARCHIVE_LIST, IBertForMaskedLM, IBertForMultipleChoice, IBertForQuestionAnswering, @@ -6426,12 +7114,14 @@ IBertPreTrainedModel, ) from .models.idefics import ( + IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST, IdeficsForVisionText2Text, IdeficsModel, IdeficsPreTrainedModel, IdeficsProcessor, ) from .models.imagegpt import ( + IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST, ImageGPTForCausalImageModeling, ImageGPTForImageClassification, ImageGPTModel, @@ -6439,28 +7129,33 @@ load_tf_weights_in_imagegpt, ) from .models.informer import ( + INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, InformerForPrediction, InformerModel, InformerPreTrainedModel, ) from .models.instructblip import ( + INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST, InstructBlipForConditionalGeneration, InstructBlipPreTrainedModel, InstructBlipQFormerModel, InstructBlipVisionModel, ) from .models.jukebox import ( + JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST, JukeboxModel, JukeboxPreTrainedModel, JukeboxPrior, JukeboxVQVAE, ) from .models.kosmos2 import ( + KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST, Kosmos2ForConditionalGeneration, Kosmos2Model, Kosmos2PreTrainedModel, ) from .models.layoutlm import ( + LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMForMaskedLM, LayoutLMForQuestionAnswering, LayoutLMForSequenceClassification, @@ -6469,6 +7164,7 @@ LayoutLMPreTrainedModel, ) from .models.layoutlmv2 import ( + LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv2ForQuestionAnswering, LayoutLMv2ForSequenceClassification, LayoutLMv2ForTokenClassification, @@ -6476,6 +7172,7 @@ LayoutLMv2PreTrainedModel, ) from .models.layoutlmv3 import ( + LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv3ForQuestionAnswering, LayoutLMv3ForSequenceClassification, LayoutLMv3ForTokenClassification, @@ -6483,6 +7180,7 @@ LayoutLMv3PreTrainedModel, ) from .models.led import ( + LED_PRETRAINED_MODEL_ARCHIVE_LIST, LEDForConditionalGeneration, LEDForQuestionAnswering, LEDForSequenceClassification, @@ -6490,12 +7188,14 @@ LEDPreTrainedModel, ) from .models.levit import ( + LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, LevitForImageClassification, LevitForImageClassificationWithTeacher, LevitModel, LevitPreTrainedModel, ) from .models.lilt import ( + LILT_PRETRAINED_MODEL_ARCHIVE_LIST, LiltForQuestionAnswering, LiltForSequenceClassification, LiltForTokenClassification, @@ -6510,6 +7210,7 @@ LlamaPreTrainedModel, ) from .models.llava import ( + LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, LlavaForConditionalGeneration, LlavaPreTrainedModel, ) @@ -6519,6 +7220,7 @@ LlavaNextPreTrainedModel, ) from .models.longformer import ( + LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, LongformerForMaskedLM, LongformerForMultipleChoice, LongformerForQuestionAnswering, @@ -6529,12 +7231,14 @@ LongformerSelfAttention, ) from .models.longt5 import ( + LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST, LongT5EncoderModel, LongT5ForConditionalGeneration, LongT5Model, LongT5PreTrainedModel, ) from .models.luke import ( + LUKE_PRETRAINED_MODEL_ARCHIVE_LIST, LukeForEntityClassification, LukeForEntityPairClassification, LukeForEntitySpanClassification, @@ -6556,17 +7260,20 @@ LxmertXLayer, ) from .models.m2m_100 import ( + M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST, M2M100ForConditionalGeneration, M2M100Model, M2M100PreTrainedModel, ) from .models.mamba import ( + MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST, MambaForCausalLM, MambaModel, MambaPreTrainedModel, ) from .models.marian import MarianForCausalLM, MarianModel, MarianMTModel from .models.markuplm import ( + MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST, MarkupLMForQuestionAnswering, MarkupLMForSequenceClassification, MarkupLMForTokenClassification, @@ -6574,11 +7281,13 @@ MarkupLMPreTrainedModel, ) from .models.mask2former import ( + MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Mask2FormerForUniversalSegmentation, Mask2FormerModel, Mask2FormerPreTrainedModel, ) from .models.maskformer import ( + MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, MaskFormerForInstanceSegmentation, MaskFormerModel, MaskFormerPreTrainedModel, @@ -6593,6 +7302,7 @@ MBartPreTrainedModel, ) from .models.mega import ( + MEGA_PRETRAINED_MODEL_ARCHIVE_LIST, MegaForCausalLM, MegaForMaskedLM, MegaForMultipleChoice, @@ -6603,6 +7313,7 @@ MegaPreTrainedModel, ) from .models.megatron_bert import ( + MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, MegatronBertForCausalLM, MegatronBertForMaskedLM, MegatronBertForMultipleChoice, @@ -6615,6 +7326,7 @@ MegatronBertPreTrainedModel, ) from .models.mgp_str import ( + MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST, MgpstrForSceneTextRecognition, MgpstrModel, MgpstrPreTrainedModel, @@ -6632,6 +7344,7 @@ MixtralPreTrainedModel, ) from .models.mobilebert import ( + MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileBertForMaskedLM, MobileBertForMultipleChoice, MobileBertForNextSentencePrediction, @@ -6645,12 +7358,14 @@ load_tf_weights_in_mobilebert, ) from .models.mobilenet_v1 import ( + MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV1ForImageClassification, MobileNetV1Model, MobileNetV1PreTrainedModel, load_tf_weights_in_mobilenet_v1, ) from .models.mobilenet_v2 import ( + MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV2ForImageClassification, MobileNetV2ForSemanticSegmentation, MobileNetV2Model, @@ -6658,18 +7373,21 @@ load_tf_weights_in_mobilenet_v2, ) from .models.mobilevit import ( + MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTForImageClassification, MobileViTForSemanticSegmentation, MobileViTModel, MobileViTPreTrainedModel, ) from .models.mobilevitv2 import ( + MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTV2ForImageClassification, MobileViTV2ForSemanticSegmentation, MobileViTV2Model, MobileViTV2PreTrainedModel, ) from .models.mpnet import ( + MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, MPNetForMaskedLM, MPNetForMultipleChoice, MPNetForQuestionAnswering, @@ -6680,6 +7398,7 @@ MPNetPreTrainedModel, ) from .models.mpt import ( + MPT_PRETRAINED_MODEL_ARCHIVE_LIST, MptForCausalLM, MptForQuestionAnswering, MptForSequenceClassification, @@ -6688,6 +7407,7 @@ MptPreTrainedModel, ) from .models.mra import ( + MRA_PRETRAINED_MODEL_ARCHIVE_LIST, MraForMaskedLM, MraForMultipleChoice, MraForQuestionAnswering, @@ -6706,6 +7426,7 @@ MT5PreTrainedModel, ) from .models.musicgen import ( + MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST, MusicgenForCausalLM, MusicgenForConditionalGeneration, MusicgenModel, @@ -6720,6 +7441,7 @@ MusicgenMelodyPreTrainedModel, ) from .models.mvp import ( + MVP_PRETRAINED_MODEL_ARCHIVE_LIST, MvpForCausalLM, MvpForConditionalGeneration, MvpForQuestionAnswering, @@ -6728,12 +7450,14 @@ MvpPreTrainedModel, ) from .models.nat import ( + NAT_PRETRAINED_MODEL_ARCHIVE_LIST, NatBackbone, NatForImageClassification, NatModel, NatPreTrainedModel, ) from .models.nezha import ( + NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST, NezhaForMaskedLM, NezhaForMultipleChoice, NezhaForNextSentencePrediction, @@ -6745,6 +7469,7 @@ NezhaPreTrainedModel, ) from .models.nllb_moe import ( + NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST, NllbMoeForConditionalGeneration, NllbMoeModel, NllbMoePreTrainedModel, @@ -6752,6 +7477,7 @@ NllbMoeTop2Router, ) from .models.nystromformer import ( + NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, NystromformerForMaskedLM, NystromformerForMultipleChoice, NystromformerForQuestionAnswering, @@ -6762,11 +7488,13 @@ NystromformerPreTrainedModel, ) from .models.oneformer import ( + ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, OneFormerForUniversalSegmentation, OneFormerModel, OneFormerPreTrainedModel, ) from .models.openai import ( + OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, OpenAIGPTDoubleHeadsModel, OpenAIGPTForSequenceClassification, OpenAIGPTLMHeadModel, @@ -6775,6 +7503,7 @@ load_tf_weights_in_openai_gpt, ) from .models.opt import ( + OPT_PRETRAINED_MODEL_ARCHIVE_LIST, OPTForCausalLM, OPTForQuestionAnswering, OPTForSequenceClassification, @@ -6782,6 +7511,7 @@ OPTPreTrainedModel, ) from .models.owlv2 import ( + OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST, Owlv2ForObjectDetection, Owlv2Model, Owlv2PreTrainedModel, @@ -6789,6 +7519,7 @@ Owlv2VisionModel, ) from .models.owlvit import ( + OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST, OwlViTForObjectDetection, OwlViTModel, OwlViTPreTrainedModel, @@ -6796,6 +7527,7 @@ OwlViTVisionModel, ) from .models.patchtsmixer import ( + PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSMixerForPrediction, PatchTSMixerForPretraining, PatchTSMixerForRegression, @@ -6804,6 +7536,7 @@ PatchTSMixerPreTrainedModel, ) from .models.patchtst import ( + PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSTForClassification, PatchTSTForPrediction, PatchTSTForPretraining, @@ -6818,11 +7551,13 @@ PegasusPreTrainedModel, ) from .models.pegasus_x import ( + PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST, PegasusXForConditionalGeneration, PegasusXModel, PegasusXPreTrainedModel, ) from .models.perceiver import ( + PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST, PerceiverForImageClassificationConvProcessing, PerceiverForImageClassificationFourier, PerceiverForImageClassificationLearned, @@ -6841,6 +7576,7 @@ PersimmonPreTrainedModel, ) from .models.phi import ( + PHI_PRETRAINED_MODEL_ARCHIVE_LIST, PhiForCausalLM, PhiForSequenceClassification, PhiForTokenClassification, @@ -6848,12 +7584,14 @@ PhiPreTrainedModel, ) from .models.pix2struct import ( + PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST, Pix2StructForConditionalGeneration, Pix2StructPreTrainedModel, Pix2StructTextModel, Pix2StructVisionModel, ) from .models.plbart import ( + PLBART_PRETRAINED_MODEL_ARCHIVE_LIST, PLBartForCausalLM, PLBartForConditionalGeneration, PLBartForSequenceClassification, @@ -6861,15 +7599,18 @@ PLBartPreTrainedModel, ) from .models.poolformer import ( + POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, PoolFormerForImageClassification, PoolFormerModel, PoolFormerPreTrainedModel, ) from .models.pop2piano import ( + POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST, Pop2PianoForConditionalGeneration, Pop2PianoPreTrainedModel, ) from .models.prophetnet import ( + PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, ProphetNetDecoder, ProphetNetEncoder, ProphetNetForCausalLM, @@ -6878,6 +7619,7 @@ ProphetNetPreTrainedModel, ) from .models.pvt import ( + PVT_PRETRAINED_MODEL_ARCHIVE_LIST, PvtForImageClassification, PvtModel, PvtPreTrainedModel, @@ -6890,6 +7632,7 @@ PvtV2PreTrainedModel, ) from .models.qdqbert import ( + QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST, QDQBertForMaskedLM, QDQBertForMultipleChoice, QDQBertForNextSentencePrediction, @@ -6915,6 +7658,7 @@ RagTokenForGeneration, ) from .models.realm import ( + REALM_PRETRAINED_MODEL_ARCHIVE_LIST, RealmEmbedder, RealmForOpenQA, RealmKnowledgeAugEncoder, @@ -6925,6 +7669,7 @@ load_tf_weights_in_realm, ) from .models.reformer import ( + REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ReformerAttention, ReformerForMaskedLM, ReformerForQuestionAnswering, @@ -6935,11 +7680,13 @@ ReformerPreTrainedModel, ) from .models.regnet import ( + REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, RegNetForImageClassification, RegNetModel, RegNetPreTrainedModel, ) from .models.rembert import ( + REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RemBertForCausalLM, RemBertForMaskedLM, RemBertForMultipleChoice, @@ -6952,12 +7699,14 @@ load_tf_weights_in_rembert, ) from .models.resnet import ( + RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, ResNetBackbone, ResNetForImageClassification, ResNetModel, ResNetPreTrainedModel, ) from .models.roberta import ( + ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaForCausalLM, RobertaForMaskedLM, RobertaForMultipleChoice, @@ -6968,6 +7717,7 @@ RobertaPreTrainedModel, ) from .models.roberta_prelayernorm import ( + ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaPreLayerNormForCausalLM, RobertaPreLayerNormForMaskedLM, RobertaPreLayerNormForMultipleChoice, @@ -6978,6 +7728,7 @@ RobertaPreLayerNormPreTrainedModel, ) from .models.roc_bert import ( + ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, RoCBertForCausalLM, RoCBertForMaskedLM, RoCBertForMultipleChoice, @@ -6991,6 +7742,7 @@ load_tf_weights_in_roc_bert, ) from .models.roformer import ( + ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, RoFormerForCausalLM, RoFormerForMaskedLM, RoFormerForMultipleChoice, @@ -7003,17 +7755,20 @@ load_tf_weights_in_roformer, ) from .models.rwkv import ( + RWKV_PRETRAINED_MODEL_ARCHIVE_LIST, RwkvForCausalLM, RwkvModel, RwkvPreTrainedModel, ) from .models.sam import ( + SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel, ) # PyTorch model imports from .models.seamless_m4t import ( + SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4TCodeHifiGan, SeamlessM4TForSpeechToSpeech, SeamlessM4TForSpeechToText, @@ -7026,6 +7781,7 @@ SeamlessM4TTextToUnitModel, ) from .models.seamless_m4t_v2 import ( + SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4Tv2ForSpeechToSpeech, SeamlessM4Tv2ForSpeechToText, SeamlessM4Tv2ForTextToSpeech, @@ -7034,6 +7790,7 @@ SeamlessM4Tv2PreTrainedModel, ) from .models.segformer import ( + SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SegformerDecodeHead, SegformerForImageClassification, SegformerForSemanticSegmentation, @@ -7042,23 +7799,27 @@ SegformerPreTrainedModel, ) from .models.seggpt import ( + SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST, SegGptForImageSegmentation, SegGptModel, SegGptPreTrainedModel, ) from .models.sew import ( + SEW_PRETRAINED_MODEL_ARCHIVE_LIST, SEWForCTC, SEWForSequenceClassification, SEWModel, SEWPreTrainedModel, ) from .models.sew_d import ( + SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST, SEWDForCTC, SEWDForSequenceClassification, SEWDModel, SEWDPreTrainedModel, ) from .models.siglip import ( + SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST, SiglipForImageClassification, SiglipModel, SiglipPreTrainedModel, @@ -7067,6 +7828,7 @@ ) from .models.speech_encoder_decoder import SpeechEncoderDecoderModel from .models.speech_to_text import ( + SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, Speech2TextForConditionalGeneration, Speech2TextModel, Speech2TextPreTrainedModel, @@ -7076,6 +7838,7 @@ Speech2Text2PreTrainedModel, ) from .models.speecht5 import ( + SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST, SpeechT5ForSpeechToSpeech, SpeechT5ForSpeechToText, SpeechT5ForTextToSpeech, @@ -7084,6 +7847,7 @@ SpeechT5PreTrainedModel, ) from .models.splinter import ( + SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST, SplinterForPreTraining, SplinterForQuestionAnswering, SplinterLayer, @@ -7091,6 +7855,7 @@ SplinterPreTrainedModel, ) from .models.squeezebert import ( + SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, SqueezeBertForMaskedLM, SqueezeBertForMultipleChoice, SqueezeBertForQuestionAnswering, @@ -7118,11 +7883,13 @@ SuperPointPreTrainedModel, ) from .models.swiftformer import ( + SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SwiftFormerForImageClassification, SwiftFormerModel, SwiftFormerPreTrainedModel, ) from .models.swin import ( + SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, SwinBackbone, SwinForImageClassification, SwinForMaskedImageModeling, @@ -7130,11 +7897,13 @@ SwinPreTrainedModel, ) from .models.swin2sr import ( + SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST, Swin2SRForImageSuperResolution, Swin2SRModel, Swin2SRPreTrainedModel, ) from .models.swinv2 import ( + SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST, Swinv2Backbone, Swinv2ForImageClassification, Swinv2ForMaskedImageModeling, @@ -7142,6 +7911,7 @@ Swinv2PreTrainedModel, ) from .models.switch_transformers import ( + SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST, SwitchTransformersEncoderModel, SwitchTransformersForConditionalGeneration, SwitchTransformersModel, @@ -7150,6 +7920,7 @@ SwitchTransformersTop1Router, ) from .models.t5 import ( + T5_PRETRAINED_MODEL_ARCHIVE_LIST, T5EncoderModel, T5ForConditionalGeneration, T5ForQuestionAnswering, @@ -7160,11 +7931,13 @@ load_tf_weights_in_t5, ) from .models.table_transformer import ( + TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TableTransformerForObjectDetection, TableTransformerModel, TableTransformerPreTrainedModel, ) from .models.tapas import ( + TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TapasForMaskedLM, TapasForQuestionAnswering, TapasForSequenceClassification, @@ -7173,32 +7946,38 @@ load_tf_weights_in_tapas, ) from .models.time_series_transformer import ( + TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimeSeriesTransformerForPrediction, TimeSeriesTransformerModel, TimeSeriesTransformerPreTrainedModel, ) from .models.timesformer import ( + TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimesformerForVideoClassification, TimesformerModel, TimesformerPreTrainedModel, ) from .models.timm_backbone import TimmBackbone from .models.trocr import ( + TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel, ) from .models.tvlt import ( + TVLT_PRETRAINED_MODEL_ARCHIVE_LIST, TvltForAudioVisualClassification, TvltForPreTraining, TvltModel, TvltPreTrainedModel, ) from .models.tvp import ( + TVP_PRETRAINED_MODEL_ARCHIVE_LIST, TvpForVideoGrounding, TvpModel, TvpPreTrainedModel, ) from .models.udop import ( + UDOP_PRETRAINED_MODEL_ARCHIVE_LIST, UdopEncoderModel, UdopForConditionalGeneration, UdopModel, @@ -7214,6 +7993,7 @@ UMT5PreTrainedModel, ) from .models.unispeech import ( + UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechForCTC, UniSpeechForPreTraining, UniSpeechForSequenceClassification, @@ -7221,6 +8001,7 @@ UniSpeechPreTrainedModel, ) from .models.unispeech_sat import ( + UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechSatForAudioFrameClassification, UniSpeechSatForCTC, UniSpeechSatForPreTraining, @@ -7229,18 +8010,20 @@ UniSpeechSatModel, UniSpeechSatPreTrainedModel, ) - from .models.univnet import UnivNetModel + from .models.univnet import UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST, UnivNetModel from .models.upernet import ( UperNetForSemanticSegmentation, UperNetPreTrainedModel, ) from .models.videomae import ( + VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST, VideoMAEForPreTraining, VideoMAEForVideoClassification, VideoMAEModel, VideoMAEPreTrainedModel, ) from .models.vilt import ( + VILT_PRETRAINED_MODEL_ARCHIVE_LIST, ViltForImageAndTextRetrieval, ViltForImagesAndTextClassification, ViltForMaskedLM, @@ -7251,12 +8034,14 @@ ViltPreTrainedModel, ) from .models.vipllava import ( + VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, VipLlavaForConditionalGeneration, VipLlavaPreTrainedModel, ) from .models.vision_encoder_decoder import VisionEncoderDecoderModel from .models.vision_text_dual_encoder import VisionTextDualEncoderModel from .models.visual_bert import ( + VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, VisualBertForMultipleChoice, VisualBertForPreTraining, VisualBertForQuestionAnswering, @@ -7267,46 +8052,55 @@ VisualBertPreTrainedModel, ) from .models.vit import ( + VIT_PRETRAINED_MODEL_ARCHIVE_LIST, ViTForImageClassification, ViTForMaskedImageModeling, ViTModel, ViTPreTrainedModel, ) from .models.vit_hybrid import ( + VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST, ViTHybridForImageClassification, ViTHybridModel, ViTHybridPreTrainedModel, ) from .models.vit_mae import ( + VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMAEForPreTraining, ViTMAELayer, ViTMAEModel, ViTMAEPreTrainedModel, ) from .models.vit_msn import ( + VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMSNForImageClassification, ViTMSNModel, ViTMSNPreTrainedModel, ) from .models.vitdet import ( + VITDET_PRETRAINED_MODEL_ARCHIVE_LIST, VitDetBackbone, VitDetModel, VitDetPreTrainedModel, ) from .models.vitmatte import ( + VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST, VitMatteForImageMatting, VitMattePreTrainedModel, ) from .models.vits import ( + VITS_PRETRAINED_MODEL_ARCHIVE_LIST, VitsModel, VitsPreTrainedModel, ) from .models.vivit import ( + VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST, VivitForVideoClassification, VivitModel, VivitPreTrainedModel, ) from .models.wav2vec2 import ( + WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ForAudioFrameClassification, Wav2Vec2ForCTC, Wav2Vec2ForMaskedLM, @@ -7317,6 +8111,7 @@ Wav2Vec2PreTrainedModel, ) from .models.wav2vec2_bert import ( + WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2BertForAudioFrameClassification, Wav2Vec2BertForCTC, Wav2Vec2BertForSequenceClassification, @@ -7325,6 +8120,7 @@ Wav2Vec2BertPreTrainedModel, ) from .models.wav2vec2_conformer import ( + WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ConformerForAudioFrameClassification, Wav2Vec2ConformerForCTC, Wav2Vec2ConformerForPreTraining, @@ -7334,6 +8130,7 @@ Wav2Vec2ConformerPreTrainedModel, ) from .models.wavlm import ( + WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST, WavLMForAudioFrameClassification, WavLMForCTC, WavLMForSequenceClassification, @@ -7342,6 +8139,7 @@ WavLMPreTrainedModel, ) from .models.whisper import ( + WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, WhisperForAudioClassification, WhisperForCausalLM, WhisperForConditionalGeneration, @@ -7349,17 +8147,20 @@ WhisperPreTrainedModel, ) from .models.x_clip import ( + XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, XCLIPModel, XCLIPPreTrainedModel, XCLIPTextModel, XCLIPVisionModel, ) from .models.xglm import ( + XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel, ) from .models.xlm import ( + XLM_PRETRAINED_MODEL_ARCHIVE_LIST, XLMForMultipleChoice, XLMForQuestionAnswering, XLMForQuestionAnsweringSimple, @@ -7370,6 +8171,7 @@ XLMWithLMHeadModel, ) from .models.xlm_prophetnet import ( + XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLMProphetNetDecoder, XLMProphetNetEncoder, XLMProphetNetForCausalLM, @@ -7378,6 +8180,7 @@ XLMProphetNetPreTrainedModel, ) from .models.xlm_roberta import ( + XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaForCausalLM, XLMRobertaForMaskedLM, XLMRobertaForMultipleChoice, @@ -7388,6 +8191,7 @@ XLMRobertaPreTrainedModel, ) from .models.xlm_roberta_xl import ( + XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaXLForCausalLM, XLMRobertaXLForMaskedLM, XLMRobertaXLForMultipleChoice, @@ -7398,6 +8202,7 @@ XLMRobertaXLPreTrainedModel, ) from .models.xlnet import ( + XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLNetForMultipleChoice, XLNetForQuestionAnswering, XLNetForQuestionAnsweringSimple, @@ -7409,6 +8214,7 @@ load_tf_weights_in_xlnet, ) from .models.xmod import ( + XMOD_PRETRAINED_MODEL_ARCHIVE_LIST, XmodForCausalLM, XmodForMaskedLM, XmodForMultipleChoice, @@ -7419,11 +8225,13 @@ XmodPreTrainedModel, ) from .models.yolos import ( + YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST, YolosForObjectDetection, YolosModel, YolosPreTrainedModel, ) from .models.yoso import ( + YOSO_PRETRAINED_MODEL_ARCHIVE_LIST, YosoForMaskedLM, YosoForMultipleChoice, YosoForQuestionAnswering, @@ -7495,6 +8303,7 @@ # TensorFlow model imports from .models.albert import ( + TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFAlbertForMaskedLM, TFAlbertForMultipleChoice, TFAlbertForPreTraining, @@ -7558,6 +8367,7 @@ TFBartPretrainedModel, ) from .models.bert import ( + TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFBertEmbeddings, TFBertForMaskedLM, TFBertForMultipleChoice, @@ -7582,6 +8392,7 @@ TFBlenderbotSmallPreTrainedModel, ) from .models.blip import ( + TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFBlipForConditionalGeneration, TFBlipForImageTextRetrieval, TFBlipForQuestionAnswering, @@ -7591,6 +8402,7 @@ TFBlipVisionModel, ) from .models.camembert import ( + TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCamembertForCausalLM, TFCamembertForMaskedLM, TFCamembertForMultipleChoice, @@ -7601,12 +8413,14 @@ TFCamembertPreTrainedModel, ) from .models.clip import ( + TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFCLIPModel, TFCLIPPreTrainedModel, TFCLIPTextModel, TFCLIPVisionModel, ) from .models.convbert import ( + TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFConvBertForMaskedLM, TFConvBertForMultipleChoice, TFConvBertForQuestionAnswering, @@ -7627,12 +8441,14 @@ TFConvNextV2PreTrainedModel, ) from .models.ctrl import ( + TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, TFCTRLForSequenceClassification, TFCTRLLMHeadModel, TFCTRLModel, TFCTRLPreTrainedModel, ) from .models.cvt import ( + TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCvtForImageClassification, TFCvtModel, TFCvtPreTrainedModel, @@ -7644,6 +8460,7 @@ TFData2VecVisionPreTrainedModel, ) from .models.deberta import ( + TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaForMaskedLM, TFDebertaForQuestionAnswering, TFDebertaForSequenceClassification, @@ -7652,6 +8469,7 @@ TFDebertaPreTrainedModel, ) from .models.deberta_v2 import ( + TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaV2ForMaskedLM, TFDebertaV2ForMultipleChoice, TFDebertaV2ForQuestionAnswering, @@ -7661,6 +8479,7 @@ TFDebertaV2PreTrainedModel, ) from .models.deit import ( + TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDeiTForImageClassification, TFDeiTForImageClassificationWithTeacher, TFDeiTForMaskedImageModeling, @@ -7668,6 +8487,7 @@ TFDeiTPreTrainedModel, ) from .models.deprecated.transfo_xl import ( + TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, TFAdaptiveEmbedding, TFTransfoXLForSequenceClassification, TFTransfoXLLMHeadModel, @@ -7676,6 +8496,7 @@ TFTransfoXLPreTrainedModel, ) from .models.distilbert import ( + TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDistilBertForMaskedLM, TFDistilBertForMultipleChoice, TFDistilBertForQuestionAnswering, @@ -7686,6 +8507,9 @@ TFDistilBertPreTrainedModel, ) from .models.dpr import ( + TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, TFDPRContextEncoder, TFDPRPretrainedContextEncoder, TFDPRPretrainedQuestionEncoder, @@ -7694,12 +8518,14 @@ TFDPRReader, ) from .models.efficientformer import ( + TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFEfficientFormerForImageClassification, TFEfficientFormerForImageClassificationWithTeacher, TFEfficientFormerModel, TFEfficientFormerPreTrainedModel, ) from .models.electra import ( + TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, TFElectraForMaskedLM, TFElectraForMultipleChoice, TFElectraForPreTraining, @@ -7711,6 +8537,7 @@ ) from .models.encoder_decoder import TFEncoderDecoderModel from .models.esm import ( + ESM_PRETRAINED_MODEL_ARCHIVE_LIST, TFEsmForMaskedLM, TFEsmForSequenceClassification, TFEsmForTokenClassification, @@ -7718,6 +8545,7 @@ TFEsmPreTrainedModel, ) from .models.flaubert import ( + TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFFlaubertForMultipleChoice, TFFlaubertForQuestionAnsweringSimple, TFFlaubertForSequenceClassification, @@ -7727,6 +8555,7 @@ TFFlaubertWithLMHeadModel, ) from .models.funnel import ( + TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, TFFunnelBaseModel, TFFunnelForMaskedLM, TFFunnelForMultipleChoice, @@ -7738,6 +8567,7 @@ TFFunnelPreTrainedModel, ) from .models.gpt2 import ( + TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, TFGPT2DoubleHeadsModel, TFGPT2ForSequenceClassification, TFGPT2LMHeadModel, @@ -7753,17 +8583,20 @@ TFGPTJPreTrainedModel, ) from .models.groupvit import ( + TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFGroupViTModel, TFGroupViTPreTrainedModel, TFGroupViTTextModel, TFGroupViTVisionModel, ) from .models.hubert import ( + TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFHubertForCTC, TFHubertModel, TFHubertPreTrainedModel, ) from .models.layoutlm import ( + TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMForMaskedLM, TFLayoutLMForQuestionAnswering, TFLayoutLMForSequenceClassification, @@ -7773,6 +8606,7 @@ TFLayoutLMPreTrainedModel, ) from .models.layoutlmv3 import ( + TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMv3ForQuestionAnswering, TFLayoutLMv3ForSequenceClassification, TFLayoutLMv3ForTokenClassification, @@ -7785,6 +8619,7 @@ TFLEDPreTrainedModel, ) from .models.longformer import ( + TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFLongformerForMaskedLM, TFLongformerForMultipleChoice, TFLongformerForQuestionAnswering, @@ -7795,6 +8630,7 @@ TFLongformerSelfAttention, ) from .models.lxmert import ( + TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFLxmertForPreTraining, TFLxmertMainLayer, TFLxmertModel, @@ -7812,6 +8648,7 @@ TFMBartPreTrainedModel, ) from .models.mobilebert import ( + TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileBertForMaskedLM, TFMobileBertForMultipleChoice, TFMobileBertForNextSentencePrediction, @@ -7824,12 +8661,14 @@ TFMobileBertPreTrainedModel, ) from .models.mobilevit import ( + TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileViTForImageClassification, TFMobileViTForSemanticSegmentation, TFMobileViTModel, TFMobileViTPreTrainedModel, ) from .models.mpnet import ( + TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFMPNetForMaskedLM, TFMPNetForMultipleChoice, TFMPNetForQuestionAnswering, @@ -7845,6 +8684,7 @@ TFMT5Model, ) from .models.openai import ( + TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, TFOpenAIGPTDoubleHeadsModel, TFOpenAIGPTForSequenceClassification, TFOpenAIGPTLMHeadModel, @@ -7865,11 +8705,13 @@ TFRagTokenForGeneration, ) from .models.regnet import ( + TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFRegNetForImageClassification, TFRegNetModel, TFRegNetPreTrainedModel, ) from .models.rembert import ( + TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFRemBertForCausalLM, TFRemBertForMaskedLM, TFRemBertForMultipleChoice, @@ -7881,11 +8723,13 @@ TFRemBertPreTrainedModel, ) from .models.resnet import ( + TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFResNetForImageClassification, TFResNetModel, TFResNetPreTrainedModel, ) from .models.roberta import ( + TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaForCausalLM, TFRobertaForMaskedLM, TFRobertaForMultipleChoice, @@ -7897,6 +8741,7 @@ TFRobertaPreTrainedModel, ) from .models.roberta_prelayernorm import ( + TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaPreLayerNormForCausalLM, TFRobertaPreLayerNormForMaskedLM, TFRobertaPreLayerNormForMultipleChoice, @@ -7908,6 +8753,7 @@ TFRobertaPreLayerNormPreTrainedModel, ) from .models.roformer import ( + TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFRoFormerForCausalLM, TFRoFormerForMaskedLM, TFRoFormerForMultipleChoice, @@ -7919,10 +8765,12 @@ TFRoFormerPreTrainedModel, ) from .models.sam import ( + TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel, ) from .models.segformer import ( + TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFSegformerDecodeHead, TFSegformerForImageClassification, TFSegformerForSemanticSegmentation, @@ -7930,23 +8778,27 @@ TFSegformerPreTrainedModel, ) from .models.speech_to_text import ( + TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, TFSpeech2TextForConditionalGeneration, TFSpeech2TextModel, TFSpeech2TextPreTrainedModel, ) from .models.swin import ( + TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, TFSwinForImageClassification, TFSwinForMaskedImageModeling, TFSwinModel, TFSwinPreTrainedModel, ) from .models.t5 import ( + TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST, TFT5EncoderModel, TFT5ForConditionalGeneration, TFT5Model, TFT5PreTrainedModel, ) from .models.tapas import ( + TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TFTapasForMaskedLM, TFTapasForQuestionAnswering, TFTapasForSequenceClassification, @@ -7966,22 +8818,26 @@ TFViTMAEPreTrainedModel, ) from .models.wav2vec2 import ( + TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, TFWav2Vec2ForCTC, TFWav2Vec2ForSequenceClassification, TFWav2Vec2Model, TFWav2Vec2PreTrainedModel, ) from .models.whisper import ( + TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, TFWhisperForConditionalGeneration, TFWhisperModel, TFWhisperPreTrainedModel, ) from .models.xglm import ( + TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXGLMForCausalLM, TFXGLMModel, TFXGLMPreTrainedModel, ) from .models.xlm import ( + TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMForMultipleChoice, TFXLMForQuestionAnsweringSimple, TFXLMForSequenceClassification, @@ -7992,6 +8848,7 @@ TFXLMWithLMHeadModel, ) from .models.xlm_roberta import ( + TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMRobertaForCausalLM, TFXLMRobertaForMaskedLM, TFXLMRobertaForMultipleChoice, @@ -8002,6 +8859,7 @@ TFXLMRobertaPreTrainedModel, ) from .models.xlnet import ( + TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLNetForMultipleChoice, TFXLNetForQuestionAnsweringSimple, TFXLNetForSequenceClassification, @@ -8323,6 +9181,7 @@ FlaxXGLMPreTrainedModel, ) from .models.xlm_roberta import ( + FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, FlaxXLMRobertaForCausalLM, FlaxXLMRobertaForMaskedLM, FlaxXLMRobertaForMultipleChoice, diff --git a/src/transformers/models/albert/__init__.py b/src/transformers/models/albert/__init__.py index 1d0a4a4d02845c..168c68db837d08 100644 --- a/src/transformers/models/albert/__init__.py +++ b/src/transformers/models/albert/__init__.py @@ -26,7 +26,7 @@ _import_structure = { - "configuration_albert": ["AlbertConfig", "AlbertOnnxConfig"], + "configuration_albert": ["ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlbertConfig", "AlbertOnnxConfig"], } try: @@ -52,6 +52,7 @@ pass else: _import_structure["modeling_albert"] = [ + "ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "AlbertForMaskedLM", "AlbertForMultipleChoice", "AlbertForPreTraining", @@ -70,6 +71,7 @@ pass else: _import_structure["modeling_tf_albert"] = [ + "TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAlbertForMaskedLM", "TFAlbertForMultipleChoice", "TFAlbertForPreTraining", @@ -99,7 +101,7 @@ ] if TYPE_CHECKING: - from .configuration_albert import AlbertConfig, AlbertOnnxConfig + from .configuration_albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig, AlbertOnnxConfig try: if not is_sentencepiece_available(): @@ -124,6 +126,7 @@ pass else: from .modeling_albert import ( + ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, AlbertForMaskedLM, AlbertForMultipleChoice, AlbertForPreTraining, @@ -142,6 +145,7 @@ pass else: from .modeling_tf_albert import ( + TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFAlbertForMaskedLM, TFAlbertForMultipleChoice, TFAlbertForPreTraining, diff --git a/src/transformers/models/align/__init__.py b/src/transformers/models/align/__init__.py index 650b25c3e5d1ee..8f9a6c40a7169f 100644 --- a/src/transformers/models/align/__init__.py +++ b/src/transformers/models/align/__init__.py @@ -22,6 +22,7 @@ _import_structure = { "configuration_align": [ + "ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP", "AlignConfig", "AlignTextConfig", "AlignVisionConfig", @@ -36,6 +37,7 @@ pass else: _import_structure["modeling_align"] = [ + "ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST", "AlignModel", "AlignPreTrainedModel", "AlignTextModel", @@ -44,6 +46,7 @@ if TYPE_CHECKING: from .configuration_align import ( + ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP, AlignConfig, AlignTextConfig, AlignVisionConfig, @@ -57,6 +60,7 @@ pass else: from .modeling_align import ( + ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST, AlignModel, AlignPreTrainedModel, AlignTextModel, diff --git a/src/transformers/models/altclip/__init__.py b/src/transformers/models/altclip/__init__.py index 4e3cb99bbb16c9..5fc02b192b256b 100755 --- a/src/transformers/models/altclip/__init__.py +++ b/src/transformers/models/altclip/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_altclip": [ + "ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "AltCLIPConfig", "AltCLIPTextConfig", "AltCLIPVisionConfig", @@ -32,6 +33,7 @@ pass else: _import_structure["modeling_altclip"] = [ + "ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "AltCLIPPreTrainedModel", "AltCLIPModel", "AltCLIPTextModel", @@ -41,6 +43,7 @@ if TYPE_CHECKING: from .configuration_altclip import ( + ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig, @@ -54,6 +57,7 @@ pass else: from .modeling_altclip import ( + ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, AltCLIPModel, AltCLIPPreTrainedModel, AltCLIPTextModel, diff --git a/src/transformers/models/audio_spectrogram_transformer/__init__.py b/src/transformers/models/audio_spectrogram_transformer/__init__.py index 9f1d65e1aac839..2b48fe07311c1e 100644 --- a/src/transformers/models/audio_spectrogram_transformer/__init__.py +++ b/src/transformers/models/audio_spectrogram_transformer/__init__.py @@ -17,7 +17,10 @@ _import_structure = { - "configuration_audio_spectrogram_transformer": ["ASTConfig"], + "configuration_audio_spectrogram_transformer": [ + "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "ASTConfig", + ], "feature_extraction_audio_spectrogram_transformer": ["ASTFeatureExtractor"], } @@ -28,6 +31,7 @@ pass else: _import_structure["modeling_audio_spectrogram_transformer"] = [ + "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ASTForAudioClassification", "ASTModel", "ASTPreTrainedModel", @@ -36,6 +40,7 @@ if TYPE_CHECKING: from .configuration_audio_spectrogram_transformer import ( + AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ASTConfig, ) from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor @@ -47,6 +52,7 @@ pass else: from .modeling_audio_spectrogram_transformer import ( + AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ASTForAudioClassification, ASTModel, ASTPreTrainedModel, diff --git a/src/transformers/models/auto/__init__.py b/src/transformers/models/auto/__init__.py index 3bb2b8e9d4c199..96a159133cc005 100644 --- a/src/transformers/models/auto/__init__.py +++ b/src/transformers/models/auto/__init__.py @@ -25,7 +25,7 @@ _import_structure = { "auto_factory": ["get_values"], - "configuration_auto": ["CONFIG_MAPPING", "MODEL_NAMES_MAPPING", "AutoConfig"], + "configuration_auto": ["ALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CONFIG_MAPPING", "MODEL_NAMES_MAPPING", "AutoConfig"], "feature_extraction_auto": ["FEATURE_EXTRACTOR_MAPPING", "AutoFeatureExtractor"], "image_processing_auto": ["IMAGE_PROCESSOR_MAPPING", "AutoImageProcessor"], "processing_auto": ["PROCESSOR_MAPPING", "AutoProcessor"], @@ -213,7 +213,7 @@ if TYPE_CHECKING: from .auto_factory import get_values - from .configuration_auto import CONFIG_MAPPING, MODEL_NAMES_MAPPING, AutoConfig + from .configuration_auto import ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, CONFIG_MAPPING, MODEL_NAMES_MAPPING, AutoConfig from .feature_extraction_auto import FEATURE_EXTRACTOR_MAPPING, AutoFeatureExtractor from .image_processing_auto import IMAGE_PROCESSOR_MAPPING, AutoImageProcessor from .processing_auto import PROCESSOR_MAPPING, AutoProcessor diff --git a/src/transformers/models/autoformer/__init__.py b/src/transformers/models/autoformer/__init__.py index 1ef70173e30a43..f87bfdea532d61 100644 --- a/src/transformers/models/autoformer/__init__.py +++ b/src/transformers/models/autoformer/__init__.py @@ -18,7 +18,10 @@ _import_structure = { - "configuration_autoformer": ["AutoformerConfig"], + "configuration_autoformer": [ + "AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "AutoformerConfig", + ], } try: @@ -28,6 +31,7 @@ pass else: _import_structure["modeling_autoformer"] = [ + "AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "AutoformerForPrediction", "AutoformerModel", "AutoformerPreTrainedModel", @@ -36,6 +40,7 @@ if TYPE_CHECKING: from .configuration_autoformer import ( + AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, AutoformerConfig, ) @@ -46,6 +51,7 @@ pass else: from .modeling_autoformer import ( + AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, AutoformerForPrediction, AutoformerModel, AutoformerPreTrainedModel, diff --git a/src/transformers/models/bark/__init__.py b/src/transformers/models/bark/__init__.py index 4cb1a606cf6567..03e5865ca4a483 100644 --- a/src/transformers/models/bark/__init__.py +++ b/src/transformers/models/bark/__init__.py @@ -22,6 +22,7 @@ _import_structure = { "configuration_bark": [ + "BARK_PRETRAINED_CONFIG_ARCHIVE_MAP", "BarkCoarseConfig", "BarkConfig", "BarkFineConfig", @@ -37,6 +38,7 @@ pass else: _import_structure["modeling_bark"] = [ + "BARK_PRETRAINED_MODEL_ARCHIVE_LIST", "BarkFineModel", "BarkSemanticModel", "BarkCoarseModel", @@ -47,6 +49,7 @@ if TYPE_CHECKING: from .configuration_bark import ( + BARK_PRETRAINED_CONFIG_ARCHIVE_MAP, BarkCoarseConfig, BarkConfig, BarkFineConfig, @@ -61,6 +64,7 @@ pass else: from .modeling_bark import ( + BARK_PRETRAINED_MODEL_ARCHIVE_LIST, BarkCausalModel, BarkCoarseModel, BarkFineModel, diff --git a/src/transformers/models/bart/__init__.py b/src/transformers/models/bart/__init__.py index d538fbb7d34304..4f104efce1a4d2 100644 --- a/src/transformers/models/bart/__init__.py +++ b/src/transformers/models/bart/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_bart": ["BartConfig", "BartOnnxConfig"], + "configuration_bart": ["BART_PRETRAINED_CONFIG_ARCHIVE_MAP", "BartConfig", "BartOnnxConfig"], "tokenization_bart": ["BartTokenizer"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_bart"] = [ + "BART_PRETRAINED_MODEL_ARCHIVE_LIST", "BartForCausalLM", "BartForConditionalGeneration", "BartForQuestionAnswering", @@ -83,7 +84,7 @@ ] if TYPE_CHECKING: - from .configuration_bart import BartConfig, BartOnnxConfig + from .configuration_bart import BART_PRETRAINED_CONFIG_ARCHIVE_MAP, BartConfig, BartOnnxConfig from .tokenization_bart import BartTokenizer try: @@ -101,6 +102,7 @@ pass else: from .modeling_bart import ( + BART_PRETRAINED_MODEL_ARCHIVE_LIST, BartForCausalLM, BartForConditionalGeneration, BartForQuestionAnswering, diff --git a/src/transformers/models/beit/__init__.py b/src/transformers/models/beit/__init__.py index c2f49240d6e64c..ce399f92e0fa4d 100644 --- a/src/transformers/models/beit/__init__.py +++ b/src/transformers/models/beit/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_beit": ["BeitConfig", "BeitOnnxConfig"]} +_import_structure = {"configuration_beit": ["BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BeitConfig", "BeitOnnxConfig"]} try: if not is_vision_available(): @@ -41,6 +41,7 @@ pass else: _import_structure["modeling_beit"] = [ + "BEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BeitForImageClassification", "BeitForMaskedImageModeling", "BeitForSemanticSegmentation", @@ -64,7 +65,7 @@ ] if TYPE_CHECKING: - from .configuration_beit import BeitConfig, BeitOnnxConfig + from .configuration_beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig, BeitOnnxConfig try: if not is_vision_available(): @@ -82,6 +83,7 @@ pass else: from .modeling_beit import ( + BEIT_PRETRAINED_MODEL_ARCHIVE_LIST, BeitBackbone, BeitForImageClassification, BeitForMaskedImageModeling, diff --git a/src/transformers/models/bert/__init__.py b/src/transformers/models/bert/__init__.py index 17048a5d1c967a..882655f394e9c9 100644 --- a/src/transformers/models/bert/__init__.py +++ b/src/transformers/models/bert/__init__.py @@ -26,7 +26,7 @@ _import_structure = { - "configuration_bert": ["BertConfig", "BertOnnxConfig"], + "configuration_bert": ["BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BertConfig", "BertOnnxConfig"], "tokenization_bert": ["BasicTokenizer", "BertTokenizer", "WordpieceTokenizer"], } @@ -45,6 +45,7 @@ pass else: _import_structure["modeling_bert"] = [ + "BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "BertForMaskedLM", "BertForMultipleChoice", "BertForNextSentencePrediction", @@ -66,6 +67,7 @@ pass else: _import_structure["modeling_tf_bert"] = [ + "TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBertEmbeddings", "TFBertForMaskedLM", "TFBertForMultipleChoice", @@ -107,7 +109,7 @@ ] if TYPE_CHECKING: - from .configuration_bert import BertConfig, BertOnnxConfig + from .configuration_bert import BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, BertConfig, BertOnnxConfig from .tokenization_bert import BasicTokenizer, BertTokenizer, WordpieceTokenizer try: @@ -125,6 +127,7 @@ pass else: from .modeling_bert import ( + BERT_PRETRAINED_MODEL_ARCHIVE_LIST, BertForMaskedLM, BertForMultipleChoice, BertForNextSentencePrediction, @@ -146,6 +149,7 @@ pass else: from .modeling_tf_bert import ( + TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFBertEmbeddings, TFBertForMaskedLM, TFBertForMultipleChoice, diff --git a/src/transformers/models/big_bird/__init__.py b/src/transformers/models/big_bird/__init__.py index 8eda33d9ee6608..ef8ad80aa6b5e6 100644 --- a/src/transformers/models/big_bird/__init__.py +++ b/src/transformers/models/big_bird/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_big_bird": ["BigBirdConfig", "BigBirdOnnxConfig"], + "configuration_big_bird": ["BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP", "BigBirdConfig", "BigBirdOnnxConfig"], } try: @@ -51,6 +51,7 @@ pass else: _import_structure["modeling_big_bird"] = [ + "BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdForCausalLM", "BigBirdForMaskedLM", "BigBirdForMultipleChoice", @@ -83,7 +84,7 @@ ] if TYPE_CHECKING: - from .configuration_big_bird import BigBirdConfig, BigBirdOnnxConfig + from .configuration_big_bird import BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdConfig, BigBirdOnnxConfig try: if not is_sentencepiece_available(): @@ -108,6 +109,7 @@ pass else: from .modeling_big_bird import ( + BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdForCausalLM, BigBirdForMaskedLM, BigBirdForMultipleChoice, diff --git a/src/transformers/models/bigbird_pegasus/__init__.py b/src/transformers/models/bigbird_pegasus/__init__.py index 85621ce76d902b..c4245496e73dc2 100644 --- a/src/transformers/models/bigbird_pegasus/__init__.py +++ b/src/transformers/models/bigbird_pegasus/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_bigbird_pegasus": [ + "BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "BigBirdPegasusConfig", "BigBirdPegasusOnnxConfig", ], @@ -30,6 +31,7 @@ pass else: _import_structure["modeling_bigbird_pegasus"] = [ + "BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST", "BigBirdPegasusForCausalLM", "BigBirdPegasusForConditionalGeneration", "BigBirdPegasusForQuestionAnswering", @@ -41,6 +43,7 @@ if TYPE_CHECKING: from .configuration_bigbird_pegasus import ( + BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, BigBirdPegasusConfig, BigBirdPegasusOnnxConfig, ) @@ -52,6 +55,7 @@ pass else: from .modeling_bigbird_pegasus import ( + BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST, BigBirdPegasusForCausalLM, BigBirdPegasusForConditionalGeneration, BigBirdPegasusForQuestionAnswering, diff --git a/src/transformers/models/biogpt/__init__.py b/src/transformers/models/biogpt/__init__.py index 355c87e67ba2b7..ec3d6966ac419d 100644 --- a/src/transformers/models/biogpt/__init__.py +++ b/src/transformers/models/biogpt/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_biogpt": ["BioGptConfig"], + "configuration_biogpt": ["BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BioGptConfig"], "tokenization_biogpt": ["BioGptTokenizer"], } @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_biogpt"] = [ + "BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "BioGptForCausalLM", "BioGptForTokenClassification", "BioGptForSequenceClassification", @@ -37,7 +38,7 @@ if TYPE_CHECKING: - from .configuration_biogpt import BioGptConfig + from .configuration_biogpt import BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, BioGptConfig from .tokenization_biogpt import BioGptTokenizer try: @@ -47,6 +48,7 @@ pass else: from .modeling_biogpt import ( + BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST, BioGptForCausalLM, BioGptForSequenceClassification, BioGptForTokenClassification, diff --git a/src/transformers/models/bit/__init__.py b/src/transformers/models/bit/__init__.py index 8f298a9adf6535..fc50659d9fa068 100644 --- a/src/transformers/models/bit/__init__.py +++ b/src/transformers/models/bit/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_bit": ["BitConfig", "BitOnnxConfig"]} +_import_structure = {"configuration_bit": ["BIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BitConfig", "BitOnnxConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_bit"] = [ + "BIT_PRETRAINED_MODEL_ARCHIVE_LIST", "BitForImageClassification", "BitModel", "BitPreTrainedModel", @@ -42,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_bit import BitConfig, BitOnnxConfig + from .configuration_bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig, BitOnnxConfig try: if not is_torch_available(): @@ -51,6 +52,7 @@ pass else: from .modeling_bit import ( + BIT_PRETRAINED_MODEL_ARCHIVE_LIST, BitBackbone, BitForImageClassification, BitModel, diff --git a/src/transformers/models/blenderbot/__init__.py b/src/transformers/models/blenderbot/__init__.py index 8b53b9100a4af1..86d857b1e9a26d 100644 --- a/src/transformers/models/blenderbot/__init__.py +++ b/src/transformers/models/blenderbot/__init__.py @@ -26,6 +26,7 @@ _import_structure = { "configuration_blenderbot": [ + "BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotConfig", "BlenderbotOnnxConfig", ], @@ -47,6 +48,7 @@ pass else: _import_structure["modeling_blenderbot"] = [ + "BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotForCausalLM", "BlenderbotForConditionalGeneration", "BlenderbotModel", @@ -82,6 +84,7 @@ if TYPE_CHECKING: from .configuration_blenderbot import ( + BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotConfig, BlenderbotOnnxConfig, ) @@ -102,6 +105,7 @@ pass else: from .modeling_blenderbot import ( + BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotForCausalLM, BlenderbotForConditionalGeneration, BlenderbotModel, diff --git a/src/transformers/models/blenderbot_small/__init__.py b/src/transformers/models/blenderbot_small/__init__.py index e6cab05c0cae02..5622ab70de6429 100644 --- a/src/transformers/models/blenderbot_small/__init__.py +++ b/src/transformers/models/blenderbot_small/__init__.py @@ -25,6 +25,7 @@ _import_structure = { "configuration_blenderbot_small": [ + "BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlenderbotSmallConfig", "BlenderbotSmallOnnxConfig", ], @@ -46,6 +47,7 @@ pass else: _import_structure["modeling_blenderbot_small"] = [ + "BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST", "BlenderbotSmallForCausalLM", "BlenderbotSmallForConditionalGeneration", "BlenderbotSmallModel", @@ -78,6 +80,7 @@ if TYPE_CHECKING: from .configuration_blenderbot_small import ( + BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP, BlenderbotSmallConfig, BlenderbotSmallOnnxConfig, ) @@ -98,6 +101,7 @@ pass else: from .modeling_blenderbot_small import ( + BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST, BlenderbotSmallForCausalLM, BlenderbotSmallForConditionalGeneration, BlenderbotSmallModel, diff --git a/src/transformers/models/blip/__init__.py b/src/transformers/models/blip/__init__.py index f78c2500bd64f4..a7001788e62916 100644 --- a/src/transformers/models/blip/__init__.py +++ b/src/transformers/models/blip/__init__.py @@ -24,6 +24,7 @@ _import_structure = { "configuration_blip": [ + "BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "BlipConfig", "BlipTextConfig", "BlipVisionConfig", @@ -47,6 +48,7 @@ pass else: _import_structure["modeling_blip"] = [ + "BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "BlipModel", "BlipPreTrainedModel", "BlipForConditionalGeneration", @@ -63,6 +65,7 @@ pass else: _import_structure["modeling_tf_blip"] = [ + "TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFBlipModel", "TFBlipPreTrainedModel", "TFBlipForConditionalGeneration", @@ -73,7 +76,7 @@ ] if TYPE_CHECKING: - from .configuration_blip import BlipConfig, BlipTextConfig, BlipVisionConfig + from .configuration_blip import BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, BlipConfig, BlipTextConfig, BlipVisionConfig from .processing_blip import BlipProcessor try: @@ -91,6 +94,7 @@ pass else: from .modeling_blip import ( + BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, BlipForConditionalGeneration, BlipForImageTextRetrieval, BlipForQuestionAnswering, @@ -107,6 +111,7 @@ pass else: from .modeling_tf_blip import ( + TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFBlipForConditionalGeneration, TFBlipForImageTextRetrieval, TFBlipForQuestionAnswering, diff --git a/src/transformers/models/blip_2/__init__.py b/src/transformers/models/blip_2/__init__.py index 6897dd35c89bd4..6fbfd53b3703fd 100644 --- a/src/transformers/models/blip_2/__init__.py +++ b/src/transformers/models/blip_2/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_blip_2": [ + "BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Blip2Config", "Blip2QFormerConfig", "Blip2VisionConfig", @@ -32,6 +33,7 @@ pass else: _import_structure["modeling_blip_2"] = [ + "BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Blip2Model", "Blip2QFormerModel", "Blip2PreTrainedModel", @@ -41,6 +43,7 @@ if TYPE_CHECKING: from .configuration_blip_2 import ( + BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Blip2Config, Blip2QFormerConfig, Blip2VisionConfig, @@ -54,6 +57,7 @@ pass else: from .modeling_blip_2 import ( + BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST, Blip2ForConditionalGeneration, Blip2Model, Blip2PreTrainedModel, diff --git a/src/transformers/models/bloom/__init__.py b/src/transformers/models/bloom/__init__.py index 3c903b39dca23f..32e8617e8270e9 100644 --- a/src/transformers/models/bloom/__init__.py +++ b/src/transformers/models/bloom/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_bloom": ["BloomConfig", "BloomOnnxConfig"], + "configuration_bloom": ["BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP", "BloomConfig", "BloomOnnxConfig"], } try: if not is_tokenizers_available(): @@ -41,6 +41,7 @@ pass else: _import_structure["modeling_bloom"] = [ + "BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST", "BloomForCausalLM", "BloomModel", "BloomPreTrainedModel", @@ -63,7 +64,7 @@ if TYPE_CHECKING: - from .configuration_bloom import BloomConfig, BloomOnnxConfig + from .configuration_bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig, BloomOnnxConfig try: if not is_tokenizers_available(): @@ -80,6 +81,7 @@ pass else: from .modeling_bloom import ( + BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST, BloomForCausalLM, BloomForQuestionAnswering, BloomForSequenceClassification, diff --git a/src/transformers/models/bridgetower/__init__.py b/src/transformers/models/bridgetower/__init__.py index 3120ca9f2a163a..cbd5bd4a366aed 100644 --- a/src/transformers/models/bridgetower/__init__.py +++ b/src/transformers/models/bridgetower/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_bridgetower": [ + "BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP", "BridgeTowerConfig", "BridgeTowerTextConfig", "BridgeTowerVisionConfig", @@ -40,6 +41,7 @@ pass else: _import_structure["modeling_bridgetower"] = [ + "BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST", "BridgeTowerForContrastiveLearning", "BridgeTowerForImageAndTextRetrieval", "BridgeTowerForMaskedLM", @@ -50,6 +52,7 @@ if TYPE_CHECKING: from .configuration_bridgetower import ( + BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP, BridgeTowerConfig, BridgeTowerTextConfig, BridgeTowerVisionConfig, @@ -71,6 +74,7 @@ pass else: from .modeling_bridgetower import ( + BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST, BridgeTowerForContrastiveLearning, BridgeTowerForImageAndTextRetrieval, BridgeTowerForMaskedLM, diff --git a/src/transformers/models/bros/__init__.py b/src/transformers/models/bros/__init__.py index 516c6349cd120c..b08d55836488a0 100644 --- a/src/transformers/models/bros/__init__.py +++ b/src/transformers/models/bros/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_bros": ["BrosConfig"], + "configuration_bros": ["BROS_PRETRAINED_CONFIG_ARCHIVE_MAP", "BrosConfig"], } try: @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_bros"] = [ + "BROS_PRETRAINED_MODEL_ARCHIVE_LIST", "BrosPreTrainedModel", "BrosModel", "BrosForTokenClassification", @@ -44,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_bros import BrosConfig + from .configuration_bros import BROS_PRETRAINED_CONFIG_ARCHIVE_MAP, BrosConfig try: if not is_tokenizers_available(): @@ -61,6 +62,7 @@ pass else: from .modeling_bros import ( + BROS_PRETRAINED_MODEL_ARCHIVE_LIST, BrosForTokenClassification, BrosModel, BrosPreTrainedModel, diff --git a/src/transformers/models/camembert/__init__.py b/src/transformers/models/camembert/__init__.py index 1759762f47f1a1..9882fc2b973355 100644 --- a/src/transformers/models/camembert/__init__.py +++ b/src/transformers/models/camembert/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_camembert": ["CamembertConfig", "CamembertOnnxConfig"], + "configuration_camembert": ["CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CamembertConfig", "CamembertOnnxConfig"], } try: @@ -51,6 +51,7 @@ pass else: _import_structure["modeling_camembert"] = [ + "CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "CamembertForCausalLM", "CamembertForMaskedLM", "CamembertForMultipleChoice", @@ -68,6 +69,7 @@ pass else: _import_structure["modeling_tf_camembert"] = [ + "TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCamembertForCausalLM", "TFCamembertForMaskedLM", "TFCamembertForMultipleChoice", @@ -80,7 +82,7 @@ if TYPE_CHECKING: - from .configuration_camembert import CamembertConfig, CamembertOnnxConfig + from .configuration_camembert import CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, CamembertConfig, CamembertOnnxConfig try: if not is_sentencepiece_available(): @@ -105,6 +107,7 @@ pass else: from .modeling_camembert import ( + CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, CamembertForCausalLM, CamembertForMaskedLM, CamembertForMultipleChoice, @@ -122,6 +125,7 @@ pass else: from .modeling_tf_camembert import ( + TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCamembertForCausalLM, TFCamembertForMaskedLM, TFCamembertForMultipleChoice, diff --git a/src/transformers/models/canine/__init__.py b/src/transformers/models/canine/__init__.py index 93f103344d476b..d036045e2f2156 100644 --- a/src/transformers/models/canine/__init__.py +++ b/src/transformers/models/canine/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_canine": ["CanineConfig"], + "configuration_canine": ["CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP", "CanineConfig"], "tokenization_canine": ["CanineTokenizer"], } @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_canine"] = [ + "CANINE_PRETRAINED_MODEL_ARCHIVE_LIST", "CanineForMultipleChoice", "CanineForQuestionAnswering", "CanineForSequenceClassification", @@ -40,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_canine import CanineConfig + from .configuration_canine import CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP, CanineConfig from .tokenization_canine import CanineTokenizer try: @@ -50,6 +51,7 @@ pass else: from .modeling_canine import ( + CANINE_PRETRAINED_MODEL_ARCHIVE_LIST, CanineForMultipleChoice, CanineForQuestionAnswering, CanineForSequenceClassification, diff --git a/src/transformers/models/chinese_clip/__init__.py b/src/transformers/models/chinese_clip/__init__.py index 03c9665ab0d09f..dbc0a57e8324f3 100644 --- a/src/transformers/models/chinese_clip/__init__.py +++ b/src/transformers/models/chinese_clip/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_chinese_clip": [ + "CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ChineseCLIPConfig", "ChineseCLIPOnnxConfig", "ChineseCLIPTextConfig", @@ -42,6 +43,7 @@ pass else: _import_structure["modeling_chinese_clip"] = [ + "CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "ChineseCLIPModel", "ChineseCLIPPreTrainedModel", "ChineseCLIPTextModel", @@ -50,6 +52,7 @@ if TYPE_CHECKING: from .configuration_chinese_clip import ( + CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, ChineseCLIPConfig, ChineseCLIPOnnxConfig, ChineseCLIPTextConfig, @@ -72,6 +75,7 @@ pass else: from .modeling_chinese_clip import ( + CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, ChineseCLIPModel, ChineseCLIPPreTrainedModel, ChineseCLIPTextModel, diff --git a/src/transformers/models/clap/__init__.py b/src/transformers/models/clap/__init__.py index 4d3d3ba04e136f..57e39b6e1fa660 100644 --- a/src/transformers/models/clap/__init__.py +++ b/src/transformers/models/clap/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_clap": [ + "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapAudioConfig", "ClapConfig", "ClapTextConfig", @@ -32,6 +33,7 @@ pass else: _import_structure["modeling_clap"] = [ + "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClapModel", "ClapPreTrainedModel", "ClapTextModel", @@ -43,6 +45,7 @@ if TYPE_CHECKING: from .configuration_clap import ( + CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioConfig, ClapConfig, ClapTextConfig, @@ -57,6 +60,7 @@ else: from .feature_extraction_clap import ClapFeatureExtractor from .modeling_clap import ( + CLAP_PRETRAINED_MODEL_ARCHIVE_LIST, ClapAudioModel, ClapAudioModelWithProjection, ClapModel, diff --git a/src/transformers/models/clip/__init__.py b/src/transformers/models/clip/__init__.py index 36247e943ecaf7..868c46616e9b33 100644 --- a/src/transformers/models/clip/__init__.py +++ b/src/transformers/models/clip/__init__.py @@ -26,6 +26,7 @@ _import_structure = { "configuration_clip": [ + "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPConfig", "CLIPOnnxConfig", "CLIPTextConfig", @@ -59,6 +60,7 @@ pass else: _import_structure["modeling_clip"] = [ + "CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPModel", "CLIPPreTrainedModel", "CLIPTextModel", @@ -75,6 +77,7 @@ pass else: _import_structure["modeling_tf_clip"] = [ + "TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCLIPModel", "TFCLIPPreTrainedModel", "TFCLIPTextModel", @@ -100,6 +103,7 @@ if TYPE_CHECKING: from .configuration_clip import ( + CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPConfig, CLIPOnnxConfig, CLIPTextConfig, @@ -132,6 +136,7 @@ pass else: from .modeling_clip import ( + CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPForImageClassification, CLIPModel, CLIPPreTrainedModel, @@ -148,6 +153,7 @@ pass else: from .modeling_tf_clip import ( + TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST, TFCLIPModel, TFCLIPPreTrainedModel, TFCLIPTextModel, diff --git a/src/transformers/models/clipseg/__init__.py b/src/transformers/models/clipseg/__init__.py index cb7daf11553efd..0e2e250e507a81 100644 --- a/src/transformers/models/clipseg/__init__.py +++ b/src/transformers/models/clipseg/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_clipseg": [ + "CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP", "CLIPSegConfig", "CLIPSegTextConfig", "CLIPSegVisionConfig", @@ -32,6 +33,7 @@ pass else: _import_structure["modeling_clipseg"] = [ + "CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST", "CLIPSegModel", "CLIPSegPreTrainedModel", "CLIPSegTextModel", @@ -41,6 +43,7 @@ if TYPE_CHECKING: from .configuration_clipseg import ( + CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP, CLIPSegConfig, CLIPSegTextConfig, CLIPSegVisionConfig, @@ -54,6 +57,7 @@ pass else: from .modeling_clipseg import ( + CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST, CLIPSegForImageSegmentation, CLIPSegModel, CLIPSegPreTrainedModel, diff --git a/src/transformers/models/clvp/__init__.py b/src/transformers/models/clvp/__init__.py index 6ef4bc60e32148..fb88e24171c369 100644 --- a/src/transformers/models/clvp/__init__.py +++ b/src/transformers/models/clvp/__init__.py @@ -22,6 +22,7 @@ _import_structure = { "configuration_clvp": [ + "CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "ClvpConfig", "ClvpDecoderConfig", "ClvpEncoderConfig", @@ -39,6 +40,7 @@ pass else: _import_structure["modeling_clvp"] = [ + "CLVP_PRETRAINED_MODEL_ARCHIVE_LIST", "ClvpModelForConditionalGeneration", "ClvpForCausalLM", "ClvpModel", @@ -50,6 +52,7 @@ if TYPE_CHECKING: from .configuration_clvp import ( + CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP, ClvpConfig, ClvpDecoderConfig, ClvpEncoderConfig, @@ -65,6 +68,7 @@ pass else: from .modeling_clvp import ( + CLVP_PRETRAINED_MODEL_ARCHIVE_LIST, ClvpDecoder, ClvpEncoder, ClvpForCausalLM, diff --git a/src/transformers/models/codegen/__init__.py b/src/transformers/models/codegen/__init__.py index 7d4cb05adb20e9..a1ce89620035d5 100644 --- a/src/transformers/models/codegen/__init__.py +++ b/src/transformers/models/codegen/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_codegen": ["CodeGenConfig", "CodeGenOnnxConfig"], + "configuration_codegen": ["CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "CodeGenConfig", "CodeGenOnnxConfig"], "tokenization_codegen": ["CodeGenTokenizer"], } @@ -36,13 +36,14 @@ pass else: _import_structure["modeling_codegen"] = [ + "CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "CodeGenForCausalLM", "CodeGenModel", "CodeGenPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_codegen import CodeGenConfig, CodeGenOnnxConfig + from .configuration_codegen import CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, CodeGenConfig, CodeGenOnnxConfig from .tokenization_codegen import CodeGenTokenizer try: @@ -60,6 +61,7 @@ pass else: from .modeling_codegen import ( + CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST, CodeGenForCausalLM, CodeGenModel, CodeGenPreTrainedModel, diff --git a/src/transformers/models/conditional_detr/__init__.py b/src/transformers/models/conditional_detr/__init__.py index c7d5c5261d6e67..565323321160ff 100644 --- a/src/transformers/models/conditional_detr/__init__.py +++ b/src/transformers/models/conditional_detr/__init__.py @@ -19,6 +19,7 @@ _import_structure = { "configuration_conditional_detr": [ + "CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConditionalDetrConfig", "ConditionalDetrOnnxConfig", ] @@ -40,6 +41,7 @@ pass else: _import_structure["modeling_conditional_detr"] = [ + "CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "ConditionalDetrForObjectDetection", "ConditionalDetrForSegmentation", "ConditionalDetrModel", @@ -49,6 +51,7 @@ if TYPE_CHECKING: from .configuration_conditional_detr import ( + CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, ConditionalDetrConfig, ConditionalDetrOnnxConfig, ) @@ -69,6 +72,7 @@ pass else: from .modeling_conditional_detr import ( + CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, ConditionalDetrForObjectDetection, ConditionalDetrForSegmentation, ConditionalDetrModel, diff --git a/src/transformers/models/convbert/__init__.py b/src/transformers/models/convbert/__init__.py index 15c6bb51767af1..f1b19a949abbef 100644 --- a/src/transformers/models/convbert/__init__.py +++ b/src/transformers/models/convbert/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_convbert": ["ConvBertConfig", "ConvBertOnnxConfig"], + "configuration_convbert": ["CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvBertConfig", "ConvBertOnnxConfig"], "tokenization_convbert": ["ConvBertTokenizer"], } @@ -42,6 +42,7 @@ pass else: _import_structure["modeling_convbert"] = [ + "CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvBertForMaskedLM", "ConvBertForMultipleChoice", "ConvBertForQuestionAnswering", @@ -61,6 +62,7 @@ pass else: _import_structure["modeling_tf_convbert"] = [ + "TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFConvBertForMaskedLM", "TFConvBertForMultipleChoice", "TFConvBertForQuestionAnswering", @@ -73,7 +75,7 @@ if TYPE_CHECKING: - from .configuration_convbert import ConvBertConfig, ConvBertOnnxConfig + from .configuration_convbert import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertOnnxConfig from .tokenization_convbert import ConvBertTokenizer try: @@ -91,6 +93,7 @@ pass else: from .modeling_convbert import ( + CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvBertForMaskedLM, ConvBertForMultipleChoice, ConvBertForQuestionAnswering, @@ -109,6 +112,7 @@ pass else: from .modeling_tf_convbert import ( + TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFConvBertForMaskedLM, TFConvBertForMultipleChoice, TFConvBertForQuestionAnswering, diff --git a/src/transformers/models/convnext/__init__.py b/src/transformers/models/convnext/__init__.py index 4e9a90bd4deb33..099a7fc9d63da4 100644 --- a/src/transformers/models/convnext/__init__.py +++ b/src/transformers/models/convnext/__init__.py @@ -22,7 +22,9 @@ ) -_import_structure = {"configuration_convnext": ["ConvNextConfig", "ConvNextOnnxConfig"]} +_import_structure = { + "configuration_convnext": ["CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvNextConfig", "ConvNextOnnxConfig"] +} try: if not is_vision_available(): @@ -40,6 +42,7 @@ pass else: _import_structure["modeling_convnext"] = [ + "CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextForImageClassification", "ConvNextModel", "ConvNextPreTrainedModel", @@ -59,7 +62,7 @@ ] if TYPE_CHECKING: - from .configuration_convnext import ConvNextConfig, ConvNextOnnxConfig + from .configuration_convnext import CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextConfig, ConvNextOnnxConfig try: if not is_vision_available(): @@ -77,6 +80,7 @@ pass else: from .modeling_convnext import ( + CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextBackbone, ConvNextForImageClassification, ConvNextModel, diff --git a/src/transformers/models/convnextv2/__init__.py b/src/transformers/models/convnextv2/__init__.py index 5505868c14a4f4..d2a484b9b82850 100644 --- a/src/transformers/models/convnextv2/__init__.py +++ b/src/transformers/models/convnextv2/__init__.py @@ -26,7 +26,12 @@ ) -_import_structure = {"configuration_convnextv2": ["ConvNextV2Config"]} +_import_structure = { + "configuration_convnextv2": [ + "CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP", + "ConvNextV2Config", + ] +} try: if not is_torch_available(): @@ -35,6 +40,7 @@ pass else: _import_structure["modeling_convnextv2"] = [ + "CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST", "ConvNextV2ForImageClassification", "ConvNextV2Model", "ConvNextV2PreTrainedModel", @@ -55,6 +61,7 @@ if TYPE_CHECKING: from .configuration_convnextv2 import ( + CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextV2Config, ) @@ -65,6 +72,7 @@ pass else: from .modeling_convnextv2 import ( + CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST, ConvNextV2Backbone, ConvNextV2ForImageClassification, ConvNextV2Model, diff --git a/src/transformers/models/cpmant/__init__.py b/src/transformers/models/cpmant/__init__.py index 61db942a4f66bd..8140009b60f156 100644 --- a/src/transformers/models/cpmant/__init__.py +++ b/src/transformers/models/cpmant/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_cpmant": ["CpmAntConfig"], + "configuration_cpmant": ["CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CpmAntConfig"], "tokenization_cpmant": ["CpmAntTokenizer"], } @@ -33,6 +33,7 @@ pass else: _import_structure["modeling_cpmant"] = [ + "CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST", "CpmAntForCausalLM", "CpmAntModel", "CpmAntPreTrainedModel", @@ -40,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_cpmant import CpmAntConfig + from .configuration_cpmant import CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP, CpmAntConfig from .tokenization_cpmant import CpmAntTokenizer try: @@ -50,6 +51,7 @@ pass else: from .modeling_cpmant import ( + CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST, CpmAntForCausalLM, CpmAntModel, CpmAntPreTrainedModel, diff --git a/src/transformers/models/ctrl/__init__.py b/src/transformers/models/ctrl/__init__.py index f64cced4e28bfe..7463117bfbc623 100644 --- a/src/transformers/models/ctrl/__init__.py +++ b/src/transformers/models/ctrl/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_ctrl": ["CTRLConfig"], + "configuration_ctrl": ["CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP", "CTRLConfig"], "tokenization_ctrl": ["CTRLTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_ctrl"] = [ + "CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "CTRLForSequenceClassification", "CTRLLMHeadModel", "CTRLModel", @@ -42,6 +43,7 @@ pass else: _import_structure["modeling_tf_ctrl"] = [ + "TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCTRLForSequenceClassification", "TFCTRLLMHeadModel", "TFCTRLModel", @@ -50,7 +52,7 @@ if TYPE_CHECKING: - from .configuration_ctrl import CTRLConfig + from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig from .tokenization_ctrl import CTRLTokenizer try: @@ -60,6 +62,7 @@ pass else: from .modeling_ctrl import ( + CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, CTRLForSequenceClassification, CTRLLMHeadModel, CTRLModel, @@ -73,6 +76,7 @@ pass else: from .modeling_tf_ctrl import ( + TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST, TFCTRLForSequenceClassification, TFCTRLLMHeadModel, TFCTRLModel, diff --git a/src/transformers/models/cvt/__init__.py b/src/transformers/models/cvt/__init__.py index 7018b41d58e8b2..5241bb5a5f3a7a 100644 --- a/src/transformers/models/cvt/__init__.py +++ b/src/transformers/models/cvt/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available -_import_structure = {"configuration_cvt": ["CvtConfig"]} +_import_structure = {"configuration_cvt": ["CVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CvtConfig"]} try: @@ -26,6 +26,7 @@ pass else: _import_structure["modeling_cvt"] = [ + "CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "CvtForImageClassification", "CvtModel", "CvtPreTrainedModel", @@ -38,13 +39,14 @@ pass else: _import_structure["modeling_tf_cvt"] = [ + "TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFCvtForImageClassification", "TFCvtModel", "TFCvtPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_cvt import CvtConfig + from .configuration_cvt import CVT_PRETRAINED_CONFIG_ARCHIVE_MAP, CvtConfig try: if not is_torch_available(): @@ -53,6 +55,7 @@ pass else: from .modeling_cvt import ( + CVT_PRETRAINED_MODEL_ARCHIVE_LIST, CvtForImageClassification, CvtModel, CvtPreTrainedModel, @@ -65,6 +68,7 @@ pass else: from .modeling_tf_cvt import ( + TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST, TFCvtForImageClassification, TFCvtModel, TFCvtPreTrainedModel, diff --git a/src/transformers/models/data2vec/__init__.py b/src/transformers/models/data2vec/__init__.py index 525068db59832c..45522f4ba893a1 100644 --- a/src/transformers/models/data2vec/__init__.py +++ b/src/transformers/models/data2vec/__init__.py @@ -18,12 +18,14 @@ _import_structure = { - "configuration_data2vec_audio": ["Data2VecAudioConfig"], + "configuration_data2vec_audio": ["DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecAudioConfig"], "configuration_data2vec_text": [ + "DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecTextConfig", "Data2VecTextOnnxConfig", ], "configuration_data2vec_vision": [ + "DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP", "Data2VecVisionConfig", "Data2VecVisionOnnxConfig", ], @@ -36,6 +38,7 @@ pass else: _import_structure["modeling_data2vec_audio"] = [ + "DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecAudioForAudioFrameClassification", "Data2VecAudioForCTC", "Data2VecAudioForSequenceClassification", @@ -44,6 +47,7 @@ "Data2VecAudioPreTrainedModel", ] _import_structure["modeling_data2vec_text"] = [ + "DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecTextForCausalLM", "Data2VecTextForMaskedLM", "Data2VecTextForMultipleChoice", @@ -54,6 +58,7 @@ "Data2VecTextPreTrainedModel", ] _import_structure["modeling_data2vec_vision"] = [ + "DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST", "Data2VecVisionForImageClassification", "Data2VecVisionForMaskedImageModeling", "Data2VecVisionForSemanticSegmentation", @@ -70,12 +75,14 @@ ] if TYPE_CHECKING: - from .configuration_data2vec_audio import Data2VecAudioConfig + from .configuration_data2vec_audio import DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecAudioConfig from .configuration_data2vec_text import ( + DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecTextConfig, Data2VecTextOnnxConfig, ) from .configuration_data2vec_vision import ( + DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP, Data2VecVisionConfig, Data2VecVisionOnnxConfig, ) @@ -87,6 +94,7 @@ pass else: from .modeling_data2vec_audio import ( + DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecAudioForAudioFrameClassification, Data2VecAudioForCTC, Data2VecAudioForSequenceClassification, @@ -95,6 +103,7 @@ Data2VecAudioPreTrainedModel, ) from .modeling_data2vec_text import ( + DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecTextForCausalLM, Data2VecTextForMaskedLM, Data2VecTextForMultipleChoice, @@ -105,6 +114,7 @@ Data2VecTextPreTrainedModel, ) from .modeling_data2vec_vision import ( + DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST, Data2VecVisionForImageClassification, Data2VecVisionForMaskedImageModeling, Data2VecVisionForSemanticSegmentation, diff --git a/src/transformers/models/deberta/__init__.py b/src/transformers/models/deberta/__init__.py index 76beee798ff075..87806dd60d60c5 100644 --- a/src/transformers/models/deberta/__init__.py +++ b/src/transformers/models/deberta/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_deberta": ["DebertaConfig", "DebertaOnnxConfig"], + "configuration_deberta": ["DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaOnnxConfig"], "tokenization_deberta": ["DebertaTokenizer"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_deberta"] = [ + "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaForMaskedLM", "DebertaForQuestionAnswering", "DebertaForSequenceClassification", @@ -58,6 +59,7 @@ pass else: _import_structure["modeling_tf_deberta"] = [ + "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaForMaskedLM", "TFDebertaForQuestionAnswering", "TFDebertaForSequenceClassification", @@ -68,7 +70,7 @@ if TYPE_CHECKING: - from .configuration_deberta import DebertaConfig, DebertaOnnxConfig + from .configuration_deberta import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaOnnxConfig from .tokenization_deberta import DebertaTokenizer try: @@ -86,6 +88,7 @@ pass else: from .modeling_deberta import ( + DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaForMaskedLM, DebertaForQuestionAnswering, DebertaForSequenceClassification, @@ -101,6 +104,7 @@ pass else: from .modeling_tf_deberta import ( + TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaForMaskedLM, TFDebertaForQuestionAnswering, TFDebertaForSequenceClassification, diff --git a/src/transformers/models/deberta_v2/__init__.py b/src/transformers/models/deberta_v2/__init__.py index 314901aee1aed3..fb1b20a331fe11 100644 --- a/src/transformers/models/deberta_v2/__init__.py +++ b/src/transformers/models/deberta_v2/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_deberta_v2": ["DebertaV2Config", "DebertaV2OnnxConfig"], + "configuration_deberta_v2": ["DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaV2Config", "DebertaV2OnnxConfig"], "tokenization_deberta_v2": ["DebertaV2Tokenizer"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_tf_deberta_v2"] = [ + "TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDebertaV2ForMaskedLM", "TFDebertaV2ForQuestionAnswering", "TFDebertaV2ForMultipleChoice", @@ -59,6 +60,7 @@ pass else: _import_structure["modeling_deberta_v2"] = [ + "DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "DebertaV2ForMaskedLM", "DebertaV2ForMultipleChoice", "DebertaV2ForQuestionAnswering", @@ -71,6 +73,7 @@ if TYPE_CHECKING: from .configuration_deberta_v2 import ( + DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaV2Config, DebertaV2OnnxConfig, ) @@ -91,6 +94,7 @@ pass else: from .modeling_tf_deberta_v2 import ( + TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, TFDebertaV2ForMaskedLM, TFDebertaV2ForMultipleChoice, TFDebertaV2ForQuestionAnswering, @@ -107,6 +111,7 @@ pass else: from .modeling_deberta_v2 import ( + DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST, DebertaV2ForMaskedLM, DebertaV2ForMultipleChoice, DebertaV2ForQuestionAnswering, diff --git a/src/transformers/models/decision_transformer/__init__.py b/src/transformers/models/decision_transformer/__init__.py index ce97cf7352a782..44070229aaa859 100644 --- a/src/transformers/models/decision_transformer/__init__.py +++ b/src/transformers/models/decision_transformer/__init__.py @@ -17,7 +17,10 @@ _import_structure = { - "configuration_decision_transformer": ["DecisionTransformerConfig"], + "configuration_decision_transformer": [ + "DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "DecisionTransformerConfig", + ], } try: @@ -27,6 +30,7 @@ pass else: _import_structure["modeling_decision_transformer"] = [ + "DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "DecisionTransformerGPT2Model", "DecisionTransformerGPT2PreTrainedModel", "DecisionTransformerModel", @@ -36,6 +40,7 @@ if TYPE_CHECKING: from .configuration_decision_transformer import ( + DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, DecisionTransformerConfig, ) @@ -46,6 +51,7 @@ pass else: from .modeling_decision_transformer import ( + DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, DecisionTransformerGPT2Model, DecisionTransformerGPT2PreTrainedModel, DecisionTransformerModel, diff --git a/src/transformers/models/deformable_detr/__init__.py b/src/transformers/models/deformable_detr/__init__.py index ab44adf3718149..a560265f4bfcb8 100644 --- a/src/transformers/models/deformable_detr/__init__.py +++ b/src/transformers/models/deformable_detr/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_deformable_detr": ["DeformableDetrConfig"], + "configuration_deformable_detr": ["DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeformableDetrConfig"], } try: @@ -37,6 +37,7 @@ pass else: _import_structure["modeling_deformable_detr"] = [ + "DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DeformableDetrForObjectDetection", "DeformableDetrModel", "DeformableDetrPreTrainedModel", @@ -44,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_deformable_detr import DeformableDetrConfig + from .configuration_deformable_detr import DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DeformableDetrConfig try: if not is_vision_available(): @@ -62,6 +63,7 @@ pass else: from .modeling_deformable_detr import ( + DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DeformableDetrForObjectDetection, DeformableDetrModel, DeformableDetrPreTrainedModel, diff --git a/src/transformers/models/deit/__init__.py b/src/transformers/models/deit/__init__.py index 8248823be24c73..a0b44186efbc05 100644 --- a/src/transformers/models/deit/__init__.py +++ b/src/transformers/models/deit/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_deit": ["DeiTConfig", "DeiTOnnxConfig"]} +_import_structure = {"configuration_deit": ["DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DeiTConfig", "DeiTOnnxConfig"]} try: if not is_vision_available(): @@ -40,6 +40,7 @@ pass else: _import_structure["modeling_deit"] = [ + "DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "DeiTForImageClassification", "DeiTForImageClassificationWithTeacher", "DeiTForMaskedImageModeling", @@ -54,6 +55,7 @@ pass else: _import_structure["modeling_tf_deit"] = [ + "TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDeiTForImageClassification", "TFDeiTForImageClassificationWithTeacher", "TFDeiTForMaskedImageModeling", @@ -63,7 +65,7 @@ if TYPE_CHECKING: - from .configuration_deit import DeiTConfig, DeiTOnnxConfig + from .configuration_deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig, DeiTOnnxConfig try: if not is_vision_available(): @@ -81,6 +83,7 @@ pass else: from .modeling_deit import ( + DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, DeiTForImageClassification, DeiTForImageClassificationWithTeacher, DeiTForMaskedImageModeling, @@ -95,6 +98,7 @@ pass else: from .modeling_tf_deit import ( + TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDeiTForImageClassification, TFDeiTForImageClassificationWithTeacher, TFDeiTForMaskedImageModeling, diff --git a/src/transformers/models/deprecated/mctct/__init__.py b/src/transformers/models/deprecated/mctct/__init__.py index 4e0a06b1779d2f..567be97b7cd863 100644 --- a/src/transformers/models/deprecated/mctct/__init__.py +++ b/src/transformers/models/deprecated/mctct/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_mctct": ["MCTCTConfig"], + "configuration_mctct": ["MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MCTCTConfig"], "feature_extraction_mctct": ["MCTCTFeatureExtractor"], "processing_mctct": ["MCTCTProcessor"], } @@ -30,6 +30,7 @@ pass else: _import_structure["modeling_mctct"] = [ + "MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST", "MCTCTForCTC", "MCTCTModel", "MCTCTPreTrainedModel", @@ -37,7 +38,7 @@ if TYPE_CHECKING: - from .configuration_mctct import MCTCTConfig + from .configuration_mctct import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig from .feature_extraction_mctct import MCTCTFeatureExtractor from .processing_mctct import MCTCTProcessor @@ -47,7 +48,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_mctct import MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel + from .modeling_mctct import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel else: import sys diff --git a/src/transformers/models/deprecated/open_llama/__init__.py b/src/transformers/models/deprecated/open_llama/__init__.py index 085c91fdb69538..446c9f076d3134 100644 --- a/src/transformers/models/deprecated/open_llama/__init__.py +++ b/src/transformers/models/deprecated/open_llama/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_open_llama": ["OpenLlamaConfig"], + "configuration_open_llama": ["OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenLlamaConfig"], } try: @@ -57,7 +57,7 @@ if TYPE_CHECKING: - from .configuration_open_llama import OpenLlamaConfig + from .configuration_open_llama import OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenLlamaConfig try: if not is_sentencepiece_available(): diff --git a/src/transformers/models/deprecated/retribert/__init__.py b/src/transformers/models/deprecated/retribert/__init__.py index ff792f40a2a88c..dba5e14594e16c 100644 --- a/src/transformers/models/deprecated/retribert/__init__.py +++ b/src/transformers/models/deprecated/retribert/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_retribert": ["RetriBertConfig"], + "configuration_retribert": ["RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RetriBertConfig"], "tokenization_retribert": ["RetriBertTokenizer"], } @@ -37,13 +37,14 @@ pass else: _import_structure["modeling_retribert"] = [ + "RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RetriBertModel", "RetriBertPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_retribert import RetriBertConfig + from .configuration_retribert import RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RetriBertConfig from .tokenization_retribert import RetriBertTokenizer try: @@ -61,6 +62,7 @@ pass else: from .modeling_retribert import ( + RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RetriBertModel, RetriBertPreTrainedModel, ) diff --git a/src/transformers/models/deprecated/trajectory_transformer/__init__.py b/src/transformers/models/deprecated/trajectory_transformer/__init__.py index 1ec0385898409b..b7af1bb48cb7d6 100644 --- a/src/transformers/models/deprecated/trajectory_transformer/__init__.py +++ b/src/transformers/models/deprecated/trajectory_transformer/__init__.py @@ -17,7 +17,10 @@ _import_structure = { - "configuration_trajectory_transformer": ["TrajectoryTransformerConfig"], + "configuration_trajectory_transformer": [ + "TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "TrajectoryTransformerConfig", + ], } try: @@ -27,6 +30,7 @@ pass else: _import_structure["modeling_trajectory_transformer"] = [ + "TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TrajectoryTransformerModel", "TrajectoryTransformerPreTrainedModel", "load_tf_weights_in_trajectory_transformer", @@ -35,6 +39,7 @@ if TYPE_CHECKING: from .configuration_trajectory_transformer import ( + TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TrajectoryTransformerConfig, ) @@ -45,6 +50,7 @@ pass else: from .modeling_trajectory_transformer import ( + TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TrajectoryTransformerModel, TrajectoryTransformerPreTrainedModel, load_tf_weights_in_trajectory_transformer, diff --git a/src/transformers/models/deprecated/transfo_xl/__init__.py b/src/transformers/models/deprecated/transfo_xl/__init__.py index 27829fd9ed169a..f3674e19665ca7 100644 --- a/src/transformers/models/deprecated/transfo_xl/__init__.py +++ b/src/transformers/models/deprecated/transfo_xl/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_transfo_xl": ["TransfoXLConfig"], + "configuration_transfo_xl": ["TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", "TransfoXLConfig"], "tokenization_transfo_xl": ["TransfoXLCorpus", "TransfoXLTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_transfo_xl"] = [ + "TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "AdaptiveEmbedding", "TransfoXLForSequenceClassification", "TransfoXLLMHeadModel", @@ -44,6 +45,7 @@ pass else: _import_structure["modeling_tf_transfo_xl"] = [ + "TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFAdaptiveEmbedding", "TFTransfoXLForSequenceClassification", "TFTransfoXLLMHeadModel", @@ -54,7 +56,7 @@ if TYPE_CHECKING: - from .configuration_transfo_xl import TransfoXLConfig + from .configuration_transfo_xl import TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig from .tokenization_transfo_xl import TransfoXLCorpus, TransfoXLTokenizer try: @@ -64,6 +66,7 @@ pass else: from .modeling_transfo_xl import ( + TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, AdaptiveEmbedding, TransfoXLForSequenceClassification, TransfoXLLMHeadModel, @@ -79,6 +82,7 @@ pass else: from .modeling_tf_transfo_xl import ( + TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST, TFAdaptiveEmbedding, TFTransfoXLForSequenceClassification, TFTransfoXLLMHeadModel, diff --git a/src/transformers/models/deprecated/van/__init__.py b/src/transformers/models/deprecated/van/__init__.py index 59522e4ed46786..2db730984ffa03 100644 --- a/src/transformers/models/deprecated/van/__init__.py +++ b/src/transformers/models/deprecated/van/__init__.py @@ -16,7 +16,7 @@ from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_van": ["VanConfig"]} +_import_structure = {"configuration_van": ["VAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "VanConfig"]} try: @@ -26,13 +26,14 @@ pass else: _import_structure["modeling_van"] = [ + "VAN_PRETRAINED_MODEL_ARCHIVE_LIST", "VanForImageClassification", "VanModel", "VanPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_van import VanConfig + from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig try: if not is_torch_available(): @@ -41,6 +42,7 @@ pass else: from .modeling_van import ( + VAN_PRETRAINED_MODEL_ARCHIVE_LIST, VanForImageClassification, VanModel, VanPreTrainedModel, diff --git a/src/transformers/models/depth_anything/__init__.py b/src/transformers/models/depth_anything/__init__.py index 0640e211259f77..0d0ea5a514a836 100644 --- a/src/transformers/models/depth_anything/__init__.py +++ b/src/transformers/models/depth_anything/__init__.py @@ -17,7 +17,9 @@ from ...utils import OptionalDependencyNotAvailable -_import_structure = {"configuration_depth_anything": ["DepthAnythingConfig"]} +_import_structure = { + "configuration_depth_anything": ["DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP", "DepthAnythingConfig"] +} try: if not is_torch_available(): @@ -26,13 +28,14 @@ pass else: _import_structure["modeling_depth_anything"] = [ + "DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST", "DepthAnythingForDepthEstimation", "DepthAnythingPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_depth_anything import DepthAnythingConfig + from .configuration_depth_anything import DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP, DepthAnythingConfig try: if not is_torch_available(): @@ -41,6 +44,7 @@ pass else: from .modeling_depth_anything import ( + DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST, DepthAnythingForDepthEstimation, DepthAnythingPreTrainedModel, ) diff --git a/src/transformers/models/deta/__init__.py b/src/transformers/models/deta/__init__.py index 843a4dc4d803d9..2d25a6a71602b3 100644 --- a/src/transformers/models/deta/__init__.py +++ b/src/transformers/models/deta/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_deta": ["DetaConfig"], + "configuration_deta": ["DETA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetaConfig"], } try: @@ -36,6 +36,7 @@ pass else: _import_structure["modeling_deta"] = [ + "DETA_PRETRAINED_MODEL_ARCHIVE_LIST", "DetaForObjectDetection", "DetaModel", "DetaPreTrainedModel", @@ -43,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_deta import DetaConfig + from .configuration_deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig try: if not is_vision_available(): @@ -60,6 +61,7 @@ pass else: from .modeling_deta import ( + DETA_PRETRAINED_MODEL_ARCHIVE_LIST, DetaForObjectDetection, DetaModel, DetaPreTrainedModel, diff --git a/src/transformers/models/detr/__init__.py b/src/transformers/models/detr/__init__.py index 422fe98230be45..9cbaca9a54581f 100644 --- a/src/transformers/models/detr/__init__.py +++ b/src/transformers/models/detr/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_detr": ["DetrConfig", "DetrOnnxConfig"]} +_import_structure = {"configuration_detr": ["DETR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DetrConfig", "DetrOnnxConfig"]} try: if not is_vision_available(): @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_detr"] = [ + "DETR_PRETRAINED_MODEL_ARCHIVE_LIST", "DetrForObjectDetection", "DetrForSegmentation", "DetrModel", @@ -43,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_detr import DetrConfig, DetrOnnxConfig + from .configuration_detr import DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DetrConfig, DetrOnnxConfig try: if not is_vision_available(): @@ -61,6 +62,7 @@ pass else: from .modeling_detr import ( + DETR_PRETRAINED_MODEL_ARCHIVE_LIST, DetrForObjectDetection, DetrForSegmentation, DetrModel, diff --git a/src/transformers/models/dinat/__init__.py b/src/transformers/models/dinat/__init__.py index 207ebfdaa8693f..88470f1ca9f9bd 100644 --- a/src/transformers/models/dinat/__init__.py +++ b/src/transformers/models/dinat/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_dinat": ["DinatConfig"]} +_import_structure = {"configuration_dinat": ["DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DinatConfig"]} try: @@ -26,6 +26,7 @@ pass else: _import_structure["modeling_dinat"] = [ + "DINAT_PRETRAINED_MODEL_ARCHIVE_LIST", "DinatForImageClassification", "DinatModel", "DinatPreTrainedModel", @@ -33,7 +34,7 @@ ] if TYPE_CHECKING: - from .configuration_dinat import DinatConfig + from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig try: if not is_torch_available(): @@ -42,6 +43,7 @@ pass else: from .modeling_dinat import ( + DINAT_PRETRAINED_MODEL_ARCHIVE_LIST, DinatBackbone, DinatForImageClassification, DinatModel, diff --git a/src/transformers/models/dinov2/__init__.py b/src/transformers/models/dinov2/__init__.py index 25cf73b315bf2d..01d02a9e65fda0 100644 --- a/src/transformers/models/dinov2/__init__.py +++ b/src/transformers/models/dinov2/__init__.py @@ -20,7 +20,9 @@ ) -_import_structure = {"configuration_dinov2": ["Dinov2Config", "Dinov2OnnxConfig"]} +_import_structure = { + "configuration_dinov2": ["DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Dinov2Config", "Dinov2OnnxConfig"] +} try: if not is_torch_available(): @@ -29,6 +31,7 @@ pass else: _import_structure["modeling_dinov2"] = [ + "DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Dinov2ForImageClassification", "Dinov2Model", "Dinov2PreTrainedModel", @@ -36,7 +39,7 @@ ] if TYPE_CHECKING: - from .configuration_dinov2 import Dinov2Config, Dinov2OnnxConfig + from .configuration_dinov2 import DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Dinov2Config, Dinov2OnnxConfig try: if not is_torch_available(): @@ -45,6 +48,7 @@ pass else: from .modeling_dinov2 import ( + DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST, Dinov2Backbone, Dinov2ForImageClassification, Dinov2Model, diff --git a/src/transformers/models/distilbert/__init__.py b/src/transformers/models/distilbert/__init__.py index 7d6586bfa50809..6a2756eb9d1c26 100644 --- a/src/transformers/models/distilbert/__init__.py +++ b/src/transformers/models/distilbert/__init__.py @@ -26,6 +26,7 @@ _import_structure = { "configuration_distilbert": [ + "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DistilBertConfig", "DistilBertOnnxConfig", ], @@ -47,6 +48,7 @@ pass else: _import_structure["modeling_distilbert"] = [ + "DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "DistilBertForMaskedLM", "DistilBertForMultipleChoice", "DistilBertForQuestionAnswering", @@ -63,6 +65,7 @@ pass else: _import_structure["modeling_tf_distilbert"] = [ + "TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDistilBertForMaskedLM", "TFDistilBertForMultipleChoice", "TFDistilBertForQuestionAnswering", @@ -92,6 +95,7 @@ if TYPE_CHECKING: from .configuration_distilbert import ( + DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, DistilBertConfig, DistilBertOnnxConfig, ) @@ -112,6 +116,7 @@ pass else: from .modeling_distilbert import ( + DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, DistilBertForMaskedLM, DistilBertForMultipleChoice, DistilBertForQuestionAnswering, @@ -128,6 +133,7 @@ pass else: from .modeling_tf_distilbert import ( + TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFDistilBertForMaskedLM, TFDistilBertForMultipleChoice, TFDistilBertForQuestionAnswering, diff --git a/src/transformers/models/donut/__init__.py b/src/transformers/models/donut/__init__.py index f6f38609e6ff54..c548a181a3bf30 100644 --- a/src/transformers/models/donut/__init__.py +++ b/src/transformers/models/donut/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_donut_swin": ["DonutSwinConfig"], + "configuration_donut_swin": ["DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "DonutSwinConfig"], "processing_donut": ["DonutProcessor"], } @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_donut_swin"] = [ + "DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "DonutSwinModel", "DonutSwinPreTrainedModel", ] @@ -43,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_donut_swin import DonutSwinConfig + from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig from .processing_donut import DonutProcessor try: @@ -53,6 +54,7 @@ pass else: from .modeling_donut_swin import ( + DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, DonutSwinModel, DonutSwinPreTrainedModel, ) diff --git a/src/transformers/models/dpr/__init__.py b/src/transformers/models/dpr/__init__.py index ef4bccee54d296..6ea8b78e503739 100644 --- a/src/transformers/models/dpr/__init__.py +++ b/src/transformers/models/dpr/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_dpr": ["DPRConfig"], + "configuration_dpr": ["DPR_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPRConfig"], "tokenization_dpr": [ "DPRContextEncoderTokenizer", "DPRQuestionEncoderTokenizer", @@ -53,6 +53,9 @@ pass else: _import_structure["modeling_dpr"] = [ + "DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "DPRContextEncoder", "DPRPretrainedContextEncoder", "DPRPreTrainedModel", @@ -69,6 +72,9 @@ pass else: _import_structure["modeling_tf_dpr"] = [ + "TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST", + "TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFDPRContextEncoder", "TFDPRPretrainedContextEncoder", "TFDPRPretrainedQuestionEncoder", @@ -79,7 +85,7 @@ if TYPE_CHECKING: - from .configuration_dpr import DPRConfig + from .configuration_dpr import DPR_PRETRAINED_CONFIG_ARCHIVE_MAP, DPRConfig from .tokenization_dpr import ( DPRContextEncoderTokenizer, DPRQuestionEncoderTokenizer, @@ -106,6 +112,9 @@ pass else: from .modeling_dpr import ( + DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, DPRContextEncoder, DPRPretrainedContextEncoder, DPRPreTrainedModel, @@ -122,6 +131,9 @@ pass else: from .modeling_tf_dpr import ( + TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, + TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, TFDPRContextEncoder, TFDPRPretrainedContextEncoder, TFDPRPretrainedQuestionEncoder, diff --git a/src/transformers/models/dpt/__init__.py b/src/transformers/models/dpt/__init__.py index ef8999d5efba78..da53011b87b318 100644 --- a/src/transformers/models/dpt/__init__.py +++ b/src/transformers/models/dpt/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable -_import_structure = {"configuration_dpt": ["DPTConfig"]} +_import_structure = {"configuration_dpt": ["DPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "DPTConfig"]} try: if not is_vision_available(): @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_dpt"] = [ + "DPT_PRETRAINED_MODEL_ARCHIVE_LIST", "DPTForDepthEstimation", "DPTForSemanticSegmentation", "DPTModel", @@ -43,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_dpt import DPTConfig + from .configuration_dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig try: if not is_vision_available(): @@ -61,6 +62,7 @@ pass else: from .modeling_dpt import ( + DPT_PRETRAINED_MODEL_ARCHIVE_LIST, DPTForDepthEstimation, DPTForSemanticSegmentation, DPTModel, diff --git a/src/transformers/models/efficientformer/__init__.py b/src/transformers/models/efficientformer/__init__.py index 9b36518587cf44..25d60d1ee765ef 100644 --- a/src/transformers/models/efficientformer/__init__.py +++ b/src/transformers/models/efficientformer/__init__.py @@ -22,7 +22,12 @@ ) -_import_structure = {"configuration_efficientformer": ["EfficientFormerConfig"]} +_import_structure = { + "configuration_efficientformer": [ + "EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "EfficientFormerConfig", + ] +} try: if not is_vision_available(): @@ -39,6 +44,7 @@ pass else: _import_structure["modeling_efficientformer"] = [ + "EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientFormerForImageClassification", "EfficientFormerForImageClassificationWithTeacher", "EfficientFormerModel", @@ -52,6 +58,7 @@ pass else: _import_structure["modeling_tf_efficientformer"] = [ + "TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEfficientFormerForImageClassification", "TFEfficientFormerForImageClassificationWithTeacher", "TFEfficientFormerModel", @@ -59,7 +66,7 @@ ] if TYPE_CHECKING: - from .configuration_efficientformer import EfficientFormerConfig + from .configuration_efficientformer import EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientFormerConfig try: if not is_vision_available(): @@ -76,6 +83,7 @@ pass else: from .modeling_efficientformer import ( + EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientFormerForImageClassification, EfficientFormerForImageClassificationWithTeacher, EfficientFormerModel, @@ -88,6 +96,7 @@ pass else: from .modeling_tf_efficientformer import ( + TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFEfficientFormerForImageClassification, TFEfficientFormerForImageClassificationWithTeacher, TFEfficientFormerModel, diff --git a/src/transformers/models/efficientnet/__init__.py b/src/transformers/models/efficientnet/__init__.py index 28cb70490d9675..6df523721aefc5 100644 --- a/src/transformers/models/efficientnet/__init__.py +++ b/src/transformers/models/efficientnet/__init__.py @@ -23,6 +23,7 @@ _import_structure = { "configuration_efficientnet": [ + "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "EfficientNetConfig", "EfficientNetOnnxConfig", ] @@ -43,6 +44,7 @@ pass else: _import_structure["modeling_efficientnet"] = [ + "EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST", "EfficientNetForImageClassification", "EfficientNetModel", "EfficientNetPreTrainedModel", @@ -50,6 +52,7 @@ if TYPE_CHECKING: from .configuration_efficientnet import ( + EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP, EfficientNetConfig, EfficientNetOnnxConfig, ) @@ -69,6 +72,7 @@ pass else: from .modeling_efficientnet import ( + EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST, EfficientNetForImageClassification, EfficientNetModel, EfficientNetPreTrainedModel, diff --git a/src/transformers/models/electra/__init__.py b/src/transformers/models/electra/__init__.py index b79f2410bf354e..09ce039d25fd05 100644 --- a/src/transformers/models/electra/__init__.py +++ b/src/transformers/models/electra/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_electra": ["ElectraConfig", "ElectraOnnxConfig"], + "configuration_electra": ["ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "ElectraConfig", "ElectraOnnxConfig"], "tokenization_electra": ["ElectraTokenizer"], } @@ -44,6 +44,7 @@ pass else: _import_structure["modeling_electra"] = [ + "ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "ElectraForCausalLM", "ElectraForMaskedLM", "ElectraForMultipleChoice", @@ -63,6 +64,7 @@ pass else: _import_structure["modeling_tf_electra"] = [ + "TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFElectraForMaskedLM", "TFElectraForMultipleChoice", "TFElectraForPreTraining", @@ -93,7 +95,7 @@ if TYPE_CHECKING: - from .configuration_electra import ElectraConfig, ElectraOnnxConfig + from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig from .tokenization_electra import ElectraTokenizer try: @@ -111,6 +113,7 @@ pass else: from .modeling_electra import ( + ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, ElectraForCausalLM, ElectraForMaskedLM, ElectraForMultipleChoice, @@ -130,6 +133,7 @@ pass else: from .modeling_tf_electra import ( + TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST, TFElectraForMaskedLM, TFElectraForMultipleChoice, TFElectraForPreTraining, diff --git a/src/transformers/models/encodec/__init__.py b/src/transformers/models/encodec/__init__.py index d67075e5560c75..d3d9488968bf2c 100644 --- a/src/transformers/models/encodec/__init__.py +++ b/src/transformers/models/encodec/__init__.py @@ -21,7 +21,10 @@ _import_structure = { - "configuration_encodec": ["EncodecConfig"], + "configuration_encodec": [ + "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP", + "EncodecConfig", + ], "feature_extraction_encodec": ["EncodecFeatureExtractor"], } @@ -32,12 +35,14 @@ pass else: _import_structure["modeling_encodec"] = [ + "ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST", "EncodecModel", "EncodecPreTrainedModel", ] if TYPE_CHECKING: from .configuration_encodec import ( + ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP, EncodecConfig, ) from .feature_extraction_encodec import EncodecFeatureExtractor @@ -49,6 +54,7 @@ pass else: from .modeling_encodec import ( + ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST, EncodecModel, EncodecPreTrainedModel, ) diff --git a/src/transformers/models/ernie/__init__.py b/src/transformers/models/ernie/__init__.py index ddd3b30365d80a..ea7f077f928d39 100644 --- a/src/transformers/models/ernie/__init__.py +++ b/src/transformers/models/ernie/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_ernie": ["ErnieConfig", "ErnieOnnxConfig"], + "configuration_ernie": ["ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieConfig", "ErnieOnnxConfig"], } try: @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_ernie"] = [ + "ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieForCausalLM", "ErnieForMaskedLM", "ErnieForMultipleChoice", @@ -41,7 +42,7 @@ ] if TYPE_CHECKING: - from .configuration_ernie import ErnieConfig, ErnieOnnxConfig + from .configuration_ernie import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieConfig, ErnieOnnxConfig try: if not is_torch_available(): @@ -50,6 +51,7 @@ pass else: from .modeling_ernie import ( + ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieForCausalLM, ErnieForMaskedLM, ErnieForMultipleChoice, diff --git a/src/transformers/models/ernie_m/__init__.py b/src/transformers/models/ernie_m/__init__.py index fc7076e4394552..b7cd3bdd0681c1 100644 --- a/src/transformers/models/ernie_m/__init__.py +++ b/src/transformers/models/ernie_m/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_ernie_m": ["ErnieMConfig"], + "configuration_ernie_m": ["ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP", "ErnieMConfig"], } try: @@ -36,6 +36,7 @@ pass else: _import_structure["modeling_ernie_m"] = [ + "ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST", "ErnieMForMultipleChoice", "ErnieMForQuestionAnswering", "ErnieMForSequenceClassification", @@ -47,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_ernie_m import ErnieMConfig + from .configuration_ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig try: if not is_sentencepiece_available(): @@ -64,6 +65,7 @@ pass else: from .modeling_ernie_m import ( + ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST, ErnieMForInformationExtraction, ErnieMForMultipleChoice, ErnieMForQuestionAnswering, diff --git a/src/transformers/models/esm/__init__.py b/src/transformers/models/esm/__init__.py index a764bedc3fadfd..1b07db5a5eea64 100644 --- a/src/transformers/models/esm/__init__.py +++ b/src/transformers/models/esm/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_esm": ["EsmConfig"], + "configuration_esm": ["ESM_PRETRAINED_CONFIG_ARCHIVE_MAP", "EsmConfig"], "tokenization_esm": ["EsmTokenizer"], } @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_esm"] = [ + "ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "EsmForMaskedLM", "EsmForSequenceClassification", "EsmForTokenClassification", @@ -43,6 +44,7 @@ pass else: _import_structure["modeling_tf_esm"] = [ + "TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFEsmForMaskedLM", "TFEsmForSequenceClassification", "TFEsmForTokenClassification", @@ -51,7 +53,7 @@ ] if TYPE_CHECKING: - from .configuration_esm import EsmConfig + from .configuration_esm import ESM_PRETRAINED_CONFIG_ARCHIVE_MAP, EsmConfig from .tokenization_esm import EsmTokenizer try: @@ -61,6 +63,7 @@ pass else: from .modeling_esm import ( + ESM_PRETRAINED_MODEL_ARCHIVE_LIST, EsmForMaskedLM, EsmForSequenceClassification, EsmForTokenClassification, @@ -76,6 +79,7 @@ pass else: from .modeling_tf_esm import ( + TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST, TFEsmForMaskedLM, TFEsmForSequenceClassification, TFEsmForTokenClassification, diff --git a/src/transformers/models/falcon/__init__.py b/src/transformers/models/falcon/__init__.py index 62c1c9262b70fc..070e0cc033fbf6 100644 --- a/src/transformers/models/falcon/__init__.py +++ b/src/transformers/models/falcon/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_falcon": ["FalconConfig"], + "configuration_falcon": ["FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP", "FalconConfig"], } try: @@ -32,6 +32,7 @@ pass else: _import_structure["modeling_falcon"] = [ + "FALCON_PRETRAINED_MODEL_ARCHIVE_LIST", "FalconForCausalLM", "FalconModel", "FalconPreTrainedModel", @@ -42,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_falcon import FalconConfig + from .configuration_falcon import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP, FalconConfig try: if not is_torch_available(): @@ -51,6 +52,7 @@ pass else: from .modeling_falcon import ( + FALCON_PRETRAINED_MODEL_ARCHIVE_LIST, FalconForCausalLM, FalconForQuestionAnswering, FalconForSequenceClassification, diff --git a/src/transformers/models/fastspeech2_conformer/__init__.py b/src/transformers/models/fastspeech2_conformer/__init__.py index 2014f74be1f772..1fd5cbf1dc272e 100644 --- a/src/transformers/models/fastspeech2_conformer/__init__.py +++ b/src/transformers/models/fastspeech2_conformer/__init__.py @@ -22,6 +22,9 @@ _import_structure = { "configuration_fastspeech2_conformer": [ + "FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", + "FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "FastSpeech2ConformerConfig", "FastSpeech2ConformerHifiGanConfig", "FastSpeech2ConformerWithHifiGanConfig", @@ -36,6 +39,7 @@ pass else: _import_structure["modeling_fastspeech2_conformer"] = [ + "FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "FastSpeech2ConformerWithHifiGan", "FastSpeech2ConformerHifiGan", "FastSpeech2ConformerModel", @@ -44,6 +48,9 @@ if TYPE_CHECKING: from .configuration_fastspeech2_conformer import ( + FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, + FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, + FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, FastSpeech2ConformerConfig, FastSpeech2ConformerHifiGanConfig, FastSpeech2ConformerWithHifiGanConfig, @@ -57,6 +64,7 @@ pass else: from .modeling_fastspeech2_conformer import ( + FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, FastSpeech2ConformerHifiGan, FastSpeech2ConformerModel, FastSpeech2ConformerPreTrainedModel, diff --git a/src/transformers/models/flaubert/__init__.py b/src/transformers/models/flaubert/__init__.py index 94cf7b66139643..210d80b00f9ea2 100644 --- a/src/transformers/models/flaubert/__init__.py +++ b/src/transformers/models/flaubert/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_flaubert": ["FlaubertConfig", "FlaubertOnnxConfig"], + "configuration_flaubert": ["FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlaubertConfig", "FlaubertOnnxConfig"], "tokenization_flaubert": ["FlaubertTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_flaubert"] = [ + "FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaubertForMultipleChoice", "FlaubertForQuestionAnswering", "FlaubertForQuestionAnsweringSimple", @@ -46,6 +47,7 @@ pass else: _import_structure["modeling_tf_flaubert"] = [ + "TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFlaubertForMultipleChoice", "TFFlaubertForQuestionAnsweringSimple", "TFFlaubertForSequenceClassification", @@ -57,7 +59,7 @@ if TYPE_CHECKING: - from .configuration_flaubert import FlaubertConfig, FlaubertOnnxConfig + from .configuration_flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertOnnxConfig from .tokenization_flaubert import FlaubertTokenizer try: @@ -67,6 +69,7 @@ pass else: from .modeling_flaubert import ( + FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, FlaubertForMultipleChoice, FlaubertForQuestionAnswering, FlaubertForQuestionAnsweringSimple, @@ -84,6 +87,7 @@ pass else: from .modeling_tf_flaubert import ( + TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFFlaubertForMultipleChoice, TFFlaubertForQuestionAnsweringSimple, TFFlaubertForSequenceClassification, diff --git a/src/transformers/models/flava/__init__.py b/src/transformers/models/flava/__init__.py index 9fbe54524a6dea..8d026a9443271c 100644 --- a/src/transformers/models/flava/__init__.py +++ b/src/transformers/models/flava/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_flava": [ + "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "FlavaConfig", "FlavaImageCodebookConfig", "FlavaImageConfig", @@ -43,6 +44,7 @@ pass else: _import_structure["modeling_flava"] = [ + "FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlavaForPreTraining", "FlavaImageCodebook", "FlavaImageModel", @@ -54,6 +56,7 @@ if TYPE_CHECKING: from .configuration_flava import ( + FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, FlavaConfig, FlavaImageCodebookConfig, FlavaImageConfig, @@ -78,6 +81,7 @@ pass else: from .modeling_flava import ( + FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, FlavaForPreTraining, FlavaImageCodebook, FlavaImageModel, diff --git a/src/transformers/models/fnet/__init__.py b/src/transformers/models/fnet/__init__.py index 08b6ddf864e15f..485160d1ccaa69 100644 --- a/src/transformers/models/fnet/__init__.py +++ b/src/transformers/models/fnet/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_fnet": ["FNetConfig"]} +_import_structure = {"configuration_fnet": ["FNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FNetConfig"]} try: if not is_sentencepiece_available(): @@ -47,6 +47,7 @@ pass else: _import_structure["modeling_fnet"] = [ + "FNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FNetForMaskedLM", "FNetForMultipleChoice", "FNetForNextSentencePrediction", @@ -61,7 +62,7 @@ if TYPE_CHECKING: - from .configuration_fnet import FNetConfig + from .configuration_fnet import FNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FNetConfig try: if not is_sentencepiece_available(): @@ -86,6 +87,7 @@ pass else: from .modeling_fnet import ( + FNET_PRETRAINED_MODEL_ARCHIVE_LIST, FNetForMaskedLM, FNetForMultipleChoice, FNetForNextSentencePrediction, diff --git a/src/transformers/models/focalnet/__init__.py b/src/transformers/models/focalnet/__init__.py index ceacb8a52a170b..b043a006f93766 100644 --- a/src/transformers/models/focalnet/__init__.py +++ b/src/transformers/models/focalnet/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_focalnet": ["FocalNetConfig"]} +_import_structure = {"configuration_focalnet": ["FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FocalNetConfig"]} try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_focalnet"] = [ + "FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST", "FocalNetForImageClassification", "FocalNetForMaskedImageModeling", "FocalNetBackbone", @@ -35,7 +36,7 @@ ] if TYPE_CHECKING: - from .configuration_focalnet import FocalNetConfig + from .configuration_focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig try: if not is_torch_available(): @@ -44,6 +45,7 @@ pass else: from .modeling_focalnet import ( + FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST, FocalNetBackbone, FocalNetForImageClassification, FocalNetForMaskedImageModeling, diff --git a/src/transformers/models/fsmt/__init__.py b/src/transformers/models/fsmt/__init__.py index db960e4a5ce9c3..65aba047469da1 100644 --- a/src/transformers/models/fsmt/__init__.py +++ b/src/transformers/models/fsmt/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_fsmt": ["FSMTConfig"], + "configuration_fsmt": ["FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP", "FSMTConfig"], "tokenization_fsmt": ["FSMTTokenizer"], } @@ -32,7 +32,7 @@ if TYPE_CHECKING: - from .configuration_fsmt import FSMTConfig + from .configuration_fsmt import FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP, FSMTConfig from .tokenization_fsmt import FSMTTokenizer try: diff --git a/src/transformers/models/funnel/__init__.py b/src/transformers/models/funnel/__init__.py index aa620540dc3fd6..28b9a34290c826 100644 --- a/src/transformers/models/funnel/__init__.py +++ b/src/transformers/models/funnel/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_funnel": ["FunnelConfig"], + "configuration_funnel": ["FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig"], "convert_funnel_original_tf_checkpoint_to_pytorch": [], "tokenization_funnel": ["FunnelTokenizer"], } @@ -44,6 +44,7 @@ pass else: _import_structure["modeling_funnel"] = [ + "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "FunnelBaseModel", "FunnelForMaskedLM", "FunnelForMultipleChoice", @@ -63,6 +64,7 @@ pass else: _import_structure["modeling_tf_funnel"] = [ + "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST", "TFFunnelBaseModel", "TFFunnelForMaskedLM", "TFFunnelForMultipleChoice", @@ -76,7 +78,7 @@ if TYPE_CHECKING: - from .configuration_funnel import FunnelConfig + from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig from .tokenization_funnel import FunnelTokenizer try: @@ -94,6 +96,7 @@ pass else: from .modeling_funnel import ( + FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, FunnelBaseModel, FunnelForMaskedLM, FunnelForMultipleChoice, @@ -113,6 +116,7 @@ pass else: from .modeling_tf_funnel import ( + TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST, TFFunnelBaseModel, TFFunnelForMaskedLM, TFFunnelForMultipleChoice, diff --git a/src/transformers/models/fuyu/__init__.py b/src/transformers/models/fuyu/__init__.py index 403acb1964c1ed..51a72a53661403 100644 --- a/src/transformers/models/fuyu/__init__.py +++ b/src/transformers/models/fuyu/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_fuyu": ["FuyuConfig"], + "configuration_fuyu": ["FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP", "FuyuConfig"], } @@ -44,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_fuyu import FuyuConfig + from .configuration_fuyu import FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP, FuyuConfig try: if not is_vision_available(): diff --git a/src/transformers/models/gemma/__init__.py b/src/transformers/models/gemma/__init__.py index 1c832e9051b38c..64ff3445382816 100644 --- a/src/transformers/models/gemma/__init__.py +++ b/src/transformers/models/gemma/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_gemma": ["GemmaConfig"], + "configuration_gemma": ["GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "GemmaConfig"], } try: @@ -71,7 +71,7 @@ if TYPE_CHECKING: - from .configuration_gemma import GemmaConfig + from .configuration_gemma import GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP, GemmaConfig try: if not is_sentencepiece_available(): diff --git a/src/transformers/models/git/__init__.py b/src/transformers/models/git/__init__.py index 02f5f6d88a1194..e234a4b01db188 100644 --- a/src/transformers/models/git/__init__.py +++ b/src/transformers/models/git/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_git": ["GitConfig", "GitVisionConfig"], + "configuration_git": ["GIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GitConfig", "GitVisionConfig"], "processing_git": ["GitProcessor"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_git"] = [ + "GIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GitForCausalLM", "GitModel", "GitPreTrainedModel", @@ -36,7 +37,7 @@ ] if TYPE_CHECKING: - from .configuration_git import GitConfig, GitVisionConfig + from .configuration_git import GIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GitConfig, GitVisionConfig from .processing_git import GitProcessor try: @@ -46,6 +47,7 @@ pass else: from .modeling_git import ( + GIT_PRETRAINED_MODEL_ARCHIVE_LIST, GitForCausalLM, GitModel, GitPreTrainedModel, diff --git a/src/transformers/models/glpn/__init__.py b/src/transformers/models/glpn/__init__.py index 9896e801c93ae7..94788dcb85e76f 100644 --- a/src/transformers/models/glpn/__init__.py +++ b/src/transformers/models/glpn/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_glpn": ["GLPNConfig"]} +_import_structure = {"configuration_glpn": ["GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP", "GLPNConfig"]} try: if not is_vision_available(): @@ -34,6 +34,7 @@ pass else: _import_structure["modeling_glpn"] = [ + "GLPN_PRETRAINED_MODEL_ARCHIVE_LIST", "GLPNForDepthEstimation", "GLPNLayer", "GLPNModel", @@ -42,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_glpn import GLPNConfig + from .configuration_glpn import GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP, GLPNConfig try: if not is_vision_available(): @@ -60,6 +61,7 @@ pass else: from .modeling_glpn import ( + GLPN_PRETRAINED_MODEL_ARCHIVE_LIST, GLPNForDepthEstimation, GLPNLayer, GLPNModel, diff --git a/src/transformers/models/gpt2/__init__.py b/src/transformers/models/gpt2/__init__.py index 8c77c68445a830..e99658ac1e885e 100644 --- a/src/transformers/models/gpt2/__init__.py +++ b/src/transformers/models/gpt2/__init__.py @@ -27,7 +27,7 @@ _import_structure = { - "configuration_gpt2": ["GPT2Config", "GPT2OnnxConfig"], + "configuration_gpt2": ["GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPT2Config", "GPT2OnnxConfig"], "tokenization_gpt2": ["GPT2Tokenizer"], } @@ -46,6 +46,7 @@ pass else: _import_structure["modeling_gpt2"] = [ + "GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "GPT2DoubleHeadsModel", "GPT2ForQuestionAnswering", "GPT2ForSequenceClassification", @@ -63,6 +64,7 @@ pass else: _import_structure["modeling_tf_gpt2"] = [ + "TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGPT2DoubleHeadsModel", "TFGPT2ForSequenceClassification", "TFGPT2LMHeadModel", @@ -88,7 +90,7 @@ _import_structure["modeling_flax_gpt2"] = ["FlaxGPT2LMHeadModel", "FlaxGPT2Model", "FlaxGPT2PreTrainedModel"] if TYPE_CHECKING: - from .configuration_gpt2 import GPT2Config, GPT2OnnxConfig + from .configuration_gpt2 import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP, GPT2Config, GPT2OnnxConfig from .tokenization_gpt2 import GPT2Tokenizer try: @@ -106,6 +108,7 @@ pass else: from .modeling_gpt2 import ( + GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, GPT2DoubleHeadsModel, GPT2ForQuestionAnswering, GPT2ForSequenceClassification, @@ -123,6 +126,7 @@ pass else: from .modeling_tf_gpt2 import ( + TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST, TFGPT2DoubleHeadsModel, TFGPT2ForSequenceClassification, TFGPT2LMHeadModel, diff --git a/src/transformers/models/gpt_bigcode/__init__.py b/src/transformers/models/gpt_bigcode/__init__.py index 60eec86ca541d7..33660eb81e4fae 100644 --- a/src/transformers/models/gpt_bigcode/__init__.py +++ b/src/transformers/models/gpt_bigcode/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_gpt_bigcode": ["GPTBigCodeConfig"], + "configuration_gpt_bigcode": ["GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTBigCodeConfig"], } try: @@ -32,6 +32,7 @@ pass else: _import_structure["modeling_gpt_bigcode"] = [ + "GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTBigCodeForSequenceClassification", "GPTBigCodeForTokenClassification", "GPTBigCodeForCausalLM", @@ -40,7 +41,7 @@ ] if TYPE_CHECKING: - from .configuration_gpt_bigcode import GPTBigCodeConfig + from .configuration_gpt_bigcode import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig try: if not is_torch_available(): @@ -49,6 +50,7 @@ pass else: from .modeling_gpt_bigcode import ( + GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTBigCodeForCausalLM, GPTBigCodeForSequenceClassification, GPTBigCodeForTokenClassification, diff --git a/src/transformers/models/gpt_neo/__init__.py b/src/transformers/models/gpt_neo/__init__.py index 6c314c89f713a4..02ca0a11949b73 100644 --- a/src/transformers/models/gpt_neo/__init__.py +++ b/src/transformers/models/gpt_neo/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_gpt_neo": ["GPTNeoConfig", "GPTNeoOnnxConfig"], + "configuration_gpt_neo": ["GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoConfig", "GPTNeoOnnxConfig"], } try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_gpt_neo"] = [ + "GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoForCausalLM", "GPTNeoForQuestionAnswering", "GPTNeoForSequenceClassification", @@ -50,7 +51,7 @@ if TYPE_CHECKING: - from .configuration_gpt_neo import GPTNeoConfig, GPTNeoOnnxConfig + from .configuration_gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig, GPTNeoOnnxConfig try: if not is_torch_available(): @@ -59,6 +60,7 @@ pass else: from .modeling_gpt_neo import ( + GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoForCausalLM, GPTNeoForQuestionAnswering, GPTNeoForSequenceClassification, diff --git a/src/transformers/models/gpt_neox/__init__.py b/src/transformers/models/gpt_neox/__init__.py index 05a6982acb0b08..46f06b1991afe7 100644 --- a/src/transformers/models/gpt_neox/__init__.py +++ b/src/transformers/models/gpt_neox/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable -_import_structure = {"configuration_gpt_neox": ["GPTNeoXConfig"]} +_import_structure = {"configuration_gpt_neox": ["GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXConfig"]} try: if not is_tokenizers_available(): @@ -34,6 +34,7 @@ pass else: _import_structure["modeling_gpt_neox"] = [ + "GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXForCausalLM", "GPTNeoXForQuestionAnswering", "GPTNeoXForSequenceClassification", @@ -45,7 +46,7 @@ if TYPE_CHECKING: - from .configuration_gpt_neox import GPTNeoXConfig + from .configuration_gpt_neox import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXConfig try: if not is_tokenizers_available(): @@ -62,6 +63,7 @@ pass else: from .modeling_gpt_neox import ( + GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXForCausalLM, GPTNeoXForQuestionAnswering, GPTNeoXForSequenceClassification, diff --git a/src/transformers/models/gpt_neox_japanese/__init__.py b/src/transformers/models/gpt_neox_japanese/__init__.py index c43391c04958d4..bf04db7676c8b6 100644 --- a/src/transformers/models/gpt_neox_japanese/__init__.py +++ b/src/transformers/models/gpt_neox_japanese/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_gpt_neox_japanese": ["GPTNeoXJapaneseConfig"], + "configuration_gpt_neox_japanese": ["GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXJapaneseConfig"], "tokenization_gpt_neox_japanese": ["GPTNeoXJapaneseTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_gpt_neox_japanese"] = [ + "GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTNeoXJapaneseForCausalLM", "GPTNeoXJapaneseLayer", "GPTNeoXJapaneseModel", @@ -37,7 +38,7 @@ if TYPE_CHECKING: - from .configuration_gpt_neox_japanese import GPTNeoXJapaneseConfig + from .configuration_gpt_neox_japanese import GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig from .tokenization_gpt_neox_japanese import GPTNeoXJapaneseTokenizer try: @@ -47,6 +48,7 @@ pass else: from .modeling_gpt_neox_japanese import ( + GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseLayer, GPTNeoXJapaneseModel, diff --git a/src/transformers/models/gptj/__init__.py b/src/transformers/models/gptj/__init__.py index 51520484529f85..4e59ed47062048 100644 --- a/src/transformers/models/gptj/__init__.py +++ b/src/transformers/models/gptj/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_gptj": ["GPTJConfig", "GPTJOnnxConfig"]} +_import_structure = {"configuration_gptj": ["GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTJConfig", "GPTJOnnxConfig"]} try: if not is_torch_available(): @@ -31,6 +31,7 @@ pass else: _import_structure["modeling_gptj"] = [ + "GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTJForCausalLM", "GPTJForQuestionAnswering", "GPTJForSequenceClassification", @@ -66,7 +67,7 @@ if TYPE_CHECKING: - from .configuration_gptj import GPTJConfig, GPTJOnnxConfig + from .configuration_gptj import GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTJConfig, GPTJOnnxConfig try: if not is_torch_available(): @@ -75,6 +76,7 @@ pass else: from .modeling_gptj import ( + GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST, GPTJForCausalLM, GPTJForQuestionAnswering, GPTJForSequenceClassification, diff --git a/src/transformers/models/gptsan_japanese/__init__.py b/src/transformers/models/gptsan_japanese/__init__.py index 9ae8af34667e34..b3635ace911635 100644 --- a/src/transformers/models/gptsan_japanese/__init__.py +++ b/src/transformers/models/gptsan_japanese/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_gptsan_japanese": ["GPTSanJapaneseConfig"], + "configuration_gptsan_japanese": ["GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTSanJapaneseConfig"], "tokenization_gptsan_japanese": ["GPTSanJapaneseTokenizer"], } @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_gptsan_japanese"] = [ + "GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST", "GPTSanJapaneseForConditionalGeneration", "GPTSanJapaneseModel", "GPTSanJapanesePreTrainedModel", @@ -45,7 +46,7 @@ if TYPE_CHECKING: - from .configuration_gptsan_japanese import GPTSanJapaneseConfig + from .configuration_gptsan_japanese import GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTSanJapaneseConfig from .tokenization_gptsan_japanese import GPTSanJapaneseTokenizer try: @@ -55,6 +56,7 @@ pass else: from .modeling_gptsan_japanese import ( + GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST, GPTSanJapaneseForConditionalGeneration, GPTSanJapaneseModel, GPTSanJapanesePreTrainedModel, diff --git a/src/transformers/models/graphormer/__init__.py b/src/transformers/models/graphormer/__init__.py index f8140c81c1bb9b..4263525682147f 100644 --- a/src/transformers/models/graphormer/__init__.py +++ b/src/transformers/models/graphormer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_graphormer": ["GraphormerConfig"], + "configuration_graphormer": ["GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "GraphormerConfig"], } try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_graphormer"] = [ + "GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "GraphormerForGraphClassification", "GraphormerModel", "GraphormerPreTrainedModel", @@ -34,7 +35,7 @@ if TYPE_CHECKING: - from .configuration_graphormer import GraphormerConfig + from .configuration_graphormer import GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, GraphormerConfig try: if not is_torch_available(): @@ -43,6 +44,7 @@ pass else: from .modeling_graphormer import ( + GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST, GraphormerForGraphClassification, GraphormerModel, GraphormerPreTrainedModel, diff --git a/src/transformers/models/groupvit/__init__.py b/src/transformers/models/groupvit/__init__.py index 98fc6f4eccef08..d0de4a00bd1500 100644 --- a/src/transformers/models/groupvit/__init__.py +++ b/src/transformers/models/groupvit/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_groupvit": [ + "GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "GroupViTConfig", "GroupViTOnnxConfig", "GroupViTTextConfig", @@ -32,6 +33,7 @@ pass else: _import_structure["modeling_groupvit"] = [ + "GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "GroupViTModel", "GroupViTPreTrainedModel", "GroupViTTextModel", @@ -45,6 +47,7 @@ pass else: _import_structure["modeling_tf_groupvit"] = [ + "TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFGroupViTModel", "TFGroupViTPreTrainedModel", "TFGroupViTTextModel", @@ -53,6 +56,7 @@ if TYPE_CHECKING: from .configuration_groupvit import ( + GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GroupViTConfig, GroupViTOnnxConfig, GroupViTTextConfig, @@ -66,6 +70,7 @@ pass else: from .modeling_groupvit import ( + GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, GroupViTModel, GroupViTPreTrainedModel, GroupViTTextModel, @@ -79,6 +84,7 @@ pass else: from .modeling_tf_groupvit import ( + TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFGroupViTModel, TFGroupViTPreTrainedModel, TFGroupViTTextModel, diff --git a/src/transformers/models/hubert/__init__.py b/src/transformers/models/hubert/__init__.py index 30331ed0d146a4..f0b72a1f297bf8 100644 --- a/src/transformers/models/hubert/__init__.py +++ b/src/transformers/models/hubert/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available -_import_structure = {"configuration_hubert": ["HubertConfig"]} +_import_structure = {"configuration_hubert": ["HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "HubertConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_hubert"] = [ + "HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "HubertForCTC", "HubertForSequenceClassification", "HubertModel", @@ -39,13 +40,14 @@ pass else: _import_structure["modeling_tf_hubert"] = [ + "TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFHubertForCTC", "TFHubertModel", "TFHubertPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_hubert import HubertConfig + from .configuration_hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig try: if not is_torch_available(): @@ -54,6 +56,7 @@ pass else: from .modeling_hubert import ( + HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, HubertForCTC, HubertForSequenceClassification, HubertModel, @@ -67,6 +70,7 @@ pass else: from .modeling_tf_hubert import ( + TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFHubertForCTC, TFHubertModel, TFHubertPreTrainedModel, diff --git a/src/transformers/models/ibert/__init__.py b/src/transformers/models/ibert/__init__.py index 3b147e414c2edf..637eb08eaf412d 100644 --- a/src/transformers/models/ibert/__init__.py +++ b/src/transformers/models/ibert/__init__.py @@ -17,7 +17,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_ibert": ["IBertConfig", "IBertOnnxConfig"]} +_import_structure = {"configuration_ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig", "IBertOnnxConfig"]} try: if not is_torch_available(): @@ -26,6 +26,7 @@ pass else: _import_structure["modeling_ibert"] = [ + "IBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "IBertForMaskedLM", "IBertForMultipleChoice", "IBertForQuestionAnswering", @@ -36,7 +37,7 @@ ] if TYPE_CHECKING: - from .configuration_ibert import IBertConfig, IBertOnnxConfig + from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig try: if not is_torch_available(): @@ -45,6 +46,7 @@ pass else: from .modeling_ibert import ( + IBERT_PRETRAINED_MODEL_ARCHIVE_LIST, IBertForMaskedLM, IBertForMultipleChoice, IBertForQuestionAnswering, diff --git a/src/transformers/models/idefics/__init__.py b/src/transformers/models/idefics/__init__.py index 7a4e8056f540d5..68ff40fc18dc24 100644 --- a/src/transformers/models/idefics/__init__.py +++ b/src/transformers/models/idefics/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_idefics": ["IdeficsConfig"]} +_import_structure = {"configuration_idefics": ["IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP", "IdeficsConfig"]} try: if not is_vision_available(): @@ -33,6 +33,7 @@ pass else: _import_structure["modeling_idefics"] = [ + "IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST", "IdeficsForVisionText2Text", "IdeficsModel", "IdeficsPreTrainedModel", @@ -41,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_idefics import IdeficsConfig + from .configuration_idefics import IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP, IdeficsConfig try: if not is_vision_available(): @@ -58,6 +59,7 @@ pass else: from .modeling_idefics import ( + IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST, IdeficsForVisionText2Text, IdeficsModel, IdeficsPreTrainedModel, diff --git a/src/transformers/models/imagegpt/__init__.py b/src/transformers/models/imagegpt/__init__.py index a64dd9affdbe35..7d3e1440da942e 100644 --- a/src/transformers/models/imagegpt/__init__.py +++ b/src/transformers/models/imagegpt/__init__.py @@ -17,7 +17,9 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_imagegpt": ["ImageGPTConfig", "ImageGPTOnnxConfig"]} +_import_structure = { + "configuration_imagegpt": ["IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ImageGPTConfig", "ImageGPTOnnxConfig"] +} try: if not is_vision_available(): @@ -35,6 +37,7 @@ pass else: _import_structure["modeling_imagegpt"] = [ + "IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "ImageGPTForCausalImageModeling", "ImageGPTForImageClassification", "ImageGPTModel", @@ -44,7 +47,7 @@ if TYPE_CHECKING: - from .configuration_imagegpt import ImageGPTConfig, ImageGPTOnnxConfig + from .configuration_imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig, ImageGPTOnnxConfig try: if not is_vision_available(): @@ -62,6 +65,7 @@ pass else: from .modeling_imagegpt import ( + IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST, ImageGPTForCausalImageModeling, ImageGPTForImageClassification, ImageGPTModel, diff --git a/src/transformers/models/informer/__init__.py b/src/transformers/models/informer/__init__.py index fba309ee2b52b1..478ad56a72ba3c 100644 --- a/src/transformers/models/informer/__init__.py +++ b/src/transformers/models/informer/__init__.py @@ -18,7 +18,10 @@ _import_structure = { - "configuration_informer": ["InformerConfig"], + "configuration_informer": [ + "INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "InformerConfig", + ], } try: @@ -28,6 +31,7 @@ pass else: _import_structure["modeling_informer"] = [ + "INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "InformerForPrediction", "InformerModel", "InformerPreTrainedModel", @@ -35,7 +39,7 @@ if TYPE_CHECKING: - from .configuration_informer import InformerConfig + from .configuration_informer import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, InformerConfig try: if not is_torch_available(): @@ -44,6 +48,7 @@ pass else: from .modeling_informer import ( + INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, InformerForPrediction, InformerModel, InformerPreTrainedModel, diff --git a/src/transformers/models/instructblip/__init__.py b/src/transformers/models/instructblip/__init__.py index 093b9f00f6fc4d..201db4d272d4b7 100644 --- a/src/transformers/models/instructblip/__init__.py +++ b/src/transformers/models/instructblip/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_instructblip": [ + "INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "InstructBlipConfig", "InstructBlipQFormerConfig", "InstructBlipVisionConfig", @@ -32,6 +33,7 @@ pass else: _import_structure["modeling_instructblip"] = [ + "INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "InstructBlipQFormerModel", "InstructBlipPreTrainedModel", "InstructBlipForConditionalGeneration", @@ -40,6 +42,7 @@ if TYPE_CHECKING: from .configuration_instructblip import ( + INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, InstructBlipConfig, InstructBlipQFormerConfig, InstructBlipVisionConfig, @@ -53,6 +56,7 @@ pass else: from .modeling_instructblip import ( + INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST, InstructBlipForConditionalGeneration, InstructBlipPreTrainedModel, InstructBlipQFormerModel, diff --git a/src/transformers/models/jukebox/__init__.py b/src/transformers/models/jukebox/__init__.py index 441b11329cf8ff..d96fba4d47b5e7 100644 --- a/src/transformers/models/jukebox/__init__.py +++ b/src/transformers/models/jukebox/__init__.py @@ -19,6 +19,7 @@ _import_structure = { "configuration_jukebox": [ + "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "JukeboxConfig", "JukeboxPriorConfig", "JukeboxVQVAEConfig", @@ -33,6 +34,7 @@ pass else: _import_structure["modeling_jukebox"] = [ + "JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST", "JukeboxModel", "JukeboxPreTrainedModel", "JukeboxVQVAE", @@ -41,6 +43,7 @@ if TYPE_CHECKING: from .configuration_jukebox import ( + JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP, JukeboxConfig, JukeboxPriorConfig, JukeboxVQVAEConfig, @@ -54,6 +57,7 @@ pass else: from .modeling_jukebox import ( + JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST, JukeboxModel, JukeboxPreTrainedModel, JukeboxPrior, diff --git a/src/transformers/models/kosmos2/__init__.py b/src/transformers/models/kosmos2/__init__.py index 171a5cc7071e53..8d26304c72e199 100644 --- a/src/transformers/models/kosmos2/__init__.py +++ b/src/transformers/models/kosmos2/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_kosmos2": ["Kosmos2Config"], + "configuration_kosmos2": ["KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Kosmos2Config"], "processing_kosmos2": ["Kosmos2Processor"], } @@ -34,6 +34,7 @@ pass else: _import_structure["modeling_kosmos2"] = [ + "KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST", "Kosmos2ForConditionalGeneration", "Kosmos2Model", "Kosmos2PreTrainedModel", @@ -41,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_kosmos2 import Kosmos2Config + from .configuration_kosmos2 import KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP, Kosmos2Config from .processing_kosmos2 import Kosmos2Processor try: @@ -51,6 +52,7 @@ pass else: from .modeling_kosmos2 import ( + KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST, Kosmos2ForConditionalGeneration, Kosmos2Model, Kosmos2PreTrainedModel, diff --git a/src/transformers/models/layoutlm/__init__.py b/src/transformers/models/layoutlm/__init__.py index 070b42368ef958..e172dd1dc79101 100644 --- a/src/transformers/models/layoutlm/__init__.py +++ b/src/transformers/models/layoutlm/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_layoutlm": ["LayoutLMConfig", "LayoutLMOnnxConfig"], + "configuration_layoutlm": ["LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMConfig", "LayoutLMOnnxConfig"], "tokenization_layoutlm": ["LayoutLMTokenizer"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_layoutlm"] = [ + "LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMForMaskedLM", "LayoutLMForSequenceClassification", "LayoutLMForTokenClassification", @@ -58,6 +59,7 @@ pass else: _import_structure["modeling_tf_layoutlm"] = [ + "TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMForMaskedLM", "TFLayoutLMForSequenceClassification", "TFLayoutLMForTokenClassification", @@ -69,7 +71,7 @@ if TYPE_CHECKING: - from .configuration_layoutlm import LayoutLMConfig, LayoutLMOnnxConfig + from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig, LayoutLMOnnxConfig from .tokenization_layoutlm import LayoutLMTokenizer try: @@ -87,6 +89,7 @@ pass else: from .modeling_layoutlm import ( + LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMForMaskedLM, LayoutLMForQuestionAnswering, LayoutLMForSequenceClassification, @@ -101,6 +104,7 @@ pass else: from .modeling_tf_layoutlm import ( + TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMForMaskedLM, TFLayoutLMForQuestionAnswering, TFLayoutLMForSequenceClassification, diff --git a/src/transformers/models/layoutlmv2/__init__.py b/src/transformers/models/layoutlmv2/__init__.py index 1c45a9f76abb3a..9eccb238780f7e 100644 --- a/src/transformers/models/layoutlmv2/__init__.py +++ b/src/transformers/models/layoutlmv2/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_layoutlmv2": ["LayoutLMv2Config"], + "configuration_layoutlmv2": ["LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv2Config"], "processing_layoutlmv2": ["LayoutLMv2Processor"], "tokenization_layoutlmv2": ["LayoutLMv2Tokenizer"], } @@ -53,6 +53,7 @@ pass else: _import_structure["modeling_layoutlmv2"] = [ + "LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv2ForQuestionAnswering", "LayoutLMv2ForSequenceClassification", "LayoutLMv2ForTokenClassification", @@ -62,7 +63,7 @@ ] if TYPE_CHECKING: - from .configuration_layoutlmv2 import LayoutLMv2Config + from .configuration_layoutlmv2 import LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv2Config from .processing_layoutlmv2 import LayoutLMv2Processor from .tokenization_layoutlmv2 import LayoutLMv2Tokenizer @@ -89,6 +90,7 @@ pass else: from .modeling_layoutlmv2 import ( + LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv2ForQuestionAnswering, LayoutLMv2ForSequenceClassification, LayoutLMv2ForTokenClassification, diff --git a/src/transformers/models/layoutlmv3/__init__.py b/src/transformers/models/layoutlmv3/__init__.py index a8ef90906e7a5b..ca1c31091e8b6e 100644 --- a/src/transformers/models/layoutlmv3/__init__.py +++ b/src/transformers/models/layoutlmv3/__init__.py @@ -26,6 +26,7 @@ _import_structure = { "configuration_layoutlmv3": [ + "LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMv3Config", "LayoutLMv3OnnxConfig", ], @@ -48,6 +49,7 @@ pass else: _import_structure["modeling_layoutlmv3"] = [ + "LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "LayoutLMv3ForQuestionAnswering", "LayoutLMv3ForSequenceClassification", "LayoutLMv3ForTokenClassification", @@ -62,6 +64,7 @@ pass else: _import_structure["modeling_tf_layoutlmv3"] = [ + "TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLayoutLMv3ForQuestionAnswering", "TFLayoutLMv3ForSequenceClassification", "TFLayoutLMv3ForTokenClassification", @@ -81,6 +84,7 @@ if TYPE_CHECKING: from .configuration_layoutlmv3 import ( + LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMv3Config, LayoutLMv3OnnxConfig, ) @@ -102,6 +106,7 @@ pass else: from .modeling_layoutlmv3 import ( + LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, LayoutLMv3ForQuestionAnswering, LayoutLMv3ForSequenceClassification, LayoutLMv3ForTokenClassification, @@ -116,6 +121,7 @@ pass else: from .modeling_tf_layoutlmv3 import ( + TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST, TFLayoutLMv3ForQuestionAnswering, TFLayoutLMv3ForSequenceClassification, TFLayoutLMv3ForTokenClassification, diff --git a/src/transformers/models/led/__init__.py b/src/transformers/models/led/__init__.py index 2dbd59dcc34705..dd1c53b886eb37 100644 --- a/src/transformers/models/led/__init__.py +++ b/src/transformers/models/led/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_led": ["LEDConfig"], + "configuration_led": ["LED_PRETRAINED_CONFIG_ARCHIVE_MAP", "LEDConfig"], "tokenization_led": ["LEDTokenizer"], } @@ -42,6 +42,7 @@ pass else: _import_structure["modeling_led"] = [ + "LED_PRETRAINED_MODEL_ARCHIVE_LIST", "LEDForConditionalGeneration", "LEDForQuestionAnswering", "LEDForSequenceClassification", @@ -60,7 +61,7 @@ if TYPE_CHECKING: - from .configuration_led import LEDConfig + from .configuration_led import LED_PRETRAINED_CONFIG_ARCHIVE_MAP, LEDConfig from .tokenization_led import LEDTokenizer try: @@ -78,6 +79,7 @@ pass else: from .modeling_led import ( + LED_PRETRAINED_MODEL_ARCHIVE_LIST, LEDForConditionalGeneration, LEDForQuestionAnswering, LEDForSequenceClassification, diff --git a/src/transformers/models/levit/__init__.py b/src/transformers/models/levit/__init__.py index 266889963c90f2..84adf04084e61d 100644 --- a/src/transformers/models/levit/__init__.py +++ b/src/transformers/models/levit/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_levit": ["LevitConfig", "LevitOnnxConfig"]} +_import_structure = {"configuration_levit": ["LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LevitConfig", "LevitOnnxConfig"]} try: if not is_vision_available(): @@ -34,6 +34,7 @@ pass else: _import_structure["modeling_levit"] = [ + "LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "LevitForImageClassification", "LevitForImageClassificationWithTeacher", "LevitModel", @@ -42,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_levit import LevitConfig, LevitOnnxConfig + from .configuration_levit import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, LevitConfig, LevitOnnxConfig try: if not is_vision_available(): @@ -60,6 +61,7 @@ pass else: from .modeling_levit import ( + LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, LevitForImageClassification, LevitForImageClassificationWithTeacher, LevitModel, diff --git a/src/transformers/models/lilt/__init__.py b/src/transformers/models/lilt/__init__.py index 5b73f3aebd9c2f..50c493e352bc75 100644 --- a/src/transformers/models/lilt/__init__.py +++ b/src/transformers/models/lilt/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_lilt": ["LiltConfig"], + "configuration_lilt": ["LILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LiltConfig"], } try: @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_lilt"] = [ + "LILT_PRETRAINED_MODEL_ARCHIVE_LIST", "LiltForQuestionAnswering", "LiltForSequenceClassification", "LiltForTokenClassification", @@ -36,7 +37,7 @@ ] if TYPE_CHECKING: - from .configuration_lilt import LiltConfig + from .configuration_lilt import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP, LiltConfig try: if not is_torch_available(): @@ -45,6 +46,7 @@ pass else: from .modeling_lilt import ( + LILT_PRETRAINED_MODEL_ARCHIVE_LIST, LiltForQuestionAnswering, LiltForSequenceClassification, LiltForTokenClassification, diff --git a/src/transformers/models/llama/__init__.py b/src/transformers/models/llama/__init__.py index 4b8a33118ccc8e..b5262941cb0e5c 100644 --- a/src/transformers/models/llama/__init__.py +++ b/src/transformers/models/llama/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_llama": ["LlamaConfig"], + "configuration_llama": ["LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlamaConfig"], } try: @@ -67,7 +67,7 @@ if TYPE_CHECKING: - from .configuration_llama import LlamaConfig + from .configuration_llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig try: if not is_sentencepiece_available(): diff --git a/src/transformers/models/llava/__init__.py b/src/transformers/models/llava/__init__.py index cfb4ac3e9e92af..1732af9b0d29ef 100644 --- a/src/transformers/models/llava/__init__.py +++ b/src/transformers/models/llava/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_llava": ["LlavaConfig"]} +_import_structure = {"configuration_llava": ["LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlavaConfig"]} try: @@ -26,13 +26,14 @@ pass else: _import_structure["modeling_llava"] = [ + "LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "LlavaForConditionalGeneration", "LlavaPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_llava import LlavaConfig + from .configuration_llava import LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlavaConfig try: if not is_torch_available(): @@ -41,6 +42,7 @@ pass else: from .modeling_llava import ( + LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, LlavaForConditionalGeneration, LlavaPreTrainedModel, ) diff --git a/src/transformers/models/longformer/__init__.py b/src/transformers/models/longformer/__init__.py index ddbd8a68ecc6dc..66ef7c953cff43 100644 --- a/src/transformers/models/longformer/__init__.py +++ b/src/transformers/models/longformer/__init__.py @@ -25,6 +25,7 @@ _import_structure = { "configuration_longformer": [ + "LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongformerConfig", "LongformerOnnxConfig", ], @@ -46,6 +47,7 @@ pass else: _import_structure["modeling_longformer"] = [ + "LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "LongformerForMaskedLM", "LongformerForMultipleChoice", "LongformerForQuestionAnswering", @@ -63,6 +65,7 @@ pass else: _import_structure["modeling_tf_longformer"] = [ + "TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLongformerForMaskedLM", "TFLongformerForMultipleChoice", "TFLongformerForQuestionAnswering", @@ -76,6 +79,7 @@ if TYPE_CHECKING: from .configuration_longformer import ( + LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, LongformerConfig, LongformerOnnxConfig, ) @@ -96,6 +100,7 @@ pass else: from .modeling_longformer import ( + LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, LongformerForMaskedLM, LongformerForMultipleChoice, LongformerForQuestionAnswering, @@ -113,6 +118,7 @@ pass else: from .modeling_tf_longformer import ( + TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFLongformerForMaskedLM, TFLongformerForMultipleChoice, TFLongformerForQuestionAnswering, diff --git a/src/transformers/models/longt5/__init__.py b/src/transformers/models/longt5/__init__.py index 97d2bbe8ccd330..93b9121c33f393 100644 --- a/src/transformers/models/longt5/__init__.py +++ b/src/transformers/models/longt5/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_longt5": ["LongT5Config", "LongT5OnnxConfig"], + "configuration_longt5": ["LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP", "LongT5Config", "LongT5OnnxConfig"], } try: @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_longt5"] = [ + "LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST", "LongT5EncoderModel", "LongT5ForConditionalGeneration", "LongT5Model", @@ -48,7 +49,7 @@ if TYPE_CHECKING: - from .configuration_longt5 import LongT5Config, LongT5OnnxConfig + from .configuration_longt5 import LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP, LongT5Config, LongT5OnnxConfig try: if not is_torch_available(): @@ -57,6 +58,7 @@ pass else: from .modeling_longt5 import ( + LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST, LongT5EncoderModel, LongT5ForConditionalGeneration, LongT5Model, diff --git a/src/transformers/models/luke/__init__.py b/src/transformers/models/luke/__init__.py index 5ae6f488116ff4..91ef5f22221856 100644 --- a/src/transformers/models/luke/__init__.py +++ b/src/transformers/models/luke/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_luke": ["LukeConfig"], + "configuration_luke": ["LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP", "LukeConfig"], "tokenization_luke": ["LukeTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_luke"] = [ + "LUKE_PRETRAINED_MODEL_ARCHIVE_LIST", "LukeForEntityClassification", "LukeForEntityPairClassification", "LukeForEntitySpanClassification", @@ -43,7 +44,7 @@ if TYPE_CHECKING: - from .configuration_luke import LukeConfig + from .configuration_luke import LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig from .tokenization_luke import LukeTokenizer try: @@ -53,6 +54,7 @@ pass else: from .modeling_luke import ( + LUKE_PRETRAINED_MODEL_ARCHIVE_LIST, LukeForEntityClassification, LukeForEntityPairClassification, LukeForEntitySpanClassification, diff --git a/src/transformers/models/lxmert/__init__.py b/src/transformers/models/lxmert/__init__.py index 007beb4ecd2dcf..4f7e775431dd0a 100644 --- a/src/transformers/models/lxmert/__init__.py +++ b/src/transformers/models/lxmert/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_lxmert": ["LxmertConfig"], + "configuration_lxmert": ["LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "LxmertConfig"], "tokenization_lxmert": ["LxmertTokenizer"], } @@ -59,6 +59,7 @@ pass else: _import_structure["modeling_tf_lxmert"] = [ + "TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFLxmertForPreTraining", "TFLxmertMainLayer", "TFLxmertModel", @@ -68,7 +69,7 @@ if TYPE_CHECKING: - from .configuration_lxmert import LxmertConfig + from .configuration_lxmert import LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, LxmertConfig from .tokenization_lxmert import LxmertTokenizer try: @@ -102,6 +103,7 @@ pass else: from .modeling_tf_lxmert import ( + TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFLxmertForPreTraining, TFLxmertMainLayer, TFLxmertModel, diff --git a/src/transformers/models/m2m_100/__init__.py b/src/transformers/models/m2m_100/__init__.py index 45232f1390a53b..db2f0223bf04d6 100644 --- a/src/transformers/models/m2m_100/__init__.py +++ b/src/transformers/models/m2m_100/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_m2m_100": ["M2M100Config", "M2M100OnnxConfig"], + "configuration_m2m_100": ["M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP", "M2M100Config", "M2M100OnnxConfig"], "tokenization_m2m_100": ["M2M100Tokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_m2m_100"] = [ + "M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST", "M2M100ForConditionalGeneration", "M2M100Model", "M2M100PreTrainedModel", @@ -36,7 +37,7 @@ if TYPE_CHECKING: - from .configuration_m2m_100 import M2M100Config, M2M100OnnxConfig + from .configuration_m2m_100 import M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP, M2M100Config, M2M100OnnxConfig from .tokenization_m2m_100 import M2M100Tokenizer try: @@ -46,6 +47,7 @@ pass else: from .modeling_m2m_100 import ( + M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST, M2M100ForConditionalGeneration, M2M100Model, M2M100PreTrainedModel, diff --git a/src/transformers/models/mamba/__init__.py b/src/transformers/models/mamba/__init__.py index 80cb8e1c68a21d..7a1c142e05d51e 100644 --- a/src/transformers/models/mamba/__init__.py +++ b/src/transformers/models/mamba/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_mamba": ["MambaConfig", "MambaOnnxConfig"], + "configuration_mamba": ["MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MambaConfig", "MambaOnnxConfig"], } try: @@ -32,6 +32,7 @@ pass else: _import_structure["modeling_mamba"] = [ + "MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST", "MambaForCausalLM", "MambaModel", "MambaPreTrainedModel", @@ -39,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_mamba import MambaConfig, MambaOnnxConfig + from .configuration_mamba import MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP, MambaConfig, MambaOnnxConfig try: if not is_torch_available(): @@ -48,6 +49,7 @@ pass else: from .modeling_mamba import ( + MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST, MambaForCausalLM, MambaModel, MambaPreTrainedModel, diff --git a/src/transformers/models/marian/__init__.py b/src/transformers/models/marian/__init__.py index e3a8c473aeeedf..56f0a4e86afba2 100644 --- a/src/transformers/models/marian/__init__.py +++ b/src/transformers/models/marian/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_marian": ["MarianConfig", "MarianOnnxConfig"], + "configuration_marian": ["MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "MarianConfig", "MarianOnnxConfig"], } try: @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_marian"] = [ + "MARIAN_PRETRAINED_MODEL_ARCHIVE_LIST", "MarianForCausalLM", "MarianModel", "MarianMTModel", @@ -66,7 +67,7 @@ _import_structure["modeling_flax_marian"] = ["FlaxMarianModel", "FlaxMarianMTModel", "FlaxMarianPreTrainedModel"] if TYPE_CHECKING: - from .configuration_marian import MarianConfig, MarianOnnxConfig + from .configuration_marian import MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP, MarianConfig, MarianOnnxConfig try: if not is_sentencepiece_available(): @@ -83,6 +84,7 @@ pass else: from .modeling_marian import ( + MARIAN_PRETRAINED_MODEL_ARCHIVE_LIST, MarianForCausalLM, MarianModel, MarianMTModel, diff --git a/src/transformers/models/markuplm/__init__.py b/src/transformers/models/markuplm/__init__.py index 368834f13e98f8..f8df88ce16f683 100644 --- a/src/transformers/models/markuplm/__init__.py +++ b/src/transformers/models/markuplm/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_markuplm": ["MarkupLMConfig"], + "configuration_markuplm": ["MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "MarkupLMConfig"], "feature_extraction_markuplm": ["MarkupLMFeatureExtractor"], "processing_markuplm": ["MarkupLMProcessor"], "tokenization_markuplm": ["MarkupLMTokenizer"], @@ -38,6 +38,7 @@ pass else: _import_structure["modeling_markuplm"] = [ + "MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST", "MarkupLMForQuestionAnswering", "MarkupLMForSequenceClassification", "MarkupLMForTokenClassification", @@ -47,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_markuplm import MarkupLMConfig + from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig from .feature_extraction_markuplm import MarkupLMFeatureExtractor from .processing_markuplm import MarkupLMProcessor from .tokenization_markuplm import MarkupLMTokenizer @@ -67,6 +68,7 @@ pass else: from .modeling_markuplm import ( + MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST, MarkupLMForQuestionAnswering, MarkupLMForSequenceClassification, MarkupLMForTokenClassification, diff --git a/src/transformers/models/mask2former/__init__.py b/src/transformers/models/mask2former/__init__.py index 7ede863452bc72..d6db4a478ac1d8 100644 --- a/src/transformers/models/mask2former/__init__.py +++ b/src/transformers/models/mask2former/__init__.py @@ -17,7 +17,10 @@ _import_structure = { - "configuration_mask2former": ["Mask2FormerConfig"], + "configuration_mask2former": [ + "MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "Mask2FormerConfig", + ], } try: @@ -35,13 +38,14 @@ pass else: _import_structure["modeling_mask2former"] = [ + "MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Mask2FormerForUniversalSegmentation", "Mask2FormerModel", "Mask2FormerPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_mask2former import Mask2FormerConfig + from .configuration_mask2former import MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Mask2FormerConfig try: if not is_vision_available(): @@ -58,6 +62,7 @@ pass else: from .modeling_mask2former import ( + MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Mask2FormerForUniversalSegmentation, Mask2FormerModel, Mask2FormerPreTrainedModel, diff --git a/src/transformers/models/maskformer/__init__.py b/src/transformers/models/maskformer/__init__.py index 78aa54a4656150..efb2290f2c9ceb 100644 --- a/src/transformers/models/maskformer/__init__.py +++ b/src/transformers/models/maskformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_maskformer": ["MaskFormerConfig"], + "configuration_maskformer": ["MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "MaskFormerConfig"], "configuration_maskformer_swin": ["MaskFormerSwinConfig"], } @@ -38,6 +38,7 @@ pass else: _import_structure["modeling_maskformer"] = [ + "MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "MaskFormerForInstanceSegmentation", "MaskFormerModel", "MaskFormerPreTrainedModel", @@ -49,7 +50,7 @@ ] if TYPE_CHECKING: - from .configuration_maskformer import MaskFormerConfig + from .configuration_maskformer import MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, MaskFormerConfig from .configuration_maskformer_swin import MaskFormerSwinConfig try: @@ -67,6 +68,7 @@ pass else: from .modeling_maskformer import ( + MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, MaskFormerForInstanceSegmentation, MaskFormerModel, MaskFormerPreTrainedModel, diff --git a/src/transformers/models/mbart/__init__.py b/src/transformers/models/mbart/__init__.py index 12575fcab74036..bae4593c87d89c 100644 --- a/src/transformers/models/mbart/__init__.py +++ b/src/transformers/models/mbart/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_mbart": ["MBartConfig", "MBartOnnxConfig"]} +_import_structure = {"configuration_mbart": ["MBART_PRETRAINED_CONFIG_ARCHIVE_MAP", "MBartConfig", "MBartOnnxConfig"]} try: if not is_sentencepiece_available(): @@ -49,6 +49,7 @@ pass else: _import_structure["modeling_mbart"] = [ + "MBART_PRETRAINED_MODEL_ARCHIVE_LIST", "MBartForCausalLM", "MBartForConditionalGeneration", "MBartForQuestionAnswering", @@ -85,7 +86,7 @@ if TYPE_CHECKING: - from .configuration_mbart import MBartConfig, MBartOnnxConfig + from .configuration_mbart import MBART_PRETRAINED_CONFIG_ARCHIVE_MAP, MBartConfig, MBartOnnxConfig try: if not is_sentencepiece_available(): @@ -110,6 +111,7 @@ pass else: from .modeling_mbart import ( + MBART_PRETRAINED_MODEL_ARCHIVE_LIST, MBartForCausalLM, MBartForConditionalGeneration, MBartForQuestionAnswering, diff --git a/src/transformers/models/mega/__init__.py b/src/transformers/models/mega/__init__.py index 3e3b204d8b1727..728499ef2d385f 100644 --- a/src/transformers/models/mega/__init__.py +++ b/src/transformers/models/mega/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_mega": ["MegaConfig", "MegaOnnxConfig"], + "configuration_mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig", "MegaOnnxConfig"], } try: @@ -32,6 +32,7 @@ pass else: _import_structure["modeling_mega"] = [ + "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST", "MegaForCausalLM", "MegaForMaskedLM", "MegaForMultipleChoice", @@ -43,7 +44,7 @@ ] if TYPE_CHECKING: - from .configuration_mega import MegaConfig, MegaOnnxConfig + from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig try: if not is_torch_available(): @@ -52,6 +53,7 @@ pass else: from .modeling_mega import ( + MEGA_PRETRAINED_MODEL_ARCHIVE_LIST, MegaForCausalLM, MegaForMaskedLM, MegaForMultipleChoice, diff --git a/src/transformers/models/megatron_bert/__init__.py b/src/transformers/models/megatron_bert/__init__.py index 259e56c25b59a4..477802fdc0098d 100644 --- a/src/transformers/models/megatron_bert/__init__.py +++ b/src/transformers/models/megatron_bert/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_megatron_bert": ["MegatronBertConfig"], + "configuration_megatron_bert": ["MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegatronBertConfig"], } try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_megatron_bert"] = [ + "MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MegatronBertForCausalLM", "MegatronBertForMaskedLM", "MegatronBertForMultipleChoice", @@ -40,7 +41,7 @@ ] if TYPE_CHECKING: - from .configuration_megatron_bert import MegatronBertConfig + from .configuration_megatron_bert import MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig try: if not is_torch_available(): @@ -49,6 +50,7 @@ pass else: from .modeling_megatron_bert import ( + MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, MegatronBertForCausalLM, MegatronBertForMaskedLM, MegatronBertForMultipleChoice, diff --git a/src/transformers/models/mgp_str/__init__.py b/src/transformers/models/mgp_str/__init__.py index 901425ca45d61a..1bb9ae50b291cf 100644 --- a/src/transformers/models/mgp_str/__init__.py +++ b/src/transformers/models/mgp_str/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_mgp_str": ["MgpstrConfig"], + "configuration_mgp_str": ["MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP", "MgpstrConfig"], "processing_mgp_str": ["MgpstrProcessor"], "tokenization_mgp_str": ["MgpstrTokenizer"], } @@ -33,13 +33,14 @@ pass else: _import_structure["modeling_mgp_str"] = [ + "MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST", "MgpstrModel", "MgpstrPreTrainedModel", "MgpstrForSceneTextRecognition", ] if TYPE_CHECKING: - from .configuration_mgp_str import MgpstrConfig + from .configuration_mgp_str import MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig from .processing_mgp_str import MgpstrProcessor from .tokenization_mgp_str import MgpstrTokenizer @@ -50,6 +51,7 @@ pass else: from .modeling_mgp_str import ( + MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST, MgpstrForSceneTextRecognition, MgpstrModel, MgpstrPreTrainedModel, diff --git a/src/transformers/models/mistral/__init__.py b/src/transformers/models/mistral/__init__.py index dc0b85980ff600..34727d98cf05af 100644 --- a/src/transformers/models/mistral/__init__.py +++ b/src/transformers/models/mistral/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_mistral": ["MistralConfig"], + "configuration_mistral": ["MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MistralConfig"], } @@ -48,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_mistral import MistralConfig + from .configuration_mistral import MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MistralConfig try: if not is_torch_available(): diff --git a/src/transformers/models/mixtral/__init__.py b/src/transformers/models/mixtral/__init__.py index 7b8f061dac8362..ebde04ea4ae81c 100644 --- a/src/transformers/models/mixtral/__init__.py +++ b/src/transformers/models/mixtral/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_mixtral": ["MixtralConfig"], + "configuration_mixtral": ["MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP", "MixtralConfig"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_mixtral import MixtralConfig + from .configuration_mixtral import MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP, MixtralConfig try: if not is_torch_available(): diff --git a/src/transformers/models/mobilebert/__init__.py b/src/transformers/models/mobilebert/__init__.py index c085c3d8636c1e..0d202eb4d4234f 100644 --- a/src/transformers/models/mobilebert/__init__.py +++ b/src/transformers/models/mobilebert/__init__.py @@ -25,6 +25,7 @@ _import_structure = { "configuration_mobilebert": [ + "MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileBertConfig", "MobileBertOnnxConfig", ], @@ -46,6 +47,7 @@ pass else: _import_structure["modeling_mobilebert"] = [ + "MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileBertForMaskedLM", "MobileBertForMultipleChoice", "MobileBertForNextSentencePrediction", @@ -66,6 +68,7 @@ pass else: _import_structure["modeling_tf_mobilebert"] = [ + "TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileBertForMaskedLM", "TFMobileBertForMultipleChoice", "TFMobileBertForNextSentencePrediction", @@ -81,6 +84,7 @@ if TYPE_CHECKING: from .configuration_mobilebert import ( + MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileBertConfig, MobileBertOnnxConfig, ) @@ -101,6 +105,7 @@ pass else: from .modeling_mobilebert import ( + MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileBertForMaskedLM, MobileBertForMultipleChoice, MobileBertForNextSentencePrediction, @@ -121,6 +126,7 @@ pass else: from .modeling_tf_mobilebert import ( + TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileBertForMaskedLM, TFMobileBertForMultipleChoice, TFMobileBertForNextSentencePrediction, diff --git a/src/transformers/models/mobilenet_v1/__init__.py b/src/transformers/models/mobilenet_v1/__init__.py index 6ff5725a21a8aa..dec8eeec2de566 100644 --- a/src/transformers/models/mobilenet_v1/__init__.py +++ b/src/transformers/models/mobilenet_v1/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_mobilenet_v1": [ + "MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileNetV1Config", "MobileNetV1OnnxConfig", ], @@ -39,6 +40,7 @@ pass else: _import_structure["modeling_mobilenet_v1"] = [ + "MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV1ForImageClassification", "MobileNetV1Model", "MobileNetV1PreTrainedModel", @@ -48,6 +50,7 @@ if TYPE_CHECKING: from .configuration_mobilenet_v1 import ( + MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV1Config, MobileNetV1OnnxConfig, ) @@ -68,6 +71,7 @@ pass else: from .modeling_mobilenet_v1 import ( + MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV1ForImageClassification, MobileNetV1Model, MobileNetV1PreTrainedModel, diff --git a/src/transformers/models/mobilenet_v2/__init__.py b/src/transformers/models/mobilenet_v2/__init__.py index 5fcab8fe7c4e58..e3d89c8b59479a 100644 --- a/src/transformers/models/mobilenet_v2/__init__.py +++ b/src/transformers/models/mobilenet_v2/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_mobilenet_v2": [ + "MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileNetV2Config", "MobileNetV2OnnxConfig", ], @@ -40,6 +41,7 @@ pass else: _import_structure["modeling_mobilenet_v2"] = [ + "MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileNetV2ForImageClassification", "MobileNetV2ForSemanticSegmentation", "MobileNetV2Model", @@ -50,6 +52,7 @@ if TYPE_CHECKING: from .configuration_mobilenet_v2 import ( + MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileNetV2Config, MobileNetV2OnnxConfig, ) @@ -70,6 +73,7 @@ pass else: from .modeling_mobilenet_v2 import ( + MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileNetV2ForImageClassification, MobileNetV2ForSemanticSegmentation, MobileNetV2Model, diff --git a/src/transformers/models/mobilevit/__init__.py b/src/transformers/models/mobilevit/__init__.py index 942a963227b955..5615c622186299 100644 --- a/src/transformers/models/mobilevit/__init__.py +++ b/src/transformers/models/mobilevit/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_mobilevit": ["MobileViTConfig", "MobileViTOnnxConfig"], + "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTConfig", "MobileViTOnnxConfig"], } try: @@ -42,6 +42,7 @@ pass else: _import_structure["modeling_mobilevit"] = [ + "MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTForImageClassification", "MobileViTForSemanticSegmentation", "MobileViTModel", @@ -55,6 +56,7 @@ pass else: _import_structure["modeling_tf_mobilevit"] = [ + "TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMobileViTForImageClassification", "TFMobileViTForSemanticSegmentation", "TFMobileViTModel", @@ -62,7 +64,7 @@ ] if TYPE_CHECKING: - from .configuration_mobilevit import MobileViTConfig, MobileViTOnnxConfig + from .configuration_mobilevit import MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTConfig, MobileViTOnnxConfig try: if not is_vision_available(): @@ -80,6 +82,7 @@ pass else: from .modeling_mobilevit import ( + MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTForImageClassification, MobileViTForSemanticSegmentation, MobileViTModel, @@ -93,6 +96,7 @@ pass else: from .modeling_tf_mobilevit import ( + TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST, TFMobileViTForImageClassification, TFMobileViTForSemanticSegmentation, TFMobileViTModel, diff --git a/src/transformers/models/mobilevitv2/__init__.py b/src/transformers/models/mobilevitv2/__init__.py index 770736c03df7ed..043caf7b7526fc 100644 --- a/src/transformers/models/mobilevitv2/__init__.py +++ b/src/transformers/models/mobilevitv2/__init__.py @@ -23,6 +23,7 @@ _import_structure = { "configuration_mobilevitv2": [ + "MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTV2Config", "MobileViTV2OnnxConfig", ], @@ -36,6 +37,7 @@ pass else: _import_structure["modeling_mobilevitv2"] = [ + "MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST", "MobileViTV2ForImageClassification", "MobileViTV2ForSemanticSegmentation", "MobileViTV2Model", @@ -44,6 +46,7 @@ if TYPE_CHECKING: from .configuration_mobilevitv2 import ( + MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTV2Config, MobileViTV2OnnxConfig, ) @@ -55,6 +58,7 @@ pass else: from .modeling_mobilevitv2 import ( + MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST, MobileViTV2ForImageClassification, MobileViTV2ForSemanticSegmentation, MobileViTV2Model, diff --git a/src/transformers/models/mpnet/__init__.py b/src/transformers/models/mpnet/__init__.py index 54c20d9f1967dd..993a99c0819bd6 100644 --- a/src/transformers/models/mpnet/__init__.py +++ b/src/transformers/models/mpnet/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_mpnet": ["MPNetConfig"], + "configuration_mpnet": ["MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "MPNetConfig"], "tokenization_mpnet": ["MPNetTokenizer"], } @@ -44,6 +44,7 @@ pass else: _import_structure["modeling_mpnet"] = [ + "MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "MPNetForMaskedLM", "MPNetForMultipleChoice", "MPNetForQuestionAnswering", @@ -61,6 +62,7 @@ pass else: _import_structure["modeling_tf_mpnet"] = [ + "TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFMPNetEmbeddings", "TFMPNetForMaskedLM", "TFMPNetForMultipleChoice", @@ -74,7 +76,7 @@ if TYPE_CHECKING: - from .configuration_mpnet import MPNetConfig + from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig from .tokenization_mpnet import MPNetTokenizer try: @@ -92,6 +94,7 @@ pass else: from .modeling_mpnet import ( + MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, MPNetForMaskedLM, MPNetForMultipleChoice, MPNetForQuestionAnswering, @@ -109,6 +112,7 @@ pass else: from .modeling_tf_mpnet import ( + TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFMPNetEmbeddings, TFMPNetForMaskedLM, TFMPNetForMultipleChoice, diff --git a/src/transformers/models/mpt/__init__.py b/src/transformers/models/mpt/__init__.py index 49b3a0d61fcdb3..d24a5fad7b9d2c 100644 --- a/src/transformers/models/mpt/__init__.py +++ b/src/transformers/models/mpt/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_mpt": ["MptConfig", "MptOnnxConfig"], + "configuration_mpt": ["MPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MptConfig", "MptOnnxConfig"], } try: @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_mpt"] = [ + "MPT_PRETRAINED_MODEL_ARCHIVE_LIST", "MptForCausalLM", "MptModel", "MptPreTrainedModel", @@ -37,7 +38,7 @@ ] if TYPE_CHECKING: - from .configuration_mpt import MptConfig, MptOnnxConfig + from .configuration_mpt import MPT_PRETRAINED_CONFIG_ARCHIVE_MAP, MptConfig, MptOnnxConfig try: if not is_torch_available(): @@ -46,6 +47,7 @@ pass else: from .modeling_mpt import ( + MPT_PRETRAINED_MODEL_ARCHIVE_LIST, MptForCausalLM, MptForQuestionAnswering, MptForSequenceClassification, diff --git a/src/transformers/models/mra/__init__.py b/src/transformers/models/mra/__init__.py index 21d82eb3dabac1..d27ee2f1719321 100644 --- a/src/transformers/models/mra/__init__.py +++ b/src/transformers/models/mra/__init__.py @@ -21,7 +21,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available -_import_structure = {"configuration_mra": ["MraConfig"]} +_import_structure = {"configuration_mra": ["MRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MraConfig"]} try: if not is_torch_available(): @@ -30,6 +30,7 @@ pass else: _import_structure["modeling_mra"] = [ + "MRA_PRETRAINED_MODEL_ARCHIVE_LIST", "MraForMaskedLM", "MraForMultipleChoice", "MraForQuestionAnswering", @@ -42,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_mra import MraConfig + from .configuration_mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig try: if not is_torch_available(): @@ -51,6 +52,7 @@ pass else: from .modeling_mra import ( + MRA_PRETRAINED_MODEL_ARCHIVE_LIST, MraForMaskedLM, MraForMultipleChoice, MraForQuestionAnswering, diff --git a/src/transformers/models/musicgen/__init__.py b/src/transformers/models/musicgen/__init__.py index 3b03adae12fc76..7fa695eba80863 100644 --- a/src/transformers/models/musicgen/__init__.py +++ b/src/transformers/models/musicgen/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_musicgen": [ + "MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP", "MusicgenConfig", "MusicgenDecoderConfig", ], @@ -31,6 +32,7 @@ pass else: _import_structure["modeling_musicgen"] = [ + "MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST", "MusicgenForConditionalGeneration", "MusicgenForCausalLM", "MusicgenModel", @@ -39,6 +41,7 @@ if TYPE_CHECKING: from .configuration_musicgen import ( + MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP, MusicgenConfig, MusicgenDecoderConfig, ) @@ -51,6 +54,7 @@ pass else: from .modeling_musicgen import ( + MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST, MusicgenForCausalLM, MusicgenForConditionalGeneration, MusicgenModel, diff --git a/src/transformers/models/mvp/__init__.py b/src/transformers/models/mvp/__init__.py index e865b8827c5cd8..406dc531e96f78 100644 --- a/src/transformers/models/mvp/__init__.py +++ b/src/transformers/models/mvp/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_mvp": ["MvpConfig", "MvpOnnxConfig"], + "configuration_mvp": ["MVP_PRETRAINED_CONFIG_ARCHIVE_MAP", "MvpConfig", "MvpOnnxConfig"], "tokenization_mvp": ["MvpTokenizer"], } @@ -36,6 +36,7 @@ pass else: _import_structure["modeling_mvp"] = [ + "MVP_PRETRAINED_MODEL_ARCHIVE_LIST", "MvpForCausalLM", "MvpForConditionalGeneration", "MvpForQuestionAnswering", @@ -45,7 +46,7 @@ ] if TYPE_CHECKING: - from .configuration_mvp import MvpConfig, MvpOnnxConfig + from .configuration_mvp import MVP_PRETRAINED_CONFIG_ARCHIVE_MAP, MvpConfig, MvpOnnxConfig from .tokenization_mvp import MvpTokenizer try: @@ -63,6 +64,7 @@ pass else: from .modeling_mvp import ( + MVP_PRETRAINED_MODEL_ARCHIVE_LIST, MvpForCausalLM, MvpForConditionalGeneration, MvpForQuestionAnswering, diff --git a/src/transformers/models/nat/__init__.py b/src/transformers/models/nat/__init__.py index bcf05ddf41ed9b..19ddb46e8266fa 100644 --- a/src/transformers/models/nat/__init__.py +++ b/src/transformers/models/nat/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_nat": ["NatConfig"]} +_import_structure = {"configuration_nat": ["NAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "NatConfig"]} try: @@ -26,6 +26,7 @@ pass else: _import_structure["modeling_nat"] = [ + "NAT_PRETRAINED_MODEL_ARCHIVE_LIST", "NatForImageClassification", "NatModel", "NatPreTrainedModel", @@ -33,7 +34,7 @@ ] if TYPE_CHECKING: - from .configuration_nat import NatConfig + from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig try: if not is_torch_available(): @@ -42,6 +43,7 @@ pass else: from .modeling_nat import ( + NAT_PRETRAINED_MODEL_ARCHIVE_LIST, NatBackbone, NatForImageClassification, NatModel, diff --git a/src/transformers/models/nezha/__init__.py b/src/transformers/models/nezha/__init__.py index 5149adf3a0cdfa..f9078fc4a5667a 100644 --- a/src/transformers/models/nezha/__init__.py +++ b/src/transformers/models/nezha/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_nezha": ["NezhaConfig"], + "configuration_nezha": ["NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP", "NezhaConfig"], } try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_nezha"] = [ + "NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST", "NezhaForNextSentencePrediction", "NezhaForMaskedLM", "NezhaForPreTraining", @@ -40,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_nezha import NezhaConfig + from .configuration_nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig try: if not is_torch_available(): @@ -49,6 +50,7 @@ pass else: from .modeling_nezha import ( + NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST, NezhaForMaskedLM, NezhaForMultipleChoice, NezhaForNextSentencePrediction, diff --git a/src/transformers/models/nllb_moe/__init__.py b/src/transformers/models/nllb_moe/__init__.py index ccb961ba38e8c0..ea0f7752ed0cac 100644 --- a/src/transformers/models/nllb_moe/__init__.py +++ b/src/transformers/models/nllb_moe/__init__.py @@ -17,7 +17,12 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_nllb_moe": ["NllbMoeConfig"]} +_import_structure = { + "configuration_nllb_moe": [ + "NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP", + "NllbMoeConfig", + ] +} try: if not is_torch_available(): @@ -26,6 +31,7 @@ pass else: _import_structure["modeling_nllb_moe"] = [ + "NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST", "NllbMoeForConditionalGeneration", "NllbMoeModel", "NllbMoePreTrainedModel", @@ -36,6 +42,7 @@ if TYPE_CHECKING: from .configuration_nllb_moe import ( + NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP, NllbMoeConfig, ) @@ -46,6 +53,7 @@ pass else: from .modeling_nllb_moe import ( + NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST, NllbMoeForConditionalGeneration, NllbMoeModel, NllbMoePreTrainedModel, diff --git a/src/transformers/models/nystromformer/__init__.py b/src/transformers/models/nystromformer/__init__.py index 74f8a620204f3f..4e94fc8f263965 100644 --- a/src/transformers/models/nystromformer/__init__.py +++ b/src/transformers/models/nystromformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_nystromformer": ["NystromformerConfig"], + "configuration_nystromformer": ["NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "NystromformerConfig"], } try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_nystromformer"] = [ + "NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "NystromformerForMaskedLM", "NystromformerForMultipleChoice", "NystromformerForQuestionAnswering", @@ -39,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_nystromformer import NystromformerConfig + from .configuration_nystromformer import NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, NystromformerConfig try: if not is_torch_available(): @@ -48,6 +49,7 @@ pass else: from .modeling_nystromformer import ( + NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, NystromformerForMaskedLM, NystromformerForMultipleChoice, NystromformerForQuestionAnswering, diff --git a/src/transformers/models/oneformer/__init__.py b/src/transformers/models/oneformer/__init__.py index 11ddde65d05991..01bbaa1398142c 100644 --- a/src/transformers/models/oneformer/__init__.py +++ b/src/transformers/models/oneformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_oneformer": ["OneFormerConfig"], + "configuration_oneformer": ["ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "OneFormerConfig"], "processing_oneformer": ["OneFormerProcessor"], } @@ -36,13 +36,14 @@ pass else: _import_structure["modeling_oneformer"] = [ + "ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "OneFormerForUniversalSegmentation", "OneFormerModel", "OneFormerPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_oneformer import OneFormerConfig + from .configuration_oneformer import ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, OneFormerConfig from .processing_oneformer import OneFormerProcessor try: @@ -59,6 +60,7 @@ pass else: from .modeling_oneformer import ( + ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, OneFormerForUniversalSegmentation, OneFormerModel, OneFormerPreTrainedModel, diff --git a/src/transformers/models/openai/__init__.py b/src/transformers/models/openai/__init__.py index af4ebbfee6630b..b7dba0b5dc0cf8 100644 --- a/src/transformers/models/openai/__init__.py +++ b/src/transformers/models/openai/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_openai": ["OpenAIGPTConfig"], + "configuration_openai": ["OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OpenAIGPTConfig"], "tokenization_openai": ["OpenAIGPTTokenizer"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_openai"] = [ + "OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OpenAIGPTDoubleHeadsModel", "OpenAIGPTForSequenceClassification", "OpenAIGPTLMHeadModel", @@ -58,6 +59,7 @@ pass else: _import_structure["modeling_tf_openai"] = [ + "TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFOpenAIGPTDoubleHeadsModel", "TFOpenAIGPTForSequenceClassification", "TFOpenAIGPTLMHeadModel", @@ -68,7 +70,7 @@ if TYPE_CHECKING: - from .configuration_openai import OpenAIGPTConfig + from .configuration_openai import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OpenAIGPTConfig from .tokenization_openai import OpenAIGPTTokenizer try: @@ -86,6 +88,7 @@ pass else: from .modeling_openai import ( + OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, OpenAIGPTDoubleHeadsModel, OpenAIGPTForSequenceClassification, OpenAIGPTLMHeadModel, @@ -101,6 +104,7 @@ pass else: from .modeling_tf_openai import ( + TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST, TFOpenAIGPTDoubleHeadsModel, TFOpenAIGPTForSequenceClassification, TFOpenAIGPTLMHeadModel, diff --git a/src/transformers/models/opt/__init__.py b/src/transformers/models/opt/__init__.py index 5ae39344b2ffce..db1c9300824b38 100644 --- a/src/transformers/models/opt/__init__.py +++ b/src/transformers/models/opt/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_opt": ["OPTConfig"]} +_import_structure = {"configuration_opt": ["OPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OPTConfig"]} try: if not is_torch_available(): @@ -32,6 +32,7 @@ pass else: _import_structure["modeling_opt"] = [ + "OPT_PRETRAINED_MODEL_ARCHIVE_LIST", "OPTForCausalLM", "OPTModel", "OPTPreTrainedModel", @@ -61,7 +62,7 @@ if TYPE_CHECKING: - from .configuration_opt import OPTConfig + from .configuration_opt import OPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OPTConfig try: if not is_torch_available(): @@ -70,6 +71,7 @@ pass else: from .modeling_opt import ( + OPT_PRETRAINED_MODEL_ARCHIVE_LIST, OPTForCausalLM, OPTForQuestionAnswering, OPTForSequenceClassification, diff --git a/src/transformers/models/owlv2/__init__.py b/src/transformers/models/owlv2/__init__.py index 83d432766d6992..895379db36309a 100644 --- a/src/transformers/models/owlv2/__init__.py +++ b/src/transformers/models/owlv2/__init__.py @@ -23,6 +23,7 @@ _import_structure = { "configuration_owlv2": [ + "OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Owlv2Config", "Owlv2TextConfig", "Owlv2VisionConfig", @@ -46,6 +47,7 @@ pass else: _import_structure["modeling_owlv2"] = [ + "OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Owlv2Model", "Owlv2PreTrainedModel", "Owlv2TextModel", @@ -55,6 +57,7 @@ if TYPE_CHECKING: from .configuration_owlv2 import ( + OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Owlv2Config, Owlv2TextConfig, Owlv2VisionConfig, @@ -76,6 +79,7 @@ pass else: from .modeling_owlv2 import ( + OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST, Owlv2ForObjectDetection, Owlv2Model, Owlv2PreTrainedModel, diff --git a/src/transformers/models/owlvit/__init__.py b/src/transformers/models/owlvit/__init__.py index a6da47da9a0fb7..599508e0e5cae7 100644 --- a/src/transformers/models/owlvit/__init__.py +++ b/src/transformers/models/owlvit/__init__.py @@ -26,6 +26,7 @@ _import_structure = { "configuration_owlvit": [ + "OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "OwlViTConfig", "OwlViTOnnxConfig", "OwlViTTextConfig", @@ -51,6 +52,7 @@ pass else: _import_structure["modeling_owlvit"] = [ + "OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "OwlViTModel", "OwlViTPreTrainedModel", "OwlViTTextModel", @@ -60,6 +62,7 @@ if TYPE_CHECKING: from .configuration_owlvit import ( + OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, OwlViTConfig, OwlViTOnnxConfig, OwlViTTextConfig, @@ -83,6 +86,7 @@ pass else: from .modeling_owlvit import ( + OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST, OwlViTForObjectDetection, OwlViTModel, OwlViTPreTrainedModel, diff --git a/src/transformers/models/patchtsmixer/__init__.py b/src/transformers/models/patchtsmixer/__init__.py index b227ca1655c440..63f433791e1fe8 100644 --- a/src/transformers/models/patchtsmixer/__init__.py +++ b/src/transformers/models/patchtsmixer/__init__.py @@ -18,7 +18,10 @@ _import_structure = { - "configuration_patchtsmixer": ["PatchTSMixerConfig"], + "configuration_patchtsmixer": [ + "PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "PatchTSMixerConfig", + ], } try: @@ -28,6 +31,7 @@ pass else: _import_structure["modeling_patchtsmixer"] = [ + "PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSMixerPreTrainedModel", "PatchTSMixerModel", "PatchTSMixerForPretraining", @@ -39,6 +43,7 @@ if TYPE_CHECKING: from .configuration_patchtsmixer import ( + PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSMixerConfig, ) @@ -49,6 +54,7 @@ pass else: from .modeling_patchtsmixer import ( + PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSMixerForPrediction, PatchTSMixerForPretraining, PatchTSMixerForRegression, diff --git a/src/transformers/models/patchtst/__init__.py b/src/transformers/models/patchtst/__init__.py index 5ba6316505afdf..8c7db64c198406 100644 --- a/src/transformers/models/patchtst/__init__.py +++ b/src/transformers/models/patchtst/__init__.py @@ -18,7 +18,10 @@ _import_structure = { - "configuration_patchtst": ["PatchTSTConfig"], + "configuration_patchtst": [ + "PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP", + "PatchTSTConfig", + ], } try: @@ -28,6 +31,7 @@ pass else: _import_structure["modeling_patchtst"] = [ + "PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST", "PatchTSTModel", "PatchTSTPreTrainedModel", "PatchTSTForPrediction", @@ -38,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_patchtst import PatchTSTConfig + from .configuration_patchtst import PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP, PatchTSTConfig try: if not is_torch_available(): @@ -47,6 +51,7 @@ pass else: from .modeling_patchtst import ( + PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST, PatchTSTForClassification, PatchTSTForPrediction, PatchTSTForPretraining, diff --git a/src/transformers/models/pegasus/__init__.py b/src/transformers/models/pegasus/__init__.py index 15ac3b56cff038..97d6ddb31ac00c 100644 --- a/src/transformers/models/pegasus/__init__.py +++ b/src/transformers/models/pegasus/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_pegasus": ["PegasusConfig"]} +_import_structure = {"configuration_pegasus": ["PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusConfig"]} try: if not is_sentencepiece_available(): @@ -49,6 +49,7 @@ pass else: _import_structure["modeling_pegasus"] = [ + "PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST", "PegasusForCausalLM", "PegasusForConditionalGeneration", "PegasusModel", @@ -81,7 +82,7 @@ if TYPE_CHECKING: - from .configuration_pegasus import PegasusConfig + from .configuration_pegasus import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig try: if not is_sentencepiece_available(): @@ -106,6 +107,7 @@ pass else: from .modeling_pegasus import ( + PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST, PegasusForCausalLM, PegasusForConditionalGeneration, PegasusModel, diff --git a/src/transformers/models/pegasus_x/__init__.py b/src/transformers/models/pegasus_x/__init__.py index ce26210d3bc6b9..32003120c6a0b1 100644 --- a/src/transformers/models/pegasus_x/__init__.py +++ b/src/transformers/models/pegasus_x/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_pegasus_x": ["PegasusXConfig"], + "configuration_pegasus_x": ["PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusXConfig"], } try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_pegasus_x"] = [ + "PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST", "PegasusXForConditionalGeneration", "PegasusXModel", "PegasusXPreTrainedModel", @@ -34,7 +35,7 @@ if TYPE_CHECKING: - from .configuration_pegasus_x import PegasusXConfig + from .configuration_pegasus_x import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig try: if not is_torch_available(): @@ -43,6 +44,7 @@ pass else: from .modeling_pegasus_x import ( + PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST, PegasusXForConditionalGeneration, PegasusXModel, PegasusXPreTrainedModel, diff --git a/src/transformers/models/perceiver/__init__.py b/src/transformers/models/perceiver/__init__.py index 5cc52d61977203..997f88234fc2c8 100644 --- a/src/transformers/models/perceiver/__init__.py +++ b/src/transformers/models/perceiver/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_perceiver": ["PerceiverConfig", "PerceiverOnnxConfig"], + "configuration_perceiver": ["PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PerceiverConfig", "PerceiverOnnxConfig"], "tokenization_perceiver": ["PerceiverTokenizer"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_perceiver"] = [ + "PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST", "PerceiverForImageClassificationConvProcessing", "PerceiverForImageClassificationFourier", "PerceiverForImageClassificationLearned", @@ -57,7 +58,7 @@ if TYPE_CHECKING: - from .configuration_perceiver import PerceiverConfig, PerceiverOnnxConfig + from .configuration_perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverOnnxConfig from .tokenization_perceiver import PerceiverTokenizer try: @@ -76,6 +77,7 @@ pass else: from .modeling_perceiver import ( + PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST, PerceiverForImageClassificationConvProcessing, PerceiverForImageClassificationFourier, PerceiverForImageClassificationLearned, diff --git a/src/transformers/models/persimmon/__init__.py b/src/transformers/models/persimmon/__init__.py index 75bc218a2913c7..4c88459362eb72 100644 --- a/src/transformers/models/persimmon/__init__.py +++ b/src/transformers/models/persimmon/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_persimmon": ["PersimmonConfig"], + "configuration_persimmon": ["PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP", "PersimmonConfig"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_persimmon import PersimmonConfig + from .configuration_persimmon import PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP, PersimmonConfig try: if not is_torch_available(): diff --git a/src/transformers/models/phi/__init__.py b/src/transformers/models/phi/__init__.py index 662c0a9bf3487d..ba79ac81a6b9e5 100644 --- a/src/transformers/models/phi/__init__.py +++ b/src/transformers/models/phi/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_phi": ["PhiConfig"], + "configuration_phi": ["PHI_PRETRAINED_CONFIG_ARCHIVE_MAP", "PhiConfig"], } try: @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_phi"] = [ + "PHI_PRETRAINED_MODEL_ARCHIVE_LIST", "PhiPreTrainedModel", "PhiModel", "PhiForCausalLM", @@ -44,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_phi import PhiConfig + from .configuration_phi import PHI_PRETRAINED_CONFIG_ARCHIVE_MAP, PhiConfig try: if not is_torch_available(): @@ -53,6 +54,7 @@ pass else: from .modeling_phi import ( + PHI_PRETRAINED_MODEL_ARCHIVE_LIST, PhiForCausalLM, PhiForSequenceClassification, PhiForTokenClassification, diff --git a/src/transformers/models/pix2struct/__init__.py b/src/transformers/models/pix2struct/__init__.py index 581d5d7240c664..8b395b31d8be19 100644 --- a/src/transformers/models/pix2struct/__init__.py +++ b/src/transformers/models/pix2struct/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_pix2struct": [ + "PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Pix2StructConfig", "Pix2StructTextConfig", "Pix2StructVisionConfig", @@ -41,6 +42,7 @@ pass else: _import_structure["modeling_pix2struct"] = [ + "PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST", "Pix2StructPreTrainedModel", "Pix2StructForConditionalGeneration", "Pix2StructVisionModel", @@ -49,6 +51,7 @@ if TYPE_CHECKING: from .configuration_pix2struct import ( + PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP, Pix2StructConfig, Pix2StructTextConfig, Pix2StructVisionConfig, @@ -70,6 +73,7 @@ pass else: from .modeling_pix2struct import ( + PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST, Pix2StructForConditionalGeneration, Pix2StructPreTrainedModel, Pix2StructTextModel, diff --git a/src/transformers/models/plbart/__init__.py b/src/transformers/models/plbart/__init__.py index cd4c46fad3dd7d..ade03d8aa5cdf8 100644 --- a/src/transformers/models/plbart/__init__.py +++ b/src/transformers/models/plbart/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_plbart": ["PLBartConfig"]} +_import_structure = {"configuration_plbart": ["PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP", "PLBartConfig"]} try: if not is_sentencepiece_available(): @@ -39,6 +39,7 @@ pass else: _import_structure["modeling_plbart"] = [ + "PLBART_PRETRAINED_MODEL_ARCHIVE_LIST", "PLBartForCausalLM", "PLBartForConditionalGeneration", "PLBartForSequenceClassification", @@ -48,7 +49,7 @@ if TYPE_CHECKING: - from .configuration_plbart import PLBartConfig + from .configuration_plbart import PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP, PLBartConfig try: if not is_sentencepiece_available(): @@ -65,6 +66,7 @@ pass else: from .modeling_plbart import ( + PLBART_PRETRAINED_MODEL_ARCHIVE_LIST, PLBartForCausalLM, PLBartForConditionalGeneration, PLBartForSequenceClassification, diff --git a/src/transformers/models/poolformer/__init__.py b/src/transformers/models/poolformer/__init__.py index 00c345463697d4..3a62183a23d6e2 100644 --- a/src/transformers/models/poolformer/__init__.py +++ b/src/transformers/models/poolformer/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_poolformer": [ + "POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "PoolFormerConfig", "PoolFormerOnnxConfig", ] @@ -39,6 +40,7 @@ pass else: _import_structure["modeling_poolformer"] = [ + "POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "PoolFormerForImageClassification", "PoolFormerModel", "PoolFormerPreTrainedModel", @@ -47,6 +49,7 @@ if TYPE_CHECKING: from .configuration_poolformer import ( + POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, PoolFormerConfig, PoolFormerOnnxConfig, ) @@ -67,6 +70,7 @@ pass else: from .modeling_poolformer import ( + POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, PoolFormerForImageClassification, PoolFormerModel, PoolFormerPreTrainedModel, diff --git a/src/transformers/models/pop2piano/__init__.py b/src/transformers/models/pop2piano/__init__.py index cd664cb8a70ce5..08b1e732b7df89 100644 --- a/src/transformers/models/pop2piano/__init__.py +++ b/src/transformers/models/pop2piano/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_pop2piano": ["Pop2PianoConfig"], + "configuration_pop2piano": ["POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP", "Pop2PianoConfig"], } try: @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_pop2piano"] = [ + "POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST", "Pop2PianoForConditionalGeneration", "Pop2PianoPreTrainedModel", ] @@ -71,7 +72,7 @@ if TYPE_CHECKING: - from .configuration_pop2piano import Pop2PianoConfig + from .configuration_pop2piano import POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP, Pop2PianoConfig try: if not is_torch_available(): @@ -80,6 +81,7 @@ pass else: from .modeling_pop2piano import ( + POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST, Pop2PianoForConditionalGeneration, Pop2PianoPreTrainedModel, ) diff --git a/src/transformers/models/prophetnet/__init__.py b/src/transformers/models/prophetnet/__init__.py index 2e1a1ac6101483..083301cc20c677 100644 --- a/src/transformers/models/prophetnet/__init__.py +++ b/src/transformers/models/prophetnet/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_prophetnet": ["ProphetNetConfig"], + "configuration_prophetnet": ["PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ProphetNetConfig"], "tokenization_prophetnet": ["ProphetNetTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_prophetnet"] = [ + "PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ProphetNetDecoder", "ProphetNetEncoder", "ProphetNetForCausalLM", @@ -39,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_prophetnet import ProphetNetConfig + from .configuration_prophetnet import PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ProphetNetConfig from .tokenization_prophetnet import ProphetNetTokenizer try: @@ -49,6 +50,7 @@ pass else: from .modeling_prophetnet import ( + PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, ProphetNetDecoder, ProphetNetEncoder, ProphetNetForCausalLM, diff --git a/src/transformers/models/pvt/__init__.py b/src/transformers/models/pvt/__init__.py index 1ee7092f0c460a..cab5af9af7c997 100644 --- a/src/transformers/models/pvt/__init__.py +++ b/src/transformers/models/pvt/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_pvt": ["PvtConfig", "PvtOnnxConfig"], + "configuration_pvt": ["PVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtConfig", "PvtOnnxConfig"], } try: @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_pvt"] = [ + "PVT_PRETRAINED_MODEL_ARCHIVE_LIST", "PvtForImageClassification", "PvtModel", "PvtPreTrainedModel", @@ -50,7 +51,7 @@ if TYPE_CHECKING: - from .configuration_pvt import PvtConfig, PvtOnnxConfig + from .configuration_pvt import PVT_PRETRAINED_CONFIG_ARCHIVE_MAP, PvtConfig, PvtOnnxConfig try: if not is_vision_available(): @@ -67,6 +68,7 @@ pass else: from .modeling_pvt import ( + PVT_PRETRAINED_MODEL_ARCHIVE_LIST, PvtForImageClassification, PvtModel, PvtPreTrainedModel, diff --git a/src/transformers/models/qdqbert/__init__.py b/src/transformers/models/qdqbert/__init__.py index d413aefe0c7c5a..3d161192d81b0d 100644 --- a/src/transformers/models/qdqbert/__init__.py +++ b/src/transformers/models/qdqbert/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_qdqbert": ["QDQBertConfig"]} +_import_structure = {"configuration_qdqbert": ["QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "QDQBertConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_qdqbert"] = [ + "QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "QDQBertForMaskedLM", "QDQBertForMultipleChoice", "QDQBertForNextSentencePrediction", @@ -40,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_qdqbert import QDQBertConfig + from .configuration_qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig try: if not is_torch_available(): @@ -49,6 +50,7 @@ pass else: from .modeling_qdqbert import ( + QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST, QDQBertForMaskedLM, QDQBertForMultipleChoice, QDQBertForNextSentencePrediction, diff --git a/src/transformers/models/qwen2/__init__.py b/src/transformers/models/qwen2/__init__.py index 3409f28214d1fd..9fd51aaffee86c 100644 --- a/src/transformers/models/qwen2/__init__.py +++ b/src/transformers/models/qwen2/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_qwen2": ["Qwen2Config"], + "configuration_qwen2": ["QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Qwen2Config"], "tokenization_qwen2": ["Qwen2Tokenizer"], } @@ -49,7 +49,7 @@ if TYPE_CHECKING: - from .configuration_qwen2 import Qwen2Config + from .configuration_qwen2 import QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP, Qwen2Config from .tokenization_qwen2 import Qwen2Tokenizer try: diff --git a/src/transformers/models/realm/__init__.py b/src/transformers/models/realm/__init__.py index eea7384673792a..594ce0c35e382f 100644 --- a/src/transformers/models/realm/__init__.py +++ b/src/transformers/models/realm/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_realm": ["RealmConfig"], + "configuration_realm": ["REALM_PRETRAINED_CONFIG_ARCHIVE_MAP", "RealmConfig"], "tokenization_realm": ["RealmTokenizer"], } @@ -36,6 +36,7 @@ pass else: _import_structure["modeling_realm"] = [ + "REALM_PRETRAINED_MODEL_ARCHIVE_LIST", "RealmEmbedder", "RealmForOpenQA", "RealmKnowledgeAugEncoder", @@ -48,7 +49,7 @@ if TYPE_CHECKING: - from .configuration_realm import RealmConfig + from .configuration_realm import REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, RealmConfig from .tokenization_realm import RealmTokenizer try: @@ -66,6 +67,7 @@ pass else: from .modeling_realm import ( + REALM_PRETRAINED_MODEL_ARCHIVE_LIST, RealmEmbedder, RealmForOpenQA, RealmKnowledgeAugEncoder, diff --git a/src/transformers/models/reformer/__init__.py b/src/transformers/models/reformer/__init__.py index ef13dd7c312dd0..37508ef808e083 100644 --- a/src/transformers/models/reformer/__init__.py +++ b/src/transformers/models/reformer/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_reformer": ["ReformerConfig"]} +_import_structure = {"configuration_reformer": ["REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ReformerConfig"]} try: if not is_sentencepiece_available(): @@ -48,6 +48,7 @@ pass else: _import_structure["modeling_reformer"] = [ + "REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "ReformerAttention", "ReformerForMaskedLM", "ReformerForQuestionAnswering", @@ -60,7 +61,7 @@ if TYPE_CHECKING: - from .configuration_reformer import ReformerConfig + from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig try: if not is_sentencepiece_available(): @@ -85,6 +86,7 @@ pass else: from .modeling_reformer import ( + REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, ReformerAttention, ReformerForMaskedLM, ReformerForQuestionAnswering, diff --git a/src/transformers/models/regnet/__init__.py b/src/transformers/models/regnet/__init__.py index 25507927affde7..5084c4486008d1 100644 --- a/src/transformers/models/regnet/__init__.py +++ b/src/transformers/models/regnet/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_regnet": ["RegNetConfig"]} +_import_structure = {"configuration_regnet": ["REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "RegNetConfig"]} try: if not is_torch_available(): @@ -31,6 +31,7 @@ pass else: _import_structure["modeling_regnet"] = [ + "REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "RegNetForImageClassification", "RegNetModel", "RegNetPreTrainedModel", @@ -43,6 +44,7 @@ pass else: _import_structure["modeling_tf_regnet"] = [ + "TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRegNetForImageClassification", "TFRegNetModel", "TFRegNetPreTrainedModel", @@ -62,7 +64,7 @@ if TYPE_CHECKING: - from .configuration_regnet import RegNetConfig + from .configuration_regnet import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP, RegNetConfig try: if not is_torch_available(): @@ -71,6 +73,7 @@ pass else: from .modeling_regnet import ( + REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, RegNetForImageClassification, RegNetModel, RegNetPreTrainedModel, @@ -83,6 +86,7 @@ pass else: from .modeling_tf_regnet import ( + TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFRegNetForImageClassification, TFRegNetModel, TFRegNetPreTrainedModel, diff --git a/src/transformers/models/rembert/__init__.py b/src/transformers/models/rembert/__init__.py index 5ffaf3c8c04cf3..98e8e2254dcfa9 100644 --- a/src/transformers/models/rembert/__init__.py +++ b/src/transformers/models/rembert/__init__.py @@ -24,7 +24,9 @@ ) -_import_structure = {"configuration_rembert": ["RemBertConfig", "RemBertOnnxConfig"]} +_import_structure = { + "configuration_rembert": ["REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RemBertConfig", "RemBertOnnxConfig"] +} try: if not is_sentencepiece_available(): @@ -49,6 +51,7 @@ pass else: _import_structure["modeling_rembert"] = [ + "REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RemBertForCausalLM", "RemBertForMaskedLM", "RemBertForMultipleChoice", @@ -69,6 +72,7 @@ pass else: _import_structure["modeling_tf_rembert"] = [ + "TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRemBertForCausalLM", "TFRemBertForMaskedLM", "TFRemBertForMultipleChoice", @@ -82,7 +86,7 @@ if TYPE_CHECKING: - from .configuration_rembert import RemBertConfig, RemBertOnnxConfig + from .configuration_rembert import REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RemBertConfig, RemBertOnnxConfig try: if not is_sentencepiece_available(): @@ -107,6 +111,7 @@ pass else: from .modeling_rembert import ( + REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, RemBertForCausalLM, RemBertForMaskedLM, RemBertForMultipleChoice, @@ -126,6 +131,7 @@ pass else: from .modeling_tf_rembert import ( + TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST, TFRemBertForCausalLM, TFRemBertForMaskedLM, TFRemBertForMultipleChoice, diff --git a/src/transformers/models/resnet/__init__.py b/src/transformers/models/resnet/__init__.py index 50b71a4dd4cf4d..62e6b1c2ca1a68 100644 --- a/src/transformers/models/resnet/__init__.py +++ b/src/transformers/models/resnet/__init__.py @@ -22,7 +22,9 @@ ) -_import_structure = {"configuration_resnet": ["ResNetConfig", "ResNetOnnxConfig"]} +_import_structure = { + "configuration_resnet": ["RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "ResNetConfig", "ResNetOnnxConfig"] +} try: if not is_torch_available(): @@ -31,6 +33,7 @@ pass else: _import_structure["modeling_resnet"] = [ + "RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "ResNetForImageClassification", "ResNetModel", "ResNetPreTrainedModel", @@ -44,6 +47,7 @@ pass else: _import_structure["modeling_tf_resnet"] = [ + "TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFResNetForImageClassification", "TFResNetModel", "TFResNetPreTrainedModel", @@ -62,7 +66,7 @@ ] if TYPE_CHECKING: - from .configuration_resnet import ResNetConfig, ResNetOnnxConfig + from .configuration_resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig, ResNetOnnxConfig try: if not is_torch_available(): @@ -71,6 +75,7 @@ pass else: from .modeling_resnet import ( + RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, ResNetBackbone, ResNetForImageClassification, ResNetModel, @@ -84,6 +89,7 @@ pass else: from .modeling_tf_resnet import ( + TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFResNetForImageClassification, TFResNetModel, TFResNetPreTrainedModel, diff --git a/src/transformers/models/roberta/__init__.py b/src/transformers/models/roberta/__init__.py index 4a97962f4f5704..774179f5f6f445 100644 --- a/src/transformers/models/roberta/__init__.py +++ b/src/transformers/models/roberta/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_roberta": ["RobertaConfig", "RobertaOnnxConfig"], + "configuration_roberta": ["ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "RobertaConfig", "RobertaOnnxConfig"], "tokenization_roberta": ["RobertaTokenizer"], } @@ -44,6 +44,7 @@ pass else: _import_structure["modeling_roberta"] = [ + "ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaForCausalLM", "RobertaForMaskedLM", "RobertaForMultipleChoice", @@ -61,6 +62,7 @@ pass else: _import_structure["modeling_tf_roberta"] = [ + "TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaForCausalLM", "TFRobertaForMaskedLM", "TFRobertaForMultipleChoice", @@ -91,7 +93,7 @@ if TYPE_CHECKING: - from .configuration_roberta import RobertaConfig, RobertaOnnxConfig + from .configuration_roberta import ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaConfig, RobertaOnnxConfig from .tokenization_roberta import RobertaTokenizer try: @@ -109,6 +111,7 @@ pass else: from .modeling_roberta import ( + ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaForCausalLM, RobertaForMaskedLM, RobertaForMultipleChoice, @@ -126,6 +129,7 @@ pass else: from .modeling_tf_roberta import ( + TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaForCausalLM, TFRobertaForMaskedLM, TFRobertaForMultipleChoice, diff --git a/src/transformers/models/roberta_prelayernorm/__init__.py b/src/transformers/models/roberta_prelayernorm/__init__.py index 9f55eed11c4224..e2dcaa71be54da 100644 --- a/src/transformers/models/roberta_prelayernorm/__init__.py +++ b/src/transformers/models/roberta_prelayernorm/__init__.py @@ -25,6 +25,7 @@ _import_structure = { "configuration_roberta_prelayernorm": [ + "ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP", "RobertaPreLayerNormConfig", "RobertaPreLayerNormOnnxConfig", ], @@ -37,6 +38,7 @@ pass else: _import_structure["modeling_roberta_prelayernorm"] = [ + "ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "RobertaPreLayerNormForCausalLM", "RobertaPreLayerNormForMaskedLM", "RobertaPreLayerNormForMultipleChoice", @@ -54,6 +56,7 @@ pass else: _import_structure["modeling_tf_roberta_prelayernorm"] = [ + "TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRobertaPreLayerNormForCausalLM", "TFRobertaPreLayerNormForMaskedLM", "TFRobertaPreLayerNormForMultipleChoice", @@ -85,6 +88,7 @@ if TYPE_CHECKING: from .configuration_roberta_prelayernorm import ( + ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaPreLayerNormConfig, RobertaPreLayerNormOnnxConfig, ) @@ -96,6 +100,7 @@ pass else: from .modeling_roberta_prelayernorm import ( + ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, RobertaPreLayerNormForCausalLM, RobertaPreLayerNormForMaskedLM, RobertaPreLayerNormForMultipleChoice, @@ -113,6 +118,7 @@ pass else: from .modeling_tf_roberta_prelayernorm import ( + TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST, TFRobertaPreLayerNormForCausalLM, TFRobertaPreLayerNormForMaskedLM, TFRobertaPreLayerNormForMultipleChoice, diff --git a/src/transformers/models/roc_bert/__init__.py b/src/transformers/models/roc_bert/__init__.py index 9971c53975d49a..344bcfa41654d1 100644 --- a/src/transformers/models/roc_bert/__init__.py +++ b/src/transformers/models/roc_bert/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_roc_bert": ["RoCBertConfig"], + "configuration_roc_bert": ["ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoCBertConfig"], "tokenization_roc_bert": ["RoCBertTokenizer"], } @@ -36,6 +36,7 @@ pass else: _import_structure["modeling_roc_bert"] = [ + "ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "RoCBertForCausalLM", "RoCBertForMaskedLM", "RoCBertForMultipleChoice", @@ -50,7 +51,7 @@ ] if TYPE_CHECKING: - from .configuration_roc_bert import RoCBertConfig + from .configuration_roc_bert import ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RoCBertConfig from .tokenization_roc_bert import RoCBertTokenizer try: @@ -68,6 +69,7 @@ pass else: from .modeling_roc_bert import ( + ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, RoCBertForCausalLM, RoCBertForMaskedLM, RoCBertForMultipleChoice, diff --git a/src/transformers/models/roformer/__init__.py b/src/transformers/models/roformer/__init__.py index d9642eba59fe26..93c86eb081fa03 100644 --- a/src/transformers/models/roformer/__init__.py +++ b/src/transformers/models/roformer/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_roformer": ["RoFormerConfig", "RoFormerOnnxConfig"], + "configuration_roformer": ["ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "RoFormerConfig", "RoFormerOnnxConfig"], "tokenization_roformer": ["RoFormerTokenizer"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_roformer"] = [ + "ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "RoFormerForCausalLM", "RoFormerForMaskedLM", "RoFormerForMultipleChoice", @@ -63,6 +64,7 @@ pass else: _import_structure["modeling_tf_roformer"] = [ + "TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFRoFormerForCausalLM", "TFRoFormerForMaskedLM", "TFRoFormerForMultipleChoice", @@ -82,6 +84,7 @@ pass else: _import_structure["modeling_flax_roformer"] = [ + "FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaxRoFormerForMaskedLM", "FlaxRoFormerForMultipleChoice", "FlaxRoFormerForQuestionAnswering", @@ -93,7 +96,7 @@ if TYPE_CHECKING: - from .configuration_roformer import RoFormerConfig, RoFormerOnnxConfig + from .configuration_roformer import ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, RoFormerConfig, RoFormerOnnxConfig from .tokenization_roformer import RoFormerTokenizer try: @@ -111,6 +114,7 @@ pass else: from .modeling_roformer import ( + ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, RoFormerForCausalLM, RoFormerForMaskedLM, RoFormerForMultipleChoice, @@ -130,6 +134,7 @@ pass else: from .modeling_tf_roformer import ( + TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFRoFormerForCausalLM, TFRoFormerForMaskedLM, TFRoFormerForMultipleChoice, @@ -148,6 +153,7 @@ pass else: from .modeling_flax_roformer import ( + FLAX_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, FlaxRoFormerForMaskedLM, FlaxRoFormerForMultipleChoice, FlaxRoFormerForQuestionAnswering, diff --git a/src/transformers/models/rwkv/__init__.py b/src/transformers/models/rwkv/__init__.py index 2cbfd94bac7bb1..e68eefe9f8aaa5 100644 --- a/src/transformers/models/rwkv/__init__.py +++ b/src/transformers/models/rwkv/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_rwkv": ["RwkvConfig", "RwkvOnnxConfig"], + "configuration_rwkv": ["RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP", "RwkvConfig", "RwkvOnnxConfig"], } try: @@ -32,6 +32,7 @@ pass else: _import_structure["modeling_rwkv"] = [ + "RWKV_PRETRAINED_MODEL_ARCHIVE_LIST", "RwkvForCausalLM", "RwkvModel", "RwkvPreTrainedModel", @@ -39,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_rwkv import RwkvConfig, RwkvOnnxConfig + from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig try: if not is_torch_available(): @@ -48,6 +49,7 @@ pass else: from .modeling_rwkv import ( + RWKV_PRETRAINED_MODEL_ARCHIVE_LIST, RwkvForCausalLM, RwkvModel, RwkvPreTrainedModel, diff --git a/src/transformers/models/sam/__init__.py b/src/transformers/models/sam/__init__.py index 672281440c1ae9..e8006e89e0f11d 100644 --- a/src/transformers/models/sam/__init__.py +++ b/src/transformers/models/sam/__init__.py @@ -24,6 +24,7 @@ _import_structure = { "configuration_sam": [ + "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP", "SamConfig", "SamMaskDecoderConfig", "SamPromptEncoderConfig", @@ -40,6 +41,7 @@ pass else: _import_structure["modeling_sam"] = [ + "SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "SamModel", "SamPreTrainedModel", ] @@ -50,6 +52,7 @@ pass else: _import_structure["modeling_tf_sam"] = [ + "TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSamModel", "TFSamPreTrainedModel", ] @@ -64,6 +67,7 @@ if TYPE_CHECKING: from .configuration_sam import ( + SAM_PRETRAINED_CONFIG_ARCHIVE_MAP, SamConfig, SamMaskDecoderConfig, SamPromptEncoderConfig, @@ -77,7 +81,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_sam import SamModel, SamPreTrainedModel + from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel try: if not is_tf_available(): @@ -85,7 +89,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_tf_sam import TFSamModel, TFSamPreTrainedModel + from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel try: if not is_vision_available(): diff --git a/src/transformers/models/seamless_m4t/__init__.py b/src/transformers/models/seamless_m4t/__init__.py index 56b04e76b62ca6..3167311a5a6ef7 100644 --- a/src/transformers/models/seamless_m4t/__init__.py +++ b/src/transformers/models/seamless_m4t/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_seamless_m4t": ["SeamlessM4TConfig"], + "configuration_seamless_m4t": ["SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP", "SeamlessM4TConfig"], "feature_extraction_seamless_m4t": ["SeamlessM4TFeatureExtractor"], "processing_seamless_m4t": ["SeamlessM4TProcessor"], } @@ -51,6 +51,7 @@ pass else: _import_structure["modeling_seamless_m4t"] = [ + "SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4TForTextToSpeech", "SeamlessM4TForSpeechToSpeech", "SeamlessM4TForTextToText", @@ -64,7 +65,7 @@ ] if TYPE_CHECKING: - from .configuration_seamless_m4t import SeamlessM4TConfig + from .configuration_seamless_m4t import SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4TConfig from .feature_extraction_seamless_m4t import SeamlessM4TFeatureExtractor from .processing_seamless_m4t import SeamlessM4TProcessor @@ -91,6 +92,7 @@ pass else: from .modeling_seamless_m4t import ( + SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4TCodeHifiGan, SeamlessM4TForSpeechToSpeech, SeamlessM4TForSpeechToText, diff --git a/src/transformers/models/seamless_m4t_v2/__init__.py b/src/transformers/models/seamless_m4t_v2/__init__.py index 5fde6a5d332a39..ebc4caef2da10a 100644 --- a/src/transformers/models/seamless_m4t_v2/__init__.py +++ b/src/transformers/models/seamless_m4t_v2/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_seamless_m4t_v2": ["SeamlessM4Tv2Config"], + "configuration_seamless_m4t_v2": ["SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "SeamlessM4Tv2Config"], } try: @@ -31,6 +31,7 @@ pass else: _import_structure["modeling_seamless_m4t_v2"] = [ + "SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "SeamlessM4Tv2ForTextToSpeech", "SeamlessM4Tv2ForSpeechToSpeech", "SeamlessM4Tv2ForTextToText", @@ -40,7 +41,7 @@ ] if TYPE_CHECKING: - from .configuration_seamless_m4t_v2 import SeamlessM4Tv2Config + from .configuration_seamless_m4t_v2 import SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, SeamlessM4Tv2Config try: if not is_torch_available(): @@ -49,6 +50,7 @@ pass else: from .modeling_seamless_m4t_v2 import ( + SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST, SeamlessM4Tv2ForSpeechToSpeech, SeamlessM4Tv2ForSpeechToText, SeamlessM4Tv2ForTextToSpeech, diff --git a/src/transformers/models/segformer/__init__.py b/src/transformers/models/segformer/__init__.py index 8d8cccdf39ff42..22dc3655b889b5 100644 --- a/src/transformers/models/segformer/__init__.py +++ b/src/transformers/models/segformer/__init__.py @@ -22,7 +22,9 @@ ) -_import_structure = {"configuration_segformer": ["SegformerConfig", "SegformerOnnxConfig"]} +_import_structure = { + "configuration_segformer": ["SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegformerConfig", "SegformerOnnxConfig"] +} try: if not is_vision_available(): @@ -40,6 +42,7 @@ pass else: _import_structure["modeling_segformer"] = [ + "SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SegformerDecodeHead", "SegformerForImageClassification", "SegformerForSemanticSegmentation", @@ -55,6 +58,7 @@ pass else: _import_structure["modeling_tf_segformer"] = [ + "TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSegformerDecodeHead", "TFSegformerForImageClassification", "TFSegformerForSemanticSegmentation", @@ -64,7 +68,7 @@ if TYPE_CHECKING: - from .configuration_segformer import SegformerConfig, SegformerOnnxConfig + from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig try: if not is_vision_available(): @@ -82,6 +86,7 @@ pass else: from .modeling_segformer import ( + SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SegformerDecodeHead, SegformerForImageClassification, SegformerForSemanticSegmentation, @@ -96,6 +101,7 @@ pass else: from .modeling_tf_segformer import ( + TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TFSegformerDecodeHead, TFSegformerForImageClassification, TFSegformerForSemanticSegmentation, diff --git a/src/transformers/models/seggpt/__init__.py b/src/transformers/models/seggpt/__init__.py index b6095b53277ae0..49649c92865da6 100644 --- a/src/transformers/models/seggpt/__init__.py +++ b/src/transformers/models/seggpt/__init__.py @@ -16,7 +16,9 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_seggpt": ["SegGptConfig", "SegGptOnnxConfig"]} +_import_structure = { + "configuration_seggpt": ["SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SegGptConfig", "SegGptOnnxConfig"] +} try: if not is_torch_available(): @@ -25,6 +27,7 @@ pass else: _import_structure["modeling_seggpt"] = [ + "SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST", "SegGptModel", "SegGptPreTrainedModel", "SegGptForImageSegmentation", @@ -39,7 +42,7 @@ _import_structure["image_processing_seggpt"] = ["SegGptImageProcessor"] if TYPE_CHECKING: - from .configuration_seggpt import SegGptConfig, SegGptOnnxConfig + from .configuration_seggpt import SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, SegGptConfig, SegGptOnnxConfig try: if not is_torch_available(): @@ -48,6 +51,7 @@ pass else: from .modeling_seggpt import ( + SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST, SegGptForImageSegmentation, SegGptModel, SegGptPreTrainedModel, diff --git a/src/transformers/models/sew/__init__.py b/src/transformers/models/sew/__init__.py index aba88cc45133c2..bd43be68b7c053 100644 --- a/src/transformers/models/sew/__init__.py +++ b/src/transformers/models/sew/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_sew": ["SEWConfig"]} +_import_structure = {"configuration_sew": ["SEW_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_sew"] = [ + "SEW_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWForCTC", "SEWForSequenceClassification", "SEWModel", @@ -32,7 +33,7 @@ ] if TYPE_CHECKING: - from .configuration_sew import SEWConfig + from .configuration_sew import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWConfig try: if not is_torch_available(): @@ -41,6 +42,7 @@ pass else: from .modeling_sew import ( + SEW_PRETRAINED_MODEL_ARCHIVE_LIST, SEWForCTC, SEWForSequenceClassification, SEWModel, diff --git a/src/transformers/models/sew_d/__init__.py b/src/transformers/models/sew_d/__init__.py index c99be845d544b5..ab1dd5284a32e4 100644 --- a/src/transformers/models/sew_d/__init__.py +++ b/src/transformers/models/sew_d/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_sew_d": ["SEWDConfig"]} +_import_structure = {"configuration_sew_d": ["SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWDConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_sew_d"] = [ + "SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST", "SEWDForCTC", "SEWDForSequenceClassification", "SEWDModel", @@ -32,7 +33,7 @@ ] if TYPE_CHECKING: - from .configuration_sew_d import SEWDConfig + from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig try: if not is_torch_available(): @@ -41,6 +42,7 @@ pass else: from .modeling_sew_d import ( + SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST, SEWDForCTC, SEWDForSequenceClassification, SEWDModel, diff --git a/src/transformers/models/siglip/__init__.py b/src/transformers/models/siglip/__init__.py index 96ce20e7f230bf..ff44d5cbf14b3c 100644 --- a/src/transformers/models/siglip/__init__.py +++ b/src/transformers/models/siglip/__init__.py @@ -24,6 +24,7 @@ _import_structure = { "configuration_siglip": [ + "SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "SiglipConfig", "SiglipTextConfig", "SiglipVisionConfig", @@ -55,6 +56,7 @@ pass else: _import_structure["modeling_siglip"] = [ + "SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "SiglipModel", "SiglipPreTrainedModel", "SiglipTextModel", @@ -65,6 +67,7 @@ if TYPE_CHECKING: from .configuration_siglip import ( + SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, SiglipConfig, SiglipTextConfig, SiglipVisionConfig, @@ -94,6 +97,7 @@ pass else: from .modeling_siglip import ( + SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST, SiglipForImageClassification, SiglipModel, SiglipPreTrainedModel, diff --git a/src/transformers/models/speech_to_text/__init__.py b/src/transformers/models/speech_to_text/__init__.py index 4ad05da69710ad..3194f99931a4d6 100644 --- a/src/transformers/models/speech_to_text/__init__.py +++ b/src/transformers/models/speech_to_text/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_speech_to_text": ["Speech2TextConfig"], + "configuration_speech_to_text": ["SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2TextConfig"], "feature_extraction_speech_to_text": ["Speech2TextFeatureExtractor"], "processing_speech_to_text": ["Speech2TextProcessor"], } @@ -43,6 +43,7 @@ pass else: _import_structure["modeling_tf_speech_to_text"] = [ + "TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSpeech2TextForConditionalGeneration", "TFSpeech2TextModel", "TFSpeech2TextPreTrainedModel", @@ -55,6 +56,7 @@ pass else: _import_structure["modeling_speech_to_text"] = [ + "SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST", "Speech2TextForConditionalGeneration", "Speech2TextModel", "Speech2TextPreTrainedModel", @@ -62,7 +64,7 @@ if TYPE_CHECKING: - from .configuration_speech_to_text import Speech2TextConfig + from .configuration_speech_to_text import SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2TextConfig from .feature_extraction_speech_to_text import Speech2TextFeatureExtractor from .processing_speech_to_text import Speech2TextProcessor @@ -81,6 +83,7 @@ pass else: from .modeling_tf_speech_to_text import ( + TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, TFSpeech2TextForConditionalGeneration, TFSpeech2TextModel, TFSpeech2TextPreTrainedModel, @@ -93,6 +96,7 @@ pass else: from .modeling_speech_to_text import ( + SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST, Speech2TextForConditionalGeneration, Speech2TextModel, Speech2TextPreTrainedModel, diff --git a/src/transformers/models/speech_to_text_2/__init__.py b/src/transformers/models/speech_to_text_2/__init__.py index ab507bc19f85f9..bf842f6006b3ec 100644 --- a/src/transformers/models/speech_to_text_2/__init__.py +++ b/src/transformers/models/speech_to_text_2/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_speech_to_text_2": ["Speech2Text2Config"], + "configuration_speech_to_text_2": ["SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2Text2Config"], "processing_speech_to_text_2": ["Speech2Text2Processor"], "tokenization_speech_to_text_2": ["Speech2Text2Tokenizer"], } @@ -36,13 +36,14 @@ pass else: _import_structure["modeling_speech_to_text_2"] = [ + "SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Speech2Text2ForCausalLM", "Speech2Text2PreTrainedModel", ] if TYPE_CHECKING: - from .configuration_speech_to_text_2 import Speech2Text2Config + from .configuration_speech_to_text_2 import SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Speech2Text2Config from .processing_speech_to_text_2 import Speech2Text2Processor from .tokenization_speech_to_text_2 import Speech2Text2Tokenizer @@ -53,6 +54,7 @@ pass else: from .modeling_speech_to_text_2 import ( + SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST, Speech2Text2ForCausalLM, Speech2Text2PreTrainedModel, ) diff --git a/src/transformers/models/speecht5/__init__.py b/src/transformers/models/speecht5/__init__.py index f9afe52aa4b7ab..20606dda51ef87 100644 --- a/src/transformers/models/speecht5/__init__.py +++ b/src/transformers/models/speecht5/__init__.py @@ -23,6 +23,8 @@ _import_structure = { "configuration_speecht5": [ + "SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP", + "SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP", "SpeechT5Config", "SpeechT5HifiGanConfig", ], @@ -45,6 +47,7 @@ pass else: _import_structure["modeling_speecht5"] = [ + "SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST", "SpeechT5ForSpeechToText", "SpeechT5ForSpeechToSpeech", "SpeechT5ForTextToSpeech", @@ -55,6 +58,8 @@ if TYPE_CHECKING: from .configuration_speecht5 import ( + SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP, + SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP, SpeechT5Config, SpeechT5HifiGanConfig, ) @@ -76,6 +81,7 @@ pass else: from .modeling_speecht5 import ( + SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST, SpeechT5ForSpeechToSpeech, SpeechT5ForSpeechToText, SpeechT5ForTextToSpeech, diff --git a/src/transformers/models/splinter/__init__.py b/src/transformers/models/splinter/__init__.py index 81896fb15a5b66..24355c01add73b 100644 --- a/src/transformers/models/splinter/__init__.py +++ b/src/transformers/models/splinter/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_splinter": ["SplinterConfig"], + "configuration_splinter": ["SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SplinterConfig"], "tokenization_splinter": ["SplinterTokenizer"], } @@ -36,6 +36,7 @@ pass else: _import_structure["modeling_splinter"] = [ + "SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST", "SplinterForQuestionAnswering", "SplinterForPreTraining", "SplinterLayer", @@ -45,7 +46,7 @@ if TYPE_CHECKING: - from .configuration_splinter import SplinterConfig + from .configuration_splinter import SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig from .tokenization_splinter import SplinterTokenizer try: @@ -63,6 +64,7 @@ pass else: from .modeling_splinter import ( + SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST, SplinterForPreTraining, SplinterForQuestionAnswering, SplinterLayer, diff --git a/src/transformers/models/squeezebert/__init__.py b/src/transformers/models/squeezebert/__init__.py index 45aff2f64c1610..b3af76dff7e1ac 100644 --- a/src/transformers/models/squeezebert/__init__.py +++ b/src/transformers/models/squeezebert/__init__.py @@ -19,6 +19,7 @@ _import_structure = { "configuration_squeezebert": [ + "SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SqueezeBertConfig", "SqueezeBertOnnxConfig", ], @@ -40,6 +41,7 @@ pass else: _import_structure["modeling_squeezebert"] = [ + "SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "SqueezeBertForMaskedLM", "SqueezeBertForMultipleChoice", "SqueezeBertForQuestionAnswering", @@ -53,6 +55,7 @@ if TYPE_CHECKING: from .configuration_squeezebert import ( + SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, SqueezeBertConfig, SqueezeBertOnnxConfig, ) @@ -73,6 +76,7 @@ pass else: from .modeling_squeezebert import ( + SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, SqueezeBertForMaskedLM, SqueezeBertForMultipleChoice, SqueezeBertForQuestionAnswering, diff --git a/src/transformers/models/stablelm/__init__.py b/src/transformers/models/stablelm/__init__.py index 7fc3a6857fa55a..5c846cad030978 100644 --- a/src/transformers/models/stablelm/__init__.py +++ b/src/transformers/models/stablelm/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_stablelm": ["StableLmConfig"], + "configuration_stablelm": ["STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP", "StableLmConfig"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_stablelm import StableLmConfig + from .configuration_stablelm import STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP, StableLmConfig try: if not is_torch_available(): diff --git a/src/transformers/models/starcoder2/__init__.py b/src/transformers/models/starcoder2/__init__.py index 1eb195fde16b03..a2b25f10090b36 100644 --- a/src/transformers/models/starcoder2/__init__.py +++ b/src/transformers/models/starcoder2/__init__.py @@ -21,7 +21,7 @@ _import_structure = { - "configuration_starcoder2": ["Starcoder2Config"], + "configuration_starcoder2": ["STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Starcoder2Config"], } @@ -40,7 +40,7 @@ if TYPE_CHECKING: - from .configuration_starcoder2 import Starcoder2Config + from .configuration_starcoder2 import STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP, Starcoder2Config try: if not is_torch_available(): diff --git a/src/transformers/models/swiftformer/__init__.py b/src/transformers/models/swiftformer/__init__.py index 2440ac686e3c08..ddba2b806fd168 100644 --- a/src/transformers/models/swiftformer/__init__.py +++ b/src/transformers/models/swiftformer/__init__.py @@ -22,6 +22,7 @@ _import_structure = { "configuration_swiftformer": [ + "SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SwiftFormerConfig", "SwiftFormerOnnxConfig", ] @@ -34,6 +35,7 @@ pass else: _import_structure["modeling_swiftformer"] = [ + "SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "SwiftFormerForImageClassification", "SwiftFormerModel", "SwiftFormerPreTrainedModel", @@ -41,6 +43,7 @@ if TYPE_CHECKING: from .configuration_swiftformer import ( + SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SwiftFormerConfig, SwiftFormerOnnxConfig, ) @@ -52,6 +55,7 @@ pass else: from .modeling_swiftformer import ( + SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, SwiftFormerForImageClassification, SwiftFormerModel, SwiftFormerPreTrainedModel, diff --git a/src/transformers/models/swin/__init__.py b/src/transformers/models/swin/__init__.py index a3458fe1efb848..39cace5d5e8875 100644 --- a/src/transformers/models/swin/__init__.py +++ b/src/transformers/models/swin/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available -_import_structure = {"configuration_swin": ["SwinConfig", "SwinOnnxConfig"]} +_import_structure = {"configuration_swin": ["SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "SwinConfig", "SwinOnnxConfig"]} try: @@ -26,6 +26,7 @@ pass else: _import_structure["modeling_swin"] = [ + "SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "SwinForImageClassification", "SwinForMaskedImageModeling", "SwinModel", @@ -40,6 +41,7 @@ pass else: _import_structure["modeling_tf_swin"] = [ + "TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST", "TFSwinForImageClassification", "TFSwinForMaskedImageModeling", "TFSwinModel", @@ -47,7 +49,7 @@ ] if TYPE_CHECKING: - from .configuration_swin import SwinConfig, SwinOnnxConfig + from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig try: if not is_torch_available(): @@ -56,6 +58,7 @@ pass else: from .modeling_swin import ( + SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, SwinBackbone, SwinForImageClassification, SwinForMaskedImageModeling, @@ -70,6 +73,7 @@ pass else: from .modeling_tf_swin import ( + TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST, TFSwinForImageClassification, TFSwinForMaskedImageModeling, TFSwinModel, diff --git a/src/transformers/models/swin2sr/__init__.py b/src/transformers/models/swin2sr/__init__.py index 16495f1dc9712d..881a7673512ef2 100644 --- a/src/transformers/models/swin2sr/__init__.py +++ b/src/transformers/models/swin2sr/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_swin2sr": ["Swin2SRConfig"], + "configuration_swin2sr": ["SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP", "Swin2SRConfig"], } @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_swin2sr"] = [ + "SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST", "Swin2SRForImageSuperResolution", "Swin2SRModel", "Swin2SRPreTrainedModel", @@ -44,7 +45,7 @@ if TYPE_CHECKING: - from .configuration_swin2sr import Swin2SRConfig + from .configuration_swin2sr import SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP, Swin2SRConfig try: if not is_torch_available(): @@ -53,6 +54,7 @@ pass else: from .modeling_swin2sr import ( + SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST, Swin2SRForImageSuperResolution, Swin2SRModel, Swin2SRPreTrainedModel, diff --git a/src/transformers/models/swinv2/__init__.py b/src/transformers/models/swinv2/__init__.py index e3a13b79651fcd..b104662e088b31 100644 --- a/src/transformers/models/swinv2/__init__.py +++ b/src/transformers/models/swinv2/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_swinv2": ["Swinv2Config"], + "configuration_swinv2": ["SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Swinv2Config"], } @@ -28,6 +28,7 @@ pass else: _import_structure["modeling_swinv2"] = [ + "SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST", "Swinv2ForImageClassification", "Swinv2ForMaskedImageModeling", "Swinv2Model", @@ -37,7 +38,7 @@ if TYPE_CHECKING: - from .configuration_swinv2 import Swinv2Config + from .configuration_swinv2 import SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP, Swinv2Config try: if not is_torch_available(): @@ -46,6 +47,7 @@ pass else: from .modeling_swinv2 import ( + SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST, Swinv2Backbone, Swinv2ForImageClassification, Swinv2ForMaskedImageModeling, diff --git a/src/transformers/models/switch_transformers/__init__.py b/src/transformers/models/switch_transformers/__init__.py index e6f9914fcbcc1e..35816110111092 100644 --- a/src/transformers/models/switch_transformers/__init__.py +++ b/src/transformers/models/switch_transformers/__init__.py @@ -27,6 +27,7 @@ _import_structure = { "configuration_switch_transformers": [ + "SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP", "SwitchTransformersConfig", "SwitchTransformersOnnxConfig", ] @@ -39,6 +40,7 @@ pass else: _import_structure["modeling_switch_transformers"] = [ + "SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST", "SwitchTransformersEncoderModel", "SwitchTransformersForConditionalGeneration", "SwitchTransformersModel", @@ -50,6 +52,7 @@ if TYPE_CHECKING: from .configuration_switch_transformers import ( + SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP, SwitchTransformersConfig, SwitchTransformersOnnxConfig, ) @@ -61,6 +64,7 @@ pass else: from .modeling_switch_transformers import ( + SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST, SwitchTransformersEncoderModel, SwitchTransformersForConditionalGeneration, SwitchTransformersModel, diff --git a/src/transformers/models/t5/__init__.py b/src/transformers/models/t5/__init__.py index d6549e270abcb6..dbdbe238ba3376 100644 --- a/src/transformers/models/t5/__init__.py +++ b/src/transformers/models/t5/__init__.py @@ -25,7 +25,7 @@ ) -_import_structure = {"configuration_t5": ["T5Config", "T5OnnxConfig"]} +_import_structure = {"configuration_t5": ["T5_PRETRAINED_CONFIG_ARCHIVE_MAP", "T5Config", "T5OnnxConfig"]} try: if not is_sentencepiece_available(): @@ -50,6 +50,7 @@ pass else: _import_structure["modeling_t5"] = [ + "T5_PRETRAINED_MODEL_ARCHIVE_LIST", "T5EncoderModel", "T5ForConditionalGeneration", "T5Model", @@ -67,6 +68,7 @@ pass else: _import_structure["modeling_tf_t5"] = [ + "TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST", "TFT5EncoderModel", "TFT5ForConditionalGeneration", "TFT5Model", @@ -88,7 +90,7 @@ if TYPE_CHECKING: - from .configuration_t5 import T5Config, T5OnnxConfig + from .configuration_t5 import T5_PRETRAINED_CONFIG_ARCHIVE_MAP, T5Config, T5OnnxConfig try: if not is_sentencepiece_available(): @@ -113,6 +115,7 @@ pass else: from .modeling_t5 import ( + T5_PRETRAINED_MODEL_ARCHIVE_LIST, T5EncoderModel, T5ForConditionalGeneration, T5ForQuestionAnswering, @@ -130,6 +133,7 @@ pass else: from .modeling_tf_t5 import ( + TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST, TFT5EncoderModel, TFT5ForConditionalGeneration, TFT5Model, diff --git a/src/transformers/models/table_transformer/__init__.py b/src/transformers/models/table_transformer/__init__.py index de993193b0c522..346bc9ef9caaa6 100644 --- a/src/transformers/models/table_transformer/__init__.py +++ b/src/transformers/models/table_transformer/__init__.py @@ -19,6 +19,7 @@ _import_structure = { "configuration_table_transformer": [ + "TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TableTransformerConfig", "TableTransformerOnnxConfig", ] @@ -31,6 +32,7 @@ pass else: _import_structure["modeling_table_transformer"] = [ + "TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TableTransformerForObjectDetection", "TableTransformerModel", "TableTransformerPreTrainedModel", @@ -39,6 +41,7 @@ if TYPE_CHECKING: from .configuration_table_transformer import ( + TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TableTransformerConfig, TableTransformerOnnxConfig, ) @@ -50,6 +53,7 @@ pass else: from .modeling_table_transformer import ( + TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TableTransformerForObjectDetection, TableTransformerModel, TableTransformerPreTrainedModel, diff --git a/src/transformers/models/tapas/__init__.py b/src/transformers/models/tapas/__init__.py index 750bf7e00f5a8f..e1afab325420f7 100644 --- a/src/transformers/models/tapas/__init__.py +++ b/src/transformers/models/tapas/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_tapas": ["TapasConfig"], + "configuration_tapas": ["TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig"], "tokenization_tapas": ["TapasTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_tapas"] = [ + "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TapasForMaskedLM", "TapasForQuestionAnswering", "TapasForSequenceClassification", @@ -43,6 +44,7 @@ pass else: _import_structure["modeling_tf_tapas"] = [ + "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST", "TFTapasForMaskedLM", "TFTapasForQuestionAnswering", "TFTapasForSequenceClassification", @@ -52,7 +54,7 @@ if TYPE_CHECKING: - from .configuration_tapas import TapasConfig + from .configuration_tapas import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig from .tokenization_tapas import TapasTokenizer try: @@ -62,6 +64,7 @@ pass else: from .modeling_tapas import ( + TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TapasForMaskedLM, TapasForQuestionAnswering, TapasForSequenceClassification, @@ -77,6 +80,7 @@ pass else: from .modeling_tf_tapas import ( + TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST, TFTapasForMaskedLM, TFTapasForQuestionAnswering, TFTapasForSequenceClassification, diff --git a/src/transformers/models/time_series_transformer/__init__.py b/src/transformers/models/time_series_transformer/__init__.py index 39879ed1bc00b7..1c09b683a34625 100644 --- a/src/transformers/models/time_series_transformer/__init__.py +++ b/src/transformers/models/time_series_transformer/__init__.py @@ -17,7 +17,10 @@ _import_structure = { - "configuration_time_series_transformer": ["TimeSeriesTransformerConfig"], + "configuration_time_series_transformer": [ + "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "TimeSeriesTransformerConfig", + ], } try: @@ -27,6 +30,7 @@ pass else: _import_structure["modeling_time_series_transformer"] = [ + "TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimeSeriesTransformerForPrediction", "TimeSeriesTransformerModel", "TimeSeriesTransformerPreTrainedModel", @@ -35,6 +39,7 @@ if TYPE_CHECKING: from .configuration_time_series_transformer import ( + TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimeSeriesTransformerConfig, ) @@ -45,6 +50,7 @@ pass else: from .modeling_time_series_transformer import ( + TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimeSeriesTransformerForPrediction, TimeSeriesTransformerModel, TimeSeriesTransformerPreTrainedModel, diff --git a/src/transformers/models/timesformer/__init__.py b/src/transformers/models/timesformer/__init__.py index 48a2aa9fa47464..f777a11ad1bdcf 100644 --- a/src/transformers/models/timesformer/__init__.py +++ b/src/transformers/models/timesformer/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_timesformer": ["TimesformerConfig"], + "configuration_timesformer": ["TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TimesformerConfig"], } try: @@ -27,13 +27,14 @@ pass else: _import_structure["modeling_timesformer"] = [ + "TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "TimesformerModel", "TimesformerForVideoClassification", "TimesformerPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_timesformer import TimesformerConfig + from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig try: if not is_torch_available(): @@ -42,6 +43,7 @@ pass else: from .modeling_timesformer import ( + TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, TimesformerForVideoClassification, TimesformerModel, TimesformerPreTrainedModel, diff --git a/src/transformers/models/trocr/__init__.py b/src/transformers/models/trocr/__init__.py index 14854857586d97..08400fc916ec21 100644 --- a/src/transformers/models/trocr/__init__.py +++ b/src/transformers/models/trocr/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_trocr": ["TrOCRConfig"], + "configuration_trocr": ["TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP", "TrOCRConfig"], "processing_trocr": ["TrOCRProcessor"], } @@ -35,13 +35,14 @@ pass else: _import_structure["modeling_trocr"] = [ + "TROCR_PRETRAINED_MODEL_ARCHIVE_LIST", "TrOCRForCausalLM", "TrOCRPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_trocr import TrOCRConfig + from .configuration_trocr import TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig from .processing_trocr import TrOCRProcessor try: @@ -50,7 +51,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_trocr import TrOCRForCausalLM, TrOCRPreTrainedModel + from .modeling_trocr import TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel else: import sys diff --git a/src/transformers/models/tvlt/__init__.py b/src/transformers/models/tvlt/__init__.py index d63bad0a7adc81..86c0f7c1c0b99d 100644 --- a/src/transformers/models/tvlt/__init__.py +++ b/src/transformers/models/tvlt/__init__.py @@ -26,7 +26,7 @@ _import_structure = { - "configuration_tvlt": ["TvltConfig"], + "configuration_tvlt": ["TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP", "TvltConfig"], "feature_extraction_tvlt": ["TvltFeatureExtractor"], "processing_tvlt": ["TvltProcessor"], } @@ -38,6 +38,7 @@ pass else: _import_structure["modeling_tvlt"] = [ + "TVLT_PRETRAINED_MODEL_ARCHIVE_LIST", "TvltModel", "TvltForPreTraining", "TvltForAudioVisualClassification", @@ -54,7 +55,7 @@ if TYPE_CHECKING: - from .configuration_tvlt import TvltConfig + from .configuration_tvlt import TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP, TvltConfig from .processing_tvlt import TvltProcessor from .feature_extraction_tvlt import TvltFeatureExtractor @@ -65,6 +66,7 @@ pass else: from .modeling_tvlt import ( + TVLT_PRETRAINED_MODEL_ARCHIVE_LIST, TvltForAudioVisualClassification, TvltForPreTraining, TvltModel, diff --git a/src/transformers/models/tvp/__init__.py b/src/transformers/models/tvp/__init__.py index b8479dbdd331b8..63c0bd27174471 100644 --- a/src/transformers/models/tvp/__init__.py +++ b/src/transformers/models/tvp/__init__.py @@ -18,7 +18,10 @@ _import_structure = { - "configuration_tvp": ["TvpConfig"], + "configuration_tvp": [ + "TVP_PRETRAINED_CONFIG_ARCHIVE_MAP", + "TvpConfig", + ], "processing_tvp": ["TvpProcessor"], } @@ -37,6 +40,7 @@ pass else: _import_structure["modeling_tvp"] = [ + "TVP_PRETRAINED_MODEL_ARCHIVE_LIST", "TvpModel", "TvpPreTrainedModel", "TvpForVideoGrounding", @@ -44,6 +48,7 @@ if TYPE_CHECKING: from .configuration_tvp import ( + TVP_PRETRAINED_CONFIG_ARCHIVE_MAP, TvpConfig, ) from .processing_tvp import TvpProcessor @@ -63,6 +68,7 @@ pass else: from .modeling_tvp import ( + TVP_PRETRAINED_MODEL_ARCHIVE_LIST, TvpForVideoGrounding, TvpModel, TvpPreTrainedModel, diff --git a/src/transformers/models/udop/__init__.py b/src/transformers/models/udop/__init__.py index 732d97aa7a99c7..5066fde6af1d15 100644 --- a/src/transformers/models/udop/__init__.py +++ b/src/transformers/models/udop/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_udop": ["UdopConfig"], + "configuration_udop": ["UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP", "UdopConfig"], "processing_udop": ["UdopProcessor"], } @@ -51,6 +51,7 @@ pass else: _import_structure["modeling_udop"] = [ + "UDOP_PRETRAINED_MODEL_ARCHIVE_LIST", "UdopForConditionalGeneration", "UdopPreTrainedModel", "UdopModel", @@ -58,7 +59,7 @@ ] if TYPE_CHECKING: - from .configuration_udop import UdopConfig + from .configuration_udop import UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP, UdopConfig from .processing_udop import UdopProcessor try: @@ -84,6 +85,7 @@ pass else: from .modeling_udop import ( + UDOP_PRETRAINED_MODEL_ARCHIVE_LIST, UdopEncoderModel, UdopForConditionalGeneration, UdopModel, diff --git a/src/transformers/models/unispeech/__init__.py b/src/transformers/models/unispeech/__init__.py index 91db9ada5ef297..2800fa17076e6e 100644 --- a/src/transformers/models/unispeech/__init__.py +++ b/src/transformers/models/unispeech/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_unispeech": ["UniSpeechConfig"]} +_import_structure = {"configuration_unispeech": ["UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP", "UniSpeechConfig"]} try: if not is_torch_available(): @@ -31,6 +31,7 @@ pass else: _import_structure["modeling_unispeech"] = [ + "UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechForCTC", "UniSpeechForPreTraining", "UniSpeechForSequenceClassification", @@ -39,7 +40,7 @@ ] if TYPE_CHECKING: - from .configuration_unispeech import UniSpeechConfig + from .configuration_unispeech import UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechConfig try: if not is_torch_available(): @@ -48,6 +49,7 @@ pass else: from .modeling_unispeech import ( + UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechForCTC, UniSpeechForPreTraining, UniSpeechForSequenceClassification, diff --git a/src/transformers/models/unispeech_sat/__init__.py b/src/transformers/models/unispeech_sat/__init__.py index 275f98ac222024..d1ac3ec2c43fb9 100644 --- a/src/transformers/models/unispeech_sat/__init__.py +++ b/src/transformers/models/unispeech_sat/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_unispeech_sat": ["UniSpeechSatConfig"], + "configuration_unispeech_sat": ["UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP", "UniSpeechSatConfig"], } try: @@ -33,6 +33,7 @@ pass else: _import_structure["modeling_unispeech_sat"] = [ + "UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST", "UniSpeechSatForAudioFrameClassification", "UniSpeechSatForCTC", "UniSpeechSatForPreTraining", @@ -43,7 +44,7 @@ ] if TYPE_CHECKING: - from .configuration_unispeech_sat import UniSpeechSatConfig + from .configuration_unispeech_sat import UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig try: if not is_torch_available(): @@ -52,6 +53,7 @@ pass else: from .modeling_unispeech_sat import ( + UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST, UniSpeechSatForAudioFrameClassification, UniSpeechSatForCTC, UniSpeechSatForPreTraining, diff --git a/src/transformers/models/univnet/__init__.py b/src/transformers/models/univnet/__init__.py index ea9babc3314f40..afb03ee9894b0e 100644 --- a/src/transformers/models/univnet/__init__.py +++ b/src/transformers/models/univnet/__init__.py @@ -22,7 +22,10 @@ _import_structure = { - "configuration_univnet": ["UnivNetConfig"], + "configuration_univnet": [ + "UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP", + "UnivNetConfig", + ], "feature_extraction_univnet": ["UnivNetFeatureExtractor"], } @@ -33,12 +36,14 @@ pass else: _import_structure["modeling_univnet"] = [ + "UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST", "UnivNetModel", ] if TYPE_CHECKING: from .configuration_univnet import ( + UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP, UnivNetConfig, ) from .feature_extraction_univnet import UnivNetFeatureExtractor @@ -50,6 +55,7 @@ pass else: from .modeling_univnet import ( + UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST, UnivNetModel, ) diff --git a/src/transformers/models/videomae/__init__.py b/src/transformers/models/videomae/__init__.py index 0e52081adbca5b..663b6d41aba605 100644 --- a/src/transformers/models/videomae/__init__.py +++ b/src/transformers/models/videomae/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_videomae": ["VideoMAEConfig"], + "configuration_videomae": ["VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VideoMAEConfig"], } try: @@ -27,6 +27,7 @@ pass else: _import_structure["modeling_videomae"] = [ + "VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST", "VideoMAEForPreTraining", "VideoMAEModel", "VideoMAEPreTrainedModel", @@ -43,7 +44,7 @@ _import_structure["image_processing_videomae"] = ["VideoMAEImageProcessor"] if TYPE_CHECKING: - from .configuration_videomae import VideoMAEConfig + from .configuration_videomae import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP, VideoMAEConfig try: if not is_torch_available(): @@ -52,6 +53,7 @@ pass else: from .modeling_videomae import ( + VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST, VideoMAEForPreTraining, VideoMAEForVideoClassification, VideoMAEModel, diff --git a/src/transformers/models/vilt/__init__.py b/src/transformers/models/vilt/__init__.py index 6fcfd64c8beb68..6d5afba10dacfc 100644 --- a/src/transformers/models/vilt/__init__.py +++ b/src/transformers/models/vilt/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_vilt": ["ViltConfig"]} +_import_structure = {"configuration_vilt": ["VILT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViltConfig"]} try: if not is_vision_available(): @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_vilt"] = [ + "VILT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViltForImageAndTextRetrieval", "ViltForImagesAndTextClassification", "ViltForTokenClassification", @@ -47,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_vilt import ViltConfig + from .configuration_vilt import VILT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViltConfig try: if not is_vision_available(): @@ -66,6 +67,7 @@ pass else: from .modeling_vilt import ( + VILT_PRETRAINED_MODEL_ARCHIVE_LIST, ViltForImageAndTextRetrieval, ViltForImagesAndTextClassification, ViltForMaskedLM, diff --git a/src/transformers/models/vipllava/__init__.py b/src/transformers/models/vipllava/__init__.py index edc2a5106ba7cf..2853605ba2d275 100644 --- a/src/transformers/models/vipllava/__init__.py +++ b/src/transformers/models/vipllava/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_vipllava": ["VipLlavaConfig"]} +_import_structure = {"configuration_vipllava": ["VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "VipLlavaConfig"]} try: @@ -26,13 +26,14 @@ pass else: _import_structure["modeling_vipllava"] = [ + "VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST", "VipLlavaForConditionalGeneration", "VipLlavaPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_vipllava import VipLlavaConfig + from .configuration_vipllava import VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, VipLlavaConfig try: if not is_torch_available(): @@ -41,6 +42,7 @@ pass else: from .modeling_vipllava import ( + VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST, VipLlavaForConditionalGeneration, VipLlavaPreTrainedModel, ) diff --git a/src/transformers/models/visual_bert/__init__.py b/src/transformers/models/visual_bert/__init__.py index db74a924a85cc7..a752f1fa0c1476 100644 --- a/src/transformers/models/visual_bert/__init__.py +++ b/src/transformers/models/visual_bert/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_visual_bert": ["VisualBertConfig"]} +_import_structure = {"configuration_visual_bert": ["VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VisualBertConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_visual_bert"] = [ + "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "VisualBertForMultipleChoice", "VisualBertForPreTraining", "VisualBertForQuestionAnswering", @@ -37,7 +38,7 @@ if TYPE_CHECKING: - from .configuration_visual_bert import VisualBertConfig + from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig try: if not is_torch_available(): @@ -46,6 +47,7 @@ pass else: from .modeling_visual_bert import ( + VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, VisualBertForMultipleChoice, VisualBertForPreTraining, VisualBertForQuestionAnswering, diff --git a/src/transformers/models/vit/__init__.py b/src/transformers/models/vit/__init__.py index db41e881faafa6..d426ec93bf5859 100644 --- a/src/transformers/models/vit/__init__.py +++ b/src/transformers/models/vit/__init__.py @@ -23,7 +23,7 @@ ) -_import_structure = {"configuration_vit": ["ViTConfig", "ViTOnnxConfig"]} +_import_structure = {"configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig", "ViTOnnxConfig"]} try: if not is_vision_available(): @@ -41,6 +41,7 @@ pass else: _import_structure["modeling_vit"] = [ + "VIT_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTForImageClassification", "ViTForMaskedImageModeling", "ViTModel", @@ -72,7 +73,7 @@ ] if TYPE_CHECKING: - from .configuration_vit import ViTConfig, ViTOnnxConfig + from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig, ViTOnnxConfig try: if not is_vision_available(): @@ -90,6 +91,7 @@ pass else: from .modeling_vit import ( + VIT_PRETRAINED_MODEL_ARCHIVE_LIST, ViTForImageClassification, ViTForMaskedImageModeling, ViTModel, diff --git a/src/transformers/models/vit_hybrid/__init__.py b/src/transformers/models/vit_hybrid/__init__.py index f87e44449a978e..47342d3a260438 100644 --- a/src/transformers/models/vit_hybrid/__init__.py +++ b/src/transformers/models/vit_hybrid/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_vit_hybrid": ["ViTHybridConfig"]} +_import_structure = {"configuration_vit_hybrid": ["VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTHybridConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_vit_hybrid"] = [ + "VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTHybridForImageClassification", "ViTHybridModel", "ViTHybridPreTrainedModel", @@ -40,7 +41,7 @@ if TYPE_CHECKING: - from .configuration_vit_hybrid import ViTHybridConfig + from .configuration_vit_hybrid import VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTHybridConfig try: if not is_torch_available(): @@ -49,6 +50,7 @@ pass else: from .modeling_vit_hybrid import ( + VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST, ViTHybridForImageClassification, ViTHybridModel, ViTHybridPreTrainedModel, diff --git a/src/transformers/models/vit_mae/__init__.py b/src/transformers/models/vit_mae/__init__.py index f5360061762e6f..bfd200e9dcb913 100644 --- a/src/transformers/models/vit_mae/__init__.py +++ b/src/transformers/models/vit_mae/__init__.py @@ -22,7 +22,7 @@ ) -_import_structure = {"configuration_vit_mae": ["ViTMAEConfig"]} +_import_structure = {"configuration_vit_mae": ["VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMAEConfig"]} try: if not is_torch_available(): @@ -31,6 +31,7 @@ pass else: _import_structure["modeling_vit_mae"] = [ + "VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMAEForPreTraining", "ViTMAELayer", "ViTMAEModel", @@ -50,7 +51,7 @@ ] if TYPE_CHECKING: - from .configuration_vit_mae import ViTMAEConfig + from .configuration_vit_mae import VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMAEConfig try: if not is_torch_available(): @@ -59,6 +60,7 @@ pass else: from .modeling_vit_mae import ( + VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMAEForPreTraining, ViTMAELayer, ViTMAEModel, diff --git a/src/transformers/models/vit_msn/__init__.py b/src/transformers/models/vit_msn/__init__.py index 88f7ff73d29b69..c36cb750cfa4e6 100644 --- a/src/transformers/models/vit_msn/__init__.py +++ b/src/transformers/models/vit_msn/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_vit_msn": ["ViTMSNConfig"]} +_import_structure = {"configuration_vit_msn": ["VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMSNConfig"]} try: if not is_torch_available(): @@ -25,13 +25,14 @@ pass else: _import_structure["modeling_vit_msn"] = [ + "VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST", "ViTMSNModel", "ViTMSNForImageClassification", "ViTMSNPreTrainedModel", ] if TYPE_CHECKING: - from .configuration_vit_msn import ViTMSNConfig + from .configuration_vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig try: if not is_torch_available(): @@ -40,6 +41,7 @@ pass else: from .modeling_vit_msn import ( + VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST, ViTMSNForImageClassification, ViTMSNModel, ViTMSNPreTrainedModel, diff --git a/src/transformers/models/vitdet/__init__.py b/src/transformers/models/vitdet/__init__.py index a7ee9c755ff19b..8ccc1365820d69 100644 --- a/src/transformers/models/vitdet/__init__.py +++ b/src/transformers/models/vitdet/__init__.py @@ -20,7 +20,7 @@ ) -_import_structure = {"configuration_vitdet": ["VitDetConfig"]} +_import_structure = {"configuration_vitdet": ["VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitDetConfig"]} try: if not is_torch_available(): @@ -29,13 +29,14 @@ pass else: _import_structure["modeling_vitdet"] = [ + "VITDET_PRETRAINED_MODEL_ARCHIVE_LIST", "VitDetModel", "VitDetPreTrainedModel", "VitDetBackbone", ] if TYPE_CHECKING: - from .configuration_vitdet import VitDetConfig + from .configuration_vitdet import VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP, VitDetConfig try: if not is_torch_available(): @@ -44,6 +45,7 @@ pass else: from .modeling_vitdet import ( + VITDET_PRETRAINED_MODEL_ARCHIVE_LIST, VitDetBackbone, VitDetModel, VitDetPreTrainedModel, diff --git a/src/transformers/models/vitmatte/__init__.py b/src/transformers/models/vitmatte/__init__.py index 7745a96cc6d545..abbfae97c22030 100644 --- a/src/transformers/models/vitmatte/__init__.py +++ b/src/transformers/models/vitmatte/__init__.py @@ -21,7 +21,7 @@ ) -_import_structure = {"configuration_vitmatte": ["VitMatteConfig"]} +_import_structure = {"configuration_vitmatte": ["VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP", "VitMatteConfig"]} try: if not is_vision_available(): @@ -38,12 +38,13 @@ pass else: _import_structure["modeling_vitmatte"] = [ + "VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST", "VitMattePreTrainedModel", "VitMatteForImageMatting", ] if TYPE_CHECKING: - from .configuration_vitmatte import VitMatteConfig + from .configuration_vitmatte import VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP, VitMatteConfig try: if not is_vision_available(): @@ -60,6 +61,7 @@ pass else: from .modeling_vitmatte import ( + VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST, VitMatteForImageMatting, VitMattePreTrainedModel, ) diff --git a/src/transformers/models/vits/__init__.py b/src/transformers/models/vits/__init__.py index 14428463d28a50..79c18048e7c776 100644 --- a/src/transformers/models/vits/__init__.py +++ b/src/transformers/models/vits/__init__.py @@ -23,7 +23,10 @@ _import_structure = { - "configuration_vits": ["VitsConfig"], + "configuration_vits": [ + "VITS_PRETRAINED_CONFIG_ARCHIVE_MAP", + "VitsConfig", + ], "tokenization_vits": ["VitsTokenizer"], } @@ -34,12 +37,14 @@ pass else: _import_structure["modeling_vits"] = [ + "VITS_PRETRAINED_MODEL_ARCHIVE_LIST", "VitsModel", "VitsPreTrainedModel", ] if TYPE_CHECKING: from .configuration_vits import ( + VITS_PRETRAINED_CONFIG_ARCHIVE_MAP, VitsConfig, ) from .tokenization_vits import VitsTokenizer @@ -51,6 +56,7 @@ pass else: from .modeling_vits import ( + VITS_PRETRAINED_MODEL_ARCHIVE_LIST, VitsModel, VitsPreTrainedModel, ) diff --git a/src/transformers/models/vivit/__init__.py b/src/transformers/models/vivit/__init__.py index 261238edccbe75..ec446b79707255 100644 --- a/src/transformers/models/vivit/__init__.py +++ b/src/transformers/models/vivit/__init__.py @@ -22,7 +22,7 @@ _import_structure = { - "configuration_vivit": ["VivitConfig"], + "configuration_vivit": ["VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VivitConfig"], } try: if not is_vision_available(): @@ -40,6 +40,7 @@ pass else: _import_structure["modeling_vivit"] = [ + "VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST", "VivitModel", "VivitPreTrainedModel", "VivitForVideoClassification", @@ -47,7 +48,7 @@ if TYPE_CHECKING: - from .configuration_vivit import VivitConfig + from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig try: if not is_vision_available(): @@ -64,6 +65,7 @@ pass else: from .modeling_vivit import ( + VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST, VivitForVideoClassification, VivitModel, VivitPreTrainedModel, diff --git a/src/transformers/models/wav2vec2/__init__.py b/src/transformers/models/wav2vec2/__init__.py index 06e1c6628db9a8..b3abdb99ec722d 100644 --- a/src/transformers/models/wav2vec2/__init__.py +++ b/src/transformers/models/wav2vec2/__init__.py @@ -23,7 +23,7 @@ _import_structure = { - "configuration_wav2vec2": ["Wav2Vec2Config"], + "configuration_wav2vec2": ["WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Wav2Vec2Config"], "feature_extraction_wav2vec2": ["Wav2Vec2FeatureExtractor"], "processing_wav2vec2": ["Wav2Vec2Processor"], "tokenization_wav2vec2": ["Wav2Vec2CTCTokenizer", "Wav2Vec2Tokenizer"], @@ -37,6 +37,7 @@ pass else: _import_structure["modeling_wav2vec2"] = [ + "WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ForAudioFrameClassification", "Wav2Vec2ForCTC", "Wav2Vec2ForMaskedLM", @@ -54,6 +55,7 @@ pass else: _import_structure["modeling_tf_wav2vec2"] = [ + "TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWav2Vec2ForCTC", "TFWav2Vec2Model", "TFWav2Vec2PreTrainedModel", @@ -75,7 +77,7 @@ if TYPE_CHECKING: - from .configuration_wav2vec2 import Wav2Vec2Config + from .configuration_wav2vec2 import WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2Config from .feature_extraction_wav2vec2 import Wav2Vec2FeatureExtractor from .processing_wav2vec2 import Wav2Vec2Processor from .tokenization_wav2vec2 import Wav2Vec2CTCTokenizer, Wav2Vec2Tokenizer @@ -87,6 +89,7 @@ pass else: from .modeling_wav2vec2 import ( + WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ForAudioFrameClassification, Wav2Vec2ForCTC, Wav2Vec2ForMaskedLM, @@ -104,6 +107,7 @@ pass else: from .modeling_tf_wav2vec2 import ( + TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, TFWav2Vec2ForCTC, TFWav2Vec2ForSequenceClassification, TFWav2Vec2Model, diff --git a/src/transformers/models/wav2vec2_bert/__init__.py b/src/transformers/models/wav2vec2_bert/__init__.py index be37038211a811..594f108bcaad96 100644 --- a/src/transformers/models/wav2vec2_bert/__init__.py +++ b/src/transformers/models/wav2vec2_bert/__init__.py @@ -17,7 +17,10 @@ _import_structure = { - "configuration_wav2vec2_bert": ["Wav2Vec2BertConfig"], + "configuration_wav2vec2_bert": [ + "WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", + "Wav2Vec2BertConfig", + ], "processing_wav2vec2_bert": ["Wav2Vec2BertProcessor"], } @@ -29,6 +32,7 @@ pass else: _import_structure["modeling_wav2vec2_bert"] = [ + "WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2BertForAudioFrameClassification", "Wav2Vec2BertForCTC", "Wav2Vec2BertForSequenceClassification", @@ -39,6 +43,7 @@ if TYPE_CHECKING: from .configuration_wav2vec2_bert import ( + WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2BertConfig, ) from .processing_wav2vec2_bert import Wav2Vec2BertProcessor @@ -50,6 +55,7 @@ pass else: from .modeling_wav2vec2_bert import ( + WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2BertForAudioFrameClassification, Wav2Vec2BertForCTC, Wav2Vec2BertForSequenceClassification, diff --git a/src/transformers/models/wav2vec2_conformer/__init__.py b/src/transformers/models/wav2vec2_conformer/__init__.py index a780a50b6cce11..35081cfcdef97b 100644 --- a/src/transformers/models/wav2vec2_conformer/__init__.py +++ b/src/transformers/models/wav2vec2_conformer/__init__.py @@ -17,7 +17,10 @@ _import_structure = { - "configuration_wav2vec2_conformer": ["Wav2Vec2ConformerConfig"], + "configuration_wav2vec2_conformer": [ + "WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", + "Wav2Vec2ConformerConfig", + ], } @@ -28,6 +31,7 @@ pass else: _import_structure["modeling_wav2vec2_conformer"] = [ + "WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST", "Wav2Vec2ConformerForAudioFrameClassification", "Wav2Vec2ConformerForCTC", "Wav2Vec2ConformerForPreTraining", @@ -39,6 +43,7 @@ if TYPE_CHECKING: from .configuration_wav2vec2_conformer import ( + WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, Wav2Vec2ConformerConfig, ) @@ -49,6 +54,7 @@ pass else: from .modeling_wav2vec2_conformer import ( + WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2ConformerForAudioFrameClassification, Wav2Vec2ConformerForCTC, Wav2Vec2ConformerForPreTraining, diff --git a/src/transformers/models/wavlm/__init__.py b/src/transformers/models/wavlm/__init__.py index d615a3a5ae4062..3d48a3615bb4a3 100644 --- a/src/transformers/models/wavlm/__init__.py +++ b/src/transformers/models/wavlm/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_wavlm": ["WavLMConfig"]} +_import_structure = {"configuration_wavlm": ["WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "WavLMConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_wavlm"] = [ + "WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST", "WavLMForAudioFrameClassification", "WavLMForCTC", "WavLMForSequenceClassification", @@ -34,7 +35,7 @@ ] if TYPE_CHECKING: - from .configuration_wavlm import WavLMConfig + from .configuration_wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig try: if not is_torch_available(): @@ -43,6 +44,7 @@ pass else: from .modeling_wavlm import ( + WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST, WavLMForAudioFrameClassification, WavLMForCTC, WavLMForSequenceClassification, diff --git a/src/transformers/models/whisper/__init__.py b/src/transformers/models/whisper/__init__.py index 5d37e72c02b5df..d87828da69f5d1 100644 --- a/src/transformers/models/whisper/__init__.py +++ b/src/transformers/models/whisper/__init__.py @@ -24,7 +24,7 @@ _import_structure = { - "configuration_whisper": ["WhisperConfig", "WhisperOnnxConfig"], + "configuration_whisper": ["WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP", "WhisperConfig", "WhisperOnnxConfig"], "feature_extraction_whisper": ["WhisperFeatureExtractor"], "processing_whisper": ["WhisperProcessor"], "tokenization_whisper": ["WhisperTokenizer"], @@ -45,6 +45,7 @@ pass else: _import_structure["modeling_whisper"] = [ + "WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "WhisperForCausalLM", "WhisperForConditionalGeneration", "WhisperModel", @@ -59,6 +60,7 @@ pass else: _import_structure["modeling_tf_whisper"] = [ + "TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST", "TFWhisperForConditionalGeneration", "TFWhisperModel", "TFWhisperPreTrainedModel", @@ -79,7 +81,7 @@ if TYPE_CHECKING: - from .configuration_whisper import WhisperConfig, WhisperOnnxConfig + from .configuration_whisper import WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperOnnxConfig from .feature_extraction_whisper import WhisperFeatureExtractor from .processing_whisper import WhisperProcessor from .tokenization_whisper import WhisperTokenizer @@ -99,6 +101,7 @@ pass else: from .modeling_whisper import ( + WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, WhisperForAudioClassification, WhisperForCausalLM, WhisperForConditionalGeneration, @@ -113,6 +116,7 @@ pass else: from .modeling_tf_whisper import ( + TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST, TFWhisperForConditionalGeneration, TFWhisperModel, TFWhisperPreTrainedModel, diff --git a/src/transformers/models/x_clip/__init__.py b/src/transformers/models/x_clip/__init__.py index 2f60ad0ddee2d2..ed3d2ff5152830 100644 --- a/src/transformers/models/x_clip/__init__.py +++ b/src/transformers/models/x_clip/__init__.py @@ -18,6 +18,7 @@ _import_structure = { "configuration_x_clip": [ + "XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP", "XCLIPConfig", "XCLIPTextConfig", "XCLIPVisionConfig", @@ -32,6 +33,7 @@ pass else: _import_structure["modeling_x_clip"] = [ + "XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST", "XCLIPModel", "XCLIPPreTrainedModel", "XCLIPTextModel", @@ -40,6 +42,7 @@ if TYPE_CHECKING: from .configuration_x_clip import ( + XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, XCLIPConfig, XCLIPTextConfig, XCLIPVisionConfig, @@ -53,6 +56,7 @@ pass else: from .modeling_x_clip import ( + XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST, XCLIPModel, XCLIPPreTrainedModel, XCLIPTextModel, diff --git a/src/transformers/models/xglm/__init__.py b/src/transformers/models/xglm/__init__.py index 59bba032f4ea2a..747a4ddb4ed9c7 100644 --- a/src/transformers/models/xglm/__init__.py +++ b/src/transformers/models/xglm/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_xglm": ["XGLMConfig"]} +_import_structure = {"configuration_xglm": ["XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XGLMConfig"]} try: if not is_sentencepiece_available(): @@ -49,6 +49,7 @@ pass else: _import_structure["modeling_xglm"] = [ + "XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XGLMForCausalLM", "XGLMModel", "XGLMPreTrainedModel", @@ -75,6 +76,7 @@ pass else: _import_structure["modeling_tf_xglm"] = [ + "TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXGLMForCausalLM", "TFXGLMModel", "TFXGLMPreTrainedModel", @@ -82,7 +84,7 @@ if TYPE_CHECKING: - from .configuration_xglm import XGLMConfig + from .configuration_xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig try: if not is_sentencepiece_available(): @@ -106,7 +108,7 @@ except OptionalDependencyNotAvailable: pass else: - from .modeling_xglm import XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel + from .modeling_xglm import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel try: if not is_flax_available(): @@ -123,6 +125,7 @@ pass else: from .modeling_tf_xglm import ( + TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXGLMForCausalLM, TFXGLMModel, TFXGLMPreTrainedModel, diff --git a/src/transformers/models/xlm/__init__.py b/src/transformers/models/xlm/__init__.py index 97d0933b8b9a7d..1dd57a90b92744 100644 --- a/src/transformers/models/xlm/__init__.py +++ b/src/transformers/models/xlm/__init__.py @@ -18,7 +18,7 @@ _import_structure = { - "configuration_xlm": ["XLMConfig", "XLMOnnxConfig"], + "configuration_xlm": ["XLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMConfig", "XLMOnnxConfig"], "tokenization_xlm": ["XLMTokenizer"], } @@ -29,6 +29,7 @@ pass else: _import_structure["modeling_xlm"] = [ + "XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMForMultipleChoice", "XLMForQuestionAnswering", "XLMForQuestionAnsweringSimple", @@ -46,6 +47,7 @@ pass else: _import_structure["modeling_tf_xlm"] = [ + "TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMForMultipleChoice", "TFXLMForQuestionAnsweringSimple", "TFXLMForSequenceClassification", @@ -58,7 +60,7 @@ if TYPE_CHECKING: - from .configuration_xlm import XLMConfig, XLMOnnxConfig + from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig from .tokenization_xlm import XLMTokenizer try: @@ -68,6 +70,7 @@ pass else: from .modeling_xlm import ( + XLM_PRETRAINED_MODEL_ARCHIVE_LIST, XLMForMultipleChoice, XLMForQuestionAnswering, XLMForQuestionAnsweringSimple, @@ -85,6 +88,7 @@ pass else: from .modeling_tf_xlm import ( + TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMForMultipleChoice, TFXLMForQuestionAnsweringSimple, TFXLMForSequenceClassification, diff --git a/src/transformers/models/xlm_prophetnet/__init__.py b/src/transformers/models/xlm_prophetnet/__init__.py index d9c24d9b4d2513..ff14e5b987a789 100644 --- a/src/transformers/models/xlm_prophetnet/__init__.py +++ b/src/transformers/models/xlm_prophetnet/__init__.py @@ -17,7 +17,7 @@ _import_structure = { - "configuration_xlm_prophetnet": ["XLMProphetNetConfig"], + "configuration_xlm_prophetnet": ["XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMProphetNetConfig"], } try: @@ -35,6 +35,7 @@ pass else: _import_structure["modeling_xlm_prophetnet"] = [ + "XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMProphetNetDecoder", "XLMProphetNetEncoder", "XLMProphetNetForCausalLM", @@ -45,7 +46,7 @@ if TYPE_CHECKING: - from .configuration_xlm_prophetnet import XLMProphetNetConfig + from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig try: if not is_sentencepiece_available(): @@ -62,6 +63,7 @@ pass else: from .modeling_xlm_prophetnet import ( + XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLMProphetNetDecoder, XLMProphetNetEncoder, XLMProphetNetForCausalLM, diff --git a/src/transformers/models/xlm_roberta/__init__.py b/src/transformers/models/xlm_roberta/__init__.py index 00658bb9ed9b8d..813cba9fe17c1d 100644 --- a/src/transformers/models/xlm_roberta/__init__.py +++ b/src/transformers/models/xlm_roberta/__init__.py @@ -27,6 +27,7 @@ _import_structure = { "configuration_xlm_roberta": [ + "XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMRobertaConfig", "XLMRobertaOnnxConfig", ], @@ -55,6 +56,7 @@ pass else: _import_structure["modeling_xlm_roberta"] = [ + "XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaForCausalLM", "XLMRobertaForMaskedLM", "XLMRobertaForMultipleChoice", @@ -72,6 +74,7 @@ pass else: _import_structure["modeling_tf_xlm_roberta"] = [ + "TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLMRobertaForCausalLM", "TFXLMRobertaForMaskedLM", "TFXLMRobertaForMultipleChoice", @@ -89,6 +92,7 @@ pass else: _import_structure["modeling_flax_xlm_roberta"] = [ + "FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST", "FlaxXLMRobertaForMaskedLM", "FlaxXLMRobertaForCausalLM", "FlaxXLMRobertaForMultipleChoice", @@ -101,6 +105,7 @@ if TYPE_CHECKING: from .configuration_xlm_roberta import ( + XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaConfig, XLMRobertaOnnxConfig, ) @@ -128,6 +133,7 @@ pass else: from .modeling_xlm_roberta import ( + XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaForCausalLM, XLMRobertaForMaskedLM, XLMRobertaForMultipleChoice, @@ -145,6 +151,7 @@ pass else: from .modeling_tf_xlm_roberta import ( + TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLMRobertaForCausalLM, TFXLMRobertaForMaskedLM, TFXLMRobertaForMultipleChoice, @@ -162,6 +169,7 @@ pass else: from .modeling_flax_xlm_roberta import ( + FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST, FlaxXLMRobertaForCausalLM, FlaxXLMRobertaForMaskedLM, FlaxXLMRobertaForMultipleChoice, diff --git a/src/transformers/models/xlm_roberta_xl/__init__.py b/src/transformers/models/xlm_roberta_xl/__init__.py index 68ae26b06d6ca9..2df95dbc49200e 100644 --- a/src/transformers/models/xlm_roberta_xl/__init__.py +++ b/src/transformers/models/xlm_roberta_xl/__init__.py @@ -19,6 +19,7 @@ _import_structure = { "configuration_xlm_roberta_xl": [ + "XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMRobertaXLConfig", "XLMRobertaXLOnnxConfig", ], @@ -31,6 +32,7 @@ pass else: _import_structure["modeling_xlm_roberta_xl"] = [ + "XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST", "XLMRobertaXLForCausalLM", "XLMRobertaXLForMaskedLM", "XLMRobertaXLForMultipleChoice", @@ -43,6 +45,7 @@ if TYPE_CHECKING: from .configuration_xlm_roberta_xl import ( + XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaXLConfig, XLMRobertaXLOnnxConfig, ) @@ -54,6 +57,7 @@ pass else: from .modeling_xlm_roberta_xl import ( + XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST, XLMRobertaXLForCausalLM, XLMRobertaXLForMaskedLM, XLMRobertaXLForMultipleChoice, diff --git a/src/transformers/models/xlnet/__init__.py b/src/transformers/models/xlnet/__init__.py index f50d4cc178d3b9..f5e1d4568a66a4 100644 --- a/src/transformers/models/xlnet/__init__.py +++ b/src/transformers/models/xlnet/__init__.py @@ -24,7 +24,7 @@ ) -_import_structure = {"configuration_xlnet": ["XLNetConfig"]} +_import_structure = {"configuration_xlnet": ["XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLNetConfig"]} try: if not is_sentencepiece_available(): @@ -49,6 +49,7 @@ pass else: _import_structure["modeling_xlnet"] = [ + "XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "XLNetForMultipleChoice", "XLNetForQuestionAnswering", "XLNetForQuestionAnsweringSimple", @@ -67,6 +68,7 @@ pass else: _import_structure["modeling_tf_xlnet"] = [ + "TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST", "TFXLNetForMultipleChoice", "TFXLNetForQuestionAnsweringSimple", "TFXLNetForSequenceClassification", @@ -79,7 +81,7 @@ if TYPE_CHECKING: - from .configuration_xlnet import XLNetConfig + from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig try: if not is_sentencepiece_available(): @@ -104,6 +106,7 @@ pass else: from .modeling_xlnet import ( + XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, XLNetForMultipleChoice, XLNetForQuestionAnswering, XLNetForQuestionAnsweringSimple, @@ -122,6 +125,7 @@ pass else: from .modeling_tf_xlnet import ( + TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFXLNetForMultipleChoice, TFXLNetForQuestionAnsweringSimple, TFXLNetForSequenceClassification, diff --git a/src/transformers/models/xmod/__init__.py b/src/transformers/models/xmod/__init__.py index 9b9cb36e3b93e5..f3cb6f195bd458 100644 --- a/src/transformers/models/xmod/__init__.py +++ b/src/transformers/models/xmod/__init__.py @@ -23,6 +23,7 @@ _import_structure = { "configuration_xmod": [ + "XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP", "XmodConfig", "XmodOnnxConfig", ], @@ -35,6 +36,7 @@ pass else: _import_structure["modeling_xmod"] = [ + "XMOD_PRETRAINED_MODEL_ARCHIVE_LIST", "XmodForCausalLM", "XmodForMaskedLM", "XmodForMultipleChoice", @@ -46,7 +48,7 @@ ] if TYPE_CHECKING: - from .configuration_xmod import XmodConfig, XmodOnnxConfig + from .configuration_xmod import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP, XmodConfig, XmodOnnxConfig try: if not is_torch_available(): @@ -55,6 +57,7 @@ pass else: from .modeling_xmod import ( + XMOD_PRETRAINED_MODEL_ARCHIVE_LIST, XmodForCausalLM, XmodForMaskedLM, XmodForMultipleChoice, diff --git a/src/transformers/models/yolos/__init__.py b/src/transformers/models/yolos/__init__.py index fdf7c5db1cb220..28d59763bb8550 100644 --- a/src/transformers/models/yolos/__init__.py +++ b/src/transformers/models/yolos/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available -_import_structure = {"configuration_yolos": ["YolosConfig", "YolosOnnxConfig"]} +_import_structure = {"configuration_yolos": ["YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP", "YolosConfig", "YolosOnnxConfig"]} try: if not is_vision_available(): @@ -34,6 +34,7 @@ pass else: _import_structure["modeling_yolos"] = [ + "YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST", "YolosForObjectDetection", "YolosModel", "YolosPreTrainedModel", @@ -41,7 +42,7 @@ if TYPE_CHECKING: - from .configuration_yolos import YolosConfig, YolosOnnxConfig + from .configuration_yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig, YolosOnnxConfig try: if not is_vision_available(): @@ -59,6 +60,7 @@ pass else: from .modeling_yolos import ( + YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST, YolosForObjectDetection, YolosModel, YolosPreTrainedModel, diff --git a/src/transformers/models/yoso/__init__.py b/src/transformers/models/yoso/__init__.py index c4c73385017eb7..e1f89d73ac47c5 100644 --- a/src/transformers/models/yoso/__init__.py +++ b/src/transformers/models/yoso/__init__.py @@ -16,7 +16,7 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available -_import_structure = {"configuration_yoso": ["YosoConfig"]} +_import_structure = {"configuration_yoso": ["YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP", "YosoConfig"]} try: if not is_torch_available(): @@ -25,6 +25,7 @@ pass else: _import_structure["modeling_yoso"] = [ + "YOSO_PRETRAINED_MODEL_ARCHIVE_LIST", "YosoForMaskedLM", "YosoForMultipleChoice", "YosoForQuestionAnswering", @@ -37,7 +38,7 @@ if TYPE_CHECKING: - from .configuration_yoso import YosoConfig + from .configuration_yoso import YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP, YosoConfig try: if not is_torch_available(): @@ -46,6 +47,7 @@ pass else: from .modeling_yoso import ( + YOSO_PRETRAINED_MODEL_ARCHIVE_LIST, YosoForMaskedLM, YosoForMultipleChoice, YosoForQuestionAnswering, diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py index 525893d5962234..5dd27ef591a180 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py @@ -33,7 +33,7 @@ {% endif %} _import_structure = { - "configuration_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.camelcase_modelname}}Config"], + "configuration_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP", "{{cookiecutter.camelcase_modelname}}Config"], "tokenization_{{cookiecutter.lowercase_modelname}}": ["{{cookiecutter.camelcase_modelname}}Tokenizer"], } @@ -54,6 +54,7 @@ pass else: _import_structure["modeling_{{cookiecutter.lowercase_modelname}}"] = [ + "{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "{{cookiecutter.camelcase_modelname}}ForMaskedLM", "{{cookiecutter.camelcase_modelname}}ForCausalLM", "{{cookiecutter.camelcase_modelname}}ForMultipleChoice", @@ -73,6 +74,7 @@ pass else: _import_structure["modeling_{{cookiecutter.lowercase_modelname}}"] = [ + "{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "{{cookiecutter.camelcase_modelname}}ForConditionalGeneration", "{{cookiecutter.camelcase_modelname}}ForQuestionAnswering", "{{cookiecutter.camelcase_modelname}}ForSequenceClassification", @@ -93,6 +95,7 @@ pass else: _import_structure["modeling_tf_{{cookiecutter.lowercase_modelname}}"] = [ + "TF_{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST", "TF{{cookiecutter.camelcase_modelname}}ForMaskedLM", "TF{{cookiecutter.camelcase_modelname}}ForCausalLM", "TF{{cookiecutter.camelcase_modelname}}ForMultipleChoice", @@ -157,7 +160,7 @@ if TYPE_CHECKING: - from .configuration_{{cookiecutter.lowercase_modelname}} import {{cookiecutter.uppercase_modelname}}{{cookiecutter.camelcase_modelname}}Config + from .configuration_{{cookiecutter.lowercase_modelname}} import {{cookiecutter.uppercase_modelname}}_PRETRAINED_CONFIG_ARCHIVE_MAP, {{cookiecutter.camelcase_modelname}}Config from .tokenization_{{cookiecutter.lowercase_modelname}} import {{cookiecutter.camelcase_modelname}}Tokenizer try: @@ -177,7 +180,8 @@ pass else: from .modeling_{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForMaskedLM, + {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, + {{cookiecutter.camelcase_modelname}}ForMaskedLM, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForMultipleChoice, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, @@ -196,7 +200,8 @@ pass else: from .modeling_{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, + {{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, + {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, {{cookiecutter.camelcase_modelname}}ForSequenceClassification, @@ -214,7 +219,8 @@ pass else: from .modeling_tf_{{cookiecutter.lowercase_modelname}} import ( - TF_{{cookiecutter.uppercase_modelname}} TF{{cookiecutter.camelcase_modelname}}ForMaskedLM, + TF_{{cookiecutter.uppercase_modelname}}_PRETRAINED_MODEL_ARCHIVE_LIST, + TF{{cookiecutter.camelcase_modelname}}ForMaskedLM, TF{{cookiecutter.camelcase_modelname}}ForCausalLM, TF{{cookiecutter.camelcase_modelname}}ForMultipleChoice, TF{{cookiecutter.camelcase_modelname}}ForQuestionAnswering, From 60c43da65cb8b5f40abf7a3637a19121ffac13f5 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Thu, 14 Mar 2024 17:07:25 +0100 Subject: [PATCH 04/13] [test_all] Deprecate instead of removing --- src/transformers/__init__.py | 3 +- .../models/albert/configuration_albert.py | 1 + .../models/albert/modeling_albert.py | 3 + .../models/albert/modeling_tf_albert.py | 3 + .../models/align/configuration_align.py | 3 + .../models/align/modeling_align.py | 3 + .../models/altclip/configuration_altclip.py | 3 + .../models/altclip/modeling_altclip.py | 3 + ...iguration_audio_spectrogram_transformer.py | 3 + .../modeling_audio_spectrogram_transformer.py | 3 + .../models/auto/configuration_auto.py | 7 + .../autoformer/configuration_autoformer.py | 3 + .../models/autoformer/modeling_autoformer.py | 3 + src/transformers/models/bark/modeling_bark.py | 3 + src/transformers/models/bart/modeling_bart.py | 3 + .../models/beit/configuration_beit.py | 3 + src/transformers/models/beit/modeling_beit.py | 3 + .../models/bert/configuration_bert.py | 3 + src/transformers/models/bert/modeling_bert.py | 3 + .../models/bert/modeling_tf_bert.py | 3 + .../models/big_bird/configuration_big_bird.py | 3 + .../models/big_bird/modeling_big_bird.py | 3 + .../configuration_bigbird_pegasus.py | 3 + .../modeling_bigbird_pegasus.py | 3 + .../models/biogpt/configuration_biogpt.py | 3 + .../models/biogpt/modeling_biogpt.py | 3 + .../models/bit/configuration_bit.py | 3 + src/transformers/models/bit/modeling_bit.py | 3 + .../blenderbot/configuration_blenderbot.py | 3 + .../models/blenderbot/modeling_blenderbot.py | 3 + .../configuration_blenderbot_small.py | 2 + .../modeling_blenderbot_small.py | 3 + .../models/blip/configuration_blip.py | 3 + src/transformers/models/blip/modeling_blip.py | 3 + .../models/blip/modeling_tf_blip.py | 3 + .../models/blip_2/configuration_blip_2.py | 3 + .../models/blip_2/modeling_blip_2.py | 3 + .../models/bloom/configuration_bloom.py | 3 + .../models/bloom/modeling_bloom.py | 3 + .../bridgetower/configuration_bridgetower.py | 3 + .../bridgetower/modeling_bridgetower.py | 3 + .../models/bros/configuration_bros.py | 3 + src/transformers/models/bros/modeling_bros.py | 3 + .../camembert/configuration_camembert.py | 3 + .../models/camembert/modeling_camembert.py | 3 + .../models/camembert/modeling_tf_camembert.py | 3 + .../models/canine/configuration_canine.py | 3 + .../models/canine/modeling_canine.py | 3 + .../configuration_chinese_clip.py | 3 + .../chinese_clip/modeling_chinese_clip.py | 3 + src/transformers/models/clap/modeling_clap.py | 3 + .../models/clip/configuration_clip.py | 3 + src/transformers/models/clip/modeling_clip.py | 3 + .../models/clip/modeling_tf_clip.py | 3 + .../models/clipseg/configuration_clipseg.py | 3 + .../models/clipseg/modeling_clipseg.py | 3 + .../models/clvp/configuration_clvp.py | 3 + src/transformers/models/clvp/modeling_clvp.py | 3 + .../models/codegen/configuration_codegen.py | 3 + .../models/codegen/modeling_codegen.py | 3 + .../configuration_conditional_detr.py | 3 + .../modeling_conditional_detr.py | 3 + .../models/convbert/configuration_convbert.py | 3 + .../models/convbert/modeling_convbert.py | 3 + .../models/convbert/modeling_tf_convbert.py | 3 + .../models/convnext/configuration_convnext.py | 3 + .../models/convnext/modeling_convnext.py | 3 + .../convnextv2/configuration_convnextv2.py | 3 + .../models/convnextv2/modeling_convnextv2.py | 3 + .../models/cpmant/configuration_cpmant.py | 3 + .../models/cpmant/modeling_cpmant.py | 3 + .../models/ctrl/configuration_ctrl.py | 3 + src/transformers/models/ctrl/modeling_ctrl.py | 3 + .../models/ctrl/modeling_tf_ctrl.py | 3 + .../models/cvt/configuration_cvt.py | 3 + src/transformers/models/cvt/modeling_cvt.py | 3 + .../models/cvt/modeling_tf_cvt.py | 3 + .../data2vec/configuration_data2vec_text.py | 3 + .../data2vec/configuration_data2vec_vision.py | 3 + .../data2vec/modeling_data2vec_audio.py | 3 + .../models/data2vec/modeling_data2vec_text.py | 3 + .../data2vec/modeling_data2vec_vision.py | 3 + .../models/deberta/configuration_deberta.py | 3 + .../models/deberta/modeling_deberta.py | 3 + .../models/deberta/modeling_tf_deberta.py | 3 + .../deberta_v2/configuration_deberta_v2.py | 3 + .../models/deberta_v2/modeling_deberta_v2.py | 3 + .../deberta_v2/modeling_tf_deberta_v2.py | 3 + .../configuration_decision_transformer.py | 3 + .../modeling_decision_transformer.py | 3 + .../configuration_deformable_detr.py | 3 + .../modeling_deformable_detr.py | 3 + .../models/deit/configuration_deit.py | 3 + src/transformers/models/deit/modeling_deit.py | 3 + .../models/deit/modeling_tf_deit.py | 3 + .../models/deprecated/_archive_maps.py | 5225 +++++++++-------- .../deprecated/mctct/configuration_mctct.py | 3 + .../models/deprecated/mctct/modeling_mctct.py | 3 + .../open_llama/configuration_open_llama.py | 3 + .../retribert/configuration_retribert.py | 2 + .../retribert/modeling_retribert.py | 3 + .../configuration_trajectory_transformer.py | 3 + .../modeling_trajectory_transformer.py | 3 + .../transfo_xl/configuration_transfo_xl.py | 3 + .../transfo_xl/modeling_tf_transfo_xl.py | 3 + .../transfo_xl/modeling_transfo_xl.py | 3 + .../deprecated/van/configuration_van.py | 3 + .../models/deprecated/van/modeling_van.py | 3 + .../configuration_depth_anything.py | 3 + .../depth_anything/modeling_depth_anything.py | 3 + .../models/deta/configuration_deta.py | 3 + src/transformers/models/deta/modeling_deta.py | 3 + .../models/detr/configuration_detr.py | 3 + src/transformers/models/detr/modeling_detr.py | 3 + .../models/dinat/configuration_dinat.py | 3 + .../models/dinat/modeling_dinat.py | 3 + .../models/dinov2/configuration_dinov2.py | 3 + .../models/dinov2/modeling_dinov2.py | 3 + .../distilbert/configuration_distilbert.py | 3 + .../models/distilbert/modeling_distilbert.py | 3 + .../distilbert/modeling_tf_distilbert.py | 3 + .../models/donut/configuration_donut_swin.py | 3 + .../models/donut/modeling_donut_swin.py | 3 + .../models/dpr/configuration_dpr.py | 3 + src/transformers/models/dpr/modeling_dpr.py | 7 + .../models/dpr/modeling_tf_dpr.py | 7 + .../models/dpt/configuration_dpt.py | 3 + src/transformers/models/dpt/modeling_dpt.py | 3 + .../configuration_efficientformer.py | 3 + .../modeling_efficientformer.py | 3 + .../modeling_tf_efficientformer.py | 3 + .../configuration_efficientnet.py | 3 + .../efficientnet/modeling_efficientnet.py | 3 + .../models/electra/configuration_electra.py | 3 + .../models/electra/modeling_electra.py | 3 + .../models/electra/modeling_tf_electra.py | 3 + .../models/encodec/configuration_encodec.py | 3 + .../models/encodec/modeling_encodec.py | 3 + .../models/ernie/configuration_ernie.py | 3 + .../models/ernie/modeling_ernie.py | 3 + .../models/ernie_m/configuration_ernie_m.py | 1 + .../models/ernie_m/modeling_ernie_m.py | 3 + .../models/esm/configuration_esm.py | 2 + src/transformers/models/esm/modeling_esm.py | 3 + .../models/falcon/configuration_falcon.py | 3 + .../models/falcon/modeling_falcon.py | 3 + .../configuration_fastspeech2_conformer.py | 7 + .../modeling_fastspeech2_conformer.py | 3 + .../models/flaubert/configuration_flaubert.py | 3 + .../models/flaubert/modeling_flaubert.py | 3 + .../models/flaubert/modeling_tf_flaubert.py | 3 + .../models/flava/configuration_flava.py | 3 + .../models/flava/modeling_flava.py | 4 + .../models/fnet/configuration_fnet.py | 3 + src/transformers/models/fnet/modeling_fnet.py | 3 + .../models/focalnet/configuration_focalnet.py | 3 + .../models/focalnet/modeling_focalnet.py | 3 + .../models/fsmt/configuration_fsmt.py | 3 + .../models/funnel/configuration_funnel.py | 3 + .../models/funnel/modeling_funnel.py | 3 + .../models/funnel/modeling_tf_funnel.py | 3 + .../models/fuyu/configuration_fuyu.py | 3 + .../models/gemma/configuration_gemma.py | 3 + .../models/git/configuration_git.py | 3 + src/transformers/models/git/modeling_git.py | 3 + .../models/glpn/configuration_glpn.py | 3 + src/transformers/models/glpn/modeling_glpn.py | 3 + .../models/gpt2/configuration_gpt2.py | 3 + src/transformers/models/gpt2/modeling_gpt2.py | 3 + .../models/gpt2/modeling_tf_gpt2.py | 3 + .../gpt_bigcode/configuration_gpt_bigcode.py | 3 + .../gpt_bigcode/modeling_gpt_bigcode.py | 3 + .../models/gpt_neo/configuration_gpt_neo.py | 3 + .../models/gpt_neo/modeling_gpt_neo.py | 3 + .../models/gpt_neox/configuration_gpt_neox.py | 3 + .../models/gpt_neox/modeling_gpt_neox.py | 3 + .../configuration_gpt_neox_japanese.py | 3 + .../modeling_gpt_neox_japanese.py | 3 + .../models/gptj/configuration_gptj.py | 3 + src/transformers/models/gptj/modeling_gptj.py | 3 + .../configuration_gptsan_japanese.py | 3 + .../modeling_gptsan_japanese.py | 2 + .../graphormer/configuration_graphormer.py | 3 + .../models/graphormer/modeling_graphormer.py | 3 + .../models/groupvit/configuration_groupvit.py | 3 + .../models/groupvit/modeling_groupvit.py | 3 + .../models/groupvit/modeling_tf_groupvit.py | 3 + .../models/hubert/configuration_hubert.py | 3 + .../models/hubert/modeling_hubert.py | 3 + .../models/hubert/modeling_tf_hubert.py | 3 + .../models/ibert/configuration_ibert.py | 3 + .../models/ibert/modeling_ibert.py | 3 + .../models/idefics/configuration_idefics.py | 3 + .../models/idefics/modeling_idefics.py | 3 + .../models/imagegpt/configuration_imagegpt.py | 3 + .../models/imagegpt/modeling_imagegpt.py | 3 + .../models/informer/configuration_informer.py | 3 + .../models/informer/modeling_informer.py | 3 + .../configuration_instructblip.py | 3 + .../instructblip/modeling_instructblip.py | 3 + .../models/jukebox/configuration_jukebox.py | 3 + .../models/jukebox/modeling_jukebox.py | 3 + .../models/kosmos2/configuration_kosmos2.py | 3 + .../models/kosmos2/modeling_kosmos2.py | 3 + .../models/layoutlm/configuration_layoutlm.py | 3 + .../models/layoutlm/modeling_layoutlm.py | 3 + .../models/layoutlm/modeling_tf_layoutlm.py | 3 + .../layoutlmv2/configuration_layoutlmv2.py | 3 + .../models/layoutlmv2/modeling_layoutlmv2.py | 3 + .../layoutlmv3/configuration_layoutlmv3.py | 3 + .../models/layoutlmv3/modeling_layoutlmv3.py | 3 + .../layoutlmv3/modeling_tf_layoutlmv3.py | 3 + .../models/led/configuration_led.py | 3 + src/transformers/models/led/modeling_led.py | 3 + .../models/levit/configuration_levit.py | 3 + .../models/levit/modeling_levit.py | 3 + .../models/lilt/configuration_lilt.py | 3 + src/transformers/models/lilt/modeling_lilt.py | 3 + .../models/llama/configuration_llama.py | 3 + .../models/llava/configuration_llava.py | 3 + .../models/llava/modeling_llava.py | 3 + .../longformer/configuration_longformer.py | 3 + .../models/longformer/modeling_longformer.py | 3 + .../longformer/modeling_tf_longformer.py | 3 + .../models/longt5/configuration_longt5.py | 3 + .../models/longt5/modeling_longt5.py | 2 + .../models/luke/configuration_luke.py | 3 + src/transformers/models/luke/modeling_luke.py | 3 + .../models/lxmert/configuration_lxmert.py | 3 + .../models/lxmert/modeling_tf_lxmert.py | 3 + .../models/m2m_100/configuration_m2m_100.py | 3 + .../models/m2m_100/modeling_m2m_100.py | 3 + .../models/mamba/configuration_mamba.py | 3 + .../models/mamba/modeling_mamba.py | 2 + .../models/markuplm/configuration_markuplm.py | 3 + .../models/markuplm/modeling_markuplm.py | 3 + .../mask2former/configuration_mask2former.py | 1 + .../mask2former/modeling_mask2former.py | 3 + .../maskformer/configuration_maskformer.py | 1 + .../models/maskformer/modeling_maskformer.py | 3 + .../models/mega/configuration_mega.py | 3 + src/transformers/models/mega/modeling_mega.py | 3 + .../configuration_megatron_bert.py | 3 + .../megatron_bert/modeling_megatron_bert.py | 3 + .../models/mgp_str/configuration_mgp_str.py | 3 + .../models/mgp_str/modeling_mgp_str.py | 3 + .../models/mistral/configuration_mistral.py | 3 + .../models/mixtral/configuration_mixtral.py | 3 + .../mobilebert/configuration_mobilebert.py | 3 + .../models/mobilebert/modeling_mobilebert.py | 3 + .../mobilebert/modeling_tf_mobilebert.py | 3 + .../configuration_mobilenet_v1.py | 3 + .../mobilenet_v1/modeling_mobilenet_v1.py | 3 + .../configuration_mobilenet_v2.py | 3 + .../mobilenet_v2/modeling_mobilenet_v2.py | 3 + .../mobilevit/configuration_mobilevit.py | 3 + .../models/mobilevit/modeling_mobilevit.py | 3 + .../models/mobilevit/modeling_tf_mobilevit.py | 3 + .../mobilevitv2/configuration_mobilevitv2.py | 3 + .../mobilevitv2/modeling_mobilevitv2.py | 3 + .../models/mpnet/configuration_mpnet.py | 3 + .../models/mpnet/modeling_mpnet.py | 3 + .../models/mpnet/modeling_tf_mpnet.py | 3 + .../models/mpt/configuration_mpt.py | 3 + src/transformers/models/mpt/modeling_mpt.py | 3 + .../models/mra/configuration_mra.py | 3 + src/transformers/models/mra/modeling_mra.py | 3 + .../models/musicgen/configuration_musicgen.py | 3 + .../models/musicgen/modeling_musicgen.py | 3 + src/transformers/models/mvp/modeling_mvp.py | 3 + .../models/nat/configuration_nat.py | 3 + src/transformers/models/nat/modeling_nat.py | 3 + .../models/nezha/configuration_nezha.py | 1 + .../models/nezha/modeling_nezha.py | 3 + .../models/nllb_moe/configuration_nllb_moe.py | 3 + .../models/nllb_moe/modeling_nllb_moe.py | 2 + .../configuration_nystromformer.py | 3 + .../nystromformer/modeling_nystromformer.py | 3 + .../oneformer/configuration_oneformer.py | 3 + .../models/oneformer/modeling_oneformer.py | 3 + .../models/openai/configuration_openai.py | 3 + .../models/openai/modeling_openai.py | 3 + .../models/openai/modeling_tf_openai.py | 3 + src/transformers/models/opt/modeling_opt.py | 3 + .../models/owlv2/configuration_owlv2.py | 3 + .../models/owlv2/modeling_owlv2.py | 2 + .../models/owlvit/configuration_owlvit.py | 3 + .../models/owlvit/modeling_owlvit.py | 2 + .../configuration_patchtsmixer.py | 3 + .../patchtsmixer/modeling_patchtsmixer.py | 3 + .../models/patchtst/configuration_patchtst.py | 3 + .../models/patchtst/modeling_patchtst.py | 3 + .../models/pegasus/configuration_pegasus.py | 3 + .../pegasus_x/configuration_pegasus_x.py | 3 + .../models/pegasus_x/modeling_pegasus_x.py | 3 + .../perceiver/configuration_perceiver.py | 3 + .../models/perceiver/modeling_perceiver.py | 3 + .../persimmon/configuration_persimmon.py | 3 + .../models/phi/configuration_phi.py | 3 + src/transformers/models/phi/modeling_phi.py | 3 + .../pix2struct/configuration_pix2struct.py | 3 + .../models/pix2struct/modeling_pix2struct.py | 3 + .../models/plbart/configuration_plbart.py | 3 + .../models/plbart/modeling_plbart.py | 3 + .../poolformer/configuration_poolformer.py | 3 + .../models/poolformer/modeling_poolformer.py | 3 + .../pop2piano/configuration_pop2piano.py | 3 + .../models/pop2piano/modeling_pop2piano.py | 3 + .../prophetnet/configuration_prophetnet.py | 3 + .../models/prophetnet/modeling_prophetnet.py | 3 + .../models/pvt/configuration_pvt.py | 3 + src/transformers/models/pvt/modeling_pvt.py | 3 + .../models/qdqbert/configuration_qdqbert.py | 3 + .../models/qdqbert/modeling_qdqbert.py | 3 + .../models/qwen2/configuration_qwen2.py | 3 + .../models/realm/configuration_realm.py | 3 + .../models/realm/modeling_realm.py | 3 + .../models/reformer/configuration_reformer.py | 3 + .../models/reformer/modeling_reformer.py | 3 + .../models/regnet/configuration_regnet.py | 3 + .../models/regnet/modeling_regnet.py | 3 + .../models/regnet/modeling_tf_regnet.py | 3 + .../models/rembert/configuration_rembert.py | 3 + .../models/rembert/modeling_rembert.py | 3 + .../models/rembert/modeling_tf_rembert.py | 3 + .../models/resnet/configuration_resnet.py | 3 + .../models/resnet/modeling_resnet.py | 3 + .../models/resnet/modeling_tf_resnet.py | 3 + .../models/roberta/configuration_roberta.py | 3 + .../models/roberta/modeling_roberta.py | 3 + .../models/roberta/modeling_tf_roberta.py | 3 + .../configuration_roberta_prelayernorm.py | 3 + .../modeling_roberta_prelayernorm.py | 3 + .../modeling_tf_roberta_prelayernorm.py | 3 + .../models/roc_bert/configuration_roc_bert.py | 3 + .../models/roc_bert/modeling_roc_bert.py | 2 + .../models/roformer/configuration_roformer.py | 3 + .../models/roformer/modeling_roformer.py | 3 + .../models/roformer/modeling_tf_roformer.py | 3 + .../models/rwkv/configuration_rwkv.py | 3 + src/transformers/models/rwkv/modeling_rwkv.py | 3 + .../models/sam/configuration_sam.py | 3 + src/transformers/models/sam/modeling_sam.py | 3 + .../models/sam/modeling_tf_sam.py | 3 + .../configuration_seamless_m4t.py | 3 + .../seamless_m4t/modeling_seamless_m4t.py | 6 + .../configuration_seamless_m4t_v2.py | 3 + .../modeling_seamless_m4t_v2.py | 8 + .../segformer/configuration_segformer.py | 3 + .../models/segformer/modeling_segformer.py | 3 + .../models/segformer/modeling_tf_segformer.py | 3 + .../models/seggpt/configuration_seggpt.py | 3 + .../models/seggpt/modeling_seggpt.py | 3 + .../models/sew/configuration_sew.py | 3 + src/transformers/models/sew/modeling_sew.py | 3 + .../models/sew_d/configuration_sew_d.py | 3 + .../models/sew_d/modeling_sew_d.py | 3 + .../models/siglip/configuration_siglip.py | 3 + .../models/siglip/modeling_siglip.py | 3 + .../configuration_speech_to_text.py | 3 + .../speech_to_text/modeling_speech_to_text.py | 3 + .../modeling_tf_speech_to_text.py | 3 + .../configuration_speech_to_text_2.py | 3 + .../models/speecht5/configuration_speecht5.py | 8 + .../models/speecht5/modeling_speecht5.py | 3 + .../models/splinter/configuration_splinter.py | 3 + .../models/splinter/modeling_splinter.py | 3 + .../squeezebert/configuration_squeezebert.py | 3 + .../squeezebert/modeling_squeezebert.py | 3 + .../models/stablelm/configuration_stablelm.py | 3 + .../starcoder2/configuration_starcoder2.py | 3 + .../swiftformer/configuration_swiftformer.py | 3 + .../swiftformer/modeling_swiftformer.py | 3 + .../models/swin/configuration_swin.py | 3 + src/transformers/models/swin/modeling_swin.py | 3 + .../models/swin/modeling_tf_swin.py | 3 + .../models/swin2sr/configuration_swin2sr.py | 3 + .../models/swin2sr/modeling_swin2sr.py | 3 + .../models/swinv2/configuration_swinv2.py | 3 + .../models/swinv2/modeling_swinv2.py | 3 + .../configuration_switch_transformers.py | 3 + .../modeling_switch_transformers.py | 2 + .../models/t5/configuration_t5.py | 3 + src/transformers/models/t5/modeling_t5.py | 2 + src/transformers/models/t5/modeling_tf_t5.py | 3 + .../configuration_table_transformer.py | 3 + .../modeling_table_transformer.py | 3 + .../models/tapas/configuration_tapas.py | 1 + .../models/tapas/modeling_tapas.py | 3 + .../models/tapas/modeling_tf_tapas.py | 3 + .../configuration_time_series_transformer.py | 3 + .../modeling_time_series_transformer.py | 3 + .../timesformer/configuration_timesformer.py | 3 + .../timesformer/modeling_timesformer.py | 3 + .../models/trocr/configuration_trocr.py | 3 + .../models/trocr/modeling_trocr.py | 3 + .../models/tvlt/configuration_tvlt.py | 3 + src/transformers/models/tvlt/modeling_tvlt.py | 3 + .../models/tvp/configuration_tvp.py | 3 + src/transformers/models/tvp/modeling_tvp.py | 3 + .../models/udop/configuration_udop.py | 3 + src/transformers/models/udop/modeling_udop.py | 3 + .../unispeech/configuration_unispeech.py | 3 + .../models/unispeech/modeling_unispeech.py | 3 + .../configuration_unispeech_sat.py | 3 + .../unispeech_sat/modeling_unispeech_sat.py | 3 + .../models/univnet/configuration_univnet.py | 3 + .../models/univnet/modeling_univnet.py | 3 + .../models/videomae/configuration_videomae.py | 3 + .../models/videomae/modeling_videomae.py | 3 + .../models/vilt/configuration_vilt.py | 3 + src/transformers/models/vilt/modeling_vilt.py | 3 + .../models/vipllava/configuration_vipllava.py | 3 + .../models/vipllava/modeling_vipllava.py | 3 + .../visual_bert/configuration_visual_bert.py | 3 + .../visual_bert/modeling_visual_bert.py | 3 + .../models/vit/configuration_vit.py | 3 + src/transformers/models/vit/modeling_vit.py | 3 + .../vit_hybrid/configuration_vit_hybrid.py | 3 + .../models/vit_hybrid/modeling_vit_hybrid.py | 3 + .../models/vit_mae/configuration_vit_mae.py | 3 + .../models/vit_mae/modeling_vit_mae.py | 3 + .../models/vit_msn/configuration_vit_msn.py | 3 + .../models/vit_msn/modeling_vit_msn.py | 2 + .../models/vitdet/configuration_vitdet.py | 3 + .../models/vitdet/modeling_vitdet.py | 3 + .../models/vitmatte/configuration_vitmatte.py | 3 + .../models/vitmatte/modeling_vitmatte.py | 1 + .../models/vits/configuration_vits.py | 3 + src/transformers/models/vits/modeling_vits.py | 3 + .../models/vivit/configuration_vivit.py | 3 + .../models/vivit/modeling_vivit.py | 3 + .../models/wav2vec2/configuration_wav2vec2.py | 3 + .../models/wav2vec2/modeling_tf_wav2vec2.py | 3 + .../models/wav2vec2/modeling_wav2vec2.py | 3 + .../configuration_wav2vec2_bert.py | 3 + .../wav2vec2_bert/modeling_wav2vec2_bert.py | 3 + .../configuration_wav2vec2_conformer.py | 3 + .../modeling_wav2vec2_conformer.py | 3 + .../models/wavlm/configuration_wavlm.py | 3 + .../models/wavlm/modeling_wavlm.py | 3 + .../models/whisper/configuration_whisper.py | 3 + .../models/whisper/modeling_tf_whisper.py | 3 + .../models/whisper/modeling_whisper.py | 3 + .../models/x_clip/configuration_x_clip.py | 3 + .../models/x_clip/modeling_x_clip.py | 3 + .../models/xglm/configuration_xglm.py | 3 + .../models/xglm/modeling_tf_xglm.py | 3 + src/transformers/models/xglm/modeling_xglm.py | 3 + .../models/xlm/configuration_xlm.py | 3 + .../models/xlm/modeling_tf_xlm.py | 3 + src/transformers/models/xlm/modeling_xlm.py | 3 + .../configuration_xlm_prophetnet.py | 3 + .../xlm_prophetnet/modeling_xlm_prophetnet.py | 3 + .../xlm_roberta/configuration_xlm_roberta.py | 3 + .../xlm_roberta/modeling_flax_xlm_roberta.py | 3 + .../xlm_roberta/modeling_tf_xlm_roberta.py | 3 + .../xlm_roberta/modeling_xlm_roberta.py | 3 + .../configuration_xlm_roberta_xl.py | 3 + .../xlm_roberta_xl/modeling_xlm_roberta_xl.py | 3 + .../models/xlnet/configuration_xlnet.py | 3 + .../models/xlnet/modeling_tf_xlnet.py | 3 + .../models/xlnet/modeling_xlnet.py | 3 + .../models/xmod/configuration_xmod.py | 3 + src/transformers/models/xmod/modeling_xmod.py | 3 + .../models/yolos/configuration_yolos.py | 3 + .../models/yolos/modeling_yolos.py | 3 + .../models/yoso/configuration_yoso.py | 3 + src/transformers/models/yoso/modeling_yoso.py | 3 + src/transformers/utils/dummy_flax_objects.py | 3 + src/transformers/utils/dummy_pt_objects.py | 618 ++ src/transformers/utils/dummy_tf_objects.py | 150 + tests/models/bloom/test_tokenization_bloom.py | 7 - tests/models/byt5/test_tokenization_byt5.py | 4 - .../models/canine/test_tokenization_canine.py | 4 - tests/models/gemma/test_tokenization_gemma.py | 4 - .../m2m_100/test_tokenization_m2m_100.py | 4 - .../perceiver/test_tokenization_perceiver.py | 4 - .../models/siglip/test_tokenization_siglip.py | 8 - tests/models/t5/test_tokenization_t5.py | 6 - tests/models/tapas/test_tokenization_tapas.py | 4 - tests/models/udop/test_tokenization_udop.py | 4 - .../wav2vec2/test_tokenization_wav2vec2.py | 4 - .../test_tokenization_wav2vec2_phoneme.py | 4 - tests/test_tokenization_common.py | 18 - tests/tokenization/test_tokenization_fast.py | 5 - 486 files changed, 4867 insertions(+), 2616 deletions(-) diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py index 3e0f73f30356fc..f46feafa8b3a0c 100644 --- a/src/transformers/__init__.py +++ b/src/transformers/__init__.py @@ -24,6 +24,7 @@ # Check the dependencies satisfy the minimal versions required. from . import dependency_versions_check +from .models.deprecated._archive_maps import * from .utils import ( OptionalDependencyNotAvailable, _LazyModule, @@ -48,8 +49,6 @@ logging, ) -from .models.deprecated._archive_maps import * - logger = logging.get_logger(__name__) # pylint: disable=invalid-name diff --git a/src/transformers/models/albert/configuration_albert.py b/src/transformers/models/albert/configuration_albert.py index 492ca2f65b33ee..c5ddded4833481 100644 --- a/src/transformers/models/albert/configuration_albert.py +++ b/src/transformers/models/albert/configuration_albert.py @@ -19,6 +19,7 @@ from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig +from ..deprecated._archive_maps import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 class AlbertConfig(PretrainedConfig): diff --git a/src/transformers/models/albert/modeling_albert.py b/src/transformers/models/albert/modeling_albert.py index 49324d58e12872..87f5a9e30c8f54 100755 --- a/src/transformers/models/albert/modeling_albert.py +++ b/src/transformers/models/albert/modeling_albert.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "AlbertConfig" +from ..deprecated._archive_maps import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_albert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/albert/modeling_tf_albert.py b/src/transformers/models/albert/modeling_tf_albert.py index ad2c2d637a0143..5aa521bb73dea7 100644 --- a/src/transformers/models/albert/modeling_tf_albert.py +++ b/src/transformers/models/albert/modeling_tf_albert.py @@ -66,6 +66,9 @@ _CONFIG_FOR_DOC = "AlbertConfig" +from ..deprecated._archive_maps import TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFAlbertPreTrainingLoss: """ Loss function suitable for ALBERT pretraining, that is, the task of pretraining a language model by combining SOP + diff --git a/src/transformers/models/align/configuration_align.py b/src/transformers/models/align/configuration_align.py index 9e96f5d15a1d35..a4b3149d971a15 100644 --- a/src/transformers/models/align/configuration_align.py +++ b/src/transformers/models/align/configuration_align.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class AlignTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`AlignTextModel`]. It is used to instantiate a diff --git a/src/transformers/models/align/modeling_align.py b/src/transformers/models/align/modeling_align.py index 137b505d03cb1e..c6789fb1f4f505 100644 --- a/src/transformers/models/align/modeling_align.py +++ b/src/transformers/models/align/modeling_align.py @@ -47,6 +47,9 @@ _CONFIG_FOR_DOC = "AlignConfig" +from ..deprecated._archive_maps import ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + ALIGN_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads diff --git a/src/transformers/models/altclip/configuration_altclip.py b/src/transformers/models/altclip/configuration_altclip.py index d6e533e1f8101d..590f2b526e8c4b 100755 --- a/src/transformers/models/altclip/configuration_altclip.py +++ b/src/transformers/models/altclip/configuration_altclip.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class AltCLIPTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`AltCLIPTextModel`]. It is used to instantiate a diff --git a/src/transformers/models/altclip/modeling_altclip.py b/src/transformers/models/altclip/modeling_altclip.py index fbd208a99e3892..0d27d87de7f4f1 100755 --- a/src/transformers/models/altclip/modeling_altclip.py +++ b/src/transformers/models/altclip/modeling_altclip.py @@ -41,6 +41,9 @@ _CONFIG_FOR_DOC = "AltCLIPConfig" +from ..deprecated._archive_maps import ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + ALTCLIP_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads diff --git a/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py b/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py index 158f1ee5d97034..94a7af6006fd7d 100644 --- a/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py +++ b/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ASTConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ASTModel`]. It is used to instantiate an AST diff --git a/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py b/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py index 1d70e57c2fd128..5ec18e2c7f16b2 100644 --- a/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py +++ b/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py @@ -45,6 +45,9 @@ _SEQ_CLASS_EXPECTED_LOSS = 0.17 +from ..deprecated._archive_maps import AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class ASTEmbeddings(nn.Module): """ Construct the CLS token, position and patch embeddings. diff --git a/src/transformers/models/auto/configuration_auto.py b/src/transformers/models/auto/configuration_auto.py index 86101639ea3e88..40639d8d837b01 100755 --- a/src/transformers/models/auto/configuration_auto.py +++ b/src/transformers/models/auto/configuration_auto.py @@ -27,6 +27,10 @@ logger = logging.get_logger(__name__) + +from ..deprecated._archive_maps import CONFIG_ARCHIVE_MAP_MAPPING_NAMES # noqa: F401, E402 + + CONFIG_MAPPING_NAMES = OrderedDict( [ # Add configs here @@ -960,3 +964,6 @@ def register(model_type, config, exist_ok=False): "match!" ) CONFIG_MAPPING.register(model_type, config, exist_ok=exist_ok) + + +ALL_PRETRAINED_CONFIG_ARCHIVE_MAP = _LazyLoadAllMappings(CONFIG_ARCHIVE_MAP_MAPPING_NAMES) diff --git a/src/transformers/models/autoformer/configuration_autoformer.py b/src/transformers/models/autoformer/configuration_autoformer.py index 4f499fd1cb6340..11909ac5c38c4c 100644 --- a/src/transformers/models/autoformer/configuration_autoformer.py +++ b/src/transformers/models/autoformer/configuration_autoformer.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class AutoformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`AutoformerModel`]. It is used to instantiate an diff --git a/src/transformers/models/autoformer/modeling_autoformer.py b/src/transformers/models/autoformer/modeling_autoformer.py index d7e1d7a4a33a70..8a993fad32785f 100644 --- a/src/transformers/models/autoformer/modeling_autoformer.py +++ b/src/transformers/models/autoformer/modeling_autoformer.py @@ -167,6 +167,9 @@ class AutoformerModelOutput(ModelOutput): static_features: Optional[torch.FloatTensor] = None +from ..deprecated._archive_maps import AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.time_series_transformer.modeling_time_series_transformer.TimeSeriesFeatureEmbedder with TimeSeries->Autoformer class AutoformerFeatureEmbedder(nn.Module): """ diff --git a/src/transformers/models/bark/modeling_bark.py b/src/transformers/models/bark/modeling_bark.py index bce2bdc794de7c..de04614075cf80 100644 --- a/src/transformers/models/bark/modeling_bark.py +++ b/src/transformers/models/bark/modeling_bark.py @@ -64,6 +64,9 @@ _CONFIG_FOR_DOC = "BarkConfig" +from ..deprecated._archive_maps import BARK_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/bart/modeling_bart.py b/src/transformers/models/bart/modeling_bart.py index c333d6e67615c1..535f380cd09b10 100755 --- a/src/transformers/models/bart/modeling_bart.py +++ b/src/transformers/models/bart/modeling_bart.py @@ -78,6 +78,9 @@ _QA_EXPECTED_OUTPUT = "' nice puppet'" +from ..deprecated._archive_maps import BART_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/beit/configuration_beit.py b/src/transformers/models/beit/configuration_beit.py index 4664bdc898fba3..dbb1e755e94b36 100644 --- a/src/transformers/models/beit/configuration_beit.py +++ b/src/transformers/models/beit/configuration_beit.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BeitConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BeitModel`]. It is used to instantiate an BEiT diff --git a/src/transformers/models/beit/modeling_beit.py b/src/transformers/models/beit/modeling_beit.py index b2d9bcf61f9ac7..d04717039ec909 100755 --- a/src/transformers/models/beit/modeling_beit.py +++ b/src/transformers/models/beit/modeling_beit.py @@ -61,6 +61,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import BEIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class BeitModelOutputWithPooling(BaseModelOutputWithPooling): """ diff --git a/src/transformers/models/bert/configuration_bert.py b/src/transformers/models/bert/configuration_bert.py index 7ad3536c96e789..e692f8284c2bac 100644 --- a/src/transformers/models/bert/configuration_bert.py +++ b/src/transformers/models/bert/configuration_bert.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BertModel`] or a [`TFBertModel`]. It is used to diff --git a/src/transformers/models/bert/modeling_bert.py b/src/transformers/models/bert/modeling_bert.py index e4ead7ac211639..1b06c375780b71 100755 --- a/src/transformers/models/bert/modeling_bert.py +++ b/src/transformers/models/bert/modeling_bert.py @@ -77,6 +77,9 @@ _SEQ_CLASS_EXPECTED_LOSS = 0.01 +from ..deprecated._archive_maps import BERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_bert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/bert/modeling_tf_bert.py b/src/transformers/models/bert/modeling_tf_bert.py index 89885887c96a4c..9d027d84316582 100644 --- a/src/transformers/models/bert/modeling_tf_bert.py +++ b/src/transformers/models/bert/modeling_tf_bert.py @@ -90,6 +90,9 @@ _SEQ_CLASS_EXPECTED_LOSS = 0.01 +from ..deprecated._archive_maps import TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFBertPreTrainingLoss: """ Loss function suitable for BERT-like pretraining, that is, the task of pretraining a language model by combining diff --git a/src/transformers/models/big_bird/configuration_big_bird.py b/src/transformers/models/big_bird/configuration_big_bird.py index dfd36d82c37c3a..f803d56839d744 100644 --- a/src/transformers/models/big_bird/configuration_big_bird.py +++ b/src/transformers/models/big_bird/configuration_big_bird.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BigBirdConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BigBirdModel`]. It is used to instantiate an diff --git a/src/transformers/models/big_bird/modeling_big_bird.py b/src/transformers/models/big_bird/modeling_big_bird.py index 28cb2ddf535ac1..510c98079501ef 100755 --- a/src/transformers/models/big_bird/modeling_big_bird.py +++ b/src/transformers/models/big_bird/modeling_big_bird.py @@ -55,6 +55,9 @@ _CONFIG_FOR_DOC = "BigBirdConfig" +from ..deprecated._archive_maps import BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + _TRIVIA_QA_MAPPING = { "big_bird_attention": "attention/self", "output_layer_norm": "output/LayerNorm", diff --git a/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py b/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py index c548573f322d36..5cdcbca775bf4d 100644 --- a/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py +++ b/src/transformers/models/bigbird_pegasus/configuration_bigbird_pegasus.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BigBirdPegasusConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BigBirdPegasusModel`]. It is used to instantiate diff --git a/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py b/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py index 552a8e760b2a54..b863beb75e18c3 100755 --- a/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py +++ b/src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py @@ -54,6 +54,9 @@ _EXPECTED_OUTPUT_SHAPE = [1, 7, 1024] +from ..deprecated._archive_maps import BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ Shift input ids one token to the right. diff --git a/src/transformers/models/biogpt/configuration_biogpt.py b/src/transformers/models/biogpt/configuration_biogpt.py index 936fee76328f4d..1b4155c0aea3bb 100644 --- a/src/transformers/models/biogpt/configuration_biogpt.py +++ b/src/transformers/models/biogpt/configuration_biogpt.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BioGptConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BioGptModel`]. It is used to instantiate an diff --git a/src/transformers/models/biogpt/modeling_biogpt.py b/src/transformers/models/biogpt/modeling_biogpt.py index 8a1668ce3d782f..30df3e0847a631 100755 --- a/src/transformers/models/biogpt/modeling_biogpt.py +++ b/src/transformers/models/biogpt/modeling_biogpt.py @@ -47,6 +47,9 @@ _CONFIG_FOR_DOC = "BioGptConfig" +from ..deprecated._archive_maps import BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.opt.modeling_opt.OPTLearnedPositionalEmbedding with OPT->BioGpt class BioGptLearnedPositionalEmbedding(nn.Embedding): """ diff --git a/src/transformers/models/bit/configuration_bit.py b/src/transformers/models/bit/configuration_bit.py index f1532a74b9ae0f..2ec6307421bfaa 100644 --- a/src/transformers/models/bit/configuration_bit.py +++ b/src/transformers/models/bit/configuration_bit.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BitConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BitModel`]. It is used to instantiate an BiT diff --git a/src/transformers/models/bit/modeling_bit.py b/src/transformers/models/bit/modeling_bit.py index 25249a13a7755f..27141a9009e540 100644 --- a/src/transformers/models/bit/modeling_bit.py +++ b/src/transformers/models/bit/modeling_bit.py @@ -57,6 +57,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" +from ..deprecated._archive_maps import BIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def get_padding_value(padding=None, kernel_size=7, stride=1, dilation=1) -> Tuple[Tuple, bool]: r""" Utility function to get the tuple padding value given the kernel_size and padding. diff --git a/src/transformers/models/blenderbot/configuration_blenderbot.py b/src/transformers/models/blenderbot/configuration_blenderbot.py index 6b9a12e02e35b1..00608710592998 100644 --- a/src/transformers/models/blenderbot/configuration_blenderbot.py +++ b/src/transformers/models/blenderbot/configuration_blenderbot.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BlenderbotConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BlenderbotModel`]. It is used to instantiate an diff --git a/src/transformers/models/blenderbot/modeling_blenderbot.py b/src/transformers/models/blenderbot/modeling_blenderbot.py index b85b33c1d00c11..5fa17abcdd294e 100755 --- a/src/transformers/models/blenderbot/modeling_blenderbot.py +++ b/src/transformers/models/blenderbot/modeling_blenderbot.py @@ -53,6 +53,9 @@ _CHECKPOINT_FOR_DOC = "facebook/blenderbot-400M-distill" +from ..deprecated._archive_maps import BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py b/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py index 667db5bd55bc40..8b54bd3760feea 100644 --- a/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py +++ b/src/transformers/models/blenderbot_small/configuration_blenderbot_small.py @@ -27,6 +27,8 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + class BlenderbotSmallConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py b/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py index 504f073ed0bec6..da07669a4e777d 100755 --- a/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py +++ b/src/transformers/models/blenderbot_small/modeling_blenderbot_small.py @@ -49,6 +49,9 @@ _CONFIG_FOR_DOC = "BlenderbotSmallConfig" +from ..deprecated._archive_maps import BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/blip/configuration_blip.py b/src/transformers/models/blip/configuration_blip.py index 1a6fe37aa4f278..2a76660c0f8ead 100644 --- a/src/transformers/models/blip/configuration_blip.py +++ b/src/transformers/models/blip/configuration_blip.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BlipTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BlipTextModel`]. It is used to instantiate a BLIP diff --git a/src/transformers/models/blip/modeling_blip.py b/src/transformers/models/blip/modeling_blip.py index 2d16216590d2a6..39506478f17926 100644 --- a/src/transformers/models/blip/modeling_blip.py +++ b/src/transformers/models/blip/modeling_blip.py @@ -42,6 +42,9 @@ _CHECKPOINT_FOR_DOC = "Salesforce/blip-vqa-base" +from ..deprecated._archive_maps import BLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.clip.modeling_clip.contrastive_loss def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: return nn.functional.cross_entropy(logits, torch.arange(len(logits), device=logits.device)) diff --git a/src/transformers/models/blip/modeling_tf_blip.py b/src/transformers/models/blip/modeling_tf_blip.py index 5312cf2323b2e1..37098467a7ad6c 100644 --- a/src/transformers/models/blip/modeling_tf_blip.py +++ b/src/transformers/models/blip/modeling_tf_blip.py @@ -49,6 +49,9 @@ _CHECKPOINT_FOR_DOC = "Salesforce/blip-vqa-base" +from ..deprecated._archive_maps import TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.clip.modeling_tf_clip.contrastive_loss def contrastive_loss(logits: tf.Tensor) -> tf.Tensor: return tf.math.reduce_mean( diff --git a/src/transformers/models/blip_2/configuration_blip_2.py b/src/transformers/models/blip_2/configuration_blip_2.py index 70dea87d352b27..f5645f5deed57c 100644 --- a/src/transformers/models/blip_2/configuration_blip_2.py +++ b/src/transformers/models/blip_2/configuration_blip_2.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Blip2VisionConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Blip2VisionModel`]. It is used to instantiate a diff --git a/src/transformers/models/blip_2/modeling_blip_2.py b/src/transformers/models/blip_2/modeling_blip_2.py index ace2736933ae54..935e041eb8360d 100644 --- a/src/transformers/models/blip_2/modeling_blip_2.py +++ b/src/transformers/models/blip_2/modeling_blip_2.py @@ -48,6 +48,9 @@ _CHECKPOINT_FOR_DOC = "Salesforce/blip2-opt-2.7b" +from ..deprecated._archive_maps import BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class Blip2ForConditionalGenerationModelOutput(ModelOutput): """ diff --git a/src/transformers/models/bloom/configuration_bloom.py b/src/transformers/models/bloom/configuration_bloom.py index ddea3f720a4d19..e04877485e3f54 100644 --- a/src/transformers/models/bloom/configuration_bloom.py +++ b/src/transformers/models/bloom/configuration_bloom.py @@ -30,6 +30,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BloomConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`BloomModel`]. It is used to instantiate a Bloom diff --git a/src/transformers/models/bloom/modeling_bloom.py b/src/transformers/models/bloom/modeling_bloom.py index 0ef158b1f85f11..05b18f5938106e 100644 --- a/src/transformers/models/bloom/modeling_bloom.py +++ b/src/transformers/models/bloom/modeling_bloom.py @@ -44,6 +44,9 @@ _CONFIG_FOR_DOC = "BloomConfig" +from ..deprecated._archive_maps import BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def build_alibi_tensor(attention_mask: torch.Tensor, num_heads: int, dtype: torch.dtype) -> torch.Tensor: """ Link to paper: https://arxiv.org/abs/2108.12409 Alibi tensor is not causal as the original paper mentions, it diff --git a/src/transformers/models/bridgetower/configuration_bridgetower.py b/src/transformers/models/bridgetower/configuration_bridgetower.py index 8513ce21f7606e..2d3340ad62ab67 100644 --- a/src/transformers/models/bridgetower/configuration_bridgetower.py +++ b/src/transformers/models/bridgetower/configuration_bridgetower.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BridgeTowerVisionConfig(PretrainedConfig): r""" This is the configuration class to store the vision configuration of a [`BridgeTowerModel`]. Instantiating a diff --git a/src/transformers/models/bridgetower/modeling_bridgetower.py b/src/transformers/models/bridgetower/modeling_bridgetower.py index 8e29413d747c06..bcace39b299bcf 100644 --- a/src/transformers/models/bridgetower/modeling_bridgetower.py +++ b/src/transformers/models/bridgetower/modeling_bridgetower.py @@ -45,6 +45,9 @@ _TOKENIZER_FOR_DOC = "RobertaTokenizer" +from ..deprecated._archive_maps import BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + BRIDGETOWER_START_DOCSTRING = r""" This model is a PyTorch `torch.nn.Module `_ subclass. Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and diff --git a/src/transformers/models/bros/configuration_bros.py b/src/transformers/models/bros/configuration_bros.py index 6a1ef6d948e9eb..547bbf39ad2ccd 100644 --- a/src/transformers/models/bros/configuration_bros.py +++ b/src/transformers/models/bros/configuration_bros.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import BROS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class BrosConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`BrosModel`] or a [`TFBrosModel`]. It is used to diff --git a/src/transformers/models/bros/modeling_bros.py b/src/transformers/models/bros/modeling_bros.py index 0f80cec4049ef5..32f0338f0ec061 100755 --- a/src/transformers/models/bros/modeling_bros.py +++ b/src/transformers/models/bros/modeling_bros.py @@ -48,6 +48,9 @@ _CONFIG_FOR_DOC = "BrosConfig" +from ..deprecated._archive_maps import BROS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + BROS_START_DOCSTRING = r""" This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage diff --git a/src/transformers/models/camembert/configuration_camembert.py b/src/transformers/models/camembert/configuration_camembert.py index 124d14abec147b..d29ca067db2790 100644 --- a/src/transformers/models/camembert/configuration_camembert.py +++ b/src/transformers/models/camembert/configuration_camembert.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CamembertConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`CamembertModel`] or a [`TFCamembertModel`]. It is diff --git a/src/transformers/models/camembert/modeling_camembert.py b/src/transformers/models/camembert/modeling_camembert.py index 8e519ab90e0e8b..26250896b23d8a 100644 --- a/src/transformers/models/camembert/modeling_camembert.py +++ b/src/transformers/models/camembert/modeling_camembert.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "CamembertConfig" +from ..deprecated._archive_maps import CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + CAMEMBERT_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/camembert/modeling_tf_camembert.py b/src/transformers/models/camembert/modeling_tf_camembert.py index 9e66f124689808..9ec998593d51b9 100644 --- a/src/transformers/models/camembert/modeling_tf_camembert.py +++ b/src/transformers/models/camembert/modeling_tf_camembert.py @@ -66,6 +66,9 @@ _CONFIG_FOR_DOC = "CamembertConfig" +from ..deprecated._archive_maps import TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + CAMEMBERT_START_DOCSTRING = r""" This model inherits from [`TFPreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/canine/configuration_canine.py b/src/transformers/models/canine/configuration_canine.py index e3d2d1373b9983..c5a77a5c4b47bc 100644 --- a/src/transformers/models/canine/configuration_canine.py +++ b/src/transformers/models/canine/configuration_canine.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CanineConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`CanineModel`]. It is used to instantiate an diff --git a/src/transformers/models/canine/modeling_canine.py b/src/transformers/models/canine/modeling_canine.py index 5454fbcd749184..023287153afc38 100644 --- a/src/transformers/models/canine/modeling_canine.py +++ b/src/transformers/models/canine/modeling_canine.py @@ -53,6 +53,9 @@ _CONFIG_FOR_DOC = "CanineConfig" +from ..deprecated._archive_maps import CANINE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Support up to 16 hash functions. _PRIMES = [31, 43, 59, 61, 73, 97, 103, 113, 137, 149, 157, 173, 181, 193, 211, 223] diff --git a/src/transformers/models/chinese_clip/configuration_chinese_clip.py b/src/transformers/models/chinese_clip/configuration_chinese_clip.py index 0cd73f67f2d121..349833d1f2c335 100644 --- a/src/transformers/models/chinese_clip/configuration_chinese_clip.py +++ b/src/transformers/models/chinese_clip/configuration_chinese_clip.py @@ -31,6 +31,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ChineseCLIPTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ChineseCLIPModel`]. It is used to instantiate a diff --git a/src/transformers/models/chinese_clip/modeling_chinese_clip.py b/src/transformers/models/chinese_clip/modeling_chinese_clip.py index d8efd8334e67f1..d8e97c20b24cd0 100644 --- a/src/transformers/models/chinese_clip/modeling_chinese_clip.py +++ b/src/transformers/models/chinese_clip/modeling_chinese_clip.py @@ -49,6 +49,9 @@ _CONFIG_FOR_DOC = "ChineseCLIPConfig" +from ..deprecated._archive_maps import CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html # Copied from transformers.models.clip.modeling_clip.contrastive_loss def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/clap/modeling_clap.py b/src/transformers/models/clap/modeling_clap.py index 2d8d7e458c1f04..b2c0df4866b15f 100644 --- a/src/transformers/models/clap/modeling_clap.py +++ b/src/transformers/models/clap/modeling_clap.py @@ -45,6 +45,9 @@ _CHECKPOINT_FOR_DOC = "laion/clap-htsat-fused" +from ..deprecated._archive_maps import CLAP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Adapted from: https://github.com/LAION-AI/CLAP/blob/6ad05a971ba0622f6acee8c41993e0d02bbed639/src/open_clip/utils.py#L191 def interpolate(hidden_states, ratio): """ diff --git a/src/transformers/models/clip/configuration_clip.py b/src/transformers/models/clip/configuration_clip.py index 827fe31d5b4533..a48cb73a9715ba 100644 --- a/src/transformers/models/clip/configuration_clip.py +++ b/src/transformers/models/clip/configuration_clip.py @@ -31,6 +31,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CLIPTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`CLIPTextModel`]. It is used to instantiate a CLIP diff --git a/src/transformers/models/clip/modeling_clip.py b/src/transformers/models/clip/modeling_clip.py index 6e4e936f409cfe..a4ce51625ebf76 100644 --- a/src/transformers/models/clip/modeling_clip.py +++ b/src/transformers/models/clip/modeling_clip.py @@ -49,6 +49,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "LABEL_0" +from ..deprecated._archive_maps import CLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # contrastive loss function, adapted from # https://sachinruk.github.io/blog/2021-03-07-clip.html def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/clip/modeling_tf_clip.py b/src/transformers/models/clip/modeling_tf_clip.py index 142141fdc4df4d..c7e8ba7f5c954e 100644 --- a/src/transformers/models/clip/modeling_tf_clip.py +++ b/src/transformers/models/clip/modeling_tf_clip.py @@ -52,6 +52,9 @@ _CHECKPOINT_FOR_DOC = "openai/clip-vit-base-patch32" +from ..deprecated._archive_maps import TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/clipseg/configuration_clipseg.py b/src/transformers/models/clipseg/configuration_clipseg.py index 7df10bfe8cf771..07ba08f4759c93 100644 --- a/src/transformers/models/clipseg/configuration_clipseg.py +++ b/src/transformers/models/clipseg/configuration_clipseg.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CLIPSegTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`CLIPSegModel`]. It is used to instantiate an diff --git a/src/transformers/models/clipseg/modeling_clipseg.py b/src/transformers/models/clipseg/modeling_clipseg.py index a6d63fc92e6128..06e4c83e7e532b 100644 --- a/src/transformers/models/clipseg/modeling_clipseg.py +++ b/src/transformers/models/clipseg/modeling_clipseg.py @@ -43,6 +43,9 @@ _CHECKPOINT_FOR_DOC = "CIDAS/clipseg-rd64-refined" +from ..deprecated._archive_maps import CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # contrastive loss function, adapted from # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/clvp/configuration_clvp.py b/src/transformers/models/clvp/configuration_clvp.py index 505238b2a8a7fb..00906e7d7f86b6 100644 --- a/src/transformers/models/clvp/configuration_clvp.py +++ b/src/transformers/models/clvp/configuration_clvp.py @@ -29,6 +29,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ClvpEncoderConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ClvpEncoder`]. It is used to instantiate a CLVP diff --git a/src/transformers/models/clvp/modeling_clvp.py b/src/transformers/models/clvp/modeling_clvp.py index a36e9822421ecc..654989dcbd6039 100644 --- a/src/transformers/models/clvp/modeling_clvp.py +++ b/src/transformers/models/clvp/modeling_clvp.py @@ -56,6 +56,9 @@ _CHECKPOINT_FOR_DOC = "susnato/clvp_dev" +from ..deprecated._archive_maps import CLVP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.clip.modeling_clip.contrastive_loss def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: return nn.functional.cross_entropy(logits, torch.arange(len(logits), device=logits.device)) diff --git a/src/transformers/models/codegen/configuration_codegen.py b/src/transformers/models/codegen/configuration_codegen.py index db0008a033312b..e16dd1fadcf74a 100644 --- a/src/transformers/models/codegen/configuration_codegen.py +++ b/src/transformers/models/codegen/configuration_codegen.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CodeGenConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`CodeGenModel`]. It is used to instantiate a diff --git a/src/transformers/models/codegen/modeling_codegen.py b/src/transformers/models/codegen/modeling_codegen.py index 7014616d74edd8..41f23900c29a2c 100644 --- a/src/transformers/models/codegen/modeling_codegen.py +++ b/src/transformers/models/codegen/modeling_codegen.py @@ -34,6 +34,9 @@ _CONFIG_FOR_DOC = "CodeGenConfig" +from ..deprecated._archive_maps import CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.gptj.modeling_gptj.create_sinusoidal_positions def create_sinusoidal_positions(num_pos: int, dim: int) -> torch.Tensor: inv_freq = 1.0 / (10000 ** (torch.arange(0, dim, 2, dtype=torch.int64) / dim)) diff --git a/src/transformers/models/conditional_detr/configuration_conditional_detr.py b/src/transformers/models/conditional_detr/configuration_conditional_detr.py index e7c454d97c1c3c..945e5edb32ad30 100644 --- a/src/transformers/models/conditional_detr/configuration_conditional_detr.py +++ b/src/transformers/models/conditional_detr/configuration_conditional_detr.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ConditionalDetrConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ConditionalDetrModel`]. It is used to instantiate diff --git a/src/transformers/models/conditional_detr/modeling_conditional_detr.py b/src/transformers/models/conditional_detr/modeling_conditional_detr.py index 2ee644c3639e1a..d8ff371fad77d1 100644 --- a/src/transformers/models/conditional_detr/modeling_conditional_detr.py +++ b/src/transformers/models/conditional_detr/modeling_conditional_detr.py @@ -61,6 +61,9 @@ _CHECKPOINT_FOR_DOC = "microsoft/conditional-detr-resnet-50" +from ..deprecated._archive_maps import CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class ConditionalDetrDecoderOutput(BaseModelOutputWithCrossAttentions): """ diff --git a/src/transformers/models/convbert/configuration_convbert.py b/src/transformers/models/convbert/configuration_convbert.py index 82d555cd3a3ccf..d309ca396baffc 100644 --- a/src/transformers/models/convbert/configuration_convbert.py +++ b/src/transformers/models/convbert/configuration_convbert.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ConvBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ConvBertModel`]. It is used to instantiate an diff --git a/src/transformers/models/convbert/modeling_convbert.py b/src/transformers/models/convbert/modeling_convbert.py index dd5d06ef92541c..d88add4e1390ef 100755 --- a/src/transformers/models/convbert/modeling_convbert.py +++ b/src/transformers/models/convbert/modeling_convbert.py @@ -46,6 +46,9 @@ _CONFIG_FOR_DOC = "ConvBertConfig" +from ..deprecated._archive_maps import CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_convbert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/convbert/modeling_tf_convbert.py b/src/transformers/models/convbert/modeling_tf_convbert.py index a8ac11a8cdf910..7206b3558ace8a 100644 --- a/src/transformers/models/convbert/modeling_tf_convbert.py +++ b/src/transformers/models/convbert/modeling_tf_convbert.py @@ -61,6 +61,9 @@ _CONFIG_FOR_DOC = "ConvBertConfig" +from ..deprecated._archive_maps import TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.albert.modeling_tf_albert.TFAlbertEmbeddings with Albert->ConvBert class TFConvBertEmbeddings(keras.layers.Layer): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/convnext/configuration_convnext.py b/src/transformers/models/convnext/configuration_convnext.py index 2549f06b9940dc..f84c31079ea34e 100644 --- a/src/transformers/models/convnext/configuration_convnext.py +++ b/src/transformers/models/convnext/configuration_convnext.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ConvNextConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ConvNextModel`]. It is used to instantiate an diff --git a/src/transformers/models/convnext/modeling_convnext.py b/src/transformers/models/convnext/modeling_convnext.py index 68d23dd1b8ca70..147d2ac22dac45 100755 --- a/src/transformers/models/convnext/modeling_convnext.py +++ b/src/transformers/models/convnext/modeling_convnext.py @@ -55,6 +55,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: """ diff --git a/src/transformers/models/convnextv2/configuration_convnextv2.py b/src/transformers/models/convnextv2/configuration_convnextv2.py index e7692250b2c186..ccee03eef6a492 100644 --- a/src/transformers/models/convnextv2/configuration_convnextv2.py +++ b/src/transformers/models/convnextv2/configuration_convnextv2.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ConvNextV2Config(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ConvNextV2Model`]. It is used to instantiate an diff --git a/src/transformers/models/convnextv2/modeling_convnextv2.py b/src/transformers/models/convnextv2/modeling_convnextv2.py index 881a995d312c54..7439f212971ec1 100644 --- a/src/transformers/models/convnextv2/modeling_convnextv2.py +++ b/src/transformers/models/convnextv2/modeling_convnextv2.py @@ -55,6 +55,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: """ diff --git a/src/transformers/models/cpmant/configuration_cpmant.py b/src/transformers/models/cpmant/configuration_cpmant.py index 4c2a8808669260..62bbce8ada50e1 100644 --- a/src/transformers/models/cpmant/configuration_cpmant.py +++ b/src/transformers/models/cpmant/configuration_cpmant.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CpmAntConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`CpmAntModel`]. It is used to instantiate an diff --git a/src/transformers/models/cpmant/modeling_cpmant.py b/src/transformers/models/cpmant/modeling_cpmant.py index 9882d4ccc65831..63bb467e64e354 100755 --- a/src/transformers/models/cpmant/modeling_cpmant.py +++ b/src/transformers/models/cpmant/modeling_cpmant.py @@ -37,6 +37,9 @@ _CONFIG_FOR_DOC = "CpmAntConfig" +from ..deprecated._archive_maps import CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class CpmAntLayerNorm(nn.Module): """ We use Root Mean Square (RMS) Layer Normalization, please see https://arxiv.org/abs/1910.07467 for details." diff --git a/src/transformers/models/ctrl/configuration_ctrl.py b/src/transformers/models/ctrl/configuration_ctrl.py index 8fd01c10b560e2..0c5a68bf6fcbdc 100644 --- a/src/transformers/models/ctrl/configuration_ctrl.py +++ b/src/transformers/models/ctrl/configuration_ctrl.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CTRLConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`CTRLModel`] or a [`TFCTRLModel`]. It is used to diff --git a/src/transformers/models/ctrl/modeling_ctrl.py b/src/transformers/models/ctrl/modeling_ctrl.py index 1fe6951f40c166..250ec8fc92dffe 100644 --- a/src/transformers/models/ctrl/modeling_ctrl.py +++ b/src/transformers/models/ctrl/modeling_ctrl.py @@ -34,6 +34,9 @@ _CONFIG_FOR_DOC = "CTRLConfig" +from ..deprecated._archive_maps import CTRL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def angle_defn(pos, i, d_model_size): angle_rates = 1 / torch.pow(10000, (2 * (i // 2)) / d_model_size) return pos * angle_rates diff --git a/src/transformers/models/ctrl/modeling_tf_ctrl.py b/src/transformers/models/ctrl/modeling_tf_ctrl.py index 86808190c885e0..6569b9e7d7b788 100644 --- a/src/transformers/models/ctrl/modeling_tf_ctrl.py +++ b/src/transformers/models/ctrl/modeling_tf_ctrl.py @@ -44,6 +44,9 @@ _CONFIG_FOR_DOC = "CTRLConfig" +from ..deprecated._archive_maps import TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def angle_defn(pos, i, d_model_size): angle_rates = 1 / np.power(10000, (2 * (i // 2)) / d_model_size) return pos * angle_rates diff --git a/src/transformers/models/cvt/configuration_cvt.py b/src/transformers/models/cvt/configuration_cvt.py index e8c50fbf7746a0..412387af5e8a7b 100644 --- a/src/transformers/models/cvt/configuration_cvt.py +++ b/src/transformers/models/cvt/configuration_cvt.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import CVT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class CvtConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`CvtModel`]. It is used to instantiate a CvT model diff --git a/src/transformers/models/cvt/modeling_cvt.py b/src/transformers/models/cvt/modeling_cvt.py index 910fb4c5d0dd46..25cf3963cbe10c 100644 --- a/src/transformers/models/cvt/modeling_cvt.py +++ b/src/transformers/models/cvt/modeling_cvt.py @@ -45,6 +45,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import CVT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class BaseModelOutputWithCLSToken(ModelOutput): """ diff --git a/src/transformers/models/cvt/modeling_tf_cvt.py b/src/transformers/models/cvt/modeling_tf_cvt.py index 03df5033b06b7f..5664412effb594 100644 --- a/src/transformers/models/cvt/modeling_tf_cvt.py +++ b/src/transformers/models/cvt/modeling_tf_cvt.py @@ -50,6 +50,9 @@ _CONFIG_FOR_DOC = "CvtConfig" +from ..deprecated._archive_maps import TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class TFBaseModelOutputWithCLSToken(ModelOutput): """ diff --git a/src/transformers/models/data2vec/configuration_data2vec_text.py b/src/transformers/models/data2vec/configuration_data2vec_text.py index e7b15270eda9fb..cd52db2d326e9f 100644 --- a/src/transformers/models/data2vec/configuration_data2vec_text.py +++ b/src/transformers/models/data2vec/configuration_data2vec_text.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Data2VecTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Data2VecTextModel`] and [`Data2VecTextModel`]. It diff --git a/src/transformers/models/data2vec/configuration_data2vec_vision.py b/src/transformers/models/data2vec/configuration_data2vec_vision.py index 315f24a55729b9..9a9de9c4be5a0d 100644 --- a/src/transformers/models/data2vec/configuration_data2vec_vision.py +++ b/src/transformers/models/data2vec/configuration_data2vec_vision.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Data2VecVisionConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Data2VecVisionModel`]. It is used to instantiate diff --git a/src/transformers/models/data2vec/modeling_data2vec_audio.py b/src/transformers/models/data2vec/modeling_data2vec_audio.py index 04edd31fa156f3..b5300cca084fa6 100755 --- a/src/transformers/models/data2vec/modeling_data2vec_audio.py +++ b/src/transformers/models/data2vec/modeling_data2vec_audio.py @@ -62,6 +62,9 @@ _CTC_EXPECTED_LOSS = 66.95 +from ..deprecated._archive_maps import DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( shape: Tuple[int, int], diff --git a/src/transformers/models/data2vec/modeling_data2vec_text.py b/src/transformers/models/data2vec/modeling_data2vec_text.py index 0f4e3f2bc3125f..7dcc53e2cc15c8 100644 --- a/src/transformers/models/data2vec/modeling_data2vec_text.py +++ b/src/transformers/models/data2vec/modeling_data2vec_text.py @@ -55,6 +55,9 @@ _CONFIG_FOR_DOC = "Data2VecTextConfig" +from ..deprecated._archive_maps import DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->Data2VecText class Data2VecTextForTextEmbeddings(nn.Module): """ diff --git a/src/transformers/models/data2vec/modeling_data2vec_vision.py b/src/transformers/models/data2vec/modeling_data2vec_vision.py index fdd80884ea8358..44088d498f6035 100644 --- a/src/transformers/models/data2vec/modeling_data2vec_vision.py +++ b/src/transformers/models/data2vec/modeling_data2vec_vision.py @@ -58,6 +58,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "remote control, remote" +from ..deprecated._archive_maps import DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.beit.modeling_beit.BeitModelOutputWithPooling with Beit->Data2VecVision class Data2VecVisionModelOutputWithPooling(BaseModelOutputWithPooling): diff --git a/src/transformers/models/deberta/configuration_deberta.py b/src/transformers/models/deberta/configuration_deberta.py index e79e7238abcaba..5907f0869d6821 100644 --- a/src/transformers/models/deberta/configuration_deberta.py +++ b/src/transformers/models/deberta/configuration_deberta.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DebertaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DebertaModel`] or a [`TFDebertaModel`]. It is diff --git a/src/transformers/models/deberta/modeling_deberta.py b/src/transformers/models/deberta/modeling_deberta.py index 730959fc8dd4cd..42dae5c80894a8 100644 --- a/src/transformers/models/deberta/modeling_deberta.py +++ b/src/transformers/models/deberta/modeling_deberta.py @@ -53,6 +53,9 @@ _QA_TARGET_END_INDEX = 14 +from ..deprecated._archive_maps import DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class ContextPooler(nn.Module): def __init__(self, config): super().__init__() diff --git a/src/transformers/models/deberta/modeling_tf_deberta.py b/src/transformers/models/deberta/modeling_tf_deberta.py index 774d6296d01c76..3cef6a50c873f4 100644 --- a/src/transformers/models/deberta/modeling_tf_deberta.py +++ b/src/transformers/models/deberta/modeling_tf_deberta.py @@ -54,6 +54,9 @@ _CHECKPOINT_FOR_DOC = "kamalkraj/deberta-base" +from ..deprecated._archive_maps import TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFDebertaContextPooler(keras.layers.Layer): def __init__(self, config: DebertaConfig, **kwargs): super().__init__(**kwargs) diff --git a/src/transformers/models/deberta_v2/configuration_deberta_v2.py b/src/transformers/models/deberta_v2/configuration_deberta_v2.py index 02af8f9c1a2b5b..520222a34a4c39 100644 --- a/src/transformers/models/deberta_v2/configuration_deberta_v2.py +++ b/src/transformers/models/deberta_v2/configuration_deberta_v2.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DebertaV2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DebertaV2Model`]. It is used to instantiate a diff --git a/src/transformers/models/deberta_v2/modeling_deberta_v2.py b/src/transformers/models/deberta_v2/modeling_deberta_v2.py index d6cf572ebfe687..dfe18b0d4964af 100644 --- a/src/transformers/models/deberta_v2/modeling_deberta_v2.py +++ b/src/transformers/models/deberta_v2/modeling_deberta_v2.py @@ -45,6 +45,9 @@ _QA_TARGET_END_INDEX = 9 +from ..deprecated._archive_maps import DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.deberta.modeling_deberta.ContextPooler class ContextPooler(nn.Module): def __init__(self, config): diff --git a/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py b/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py index 9bd62581006dd6..546e7f1a8d0038 100644 --- a/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py +++ b/src/transformers/models/deberta_v2/modeling_tf_deberta_v2.py @@ -53,6 +53,9 @@ _CHECKPOINT_FOR_DOC = "kamalkraj/deberta-v2-xlarge" +from ..deprecated._archive_maps import TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.deberta.modeling_tf_deberta.TFDebertaContextPooler with Deberta->DebertaV2 class TFDebertaV2ContextPooler(keras.layers.Layer): def __init__(self, config: DebertaV2Config, **kwargs): diff --git a/src/transformers/models/decision_transformer/configuration_decision_transformer.py b/src/transformers/models/decision_transformer/configuration_decision_transformer.py index 6f1fb500bab801..d2c1914bee06ee 100644 --- a/src/transformers/models/decision_transformer/configuration_decision_transformer.py +++ b/src/transformers/models/decision_transformer/configuration_decision_transformer.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DecisionTransformerConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`DecisionTransformerModel`]. It is used to diff --git a/src/transformers/models/decision_transformer/modeling_decision_transformer.py b/src/transformers/models/decision_transformer/modeling_decision_transformer.py index 9e2c9b23d8afbd..9dd9d95c387968 100755 --- a/src/transformers/models/decision_transformer/modeling_decision_transformer.py +++ b/src/transformers/models/decision_transformer/modeling_decision_transformer.py @@ -44,6 +44,9 @@ _CONFIG_FOR_DOC = "DecisionTransformerConfig" +from ..deprecated._archive_maps import DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.gpt2.modeling_gpt2.load_tf_weights_in_gpt2 def load_tf_weights_in_gpt2(model, config, gpt2_checkpoint_path): """Load tf checkpoints in a pytorch model""" diff --git a/src/transformers/models/deformable_detr/configuration_deformable_detr.py b/src/transformers/models/deformable_detr/configuration_deformable_detr.py index 456647ced9c412..6d32f6220df586 100644 --- a/src/transformers/models/deformable_detr/configuration_deformable_detr.py +++ b/src/transformers/models/deformable_detr/configuration_deformable_detr.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DeformableDetrConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DeformableDetrModel`]. It is used to instantiate diff --git a/src/transformers/models/deformable_detr/modeling_deformable_detr.py b/src/transformers/models/deformable_detr/modeling_deformable_detr.py index fd9501402ce217..1e2296d177c4de 100755 --- a/src/transformers/models/deformable_detr/modeling_deformable_detr.py +++ b/src/transformers/models/deformable_detr/modeling_deformable_detr.py @@ -153,6 +153,9 @@ def backward(context, grad_output): _CHECKPOINT_FOR_DOC = "sensetime/deformable-detr" +from ..deprecated._archive_maps import DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class DeformableDetrDecoderOutput(ModelOutput): """ diff --git a/src/transformers/models/deit/configuration_deit.py b/src/transformers/models/deit/configuration_deit.py index e1767c35fda838..394c6ff93704cc 100644 --- a/src/transformers/models/deit/configuration_deit.py +++ b/src/transformers/models/deit/configuration_deit.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DeiTConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DeiTModel`]. It is used to instantiate an DeiT diff --git a/src/transformers/models/deit/modeling_deit.py b/src/transformers/models/deit/modeling_deit.py index 2f13cc2644dc96..d8f904b9388d52 100644 --- a/src/transformers/models/deit/modeling_deit.py +++ b/src/transformers/models/deit/modeling_deit.py @@ -59,6 +59,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import DEIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class DeiTEmbeddings(nn.Module): """ Construct the CLS token, distillation token, position and patch embeddings. Optionally, also the mask token. diff --git a/src/transformers/models/deit/modeling_tf_deit.py b/src/transformers/models/deit/modeling_tf_deit.py index 43a3465ba14d3a..aec5f6df95922a 100644 --- a/src/transformers/models/deit/modeling_tf_deit.py +++ b/src/transformers/models/deit/modeling_tf_deit.py @@ -65,6 +65,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class TFDeiTForImageClassificationWithTeacherOutput(ModelOutput): """ diff --git a/src/transformers/models/deprecated/_archive_maps.py b/src/transformers/models/deprecated/_archive_maps.py index 87c4d64fb304a3..c534edc8bc691d 100644 --- a/src/transformers/models/deprecated/_archive_maps.py +++ b/src/transformers/models/deprecated/_archive_maps.py @@ -1,6 +1,25 @@ -from ... import logging +# coding=utf-8 +# Copyright 2024 The HuggingFace Inc. team. +# +# 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 collections import OrderedDict + +from ...utils import logging + + logger = logging.get_logger(__name__) + class DeprecatedDict(dict): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -27,2576 +46,2714 @@ def __getitem__(self, item): return super().__getitem__(item) -ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "albert/albert-base-v1": "https://huggingface.co/albert/albert-base-v1/resolve/main/config.json", - "albert/albert-large-v1": "https://huggingface.co/albert/albert-large-v1/resolve/main/config.json", - "albert/albert-xlarge-v1": "https://huggingface.co/albert/albert-xlarge-v1/resolve/main/config.json", - "albert/albert-xxlarge-v1": "https://huggingface.co/albert/albert-xxlarge-v1/resolve/main/config.json", - "albert/albert-base-v2": "https://huggingface.co/albert/albert-base-v2/resolve/main/config.json", - "albert/albert-large-v2": "https://huggingface.co/albert/albert-large-v2/resolve/main/config.json", - "albert/albert-xlarge-v2": "https://huggingface.co/albert/albert-xlarge-v2/resolve/main/config.json", - "albert/albert-xxlarge-v2": "https://huggingface.co/albert/albert-xxlarge-v2/resolve/main/config.json" -}) - -ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "albert/albert-base-v1", - "albert/albert-large-v1", - "albert/albert-xlarge-v1", - "albert/albert-xxlarge-v1", - "albert/albert-base-v2", - "albert/albert-large-v2", - "albert/albert-xlarge-v2", - "albert/albert-xxlarge-v2" -]) - -TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "albert/albert-base-v1", - "albert/albert-large-v1", - "albert/albert-xlarge-v1", - "albert/albert-xxlarge-v1", - "albert/albert-base-v2", - "albert/albert-large-v2", - "albert/albert-xlarge-v2", - "albert/albert-xxlarge-v2" -]) - -ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "kakaobrain/align-base": "https://huggingface.co/kakaobrain/align-base/resolve/main/config.json" -}) - -ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "kakaobrain/align-base" -]) - -ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "BAAI/AltCLIP": "https://huggingface.co/BAAI/AltCLIP/resolve/main/config.json" -}) - -ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "BAAI/AltCLIP" -]) - -AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "MIT/ast-finetuned-audioset-10-10-0.4593": "https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json" -}) - -AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "MIT/ast-finetuned-audioset-10-10-0.4593" -]) - -AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "huggingface/autoformer-tourism-monthly": "https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json" -}) - -AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "huggingface/autoformer-tourism-monthly" -]) - -BARK_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "suno/bark-small", - "suno/bark" -]) - -BART_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/bart-large" -]) - -BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/beit-base-patch16-224-pt22k": "https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json" -}) - -BEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/beit-base-patch16-224" -]) - -BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json", - "google-bert/bert-large-uncased": "https://huggingface.co/google-bert/bert-large-uncased/resolve/main/config.json", - "google-bert/bert-base-cased": "https://huggingface.co/google-bert/bert-base-cased/resolve/main/config.json", - "google-bert/bert-large-cased": "https://huggingface.co/google-bert/bert-large-cased/resolve/main/config.json", - "google-bert/bert-base-multilingual-uncased": "https://huggingface.co/google-bert/bert-base-multilingual-uncased/resolve/main/config.json", - "google-bert/bert-base-multilingual-cased": "https://huggingface.co/google-bert/bert-base-multilingual-cased/resolve/main/config.json", - "google-bert/bert-base-chinese": "https://huggingface.co/google-bert/bert-base-chinese/resolve/main/config.json", - "google-bert/bert-base-german-cased": "https://huggingface.co/google-bert/bert-base-german-cased/resolve/main/config.json", - "google-bert/bert-large-uncased-whole-word-masking": "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking/resolve/main/config.json", - "google-bert/bert-large-cased-whole-word-masking": "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking/resolve/main/config.json", - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json", - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/config.json", - "google-bert/bert-base-cased-finetuned-mrpc": "https://huggingface.co/google-bert/bert-base-cased-finetuned-mrpc/resolve/main/config.json", - "google-bert/bert-base-german-dbmdz-cased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-cased/resolve/main/config.json", - "google-bert/bert-base-german-dbmdz-uncased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-uncased/resolve/main/config.json", - "cl-tohoku/bert-base-japanese": "https://huggingface.co/cl-tohoku/bert-base-japanese/resolve/main/config.json", - "cl-tohoku/bert-base-japanese-whole-word-masking": "https://huggingface.co/cl-tohoku/bert-base-japanese-whole-word-masking/resolve/main/config.json", - "cl-tohoku/bert-base-japanese-char": "https://huggingface.co/cl-tohoku/bert-base-japanese-char/resolve/main/config.json", - "cl-tohoku/bert-base-japanese-char-whole-word-masking": "https://huggingface.co/cl-tohoku/bert-base-japanese-char-whole-word-masking/resolve/main/config.json", - "TurkuNLP/bert-base-finnish-cased-v1": "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/config.json", - "TurkuNLP/bert-base-finnish-uncased-v1": "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/config.json", - "wietsedv/bert-base-dutch-cased": "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/config.json" -}) - -BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google-bert/bert-base-uncased", - "google-bert/bert-large-uncased", - "google-bert/bert-base-cased", - "google-bert/bert-large-cased", - "google-bert/bert-base-multilingual-uncased", - "google-bert/bert-base-multilingual-cased", - "google-bert/bert-base-chinese", - "google-bert/bert-base-german-cased", - "google-bert/bert-large-uncased-whole-word-masking", - "google-bert/bert-large-cased-whole-word-masking", - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", - "google-bert/bert-base-cased-finetuned-mrpc", - "google-bert/bert-base-german-dbmdz-cased", - "google-bert/bert-base-german-dbmdz-uncased", - "cl-tohoku/bert-base-japanese", - "cl-tohoku/bert-base-japanese-whole-word-masking", - "cl-tohoku/bert-base-japanese-char", - "cl-tohoku/bert-base-japanese-char-whole-word-masking", - "TurkuNLP/bert-base-finnish-cased-v1", - "TurkuNLP/bert-base-finnish-uncased-v1", - "wietsedv/bert-base-dutch-cased" -]) - -TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google-bert/bert-base-uncased", - "google-bert/bert-large-uncased", - "google-bert/bert-base-cased", - "google-bert/bert-large-cased", - "google-bert/bert-base-multilingual-uncased", - "google-bert/bert-base-multilingual-cased", - "google-bert/bert-base-chinese", - "google-bert/bert-base-german-cased", - "google-bert/bert-large-uncased-whole-word-masking", - "google-bert/bert-large-cased-whole-word-masking", - "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", - "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", - "google-bert/bert-base-cased-finetuned-mrpc", - "cl-tohoku/bert-base-japanese", - "cl-tohoku/bert-base-japanese-whole-word-masking", - "cl-tohoku/bert-base-japanese-char", - "cl-tohoku/bert-base-japanese-char-whole-word-masking", - "TurkuNLP/bert-base-finnish-cased-v1", - "TurkuNLP/bert-base-finnish-uncased-v1", - "wietsedv/bert-base-dutch-cased" -]) - -BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json", - "google/bigbird-roberta-large": "https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json", - "google/bigbird-base-trivia-itc": "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json" -}) - -BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/bigbird-roberta-base", - "google/bigbird-roberta-large", - "google/bigbird-base-trivia-itc" -]) - -BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/bigbird-pegasus-large-arxiv": "https://huggingface.co/google/bigbird-pegasus-large-arxiv/resolve/main/config.json", - "google/bigbird-pegasus-large-pubmed": "https://huggingface.co/google/bigbird-pegasus-large-pubmed/resolve/main/config.json", - "google/bigbird-pegasus-large-bigpatent": "https://huggingface.co/google/bigbird-pegasus-large-bigpatent/resolve/main/config.json" -}) - -BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/bigbird-pegasus-large-arxiv", - "google/bigbird-pegasus-large-pubmed", - "google/bigbird-pegasus-large-bigpatent" -]) - -BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/biogpt": "https://huggingface.co/microsoft/biogpt/resolve/main/config.json" -}) - -BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/biogpt", - "microsoft/BioGPT-Large" -]) - -BIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/bit-50": "https://huggingface.co/google/bit-50/resolve/main/config.json" -}) - -BIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/bit-50" -]) - -BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/config.json" -}) - -BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/blenderbot-3B" -]) - -BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/blenderbot_small-90M" -]) - -BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Salesforce/blip-vqa-base": "https://huggingface.co/Salesforce/blip-vqa-base/resolve/main/config.json", - "Salesforce/blip-vqa-capfit-large": "https://huggingface.co/Salesforce/blip-vqa-base-capfit/resolve/main/config.json", - "Salesforce/blip-image-captioning-base": "https://huggingface.co/Salesforce/blip-image-captioning-base/resolve/main/config.json", - "Salesforce/blip-image-captioning-large": "https://huggingface.co/Salesforce/blip-image-captioning-large/resolve/main/config.json", - "Salesforce/blip-itm-base-coco": "https://huggingface.co/Salesforce/blip-itm-base-coco/resolve/main/config.json", - "Salesforce/blip-itm-large-coco": "https://huggingface.co/Salesforce/blip-itm-large-coco/resolve/main/config.json", - "Salesforce/blip-itm-base-flikr": "https://huggingface.co/Salesforce/blip-itm-base-flikr/resolve/main/config.json", - "Salesforce/blip-itm-large-flikr": "https://huggingface.co/Salesforce/blip-itm-large-flikr/resolve/main/config.json" -}) - -BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Salesforce/blip-vqa-base", - "Salesforce/blip-vqa-capfilt-large", - "Salesforce/blip-image-captioning-base", - "Salesforce/blip-image-captioning-large", - "Salesforce/blip-itm-base-coco", - "Salesforce/blip-itm-large-coco", - "Salesforce/blip-itm-base-flickr", - "Salesforce/blip-itm-large-flickr" -]) - -TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Salesforce/blip-vqa-base", - "Salesforce/blip-vqa-capfilt-large", - "Salesforce/blip-image-captioning-base", - "Salesforce/blip-image-captioning-large", - "Salesforce/blip-itm-base-coco", - "Salesforce/blip-itm-large-coco", - "Salesforce/blip-itm-base-flickr", - "Salesforce/blip-itm-large-flickr" -]) - -BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "salesforce/blip2-opt-2.7b": "https://huggingface.co/salesforce/blip2-opt-2.7b/resolve/main/config.json" -}) - -BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Salesforce/blip2-opt-2.7b" -]) - -BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "bigscience/bloom": "https://huggingface.co/bigscience/bloom/resolve/main/config.json", - "bigscience/bloom-560m": "https://huggingface.co/bigscience/bloom-560m/blob/main/config.json", - "bigscience/bloom-1b1": "https://huggingface.co/bigscience/bloom-1b1/blob/main/config.json", - "bigscience/bloom-1b7": "https://huggingface.co/bigscience/bloom-1b7/blob/main/config.json", - "bigscience/bloom-3b": "https://huggingface.co/bigscience/bloom-3b/blob/main/config.json", - "bigscience/bloom-7b1": "https://huggingface.co/bigscience/bloom-7b1/blob/main/config.json" -}) - -BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "bigscience/bigscience-small-testing", - "bigscience/bloom-560m", - "bigscience/bloom-1b1", - "bigscience/bloom-1b7", - "bigscience/bloom-3b", - "bigscience/bloom-7b1", - "bigscience/bloom" -]) - -BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "BridgeTower/bridgetower-base": "https://huggingface.co/BridgeTower/bridgetower-base/blob/main/config.json", - "BridgeTower/bridgetower-base-itm-mlm": "https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm/blob/main/config.json" -}) - -BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "BridgeTower/bridgetower-base", - "BridgeTower/bridgetower-base-itm-mlm" -]) - -BROS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "jinho8345/bros-base-uncased": "https://huggingface.co/jinho8345/bros-base-uncased/blob/main/config.json", - "jinho8345/bros-large-uncased": "https://huggingface.co/jinho8345/bros-large-uncased/blob/main/config.json" -}) - -BROS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "jinho8345/bros-base-uncased", - "jinho8345/bros-large-uncased" -]) - -CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "almanach/camembert-base": "https://huggingface.co/almanach/camembert-base/resolve/main/config.json", - "umberto-commoncrawl-cased-v1": "https://huggingface.co/Musixmatch/umberto-commoncrawl-cased-v1/resolve/main/config.json", - "umberto-wikipedia-uncased-v1": "https://huggingface.co/Musixmatch/umberto-wikipedia-uncased-v1/resolve/main/config.json" -}) - -CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "almanach/camembert-base", - "Musixmatch/umberto-commoncrawl-cased-v1", - "Musixmatch/umberto-wikipedia-uncased-v1" -]) +ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "albert/albert-base-v1": "https://huggingface.co/albert/albert-base-v1/resolve/main/config.json", + "albert/albert-large-v1": "https://huggingface.co/albert/albert-large-v1/resolve/main/config.json", + "albert/albert-xlarge-v1": "https://huggingface.co/albert/albert-xlarge-v1/resolve/main/config.json", + "albert/albert-xxlarge-v1": "https://huggingface.co/albert/albert-xxlarge-v1/resolve/main/config.json", + "albert/albert-base-v2": "https://huggingface.co/albert/albert-base-v2/resolve/main/config.json", + "albert/albert-large-v2": "https://huggingface.co/albert/albert-large-v2/resolve/main/config.json", + "albert/albert-xlarge-v2": "https://huggingface.co/albert/albert-xlarge-v2/resolve/main/config.json", + "albert/albert-xxlarge-v2": "https://huggingface.co/albert/albert-xxlarge-v2/resolve/main/config.json", + } +) + +ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "albert/albert-base-v1", + "albert/albert-large-v1", + "albert/albert-xlarge-v1", + "albert/albert-xxlarge-v1", + "albert/albert-base-v2", + "albert/albert-large-v2", + "albert/albert-xlarge-v2", + "albert/albert-xxlarge-v2", + ] +) + +TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "albert/albert-base-v1", + "albert/albert-large-v1", + "albert/albert-xlarge-v1", + "albert/albert-xxlarge-v1", + "albert/albert-base-v2", + "albert/albert-large-v2", + "albert/albert-xlarge-v2", + "albert/albert-xxlarge-v2", + ] +) + +ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"kakaobrain/align-base": "https://huggingface.co/kakaobrain/align-base/resolve/main/config.json"} +) + +ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["kakaobrain/align-base"]) + +ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"BAAI/AltCLIP": "https://huggingface.co/BAAI/AltCLIP/resolve/main/config.json"} +) + +ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["BAAI/AltCLIP"]) + +AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "MIT/ast-finetuned-audioset-10-10-0.4593": "https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json" + } +) + +AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["MIT/ast-finetuned-audioset-10-10-0.4593"] +) + +AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "huggingface/autoformer-tourism-monthly": "https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json" + } +) + +AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["huggingface/autoformer-tourism-monthly"]) + +BARK_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["suno/bark-small", "suno/bark"]) + +BART_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/bart-large"]) + +BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/beit-base-patch16-224-pt22k": "https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json" + } +) + +BEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/beit-base-patch16-224"]) + +BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json", + "google-bert/bert-large-uncased": "https://huggingface.co/google-bert/bert-large-uncased/resolve/main/config.json", + "google-bert/bert-base-cased": "https://huggingface.co/google-bert/bert-base-cased/resolve/main/config.json", + "google-bert/bert-large-cased": "https://huggingface.co/google-bert/bert-large-cased/resolve/main/config.json", + "google-bert/bert-base-multilingual-uncased": "https://huggingface.co/google-bert/bert-base-multilingual-uncased/resolve/main/config.json", + "google-bert/bert-base-multilingual-cased": "https://huggingface.co/google-bert/bert-base-multilingual-cased/resolve/main/config.json", + "google-bert/bert-base-chinese": "https://huggingface.co/google-bert/bert-base-chinese/resolve/main/config.json", + "google-bert/bert-base-german-cased": "https://huggingface.co/google-bert/bert-base-german-cased/resolve/main/config.json", + "google-bert/bert-large-uncased-whole-word-masking": "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking/resolve/main/config.json", + "google-bert/bert-large-cased-whole-word-masking": "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking/resolve/main/config.json", + "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad": "https://huggingface.co/google-bert/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json", + "google-bert/bert-large-cased-whole-word-masking-finetuned-squad": "https://huggingface.co/google-bert/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/config.json", + "google-bert/bert-base-cased-finetuned-mrpc": "https://huggingface.co/google-bert/bert-base-cased-finetuned-mrpc/resolve/main/config.json", + "google-bert/bert-base-german-dbmdz-cased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-cased/resolve/main/config.json", + "google-bert/bert-base-german-dbmdz-uncased": "https://huggingface.co/google-bert/bert-base-german-dbmdz-uncased/resolve/main/config.json", + "cl-tohoku/bert-base-japanese": "https://huggingface.co/cl-tohoku/bert-base-japanese/resolve/main/config.json", + "cl-tohoku/bert-base-japanese-whole-word-masking": "https://huggingface.co/cl-tohoku/bert-base-japanese-whole-word-masking/resolve/main/config.json", + "cl-tohoku/bert-base-japanese-char": "https://huggingface.co/cl-tohoku/bert-base-japanese-char/resolve/main/config.json", + "cl-tohoku/bert-base-japanese-char-whole-word-masking": "https://huggingface.co/cl-tohoku/bert-base-japanese-char-whole-word-masking/resolve/main/config.json", + "TurkuNLP/bert-base-finnish-cased-v1": "https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/config.json", + "TurkuNLP/bert-base-finnish-uncased-v1": "https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/config.json", + "wietsedv/bert-base-dutch-cased": "https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/config.json", + } +) + +BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google-bert/bert-base-uncased", + "google-bert/bert-large-uncased", + "google-bert/bert-base-cased", + "google-bert/bert-large-cased", + "google-bert/bert-base-multilingual-uncased", + "google-bert/bert-base-multilingual-cased", + "google-bert/bert-base-chinese", + "google-bert/bert-base-german-cased", + "google-bert/bert-large-uncased-whole-word-masking", + "google-bert/bert-large-cased-whole-word-masking", + "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", + "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", + "google-bert/bert-base-cased-finetuned-mrpc", + "google-bert/bert-base-german-dbmdz-cased", + "google-bert/bert-base-german-dbmdz-uncased", + "cl-tohoku/bert-base-japanese", + "cl-tohoku/bert-base-japanese-whole-word-masking", + "cl-tohoku/bert-base-japanese-char", + "cl-tohoku/bert-base-japanese-char-whole-word-masking", + "TurkuNLP/bert-base-finnish-cased-v1", + "TurkuNLP/bert-base-finnish-uncased-v1", + "wietsedv/bert-base-dutch-cased", + ] +) + +TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google-bert/bert-base-uncased", + "google-bert/bert-large-uncased", + "google-bert/bert-base-cased", + "google-bert/bert-large-cased", + "google-bert/bert-base-multilingual-uncased", + "google-bert/bert-base-multilingual-cased", + "google-bert/bert-base-chinese", + "google-bert/bert-base-german-cased", + "google-bert/bert-large-uncased-whole-word-masking", + "google-bert/bert-large-cased-whole-word-masking", + "google-bert/bert-large-uncased-whole-word-masking-finetuned-squad", + "google-bert/bert-large-cased-whole-word-masking-finetuned-squad", + "google-bert/bert-base-cased-finetuned-mrpc", + "cl-tohoku/bert-base-japanese", + "cl-tohoku/bert-base-japanese-whole-word-masking", + "cl-tohoku/bert-base-japanese-char", + "cl-tohoku/bert-base-japanese-char-whole-word-masking", + "TurkuNLP/bert-base-finnish-cased-v1", + "TurkuNLP/bert-base-finnish-uncased-v1", + "wietsedv/bert-base-dutch-cased", + ] +) + +BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json", + "google/bigbird-roberta-large": "https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json", + "google/bigbird-base-trivia-itc": "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json", + } +) + +BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["google/bigbird-roberta-base", "google/bigbird-roberta-large", "google/bigbird-base-trivia-itc"] +) + +BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/bigbird-pegasus-large-arxiv": "https://huggingface.co/google/bigbird-pegasus-large-arxiv/resolve/main/config.json", + "google/bigbird-pegasus-large-pubmed": "https://huggingface.co/google/bigbird-pegasus-large-pubmed/resolve/main/config.json", + "google/bigbird-pegasus-large-bigpatent": "https://huggingface.co/google/bigbird-pegasus-large-bigpatent/resolve/main/config.json", + } +) + +BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/bigbird-pegasus-large-arxiv", + "google/bigbird-pegasus-large-pubmed", + "google/bigbird-pegasus-large-bigpatent", + ] +) + +BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/biogpt": "https://huggingface.co/microsoft/biogpt/resolve/main/config.json"} +) + +BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/biogpt", "microsoft/BioGPT-Large"]) + +BIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/bit-50": "https://huggingface.co/google/bit-50/resolve/main/config.json"} +) + +BIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/bit-50"]) + +BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/config.json"} +) + +BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/blenderbot-3B"]) + +BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP = { + "facebook/blenderbot_small-90M": "https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/config.json", + # See all BlenderbotSmall models at https://huggingface.co/models?filter=blenderbot_small +} + +BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/blenderbot_small-90M"]) + +BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "Salesforce/blip-vqa-base": "https://huggingface.co/Salesforce/blip-vqa-base/resolve/main/config.json", + "Salesforce/blip-vqa-capfit-large": "https://huggingface.co/Salesforce/blip-vqa-base-capfit/resolve/main/config.json", + "Salesforce/blip-image-captioning-base": "https://huggingface.co/Salesforce/blip-image-captioning-base/resolve/main/config.json", + "Salesforce/blip-image-captioning-large": "https://huggingface.co/Salesforce/blip-image-captioning-large/resolve/main/config.json", + "Salesforce/blip-itm-base-coco": "https://huggingface.co/Salesforce/blip-itm-base-coco/resolve/main/config.json", + "Salesforce/blip-itm-large-coco": "https://huggingface.co/Salesforce/blip-itm-large-coco/resolve/main/config.json", + "Salesforce/blip-itm-base-flikr": "https://huggingface.co/Salesforce/blip-itm-base-flikr/resolve/main/config.json", + "Salesforce/blip-itm-large-flikr": "https://huggingface.co/Salesforce/blip-itm-large-flikr/resolve/main/config.json", + } +) + +BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "Salesforce/blip-vqa-base", + "Salesforce/blip-vqa-capfilt-large", + "Salesforce/blip-image-captioning-base", + "Salesforce/blip-image-captioning-large", + "Salesforce/blip-itm-base-coco", + "Salesforce/blip-itm-large-coco", + "Salesforce/blip-itm-base-flickr", + "Salesforce/blip-itm-large-flickr", + ] +) + +TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "Salesforce/blip-vqa-base", + "Salesforce/blip-vqa-capfilt-large", + "Salesforce/blip-image-captioning-base", + "Salesforce/blip-image-captioning-large", + "Salesforce/blip-itm-base-coco", + "Salesforce/blip-itm-large-coco", + "Salesforce/blip-itm-base-flickr", + "Salesforce/blip-itm-large-flickr", + ] +) + +BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"salesforce/blip2-opt-2.7b": "https://huggingface.co/salesforce/blip2-opt-2.7b/resolve/main/config.json"} +) + +BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Salesforce/blip2-opt-2.7b"]) + +BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "bigscience/bloom": "https://huggingface.co/bigscience/bloom/resolve/main/config.json", + "bigscience/bloom-560m": "https://huggingface.co/bigscience/bloom-560m/blob/main/config.json", + "bigscience/bloom-1b1": "https://huggingface.co/bigscience/bloom-1b1/blob/main/config.json", + "bigscience/bloom-1b7": "https://huggingface.co/bigscience/bloom-1b7/blob/main/config.json", + "bigscience/bloom-3b": "https://huggingface.co/bigscience/bloom-3b/blob/main/config.json", + "bigscience/bloom-7b1": "https://huggingface.co/bigscience/bloom-7b1/blob/main/config.json", + } +) + +BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "bigscience/bigscience-small-testing", + "bigscience/bloom-560m", + "bigscience/bloom-1b1", + "bigscience/bloom-1b7", + "bigscience/bloom-3b", + "bigscience/bloom-7b1", + "bigscience/bloom", + ] +) + +BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "BridgeTower/bridgetower-base": "https://huggingface.co/BridgeTower/bridgetower-base/blob/main/config.json", + "BridgeTower/bridgetower-base-itm-mlm": "https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm/blob/main/config.json", + } +) + +BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["BridgeTower/bridgetower-base", "BridgeTower/bridgetower-base-itm-mlm"] +) + +BROS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "jinho8345/bros-base-uncased": "https://huggingface.co/jinho8345/bros-base-uncased/blob/main/config.json", + "jinho8345/bros-large-uncased": "https://huggingface.co/jinho8345/bros-large-uncased/blob/main/config.json", + } +) + +BROS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["jinho8345/bros-base-uncased", "jinho8345/bros-large-uncased"]) + +CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "almanach/camembert-base": "https://huggingface.co/almanach/camembert-base/resolve/main/config.json", + "umberto-commoncrawl-cased-v1": "https://huggingface.co/Musixmatch/umberto-commoncrawl-cased-v1/resolve/main/config.json", + "umberto-wikipedia-uncased-v1": "https://huggingface.co/Musixmatch/umberto-wikipedia-uncased-v1/resolve/main/config.json", + } +) + +CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["almanach/camembert-base", "Musixmatch/umberto-commoncrawl-cased-v1", "Musixmatch/umberto-wikipedia-uncased-v1"] +) TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) -CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/canine-s": "https://huggingface.co/google/canine-s/resolve/main/config.json" -}) - -CANINE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/canine-s", - "google/canine-r" -]) - -CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "OFA-Sys/chinese-clip-vit-base-patch16": "https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16/resolve/main/config.json" -}) - -CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "OFA-Sys/chinese-clip-vit-base-patch16" -]) - -CLAP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "laion/clap-htsat-fused", - "laion/clap-htsat-unfused" -]) - -CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/config.json" -}) - -CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai/clip-vit-base-patch32" -]) - -TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai/clip-vit-base-patch32" -]) - -CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "CIDAS/clipseg-rd64": "https://huggingface.co/CIDAS/clipseg-rd64/resolve/main/config.json" -}) - -CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "CIDAS/clipseg-rd64-refined" -]) - -CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "susnato/clvp_dev": "https://huggingface.co/susnato/clvp_dev/resolve/main/config.json" -}) - -CLVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "susnato/clvp_dev" -]) - -CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Salesforce/codegen-350M-nl": "https://huggingface.co/Salesforce/codegen-350M-nl/resolve/main/config.json", - "Salesforce/codegen-350M-multi": "https://huggingface.co/Salesforce/codegen-350M-multi/resolve/main/config.json", - "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/config.json", - "Salesforce/codegen-2B-nl": "https://huggingface.co/Salesforce/codegen-2B-nl/resolve/main/config.json", - "Salesforce/codegen-2B-multi": "https://huggingface.co/Salesforce/codegen-2B-multi/resolve/main/config.json", - "Salesforce/codegen-2B-mono": "https://huggingface.co/Salesforce/codegen-2B-mono/resolve/main/config.json", - "Salesforce/codegen-6B-nl": "https://huggingface.co/Salesforce/codegen-6B-nl/resolve/main/config.json", - "Salesforce/codegen-6B-multi": "https://huggingface.co/Salesforce/codegen-6B-multi/resolve/main/config.json", - "Salesforce/codegen-6B-mono": "https://huggingface.co/Salesforce/codegen-6B-mono/resolve/main/config.json", - "Salesforce/codegen-16B-nl": "https://huggingface.co/Salesforce/codegen-16B-nl/resolve/main/config.json", - "Salesforce/codegen-16B-multi": "https://huggingface.co/Salesforce/codegen-16B-multi/resolve/main/config.json", - "Salesforce/codegen-16B-mono": "https://huggingface.co/Salesforce/codegen-16B-mono/resolve/main/config.json" -}) - -CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Salesforce/codegen-350M-nl", - "Salesforce/codegen-350M-multi", - "Salesforce/codegen-350M-mono", - "Salesforce/codegen-2B-nl", - "Salesforce/codegen-2B-multi", - "Salesforce/codegen-2B-mono", - "Salesforce/codegen-6B-nl", - "Salesforce/codegen-6B-multi", - "Salesforce/codegen-6B-mono", - "Salesforce/codegen-16B-nl", - "Salesforce/codegen-16B-multi", - "Salesforce/codegen-16B-mono" -]) - -CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/conditional-detr-resnet-50": "https://huggingface.co/microsoft/conditional-detr-resnet-50/resolve/main/config.json" -}) - -CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/conditional-detr-resnet-50" -]) - -CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "YituTech/conv-bert-base": "https://huggingface.co/YituTech/conv-bert-base/resolve/main/config.json", - "YituTech/conv-bert-medium-small": "https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/config.json", - "YituTech/conv-bert-small": "https://huggingface.co/YituTech/conv-bert-small/resolve/main/config.json" -}) - -CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "YituTech/conv-bert-base", - "YituTech/conv-bert-medium-small", - "YituTech/conv-bert-small" -]) - -TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "YituTech/conv-bert-base", - "YituTech/conv-bert-medium-small", - "YituTech/conv-bert-small" -]) - -CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/convnext-tiny-224": "https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json" -}) - -CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/convnext-tiny-224" -]) - -CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json" -}) - -CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/convnextv2-tiny-1k-224" -]) - -CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "openbmb/cpm-ant-10b": "https://huggingface.co/openbmb/cpm-ant-10b/blob/main/config.json" -}) - -CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openbmb/cpm-ant-10b" -]) - -CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Salesforce/ctrl": "https://huggingface.co/Salesforce/ctrl/resolve/main/config.json" -}) - -CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Salesforce/ctrl" -]) - -TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Salesforce/ctrl" -]) - -CVT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/cvt-13": "https://huggingface.co/microsoft/cvt-13/resolve/main/config.json" -}) - -CVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/cvt-13", - "microsoft/cvt-13-384", - "microsoft/cvt-13-384-22k", - "microsoft/cvt-21", - "microsoft/cvt-21-384", - "microsoft/cvt-21-384-22k" -]) - -TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/cvt-13", - "microsoft/cvt-13-384", - "microsoft/cvt-13-384-22k", - "microsoft/cvt-21", - "microsoft/cvt-21-384", - "microsoft/cvt-21-384-22k" -]) - -DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/data2vec-text-base": "https://huggingface.co/data2vec/resolve/main/config.json" -}) - -DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/data2vec-vision-base-ft": "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json" -}) - -DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/data2vec-audio-base", - "facebook/data2vec-audio-base-10m", - "facebook/data2vec-audio-base-100h", - "facebook/data2vec-audio-base-960h" -]) - -DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/data2vec-text-base" -]) - -DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/data2vec-vision-base-ft1k" -]) - -DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/config.json", - "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/config.json", - "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/config.json", - "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/config.json", - "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/config.json", - "microsoft/deberta-xlarge-mnli": "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/config.json" -}) - -DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/deberta-base", - "microsoft/deberta-large", - "microsoft/deberta-xlarge", - "microsoft/deberta-base-mnli", - "microsoft/deberta-large-mnli", - "microsoft/deberta-xlarge-mnli" -]) - -TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "kamalkraj/deberta-base" -]) - -DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json", - "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json", - "microsoft/deberta-v2-xlarge-mnli": "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json", - "microsoft/deberta-v2-xxlarge-mnli": "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json" -}) - -DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/deberta-v2-xlarge", - "microsoft/deberta-v2-xxlarge", - "microsoft/deberta-v2-xlarge-mnli", - "microsoft/deberta-v2-xxlarge-mnli" -]) - -TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "kamalkraj/deberta-v2-xlarge" -]) - -DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "edbeeching/decision-transformer-gym-hopper-medium": "https://huggingface.co/edbeeching/decision-transformer-gym-hopper-medium/resolve/main/config.json" -}) - -DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "edbeeching/decision-transformer-gym-hopper-medium" -]) - -DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "SenseTime/deformable-detr": "https://huggingface.co/sensetime/deformable-detr/resolve/main/config.json" -}) - -DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "sensetime/deformable-detr" -]) - -DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/deit-base-distilled-patch16-224": "https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json" -}) - -DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/deit-base-distilled-patch16-224" -]) - -TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/deit-base-distilled-patch16-224" -]) - -MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json" -}) - -MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "speechbrain/m-ctc-t-large" -]) - -OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "s-JoL/Open-Llama-V1": "https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json" -}) - -RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "yjernite/retribert-base-uncased": "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/config.json" -}) - -RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "yjernite/retribert-base-uncased" -]) - -TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "CarlCochet/trajectory-transformer-halfcheetah-medium-v2": "https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2/resolve/main/config.json" -}) - -TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "CarlCochet/trajectory-transformer-halfcheetah-medium-v2" -]) - -TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "transfo-xl/transfo-xl-wt103": "https://huggingface.co/transfo-xl/transfo-xl-wt103/resolve/main/config.json" -}) - -TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "transfo-xl/transfo-xl-wt103" -]) - -TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "transfo-xl/transfo-xl-wt103" -]) - -VAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Visual-Attention-Network/van-base": "https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json" -}) - -VAN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Visual-Attention-Network/van-base" -]) - -DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "LiheYoung/depth-anything-small-hf": "https://huggingface.co/LiheYoung/depth-anything-small-hf/resolve/main/config.json" -}) - -DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "LiheYoung/depth-anything-small-hf" -]) - -DETA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "ut/deta": "https://huggingface.co/ut/deta/resolve/main/config.json" -}) - -DETA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "jozhang97/deta-swin-large-o365" -]) - -DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/detr-resnet-50": "https://huggingface.co/facebook/detr-resnet-50/resolve/main/config.json" -}) - -DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/detr-resnet-50" -]) - -DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "shi-labs/dinat-mini-in1k-224": "https://huggingface.co/shi-labs/dinat-mini-in1k-224/resolve/main/config.json" -}) - -DINAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "shi-labs/dinat-mini-in1k-224" -]) - -DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/dinov2-base": "https://huggingface.co/facebook/dinov2-base/resolve/main/config.json" -}) - -DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/dinov2-base" -]) - -DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/config.json", - "distilbert-base-uncased-distilled-squad": "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json", - "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/config.json", - "distilbert-base-cased-distilled-squad": "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json", - "distilbert-base-german-cased": "https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json", - "distilbert-base-multilingual-cased": "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json", - "distilbert-base-uncased-finetuned-sst-2-english": "https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json" -}) - -DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "distilbert-base-uncased", - "distilbert-base-uncased-distilled-squad", - "distilbert-base-cased", - "distilbert-base-cased-distilled-squad", - "distilbert-base-german-cased", - "distilbert-base-multilingual-cased", - "distilbert-base-uncased-finetuned-sst-2-english" -]) - -TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "distilbert-base-uncased", - "distilbert-base-uncased-distilled-squad", - "distilbert-base-cased", - "distilbert-base-cased-distilled-squad", - "distilbert-base-multilingual-cased", - "distilbert-base-uncased-finetuned-sst-2-english" -]) - -DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "naver-clova-ix/donut-base": "https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json" -}) - -DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "naver-clova-ix/donut-base" -]) - -DPR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/dpr-ctx_encoder-single-nq-base": "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json", - "facebook/dpr-question_encoder-single-nq-base": "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json", - "facebook/dpr-reader-single-nq-base": "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json", - "facebook/dpr-ctx_encoder-multiset-base": "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json", - "facebook/dpr-question_encoder-multiset-base": "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json", - "facebook/dpr-reader-multiset-base": "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json" -}) - -DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/dpr-ctx_encoder-single-nq-base", - "facebook/dpr-ctx_encoder-multiset-base" -]) - -DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/dpr-question_encoder-single-nq-base", - "facebook/dpr-question_encoder-multiset-base" -]) - -DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/dpr-reader-single-nq-base", - "facebook/dpr-reader-multiset-base" -]) - -TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/dpr-ctx_encoder-single-nq-base", - "facebook/dpr-ctx_encoder-multiset-base" -]) - -TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/dpr-question_encoder-single-nq-base", - "facebook/dpr-question_encoder-multiset-base" -]) - -TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/dpr-reader-single-nq-base", - "facebook/dpr-reader-multiset-base" -]) - -DPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Intel/dpt-large": "https://huggingface.co/Intel/dpt-large/resolve/main/config.json" -}) - -DPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Intel/dpt-large", - "Intel/dpt-hybrid-midas" -]) - -EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "snap-research/efficientformer-l1-300": "https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json" -}) - -EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "snap-research/efficientformer-l1-300" -]) - -TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "snap-research/efficientformer-l1-300" -]) - -EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/efficientnet-b7": "https://huggingface.co/google/efficientnet-b7/resolve/main/config.json" -}) - -EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/efficientnet-b7" -]) - -ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/electra-small-generator": "https://huggingface.co/google/electra-small-generator/resolve/main/config.json", - "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/config.json", - "google/electra-large-generator": "https://huggingface.co/google/electra-large-generator/resolve/main/config.json", - "google/electra-small-discriminator": "https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json", - "google/electra-base-discriminator": "https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json", - "google/electra-large-discriminator": "https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json" -}) - -ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/electra-small-generator", - "google/electra-base-generator", - "google/electra-large-generator", - "google/electra-small-discriminator", - "google/electra-base-discriminator", - "google/electra-large-discriminator" -]) - -TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/electra-small-generator", - "google/electra-base-generator", - "google/electra-large-generator", - "google/electra-small-discriminator", - "google/electra-base-discriminator", - "google/electra-large-discriminator" -]) - -ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/encodec_24khz": "https://huggingface.co/facebook/encodec_24khz/resolve/main/config.json", - "facebook/encodec_48khz": "https://huggingface.co/facebook/encodec_48khz/resolve/main/config.json" -}) - -ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/encodec_24khz", - "facebook/encodec_48khz" -]) - -ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "nghuyong/ernie-1.0-base-zh": "https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json", - "nghuyong/ernie-2.0-base-en": "https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json", - "nghuyong/ernie-2.0-large-en": "https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json", - "nghuyong/ernie-3.0-base-zh": "https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-medium-zh": "https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-mini-zh": "https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-micro-zh": "https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json", - "nghuyong/ernie-3.0-nano-zh": "https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json", - "nghuyong/ernie-gram-zh": "https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json", - "nghuyong/ernie-health-zh": "https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json" -}) - -ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "nghuyong/ernie-1.0-base-zh", - "nghuyong/ernie-2.0-base-en", - "nghuyong/ernie-2.0-large-en", - "nghuyong/ernie-3.0-base-zh", - "nghuyong/ernie-3.0-medium-zh", - "nghuyong/ernie-3.0-mini-zh", - "nghuyong/ernie-3.0-micro-zh", - "nghuyong/ernie-3.0-nano-zh", - "nghuyong/ernie-gram-zh", - "nghuyong/ernie-health-zh" -]) - -ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "susnato/ernie-m-base_pytorch": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json", - "susnato/ernie-m-large_pytorch": "https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json" -}) - -ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "susnato/ernie-m-base_pytorch", - "susnato/ernie-m-large_pytorch" -]) - -ESM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/esm-1b": "https://huggingface.co/facebook/esm-1b/resolve/main/config.json" -}) - -ESM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/esm2_t6_8M_UR50D", - "facebook/esm2_t12_35M_UR50D" -]) - -FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "tiiuae/falcon-40b": "https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json", - "tiiuae/falcon-7b": "https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json" -}) - -FALCON_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "tiiuae/falcon-40b", - "tiiuae/falcon-40b-instruct", - "tiiuae/falcon-7b", - "tiiuae/falcon-7b-instruct", - "tiiuae/falcon-rw-7b", - "tiiuae/falcon-rw-1b" -]) - -FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "espnet/fastspeech2_conformer_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_hifigan/raw/main/config.json" -}) - -FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "espnet/fastspeech2_conformer": "https://huggingface.co/espnet/fastspeech2_conformer/raw/main/config.json" -}) - -FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "espnet/fastspeech2_conformer_with_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_with_hifigan/raw/main/config.json" -}) - -FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "espnet/fastspeech2_conformer" -]) - -FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "flaubert/flaubert_small_cased": "https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/config.json", - "flaubert/flaubert_base_uncased": "https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/config.json", - "flaubert/flaubert_base_cased": "https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/config.json", - "flaubert/flaubert_large_cased": "https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/config.json" -}) - -FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "flaubert/flaubert_small_cased", - "flaubert/flaubert_base_uncased", - "flaubert/flaubert_base_cased", - "flaubert/flaubert_large_cased" -]) +CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/canine-s": "https://huggingface.co/google/canine-s/resolve/main/config.json"} +) + +CANINE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/canine-s", "google/canine-r"]) + +CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "OFA-Sys/chinese-clip-vit-base-patch16": "https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16/resolve/main/config.json" + } +) + +CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["OFA-Sys/chinese-clip-vit-base-patch16"]) + +CLAP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["laion/clap-htsat-fused", "laion/clap-htsat-unfused"]) + +CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"openai/clip-vit-base-patch32": "https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/config.json"} +) + +CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openai/clip-vit-base-patch32"]) + +TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openai/clip-vit-base-patch32"]) + +CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"CIDAS/clipseg-rd64": "https://huggingface.co/CIDAS/clipseg-rd64/resolve/main/config.json"} +) + +CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["CIDAS/clipseg-rd64-refined"]) + +CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"susnato/clvp_dev": "https://huggingface.co/susnato/clvp_dev/resolve/main/config.json"} +) + +CLVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["susnato/clvp_dev"]) + +CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "Salesforce/codegen-350M-nl": "https://huggingface.co/Salesforce/codegen-350M-nl/resolve/main/config.json", + "Salesforce/codegen-350M-multi": "https://huggingface.co/Salesforce/codegen-350M-multi/resolve/main/config.json", + "Salesforce/codegen-350M-mono": "https://huggingface.co/Salesforce/codegen-350M-mono/resolve/main/config.json", + "Salesforce/codegen-2B-nl": "https://huggingface.co/Salesforce/codegen-2B-nl/resolve/main/config.json", + "Salesforce/codegen-2B-multi": "https://huggingface.co/Salesforce/codegen-2B-multi/resolve/main/config.json", + "Salesforce/codegen-2B-mono": "https://huggingface.co/Salesforce/codegen-2B-mono/resolve/main/config.json", + "Salesforce/codegen-6B-nl": "https://huggingface.co/Salesforce/codegen-6B-nl/resolve/main/config.json", + "Salesforce/codegen-6B-multi": "https://huggingface.co/Salesforce/codegen-6B-multi/resolve/main/config.json", + "Salesforce/codegen-6B-mono": "https://huggingface.co/Salesforce/codegen-6B-mono/resolve/main/config.json", + "Salesforce/codegen-16B-nl": "https://huggingface.co/Salesforce/codegen-16B-nl/resolve/main/config.json", + "Salesforce/codegen-16B-multi": "https://huggingface.co/Salesforce/codegen-16B-multi/resolve/main/config.json", + "Salesforce/codegen-16B-mono": "https://huggingface.co/Salesforce/codegen-16B-mono/resolve/main/config.json", + } +) + +CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "Salesforce/codegen-350M-nl", + "Salesforce/codegen-350M-multi", + "Salesforce/codegen-350M-mono", + "Salesforce/codegen-2B-nl", + "Salesforce/codegen-2B-multi", + "Salesforce/codegen-2B-mono", + "Salesforce/codegen-6B-nl", + "Salesforce/codegen-6B-multi", + "Salesforce/codegen-6B-mono", + "Salesforce/codegen-16B-nl", + "Salesforce/codegen-16B-multi", + "Salesforce/codegen-16B-mono", + ] +) + +CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/conditional-detr-resnet-50": "https://huggingface.co/microsoft/conditional-detr-resnet-50/resolve/main/config.json" + } +) + +CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/conditional-detr-resnet-50"]) + +CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "YituTech/conv-bert-base": "https://huggingface.co/YituTech/conv-bert-base/resolve/main/config.json", + "YituTech/conv-bert-medium-small": "https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/config.json", + "YituTech/conv-bert-small": "https://huggingface.co/YituTech/conv-bert-small/resolve/main/config.json", + } +) + +CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["YituTech/conv-bert-base", "YituTech/conv-bert-medium-small", "YituTech/conv-bert-small"] +) + +TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["YituTech/conv-bert-base", "YituTech/conv-bert-medium-small", "YituTech/conv-bert-small"] +) + +CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/convnext-tiny-224": "https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json"} +) + +CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/convnext-tiny-224"]) + +CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json" + } +) + +CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/convnextv2-tiny-1k-224"]) + +CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"openbmb/cpm-ant-10b": "https://huggingface.co/openbmb/cpm-ant-10b/blob/main/config.json"} +) + +CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openbmb/cpm-ant-10b"]) + +CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"Salesforce/ctrl": "https://huggingface.co/Salesforce/ctrl/resolve/main/config.json"} +) + +CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Salesforce/ctrl"]) + +TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Salesforce/ctrl"]) + +CVT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/cvt-13": "https://huggingface.co/microsoft/cvt-13/resolve/main/config.json"} +) + +CVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "microsoft/cvt-13", + "microsoft/cvt-13-384", + "microsoft/cvt-13-384-22k", + "microsoft/cvt-21", + "microsoft/cvt-21-384", + "microsoft/cvt-21-384-22k", + ] +) + +TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "microsoft/cvt-13", + "microsoft/cvt-13-384", + "microsoft/cvt-13-384-22k", + "microsoft/cvt-21", + "microsoft/cvt-21-384", + "microsoft/cvt-21-384-22k", + ] +) + +DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/data2vec-text-base": "https://huggingface.co/data2vec/resolve/main/config.json"} +) + +DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/data2vec-vision-base-ft": "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json" + } +) + +DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "facebook/data2vec-audio-base", + "facebook/data2vec-audio-base-10m", + "facebook/data2vec-audio-base-100h", + "facebook/data2vec-audio-base-960h", + ] +) + +DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/data2vec-text-base"]) + +DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/data2vec-vision-base-ft1k"]) + +DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/deberta-base": "https://huggingface.co/microsoft/deberta-base/resolve/main/config.json", + "microsoft/deberta-large": "https://huggingface.co/microsoft/deberta-large/resolve/main/config.json", + "microsoft/deberta-xlarge": "https://huggingface.co/microsoft/deberta-xlarge/resolve/main/config.json", + "microsoft/deberta-base-mnli": "https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/config.json", + "microsoft/deberta-large-mnli": "https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/config.json", + "microsoft/deberta-xlarge-mnli": "https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/config.json", + } +) + +DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "microsoft/deberta-base", + "microsoft/deberta-large", + "microsoft/deberta-xlarge", + "microsoft/deberta-base-mnli", + "microsoft/deberta-large-mnli", + "microsoft/deberta-xlarge-mnli", + ] +) + +TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["kamalkraj/deberta-base"]) + +DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json", + "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json", + "microsoft/deberta-v2-xlarge-mnli": "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json", + "microsoft/deberta-v2-xxlarge-mnli": "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json", + } +) + +DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "microsoft/deberta-v2-xlarge", + "microsoft/deberta-v2-xxlarge", + "microsoft/deberta-v2-xlarge-mnli", + "microsoft/deberta-v2-xxlarge-mnli", + ] +) + +TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["kamalkraj/deberta-v2-xlarge"]) + +DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "edbeeching/decision-transformer-gym-hopper-medium": "https://huggingface.co/edbeeching/decision-transformer-gym-hopper-medium/resolve/main/config.json" + } +) + +DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["edbeeching/decision-transformer-gym-hopper-medium"] +) + +DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"SenseTime/deformable-detr": "https://huggingface.co/sensetime/deformable-detr/resolve/main/config.json"} +) + +DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["sensetime/deformable-detr"]) + +DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/deit-base-distilled-patch16-224": "https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json" + } +) + +DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/deit-base-distilled-patch16-224"]) + +TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/deit-base-distilled-patch16-224"]) + +MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json"} +) + +MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["speechbrain/m-ctc-t-large"]) + +OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"s-JoL/Open-Llama-V1": "https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json"} +) + +RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "yjernite/retribert-base-uncased": "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/config.json" + } +) + +RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["yjernite/retribert-base-uncased"]) + +TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "CarlCochet/trajectory-transformer-halfcheetah-medium-v2": "https://huggingface.co/CarlCochet/trajectory-transformer-halfcheetah-medium-v2/resolve/main/config.json" + } +) + +TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["CarlCochet/trajectory-transformer-halfcheetah-medium-v2"] +) + +TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"transfo-xl/transfo-xl-wt103": "https://huggingface.co/transfo-xl/transfo-xl-wt103/resolve/main/config.json"} +) + +TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["transfo-xl/transfo-xl-wt103"]) + +TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["transfo-xl/transfo-xl-wt103"]) + +VAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "Visual-Attention-Network/van-base": "https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json" + } +) + +VAN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Visual-Attention-Network/van-base"]) + +DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "LiheYoung/depth-anything-small-hf": "https://huggingface.co/LiheYoung/depth-anything-small-hf/resolve/main/config.json" + } +) + +DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["LiheYoung/depth-anything-small-hf"]) + +DETA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"ut/deta": "https://huggingface.co/ut/deta/resolve/main/config.json"} +) + +DETA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["jozhang97/deta-swin-large-o365"]) + +DETR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/detr-resnet-50": "https://huggingface.co/facebook/detr-resnet-50/resolve/main/config.json"} +) + +DETR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/detr-resnet-50"]) + +DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"shi-labs/dinat-mini-in1k-224": "https://huggingface.co/shi-labs/dinat-mini-in1k-224/resolve/main/config.json"} +) + +DINAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["shi-labs/dinat-mini-in1k-224"]) + +DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/dinov2-base": "https://huggingface.co/facebook/dinov2-base/resolve/main/config.json"} +) + +DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/dinov2-base"]) + +DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/config.json", + "distilbert-base-uncased-distilled-squad": "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json", + "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/config.json", + "distilbert-base-cased-distilled-squad": "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json", + "distilbert-base-german-cased": "https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json", + "distilbert-base-multilingual-cased": "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json", + "distilbert-base-uncased-finetuned-sst-2-english": "https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json", + } +) + +DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "distilbert-base-uncased", + "distilbert-base-uncased-distilled-squad", + "distilbert-base-cased", + "distilbert-base-cased-distilled-squad", + "distilbert-base-german-cased", + "distilbert-base-multilingual-cased", + "distilbert-base-uncased-finetuned-sst-2-english", + ] +) + +TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "distilbert-base-uncased", + "distilbert-base-uncased-distilled-squad", + "distilbert-base-cased", + "distilbert-base-cased-distilled-squad", + "distilbert-base-multilingual-cased", + "distilbert-base-uncased-finetuned-sst-2-english", + ] +) + +DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"naver-clova-ix/donut-base": "https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json"} +) + +DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["naver-clova-ix/donut-base"]) + +DPR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/dpr-ctx_encoder-single-nq-base": "https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json", + "facebook/dpr-question_encoder-single-nq-base": "https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json", + "facebook/dpr-reader-single-nq-base": "https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json", + "facebook/dpr-ctx_encoder-multiset-base": "https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json", + "facebook/dpr-question_encoder-multiset-base": "https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json", + "facebook/dpr-reader-multiset-base": "https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json", + } +) + +DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/dpr-ctx_encoder-single-nq-base", "facebook/dpr-ctx_encoder-multiset-base"] +) + +DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/dpr-question_encoder-single-nq-base", "facebook/dpr-question_encoder-multiset-base"] +) + +DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/dpr-reader-single-nq-base", "facebook/dpr-reader-multiset-base"] +) + +TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/dpr-ctx_encoder-single-nq-base", "facebook/dpr-ctx_encoder-multiset-base"] +) + +TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/dpr-question_encoder-single-nq-base", "facebook/dpr-question_encoder-multiset-base"] +) + +TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/dpr-reader-single-nq-base", "facebook/dpr-reader-multiset-base"] +) + +DPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"Intel/dpt-large": "https://huggingface.co/Intel/dpt-large/resolve/main/config.json"} +) + +DPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Intel/dpt-large", "Intel/dpt-hybrid-midas"]) + +EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "snap-research/efficientformer-l1-300": "https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json" + } +) + +EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["snap-research/efficientformer-l1-300"]) + +TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["snap-research/efficientformer-l1-300"]) + +EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/efficientnet-b7": "https://huggingface.co/google/efficientnet-b7/resolve/main/config.json"} +) + +EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/efficientnet-b7"]) + +ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/electra-small-generator": "https://huggingface.co/google/electra-small-generator/resolve/main/config.json", + "google/electra-base-generator": "https://huggingface.co/google/electra-base-generator/resolve/main/config.json", + "google/electra-large-generator": "https://huggingface.co/google/electra-large-generator/resolve/main/config.json", + "google/electra-small-discriminator": "https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json", + "google/electra-base-discriminator": "https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json", + "google/electra-large-discriminator": "https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json", + } +) + +ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/electra-small-generator", + "google/electra-base-generator", + "google/electra-large-generator", + "google/electra-small-discriminator", + "google/electra-base-discriminator", + "google/electra-large-discriminator", + ] +) + +TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/electra-small-generator", + "google/electra-base-generator", + "google/electra-large-generator", + "google/electra-small-discriminator", + "google/electra-base-discriminator", + "google/electra-large-discriminator", + ] +) + +ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/encodec_24khz": "https://huggingface.co/facebook/encodec_24khz/resolve/main/config.json", + "facebook/encodec_48khz": "https://huggingface.co/facebook/encodec_48khz/resolve/main/config.json", + } +) + +ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/encodec_24khz", "facebook/encodec_48khz"]) + +ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "nghuyong/ernie-1.0-base-zh": "https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json", + "nghuyong/ernie-2.0-base-en": "https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json", + "nghuyong/ernie-2.0-large-en": "https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json", + "nghuyong/ernie-3.0-base-zh": "https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-medium-zh": "https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-mini-zh": "https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-micro-zh": "https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json", + "nghuyong/ernie-3.0-nano-zh": "https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json", + "nghuyong/ernie-gram-zh": "https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json", + "nghuyong/ernie-health-zh": "https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json", + } +) + +ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "nghuyong/ernie-1.0-base-zh", + "nghuyong/ernie-2.0-base-en", + "nghuyong/ernie-2.0-large-en", + "nghuyong/ernie-3.0-base-zh", + "nghuyong/ernie-3.0-medium-zh", + "nghuyong/ernie-3.0-mini-zh", + "nghuyong/ernie-3.0-micro-zh", + "nghuyong/ernie-3.0-nano-zh", + "nghuyong/ernie-gram-zh", + "nghuyong/ernie-health-zh", + ] +) + +ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "susnato/ernie-m-base_pytorch": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json", + "susnato/ernie-m-large_pytorch": "https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json", + } +) + +ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["susnato/ernie-m-base_pytorch", "susnato/ernie-m-large_pytorch"] +) + +ESM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/esm-1b": "https://huggingface.co/facebook/esm-1b/resolve/main/config.json"} +) + +ESM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/esm2_t6_8M_UR50D", "facebook/esm2_t12_35M_UR50D"]) + +FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "tiiuae/falcon-40b": "https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json", + "tiiuae/falcon-7b": "https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json", + } +) + +FALCON_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "tiiuae/falcon-40b", + "tiiuae/falcon-40b-instruct", + "tiiuae/falcon-7b", + "tiiuae/falcon-7b-instruct", + "tiiuae/falcon-rw-7b", + "tiiuae/falcon-rw-1b", + ] +) + +FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "espnet/fastspeech2_conformer_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_hifigan/raw/main/config.json" + } +) + +FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"espnet/fastspeech2_conformer": "https://huggingface.co/espnet/fastspeech2_conformer/raw/main/config.json"} +) + +FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "espnet/fastspeech2_conformer_with_hifigan": "https://huggingface.co/espnet/fastspeech2_conformer_with_hifigan/raw/main/config.json" + } +) + +FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["espnet/fastspeech2_conformer"]) + +FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "flaubert/flaubert_small_cased": "https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/config.json", + "flaubert/flaubert_base_uncased": "https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/config.json", + "flaubert/flaubert_base_cased": "https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/config.json", + "flaubert/flaubert_large_cased": "https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/config.json", + } +) + +FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "flaubert/flaubert_small_cased", + "flaubert/flaubert_base_uncased", + "flaubert/flaubert_base_cased", + "flaubert/flaubert_large_cased", + ] +) TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) -FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/flava-full": "https://huggingface.co/facebook/flava-full/resolve/main/config.json" -}) +FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/flava-full": "https://huggingface.co/facebook/flava-full/resolve/main/config.json"} +) -FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/flava-full" -]) +FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/flava-full"]) -FNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/config.json", - "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/config.json" -}) +FNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/config.json", + "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/config.json", + } +) -FNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/fnet-base", - "google/fnet-large" -]) +FNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/fnet-base", "google/fnet-large"]) -FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json" -}) +FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json"} +) -FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/focalnet-tiny" -]) +FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/focalnet-tiny"]) FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) -FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/config.json", - "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json", - "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/config.json", - "funnel-transformer/medium-base": "https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json", - "funnel-transformer/intermediate": "https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json", - "funnel-transformer/intermediate-base": "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json", - "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/config.json", - "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json", - "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json", - "funnel-transformer/xlarge-base": "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json" -}) - -FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "funnel-transformer/small", - "funnel-transformer/small-base", - "funnel-transformer/medium", - "funnel-transformer/medium-base", - "funnel-transformer/intermediate", - "funnel-transformer/intermediate-base", - "funnel-transformer/large", - "funnel-transformer/large-base", - "funnel-transformer/xlarge-base", - "funnel-transformer/xlarge" -]) - -TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "funnel-transformer/small", - "funnel-transformer/small-base", - "funnel-transformer/medium", - "funnel-transformer/medium-base", - "funnel-transformer/intermediate", - "funnel-transformer/intermediate-base", - "funnel-transformer/large", - "funnel-transformer/large-base", - "funnel-transformer/xlarge-base", - "funnel-transformer/xlarge" -]) - -FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "adept/fuyu-8b": "https://huggingface.co/adept/fuyu-8b/resolve/main/config.json" -}) +FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/config.json", + "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json", + "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/config.json", + "funnel-transformer/medium-base": "https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json", + "funnel-transformer/intermediate": "https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json", + "funnel-transformer/intermediate-base": "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json", + "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/config.json", + "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json", + "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json", + "funnel-transformer/xlarge-base": "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json", + } +) + +FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "funnel-transformer/small", + "funnel-transformer/small-base", + "funnel-transformer/medium", + "funnel-transformer/medium-base", + "funnel-transformer/intermediate", + "funnel-transformer/intermediate-base", + "funnel-transformer/large", + "funnel-transformer/large-base", + "funnel-transformer/xlarge-base", + "funnel-transformer/xlarge", + ] +) + +TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "funnel-transformer/small", + "funnel-transformer/small-base", + "funnel-transformer/medium", + "funnel-transformer/medium-base", + "funnel-transformer/intermediate", + "funnel-transformer/intermediate-base", + "funnel-transformer/large", + "funnel-transformer/large-base", + "funnel-transformer/xlarge-base", + "funnel-transformer/xlarge", + ] +) + +FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"adept/fuyu-8b": "https://huggingface.co/adept/fuyu-8b/resolve/main/config.json"} +) GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) -GIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/git-base": "https://huggingface.co/microsoft/git-base/resolve/main/config.json" -}) - -GIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/git-base" -]) - -GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "vinvino02/glpn-kitti": "https://huggingface.co/vinvino02/glpn-kitti/resolve/main/config.json" -}) - -GLPN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "vinvino02/glpn-kitti" -]) - -GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/config.json", - "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/config.json", - "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/config.json", - "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/config.json", - "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/config.json" -}) - -GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai-community/gpt2", - "openai-community/gpt2-medium", - "openai-community/gpt2-large", - "openai-community/gpt2-xl", - "distilbert/distilgpt2" -]) - -TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai-community/gpt2", - "openai-community/gpt2-medium", - "openai-community/gpt2-large", - "openai-community/gpt2-xl", - "distilbert/distilgpt2" -]) - -GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json" -}) - -GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "bigcode/gpt_bigcode-santacoder" -]) - -GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "EleutherAI/gpt-neo-1.3B": "https://huggingface.co/EleutherAI/gpt-neo-1.3B/resolve/main/config.json" -}) - -GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "EleutherAI/gpt-neo-1.3B" -]) - -GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "EleutherAI/gpt-neox-20b": "https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/config.json" -}) - -GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "EleutherAI/gpt-neox-20b" -]) - -GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "abeja/gpt-neox-japanese-2.7b": "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json" -}) - -GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json" -]) - -GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "EleutherAI/gpt-j-6B": "https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json" -}) - -GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "EleutherAI/gpt-j-6B" -]) - -GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "tanreinama/GPTSAN-2.8B-spout_is_uniform": "https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json" -}) - -GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Tanrei/GPTSAN-japanese" -]) - -GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "graphormer-base": "https://huggingface.co/clefourrier/graphormer-base-pcqm4mv2/resolve/main/config.json" -}) - -GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "clefourrier/graphormer-base-pcqm4mv1", - "clefourrier/graphormer-base-pcqm4mv2" -]) - -GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "nvidia/groupvit-gcc-yfcc": "https://huggingface.co/nvidia/groupvit-gcc-yfcc/resolve/main/config.json" -}) - -GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "nvidia/groupvit-gcc-yfcc" -]) - -TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "nvidia/groupvit-gcc-yfcc" -]) - -HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/hubert-base-ls960": "https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json" -}) - -HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/hubert-base-ls960" -]) - -TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/hubert-base-ls960" -]) - -IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "kssteven/ibert-roberta-base": "https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json", - "kssteven/ibert-roberta-large": "https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json", - "kssteven/ibert-roberta-large-mnli": "https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json" -}) - -IBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "kssteven/ibert-roberta-base", - "kssteven/ibert-roberta-large", - "kssteven/ibert-roberta-large-mnli" -]) - -IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "HuggingFaceM4/idefics-9b": "https://huggingface.co/HuggingFaceM4/idefics-9b/blob/main/config.json", - "HuggingFaceM4/idefics-80b": "https://huggingface.co/HuggingFaceM4/idefics-80b/blob/main/config.json" -}) - -IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "HuggingFaceM4/idefics-9b", - "HuggingFaceM4/idefics-80b" -]) - -IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "openai/imagegpt-small": "", - "openai/imagegpt-medium": "", - "openai/imagegpt-large": "" -}) - -IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai/imagegpt-small", - "openai/imagegpt-medium", - "openai/imagegpt-large" -]) - -INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "huggingface/informer-tourism-monthly": "https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json" -}) - -INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "huggingface/informer-tourism-monthly" -]) - -INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Salesforce/instruct-blip-flan-t5": "https://huggingface.co/Salesforce/instruct-blip-flan-t5/resolve/main/config.json" -}) - -INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Salesforce/instructblip-flan-t5-xl" -]) - -JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "openai/jukebox-5b-lyrics": "https://huggingface.co/openai/jukebox-5b-lyrics/blob/main/config.json", - "openai/jukebox-1b-lyrics": "https://huggingface.co/openai/jukebox-1b-lyrics/blob/main/config.json" -}) - -JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai/jukebox-1b-lyrics", - "openai/jukebox-5b-lyrics" -]) - -KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/kosmos-2-patch14-224": "https://huggingface.co/microsoft/kosmos-2-patch14-224/resolve/main/config.json" -}) - -KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/kosmos-2-patch14-224" -]) - -LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/layoutlm-base-uncased": "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/config.json", - "microsoft/layoutlm-large-uncased": "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/config.json" -}) - -LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "layoutlm-base-uncased", - "layoutlm-large-uncased" -]) - -TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/layoutlm-base-uncased", - "microsoft/layoutlm-large-uncased" -]) - -LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "layoutlmv2-base-uncased": "https://huggingface.co/microsoft/layoutlmv2-base-uncased/resolve/main/config.json", - "layoutlmv2-large-uncased": "https://huggingface.co/microsoft/layoutlmv2-large-uncased/resolve/main/config.json" -}) - -LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/layoutlmv2-base-uncased", - "microsoft/layoutlmv2-large-uncased" -]) - -LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/resolve/main/config.json" -}) - -LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/layoutlmv3-base", - "microsoft/layoutlmv3-large" -]) - -TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/layoutlmv3-base", - "microsoft/layoutlmv3-large" -]) - -LED_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/config.json" -}) - -LED_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "allenai/led-base-16384" -]) - -LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/levit-128S": "https://huggingface.co/facebook/levit-128S/resolve/main/config.json" -}) - -LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/levit-128S" -]) - -LILT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "SCUT-DLVCLab/lilt-roberta-en-base": "https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base/resolve/main/config.json" -}) - -LILT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "SCUT-DLVCLab/lilt-roberta-en-base" -]) +GIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/git-base": "https://huggingface.co/microsoft/git-base/resolve/main/config.json"} +) + +GIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/git-base"]) + +GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"vinvino02/glpn-kitti": "https://huggingface.co/vinvino02/glpn-kitti/resolve/main/config.json"} +) + +GLPN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["vinvino02/glpn-kitti"]) + +GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "openai-community/gpt2": "https://huggingface.co/openai-community/gpt2/resolve/main/config.json", + "openai-community/gpt2-medium": "https://huggingface.co/openai-community/gpt2-medium/resolve/main/config.json", + "openai-community/gpt2-large": "https://huggingface.co/openai-community/gpt2-large/resolve/main/config.json", + "openai-community/gpt2-xl": "https://huggingface.co/openai-community/gpt2-xl/resolve/main/config.json", + "distilbert/distilgpt2": "https://huggingface.co/distilbert/distilgpt2/resolve/main/config.json", + } +) + +GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "openai-community/gpt2", + "openai-community/gpt2-medium", + "openai-community/gpt2-large", + "openai-community/gpt2-xl", + "distilbert/distilgpt2", + ] +) + +TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "openai-community/gpt2", + "openai-community/gpt2-medium", + "openai-community/gpt2-large", + "openai-community/gpt2-xl", + "distilbert/distilgpt2", + ] +) + +GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json" + } +) + +GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["bigcode/gpt_bigcode-santacoder"]) + +GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"EleutherAI/gpt-neo-1.3B": "https://huggingface.co/EleutherAI/gpt-neo-1.3B/resolve/main/config.json"} +) + +GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["EleutherAI/gpt-neo-1.3B"]) + +GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"EleutherAI/gpt-neox-20b": "https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/config.json"} +) + +GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["EleutherAI/gpt-neox-20b"]) + +GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"abeja/gpt-neox-japanese-2.7b": "https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json"} +) + +GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json"] +) + +GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"EleutherAI/gpt-j-6B": "https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json"} +) + +GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["EleutherAI/gpt-j-6B"]) + +GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "tanreinama/GPTSAN-2.8B-spout_is_uniform": "https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json" + } +) + +GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Tanrei/GPTSAN-japanese"]) + +GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"graphormer-base": "https://huggingface.co/clefourrier/graphormer-base-pcqm4mv2/resolve/main/config.json"} +) + +GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["clefourrier/graphormer-base-pcqm4mv1", "clefourrier/graphormer-base-pcqm4mv2"] +) + +GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"nvidia/groupvit-gcc-yfcc": "https://huggingface.co/nvidia/groupvit-gcc-yfcc/resolve/main/config.json"} +) + +GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["nvidia/groupvit-gcc-yfcc"]) + +TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["nvidia/groupvit-gcc-yfcc"]) + +HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/hubert-base-ls960": "https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json"} +) + +HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/hubert-base-ls960"]) + +TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/hubert-base-ls960"]) + +IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "kssteven/ibert-roberta-base": "https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json", + "kssteven/ibert-roberta-large": "https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json", + "kssteven/ibert-roberta-large-mnli": "https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json", + } +) + +IBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["kssteven/ibert-roberta-base", "kssteven/ibert-roberta-large", "kssteven/ibert-roberta-large-mnli"] +) + +IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "HuggingFaceM4/idefics-9b": "https://huggingface.co/HuggingFaceM4/idefics-9b/blob/main/config.json", + "HuggingFaceM4/idefics-80b": "https://huggingface.co/HuggingFaceM4/idefics-80b/blob/main/config.json", + } +) + +IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["HuggingFaceM4/idefics-9b", "HuggingFaceM4/idefics-80b"]) + +IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"openai/imagegpt-small": "", "openai/imagegpt-medium": "", "openai/imagegpt-large": ""} +) + +IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["openai/imagegpt-small", "openai/imagegpt-medium", "openai/imagegpt-large"] +) + +INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "huggingface/informer-tourism-monthly": "https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json" + } +) + +INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["huggingface/informer-tourism-monthly"]) + +INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "Salesforce/instruct-blip-flan-t5": "https://huggingface.co/Salesforce/instruct-blip-flan-t5/resolve/main/config.json" + } +) + +INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Salesforce/instructblip-flan-t5-xl"]) + +JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "openai/jukebox-5b-lyrics": "https://huggingface.co/openai/jukebox-5b-lyrics/blob/main/config.json", + "openai/jukebox-1b-lyrics": "https://huggingface.co/openai/jukebox-1b-lyrics/blob/main/config.json", + } +) + +JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openai/jukebox-1b-lyrics", "openai/jukebox-5b-lyrics"]) + +KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/kosmos-2-patch14-224": "https://huggingface.co/microsoft/kosmos-2-patch14-224/resolve/main/config.json" + } +) + +KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/kosmos-2-patch14-224"]) + +LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/layoutlm-base-uncased": "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/config.json", + "microsoft/layoutlm-large-uncased": "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/config.json", + } +) + +LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["layoutlm-base-uncased", "layoutlm-large-uncased"]) + +TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["microsoft/layoutlm-base-uncased", "microsoft/layoutlm-large-uncased"] +) + +LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "layoutlmv2-base-uncased": "https://huggingface.co/microsoft/layoutlmv2-base-uncased/resolve/main/config.json", + "layoutlmv2-large-uncased": "https://huggingface.co/microsoft/layoutlmv2-large-uncased/resolve/main/config.json", + } +) + +LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["microsoft/layoutlmv2-base-uncased", "microsoft/layoutlmv2-large-uncased"] +) + +LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/layoutlmv3-base": "https://huggingface.co/microsoft/layoutlmv3-base/resolve/main/config.json"} +) + +LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/layoutlmv3-base", "microsoft/layoutlmv3-large"]) + +TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["microsoft/layoutlmv3-base", "microsoft/layoutlmv3-large"] +) + +LED_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/config.json"} +) + +LED_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["allenai/led-base-16384"]) + +LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/levit-128S": "https://huggingface.co/facebook/levit-128S/resolve/main/config.json"} +) + +LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/levit-128S"]) + +LILT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "SCUT-DLVCLab/lilt-roberta-en-base": "https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base/resolve/main/config.json" + } +) + +LILT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["SCUT-DLVCLab/lilt-roberta-en-base"]) LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) -LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "llava-hf/llava-v1.5-7b": "https://huggingface.co/llava-hf/llava-v1.5-7b/resolve/main/config.json" -}) - -LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "llava-hf/llava-1.5-7b-hf", - "llava-hf/llava-1.5-13b-hf", - "llava-hf/bakLlava-v1-hf" -]) - -LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/config.json", - "allenai/longformer-large-4096": "https://huggingface.co/allenai/longformer-large-4096/resolve/main/config.json", - "allenai/longformer-large-4096-finetuned-triviaqa": "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/config.json", - "allenai/longformer-base-4096-extra.pos.embd.only": "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/config.json", - "allenai/longformer-large-4096-extra.pos.embd.only": "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/config.json" -}) - -LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "allenai/longformer-base-4096", - "allenai/longformer-large-4096", - "allenai/longformer-large-4096-finetuned-triviaqa", - "allenai/longformer-base-4096-extra.pos.embd.only", - "allenai/longformer-large-4096-extra.pos.embd.only" -]) - -TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "allenai/longformer-base-4096", - "allenai/longformer-large-4096", - "allenai/longformer-large-4096-finetuned-triviaqa", - "allenai/longformer-base-4096-extra.pos.embd.only", - "allenai/longformer-large-4096-extra.pos.embd.only" -]) - -LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/long-t5-local-base": "https://huggingface.co/google/long-t5-local-base/blob/main/config.json", - "google/long-t5-local-large": "https://huggingface.co/google/long-t5-local-large/blob/main/config.json", - "google/long-t5-tglobal-base": "https://huggingface.co/google/long-t5-tglobal-base/blob/main/config.json", - "google/long-t5-tglobal-large": "https://huggingface.co/google/long-t5-tglobal-large/blob/main/config.json" -}) - -LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/long-t5-local-base", - "google/long-t5-local-large", - "google/long-t5-tglobal-base", - "google/long-t5-tglobal-large" -]) - -LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/config.json", - "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/config.json" -}) - -LUKE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "studio-ousia/luke-base", - "studio-ousia/luke-large" -]) - -LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json" -}) - -TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "unc-nlp/lxmert-base-uncased" -]) - -M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/m2m100_418M": "https://huggingface.co/facebook/m2m100_418M/resolve/main/config.json" -}) - -M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/m2m100_418M" -]) - -MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "state-spaces/mamba-2.8b": "https://huggingface.co/state-spaces/mamba-2.8b/resolve/main/config.json" -}) +LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"llava-hf/llava-v1.5-7b": "https://huggingface.co/llava-hf/llava-v1.5-7b/resolve/main/config.json"} +) + +LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["llava-hf/llava-1.5-7b-hf", "llava-hf/llava-1.5-13b-hf", "llava-hf/bakLlava-v1-hf"] +) + +LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "allenai/longformer-base-4096": "https://huggingface.co/allenai/longformer-base-4096/resolve/main/config.json", + "allenai/longformer-large-4096": "https://huggingface.co/allenai/longformer-large-4096/resolve/main/config.json", + "allenai/longformer-large-4096-finetuned-triviaqa": "https://huggingface.co/allenai/longformer-large-4096-finetuned-triviaqa/resolve/main/config.json", + "allenai/longformer-base-4096-extra.pos.embd.only": "https://huggingface.co/allenai/longformer-base-4096-extra.pos.embd.only/resolve/main/config.json", + "allenai/longformer-large-4096-extra.pos.embd.only": "https://huggingface.co/allenai/longformer-large-4096-extra.pos.embd.only/resolve/main/config.json", + } +) + +LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "allenai/longformer-base-4096", + "allenai/longformer-large-4096", + "allenai/longformer-large-4096-finetuned-triviaqa", + "allenai/longformer-base-4096-extra.pos.embd.only", + "allenai/longformer-large-4096-extra.pos.embd.only", + ] +) + +TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "allenai/longformer-base-4096", + "allenai/longformer-large-4096", + "allenai/longformer-large-4096-finetuned-triviaqa", + "allenai/longformer-base-4096-extra.pos.embd.only", + "allenai/longformer-large-4096-extra.pos.embd.only", + ] +) + +LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/long-t5-local-base": "https://huggingface.co/google/long-t5-local-base/blob/main/config.json", + "google/long-t5-local-large": "https://huggingface.co/google/long-t5-local-large/blob/main/config.json", + "google/long-t5-tglobal-base": "https://huggingface.co/google/long-t5-tglobal-base/blob/main/config.json", + "google/long-t5-tglobal-large": "https://huggingface.co/google/long-t5-tglobal-large/blob/main/config.json", + } +) + +LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/long-t5-local-base", + "google/long-t5-local-large", + "google/long-t5-tglobal-base", + "google/long-t5-tglobal-large", + ] +) + +LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/config.json", + "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/config.json", + } +) + +LUKE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["studio-ousia/luke-base", "studio-ousia/luke-large"]) + +LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"unc-nlp/lxmert-base-uncased": "https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json"} +) + +TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["unc-nlp/lxmert-base-uncased"]) + +M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/m2m100_418M": "https://huggingface.co/facebook/m2m100_418M/resolve/main/config.json"} +) + +M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/m2m100_418M"]) + +MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"state-spaces/mamba-2.8b": "https://huggingface.co/state-spaces/mamba-2.8b/resolve/main/config.json"} +) MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) -MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/config.json", - "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/config.json" -}) +MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/markuplm-base": "https://huggingface.co/microsoft/markuplm-base/resolve/main/config.json", + "microsoft/markuplm-large": "https://huggingface.co/microsoft/markuplm-large/resolve/main/config.json", + } +) -MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/markuplm-base", - "microsoft/markuplm-large" -]) +MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/markuplm-base", "microsoft/markuplm-large"]) -MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/mask2former-swin-small-coco-instance": "https://huggingface.co/facebook/mask2former-swin-small-coco-instance/blob/main/config.json" -}) +MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/mask2former-swin-small-coco-instance": "https://huggingface.co/facebook/mask2former-swin-small-coco-instance/blob/main/config.json" + } +) -MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/mask2former-swin-small-coco-instance" -]) +MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/mask2former-swin-small-coco-instance"]) -MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/maskformer-swin-base-ade": "https://huggingface.co/facebook/maskformer-swin-base-ade/blob/main/config.json" -}) +MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/maskformer-swin-base-ade": "https://huggingface.co/facebook/maskformer-swin-base-ade/blob/main/config.json" + } +) -MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/maskformer-swin-base-ade" -]) +MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/maskformer-swin-base-ade"]) -MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "mnaylor/mega-base-wikitext": "https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json" -}) +MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"mnaylor/mega-base-wikitext": "https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json"} +) -MEGA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "mnaylor/mega-base-wikitext" -]) +MEGA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["mnaylor/mega-base-wikitext"]) MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) -MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "nvidia/megatron-bert-cased-345m" -]) - -MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "alibaba-damo/mgp-str-base": "https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json" -}) - -MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "alibaba-damo/mgp-str-base" -]) - -MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "mistralai/Mistral-7B-v0.1": "https://huggingface.co/mistralai/Mistral-7B-v0.1/resolve/main/config.json", - "mistralai/Mistral-7B-Instruct-v0.1": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1/resolve/main/config.json" -}) - -MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "mistral-ai/Mixtral-8x7B": "https://huggingface.co/mistral-ai/Mixtral-8x7B/resolve/main/config.json" -}) - -MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/config.json" -}) - -MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/mobilebert-uncased" -]) - -TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/mobilebert-uncased" -]) - -MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/mobilenet_v1_1.0_224": "https://huggingface.co/google/mobilenet_v1_1.0_224/resolve/main/config.json", - "google/mobilenet_v1_0.75_192": "https://huggingface.co/google/mobilenet_v1_0.75_192/resolve/main/config.json" -}) - -MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/mobilenet_v1_1.0_224", - "google/mobilenet_v1_0.75_192" -]) - -MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/mobilenet_v2_1.4_224": "https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json", - "google/mobilenet_v2_1.0_224": "https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json", - "google/mobilenet_v2_0.75_160": "https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json", - "google/mobilenet_v2_0.35_96": "https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json" -}) - -MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/mobilenet_v2_1.4_224", - "google/mobilenet_v2_1.0_224", - "google/mobilenet_v2_0.37_160", - "google/mobilenet_v2_0.35_96" -]) - -MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "apple/mobilevit-small": "https://huggingface.co/apple/mobilevit-small/resolve/main/config.json", - "apple/mobilevit-x-small": "https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json", - "apple/mobilevit-xx-small": "https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json", - "apple/deeplabv3-mobilevit-small": "https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json", - "apple/deeplabv3-mobilevit-x-small": "https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json", - "apple/deeplabv3-mobilevit-xx-small": "https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json" -}) - -MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "apple/mobilevit-small", - "apple/mobilevit-x-small", - "apple/mobilevit-xx-small", - "apple/deeplabv3-mobilevit-small", - "apple/deeplabv3-mobilevit-x-small", - "apple/deeplabv3-mobilevit-xx-small" -]) - -TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "apple/mobilevit-small", - "apple/mobilevit-x-small", - "apple/mobilevit-xx-small", - "apple/deeplabv3-mobilevit-small", - "apple/deeplabv3-mobilevit-x-small", - "apple/deeplabv3-mobilevit-xx-small" -]) - -MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "apple/mobilevitv2-1.0": "https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json" -}) - -MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "apple/mobilevitv2-1.0-imagenet1k-256" -]) - -MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/config.json" -}) - -MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/mpnet-base" -]) - -TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/mpnet-base" -]) - -MPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "mosaicml/mpt-7b": "https://huggingface.co/mosaicml/mpt-7b/resolve/main/config.json" -}) - -MPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "mosaicml/mpt-7b", - "mosaicml/mpt-7b-storywriter", - "mosaicml/mpt-7b-instruct", - "mosaicml/mpt-7b-8k", - "mosaicml/mpt-7b-8k-instruct", - "mosaicml/mpt-7b-8k-chat", - "mosaicml/mpt-30b", - "mosaicml/mpt-30b-instruct", - "mosaicml/mpt-30b-chat" -]) - -MRA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "uw-madison/mra-base-512-4": "https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json" -}) - -MRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "uw-madison/mra-base-512-4" -]) - -MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/musicgen-small": "https://huggingface.co/facebook/musicgen-small/resolve/main/config.json" -}) - -MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/musicgen-small" -]) - -MVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "RUCAIBox/mvp", - "RUCAIBox/mvp-data-to-text", - "RUCAIBox/mvp-open-dialog", - "RUCAIBox/mvp-question-answering", - "RUCAIBox/mvp-question-generation", - "RUCAIBox/mvp-story", - "RUCAIBox/mvp-summarization", - "RUCAIBox/mvp-task-dialog", - "RUCAIBox/mtl-data-to-text", - "RUCAIBox/mtl-multi-task", - "RUCAIBox/mtl-open-dialog", - "RUCAIBox/mtl-question-answering", - "RUCAIBox/mtl-question-generation", - "RUCAIBox/mtl-story", - "RUCAIBox/mtl-summarization" -]) - -NAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "shi-labs/nat-mini-in1k-224": "https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json" -}) - -NAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "shi-labs/nat-mini-in1k-224" -]) - -NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "sijunhe/nezha-cn-base": "https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json" -}) - -NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "sijunhe/nezha-cn-base", - "sijunhe/nezha-cn-large", - "sijunhe/nezha-base-wwm", - "sijunhe/nezha-large-wwm" -]) - -NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/nllb-moe-54B": "https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json" -}) - -NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/nllb-moe-54b" -]) - -NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "uw-madison/nystromformer-512": "https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json" -}) - -NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "uw-madison/nystromformer-512" -]) - -ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "shi-labs/oneformer_ade20k_swin_tiny": "https://huggingface.co/shi-labs/oneformer_ade20k_swin_tiny/blob/main/config.json" -}) - -ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "shi-labs/oneformer_ade20k_swin_tiny" -]) - -OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/config.json" -}) - -OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai-community/openai-gpt" -]) - -TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai-community/openai-gpt" -]) - -OPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/opt-125m", - "facebook/opt-350m", - "facebook/opt-1.3b", - "facebook/opt-2.7b", - "facebook/opt-6.7b", - "facebook/opt-13b", - "facebook/opt-30b" -]) - -OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/owlv2-base-patch16": "https://huggingface.co/google/owlv2-base-patch16/resolve/main/config.json" -}) - -OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/owlv2-base-patch16-ensemble" -]) - -OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/owlvit-base-patch32": "https://huggingface.co/google/owlvit-base-patch32/resolve/main/config.json", - "google/owlvit-base-patch16": "https://huggingface.co/google/owlvit-base-patch16/resolve/main/config.json", - "google/owlvit-large-patch14": "https://huggingface.co/google/owlvit-large-patch14/resolve/main/config.json" -}) - -OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/owlvit-base-patch32", - "google/owlvit-base-patch16", - "google/owlvit-large-patch14" -]) - -PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "ibm/patchtsmixer-etth1-pretrain": "https://huggingface.co/ibm/patchtsmixer-etth1-pretrain/resolve/main/config.json" -}) - -PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "ibm/patchtsmixer-etth1-pretrain" -]) - -PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "ibm/patchtst-base": "https://huggingface.co/ibm/patchtst-base/resolve/main/config.json" -}) - -PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "ibm/patchtst-etth1-pretrain" -]) - -PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/pegasus-large": "https://huggingface.co/google/pegasus-large/resolve/main/config.json" -}) - -PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/pegasus-x-base": "https://huggingface.co/google/pegasus-x-base/resolve/main/config.json", - "google/pegasus-x-large": "https://huggingface.co/google/pegasus-x-large/resolve/main/config.json" -}) - -PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/pegasus-x-base", - "google/pegasus-x-large" -]) - -PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "deepmind/language-perceiver": "https://huggingface.co/deepmind/language-perceiver/resolve/main/config.json" -}) - -PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "deepmind/language-perceiver" -]) - -PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "adept/persimmon-8b-base": "https://huggingface.co/adept/persimmon-8b-base/resolve/main/config.json" -}) - -PHI_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/phi-1": "https://huggingface.co/microsoft/phi-1/resolve/main/config.json", - "microsoft/phi-1_5": "https://huggingface.co/microsoft/phi-1_5/resolve/main/config.json", - "microsoft/phi-2": "https://huggingface.co/microsoft/phi-2/resolve/main/config.json" -}) - -PHI_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/phi-1", - "microsoft/phi-1_5", - "microsoft/phi-2" -]) - -PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/pix2struct-textcaps-base": "https://huggingface.co/google/pix2struct-textcaps-base/resolve/main/config.json" -}) - -PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/pix2struct-textcaps-base", - "google/pix2struct-textcaps-large", - "google/pix2struct-base", - "google/pix2struct-large", - "google/pix2struct-ai2d-base", - "google/pix2struct-ai2d-large", - "google/pix2struct-widget-captioning-base", - "google/pix2struct-widget-captioning-large", - "google/pix2struct-screen2words-base", - "google/pix2struct-screen2words-large", - "google/pix2struct-docvqa-base", - "google/pix2struct-docvqa-large", - "google/pix2struct-ocrvqa-base", - "google/pix2struct-ocrvqa-large", - "google/pix2struct-chartqa-base", - "google/pix2struct-inforgraphics-vqa-base", - "google/pix2struct-inforgraphics-vqa-large" -]) - -PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "uclanlp/plbart-base": "https://huggingface.co/uclanlp/plbart-base/resolve/main/config.json" -}) - -PLBART_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "uclanlp/plbart-base", - "uclanlp/plbart-cs-java", - "uclanlp/plbart-multi_task-all" -]) - -POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "sail/poolformer_s12": "https://huggingface.co/sail/poolformer_s12/resolve/main/config.json" -}) - -POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "sail/poolformer_s12" -]) - -POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "sweetcocoa/pop2piano": "https://huggingface.co/sweetcocoa/pop2piano/blob/main/config.json" -}) - -POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "sweetcocoa/pop2piano" -]) - -PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/prophetnet-large-uncased": "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json" -}) - -PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/prophetnet-large-uncased" -]) - -PVT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "pvt-tiny-224": "https://huggingface.co/Zetatech/pvt-tiny-224" -}) - -PVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Zetatech/pvt-tiny-224" -]) - -QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json" -}) - -QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google-bert/bert-base-uncased" -]) - -QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Qwen/Qwen2-7B-beta": "https://huggingface.co/Qwen/Qwen2-7B-beta/resolve/main/config.json" -}) - -REALM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/realm-cc-news-pretrained-embedder": "https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json", - "google/realm-cc-news-pretrained-encoder": "https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json", - "google/realm-cc-news-pretrained-scorer": "https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json", - "google/realm-cc-news-pretrained-openqa": "https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json", - "google/realm-orqa-nq-openqa": "https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json", - "google/realm-orqa-nq-reader": "https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json", - "google/realm-orqa-wq-openqa": "https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json", - "google/realm-orqa-wq-reader": "https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json" -}) - -REALM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/realm-cc-news-pretrained-embedder", - "google/realm-cc-news-pretrained-encoder", - "google/realm-cc-news-pretrained-scorer", - "google/realm-cc-news-pretrained-openqa", - "google/realm-orqa-nq-openqa", - "google/realm-orqa-nq-reader", - "google/realm-orqa-wq-openqa", - "google/realm-orqa-wq-reader" -]) - -REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/reformer-crime-and-punishment": "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json", - "google/reformer-enwik8": "https://huggingface.co/google/reformer-enwik8/resolve/main/config.json" -}) - -REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/reformer-crime-and-punishment", - "google/reformer-enwik8" -]) - -REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/regnet-y-040": "https://huggingface.co/facebook/regnet-y-040/blob/main/config.json" -}) - -REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/regnet-y-040" -]) - -TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/regnet-y-040" -]) - -REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/rembert": "https://huggingface.co/google/rembert/resolve/main/config.json" -}) - -REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/rembert" -]) - -TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/rembert" -]) - -RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/resnet-50": "https://huggingface.co/microsoft/resnet-50/blob/main/config.json" -}) - -RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/resnet-50" -]) - -TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/resnet-50" -]) - -ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/config.json", - "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/config.json", - "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/config.json", - "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/config.json", - "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/config.json", - "openai-community/roberta-large-openai-detector": "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/config.json" -}) - -ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "FacebookAI/roberta-base", - "FacebookAI/roberta-large", - "FacebookAI/roberta-large-mnli", - "distilbert/distilroberta-base", - "openai-community/roberta-base-openai-detector", - "openai-community/roberta-large-openai-detector" -]) - -TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "FacebookAI/roberta-base", - "FacebookAI/roberta-large", - "FacebookAI/roberta-large-mnli", - "distilbert/distilroberta-base" -]) - -ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "andreasmadsen/efficient_mlm_m0.40": "https://huggingface.co/andreasmadsen/efficient_mlm_m0.40/resolve/main/config.json" -}) - -ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "andreasmadsen/efficient_mlm_m0.15", - "andreasmadsen/efficient_mlm_m0.20", - "andreasmadsen/efficient_mlm_m0.30", - "andreasmadsen/efficient_mlm_m0.40", - "andreasmadsen/efficient_mlm_m0.50", - "andreasmadsen/efficient_mlm_m0.60", - "andreasmadsen/efficient_mlm_m0.70", - "andreasmadsen/efficient_mlm_m0.80" -]) - -TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "andreasmadsen/efficient_mlm_m0.15", - "andreasmadsen/efficient_mlm_m0.20", - "andreasmadsen/efficient_mlm_m0.30", - "andreasmadsen/efficient_mlm_m0.40", - "andreasmadsen/efficient_mlm_m0.50", - "andreasmadsen/efficient_mlm_m0.60", - "andreasmadsen/efficient_mlm_m0.70", - "andreasmadsen/efficient_mlm_m0.80" -]) - -ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "weiweishi/roc-bert-base-zh": "https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json" -}) - -ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "weiweishi/roc-bert-base-zh" -]) - -ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/config.json", - "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/config.json", - "junnyu/roformer_chinese_char_small": "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/config.json", - "junnyu/roformer_chinese_char_base": "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/config.json", - "junnyu/roformer_small_discriminator": "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/config.json", - "junnyu/roformer_small_generator": "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/config.json" -}) - -ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "junnyu/roformer_chinese_small", - "junnyu/roformer_chinese_base", - "junnyu/roformer_chinese_char_small", - "junnyu/roformer_chinese_char_base", - "junnyu/roformer_small_discriminator", - "junnyu/roformer_small_generator" -]) - -TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "junnyu/roformer_chinese_small", - "junnyu/roformer_chinese_base", - "junnyu/roformer_chinese_char_small", - "junnyu/roformer_chinese_char_base", - "junnyu/roformer_small_discriminator", - "junnyu/roformer_small_generator" -]) - -RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "RWKV/rwkv-4-169m-pile": "https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json", - "RWKV/rwkv-4-430m-pile": "https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json", - "RWKV/rwkv-4-1b5-pile": "https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json", - "RWKV/rwkv-4-3b-pile": "https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json", - "RWKV/rwkv-4-7b-pile": "https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json", - "RWKV/rwkv-4-14b-pile": "https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json", - "RWKV/rwkv-raven-1b5": "https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json", - "RWKV/rwkv-raven-3b": "https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json", - "RWKV/rwkv-raven-7b": "https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json", - "RWKV/rwkv-raven-14b": "https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json" -}) - -RWKV_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "RWKV/rwkv-4-169m-pile", - "RWKV/rwkv-4-430m-pile", - "RWKV/rwkv-4-1b5-pile", - "RWKV/rwkv-4-3b-pile", - "RWKV/rwkv-4-7b-pile", - "RWKV/rwkv-4-14b-pile", - "RWKV/rwkv-raven-1b5", - "RWKV/rwkv-raven-3b", - "RWKV/rwkv-raven-7b", - "RWKV/rwkv-raven-14b" -]) - -SAM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/sam-vit-huge": "https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json", - "facebook/sam-vit-large": "https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json", - "facebook/sam-vit-base": "https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json" -}) - -SAM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/sam-vit-huge", - "facebook/sam-vit-large", - "facebook/sam-vit-base" -]) - -TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/sam-vit-huge", - "facebook/sam-vit-large", - "facebook/sam-vit-base" -]) - -SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/hf-seamless-m4t-medium": "https://huggingface.co/facebook/hf-seamless-m4t-medium/resolve/main/config.json" -}) - -SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/hf-seamless-m4t-medium" -]) - -SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "": "https://huggingface.co//resolve/main/config.json" -}) - -SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/seamless-m4t-v2-large" -]) - -SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "nvidia/segformer-b0-finetuned-ade-512-512": "https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json" -}) - -SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "nvidia/segformer-b0-finetuned-ade-512-512" -]) - -TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "nvidia/segformer-b0-finetuned-ade-512-512" -]) - -SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "BAAI/seggpt-vit-large": "https://huggingface.co/BAAI/seggpt-vit-large/resolve/main/config.json" -}) - -SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "BAAI/seggpt-vit-large" -]) - -SEW_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "asapp/sew-tiny-100k": "https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json" -}) - -SEW_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "asapp/sew-tiny-100k", - "asapp/sew-small-100k", - "asapp/sew-mid-100k" -]) - -SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "asapp/sew-d-tiny-100k": "https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json" -}) - -SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "asapp/sew-d-tiny-100k", - "asapp/sew-d-small-100k", - "asapp/sew-d-mid-100k", - "asapp/sew-d-mid-k127-100k", - "asapp/sew-d-base-100k", - "asapp/sew-d-base-plus-100k", - "asapp/sew-d-mid-400k", - "asapp/sew-d-mid-k127-400k", - "asapp/sew-d-base-plus-400k" -]) - -SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/siglip-base-patch16-224": "https://huggingface.co/google/siglip-base-patch16-224/resolve/main/config.json" -}) - -SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/siglip-base-patch16-224" -]) - -SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/s2t-small-librispeech-asr": "https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json" -}) - -SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/s2t-small-librispeech-asr" -]) - -TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/s2t-small-librispeech-asr" -]) - -SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/s2t-wav2vec2-large-en-de": "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json" -}) - -SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/speecht5_asr": "https://huggingface.co/microsoft/speecht5_asr/resolve/main/config.json", - "microsoft/speecht5_tts": "https://huggingface.co/microsoft/speecht5_tts/resolve/main/config.json", - "microsoft/speecht5_vc": "https://huggingface.co/microsoft/speecht5_vc/resolve/main/config.json" -}) - -SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json" -}) - -SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/speecht5_asr", - "microsoft/speecht5_tts", - "microsoft/speecht5_vc" -]) - -SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "tau/splinter-base": "https://huggingface.co/tau/splinter-base/resolve/main/config.json", - "tau/splinter-base-qass": "https://huggingface.co/tau/splinter-base-qass/resolve/main/config.json", - "tau/splinter-large": "https://huggingface.co/tau/splinter-large/resolve/main/config.json", - "tau/splinter-large-qass": "https://huggingface.co/tau/splinter-large-qass/resolve/main/config.json" -}) - -SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "tau/splinter-base", - "tau/splinter-base-qass", - "tau/splinter-large", - "tau/splinter-large-qass" -]) - -SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "squeezebert/squeezebert-uncased": "https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/config.json", - "squeezebert/squeezebert-mnli": "https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/config.json", - "squeezebert/squeezebert-mnli-headless": "https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/config.json" -}) - -SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "squeezebert/squeezebert-uncased", - "squeezebert/squeezebert-mnli", - "squeezebert/squeezebert-mnli-headless" -]) - -STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "stabilityai/stablelm-3b-4e1t": "https://huggingface.co/stabilityai/stablelm-3b-4e1t/resolve/main/config.json" -}) +MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["nvidia/megatron-bert-cased-345m"]) + +MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"alibaba-damo/mgp-str-base": "https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json"} +) + +MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["alibaba-damo/mgp-str-base"]) + +MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "mistralai/Mistral-7B-v0.1": "https://huggingface.co/mistralai/Mistral-7B-v0.1/resolve/main/config.json", + "mistralai/Mistral-7B-Instruct-v0.1": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1/resolve/main/config.json", + } +) + +MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"mistral-ai/Mixtral-8x7B": "https://huggingface.co/mistral-ai/Mixtral-8x7B/resolve/main/config.json"} +) + +MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/mobilebert-uncased": "https://huggingface.co/google/mobilebert-uncased/resolve/main/config.json"} +) + +MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/mobilebert-uncased"]) + +TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/mobilebert-uncased"]) + +MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/mobilenet_v1_1.0_224": "https://huggingface.co/google/mobilenet_v1_1.0_224/resolve/main/config.json", + "google/mobilenet_v1_0.75_192": "https://huggingface.co/google/mobilenet_v1_0.75_192/resolve/main/config.json", + } +) + +MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["google/mobilenet_v1_1.0_224", "google/mobilenet_v1_0.75_192"] +) + +MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/mobilenet_v2_1.4_224": "https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json", + "google/mobilenet_v2_1.0_224": "https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json", + "google/mobilenet_v2_0.75_160": "https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json", + "google/mobilenet_v2_0.35_96": "https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json", + } +) + +MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/mobilenet_v2_1.4_224", + "google/mobilenet_v2_1.0_224", + "google/mobilenet_v2_0.37_160", + "google/mobilenet_v2_0.35_96", + ] +) + +MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "apple/mobilevit-small": "https://huggingface.co/apple/mobilevit-small/resolve/main/config.json", + "apple/mobilevit-x-small": "https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json", + "apple/mobilevit-xx-small": "https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json", + "apple/deeplabv3-mobilevit-small": "https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json", + "apple/deeplabv3-mobilevit-x-small": "https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json", + "apple/deeplabv3-mobilevit-xx-small": "https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json", + } +) + +MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "apple/mobilevit-small", + "apple/mobilevit-x-small", + "apple/mobilevit-xx-small", + "apple/deeplabv3-mobilevit-small", + "apple/deeplabv3-mobilevit-x-small", + "apple/deeplabv3-mobilevit-xx-small", + ] +) + +TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "apple/mobilevit-small", + "apple/mobilevit-x-small", + "apple/mobilevit-xx-small", + "apple/deeplabv3-mobilevit-small", + "apple/deeplabv3-mobilevit-x-small", + "apple/deeplabv3-mobilevit-xx-small", + ] +) + +MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"apple/mobilevitv2-1.0": "https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json"} +) + +MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["apple/mobilevitv2-1.0-imagenet1k-256"]) + +MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/mpnet-base": "https://huggingface.co/microsoft/mpnet-base/resolve/main/config.json"} +) + +MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/mpnet-base"]) + +TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/mpnet-base"]) + +MPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"mosaicml/mpt-7b": "https://huggingface.co/mosaicml/mpt-7b/resolve/main/config.json"} +) + +MPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "mosaicml/mpt-7b", + "mosaicml/mpt-7b-storywriter", + "mosaicml/mpt-7b-instruct", + "mosaicml/mpt-7b-8k", + "mosaicml/mpt-7b-8k-instruct", + "mosaicml/mpt-7b-8k-chat", + "mosaicml/mpt-30b", + "mosaicml/mpt-30b-instruct", + "mosaicml/mpt-30b-chat", + ] +) + +MRA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"uw-madison/mra-base-512-4": "https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json"} +) + +MRA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["uw-madison/mra-base-512-4"]) + +MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/musicgen-small": "https://huggingface.co/facebook/musicgen-small/resolve/main/config.json"} +) + +MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/musicgen-small"]) + +MVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "RUCAIBox/mvp", + "RUCAIBox/mvp-data-to-text", + "RUCAIBox/mvp-open-dialog", + "RUCAIBox/mvp-question-answering", + "RUCAIBox/mvp-question-generation", + "RUCAIBox/mvp-story", + "RUCAIBox/mvp-summarization", + "RUCAIBox/mvp-task-dialog", + "RUCAIBox/mtl-data-to-text", + "RUCAIBox/mtl-multi-task", + "RUCAIBox/mtl-open-dialog", + "RUCAIBox/mtl-question-answering", + "RUCAIBox/mtl-question-generation", + "RUCAIBox/mtl-story", + "RUCAIBox/mtl-summarization", + ] +) + +NAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"shi-labs/nat-mini-in1k-224": "https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json"} +) + +NAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["shi-labs/nat-mini-in1k-224"]) + +NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"sijunhe/nezha-cn-base": "https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json"} +) + +NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["sijunhe/nezha-cn-base", "sijunhe/nezha-cn-large", "sijunhe/nezha-base-wwm", "sijunhe/nezha-large-wwm"] +) + +NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/nllb-moe-54B": "https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json"} +) + +NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/nllb-moe-54b"]) + +NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"uw-madison/nystromformer-512": "https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json"} +) + +NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["uw-madison/nystromformer-512"]) + +ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "shi-labs/oneformer_ade20k_swin_tiny": "https://huggingface.co/shi-labs/oneformer_ade20k_swin_tiny/blob/main/config.json" + } +) + +ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["shi-labs/oneformer_ade20k_swin_tiny"]) + +OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"openai-community/openai-gpt": "https://huggingface.co/openai-community/openai-gpt/resolve/main/config.json"} +) + +OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openai-community/openai-gpt"]) + +TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openai-community/openai-gpt"]) + +OPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "facebook/opt-125m", + "facebook/opt-350m", + "facebook/opt-1.3b", + "facebook/opt-2.7b", + "facebook/opt-6.7b", + "facebook/opt-13b", + "facebook/opt-30b", + ] +) + +OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/owlv2-base-patch16": "https://huggingface.co/google/owlv2-base-patch16/resolve/main/config.json"} +) + +OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/owlv2-base-patch16-ensemble"]) + +OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/owlvit-base-patch32": "https://huggingface.co/google/owlvit-base-patch32/resolve/main/config.json", + "google/owlvit-base-patch16": "https://huggingface.co/google/owlvit-base-patch16/resolve/main/config.json", + "google/owlvit-large-patch14": "https://huggingface.co/google/owlvit-large-patch14/resolve/main/config.json", + } +) + +OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["google/owlvit-base-patch32", "google/owlvit-base-patch16", "google/owlvit-large-patch14"] +) + +PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "ibm/patchtsmixer-etth1-pretrain": "https://huggingface.co/ibm/patchtsmixer-etth1-pretrain/resolve/main/config.json" + } +) + +PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["ibm/patchtsmixer-etth1-pretrain"]) + +PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"ibm/patchtst-base": "https://huggingface.co/ibm/patchtst-base/resolve/main/config.json"} +) + +PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["ibm/patchtst-etth1-pretrain"]) + +PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/pegasus-large": "https://huggingface.co/google/pegasus-large/resolve/main/config.json"} +) + +PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/pegasus-x-base": "https://huggingface.co/google/pegasus-x-base/resolve/main/config.json", + "google/pegasus-x-large": "https://huggingface.co/google/pegasus-x-large/resolve/main/config.json", + } +) + +PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/pegasus-x-base", "google/pegasus-x-large"]) + +PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"deepmind/language-perceiver": "https://huggingface.co/deepmind/language-perceiver/resolve/main/config.json"} +) + +PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["deepmind/language-perceiver"]) + +PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"adept/persimmon-8b-base": "https://huggingface.co/adept/persimmon-8b-base/resolve/main/config.json"} +) + +PHI_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/phi-1": "https://huggingface.co/microsoft/phi-1/resolve/main/config.json", + "microsoft/phi-1_5": "https://huggingface.co/microsoft/phi-1_5/resolve/main/config.json", + "microsoft/phi-2": "https://huggingface.co/microsoft/phi-2/resolve/main/config.json", + } +) + +PHI_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/phi-1", "microsoft/phi-1_5", "microsoft/phi-2"]) + +PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/pix2struct-textcaps-base": "https://huggingface.co/google/pix2struct-textcaps-base/resolve/main/config.json" + } +) + +PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/pix2struct-textcaps-base", + "google/pix2struct-textcaps-large", + "google/pix2struct-base", + "google/pix2struct-large", + "google/pix2struct-ai2d-base", + "google/pix2struct-ai2d-large", + "google/pix2struct-widget-captioning-base", + "google/pix2struct-widget-captioning-large", + "google/pix2struct-screen2words-base", + "google/pix2struct-screen2words-large", + "google/pix2struct-docvqa-base", + "google/pix2struct-docvqa-large", + "google/pix2struct-ocrvqa-base", + "google/pix2struct-ocrvqa-large", + "google/pix2struct-chartqa-base", + "google/pix2struct-inforgraphics-vqa-base", + "google/pix2struct-inforgraphics-vqa-large", + ] +) + +PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"uclanlp/plbart-base": "https://huggingface.co/uclanlp/plbart-base/resolve/main/config.json"} +) + +PLBART_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["uclanlp/plbart-base", "uclanlp/plbart-cs-java", "uclanlp/plbart-multi_task-all"] +) + +POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"sail/poolformer_s12": "https://huggingface.co/sail/poolformer_s12/resolve/main/config.json"} +) + +POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["sail/poolformer_s12"]) + +POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"sweetcocoa/pop2piano": "https://huggingface.co/sweetcocoa/pop2piano/blob/main/config.json"} +) + +POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["sweetcocoa/pop2piano"]) + +PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/prophetnet-large-uncased": "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json" + } +) + +PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/prophetnet-large-uncased"]) + +PVT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({"pvt-tiny-224": "https://huggingface.co/Zetatech/pvt-tiny-224"}) + +PVT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Zetatech/pvt-tiny-224"]) + +QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google-bert/bert-base-uncased": "https://huggingface.co/google-bert/bert-base-uncased/resolve/main/config.json"} +) + +QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google-bert/bert-base-uncased"]) + +QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"Qwen/Qwen2-7B-beta": "https://huggingface.co/Qwen/Qwen2-7B-beta/resolve/main/config.json"} +) + +REALM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/realm-cc-news-pretrained-embedder": "https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json", + "google/realm-cc-news-pretrained-encoder": "https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json", + "google/realm-cc-news-pretrained-scorer": "https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json", + "google/realm-cc-news-pretrained-openqa": "https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json", + "google/realm-orqa-nq-openqa": "https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json", + "google/realm-orqa-nq-reader": "https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json", + "google/realm-orqa-wq-openqa": "https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json", + "google/realm-orqa-wq-reader": "https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json", + } +) + +REALM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/realm-cc-news-pretrained-embedder", + "google/realm-cc-news-pretrained-encoder", + "google/realm-cc-news-pretrained-scorer", + "google/realm-cc-news-pretrained-openqa", + "google/realm-orqa-nq-openqa", + "google/realm-orqa-nq-reader", + "google/realm-orqa-wq-openqa", + "google/realm-orqa-wq-reader", + ] +) + +REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/reformer-crime-and-punishment": "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json", + "google/reformer-enwik8": "https://huggingface.co/google/reformer-enwik8/resolve/main/config.json", + } +) + +REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["google/reformer-crime-and-punishment", "google/reformer-enwik8"] +) + +REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/regnet-y-040": "https://huggingface.co/facebook/regnet-y-040/blob/main/config.json"} +) + +REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/regnet-y-040"]) + +TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/regnet-y-040"]) + +REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/rembert": "https://huggingface.co/google/rembert/resolve/main/config.json"} +) + +REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/rembert"]) + +TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/rembert"]) + +RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/resnet-50": "https://huggingface.co/microsoft/resnet-50/blob/main/config.json"} +) + +RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/resnet-50"]) + +TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/resnet-50"]) + +ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "FacebookAI/roberta-base": "https://huggingface.co/FacebookAI/roberta-base/resolve/main/config.json", + "FacebookAI/roberta-large": "https://huggingface.co/FacebookAI/roberta-large/resolve/main/config.json", + "FacebookAI/roberta-large-mnli": "https://huggingface.co/FacebookAI/roberta-large-mnli/resolve/main/config.json", + "distilbert/distilroberta-base": "https://huggingface.co/distilbert/distilroberta-base/resolve/main/config.json", + "openai-community/roberta-base-openai-detector": "https://huggingface.co/openai-community/roberta-base-openai-detector/resolve/main/config.json", + "openai-community/roberta-large-openai-detector": "https://huggingface.co/openai-community/roberta-large-openai-detector/resolve/main/config.json", + } +) + +ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "FacebookAI/roberta-base", + "FacebookAI/roberta-large", + "FacebookAI/roberta-large-mnli", + "distilbert/distilroberta-base", + "openai-community/roberta-base-openai-detector", + "openai-community/roberta-large-openai-detector", + ] +) + +TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "FacebookAI/roberta-base", + "FacebookAI/roberta-large", + "FacebookAI/roberta-large-mnli", + "distilbert/distilroberta-base", + ] +) + +ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "andreasmadsen/efficient_mlm_m0.40": "https://huggingface.co/andreasmadsen/efficient_mlm_m0.40/resolve/main/config.json" + } +) + +ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "andreasmadsen/efficient_mlm_m0.15", + "andreasmadsen/efficient_mlm_m0.20", + "andreasmadsen/efficient_mlm_m0.30", + "andreasmadsen/efficient_mlm_m0.40", + "andreasmadsen/efficient_mlm_m0.50", + "andreasmadsen/efficient_mlm_m0.60", + "andreasmadsen/efficient_mlm_m0.70", + "andreasmadsen/efficient_mlm_m0.80", + ] +) + +TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "andreasmadsen/efficient_mlm_m0.15", + "andreasmadsen/efficient_mlm_m0.20", + "andreasmadsen/efficient_mlm_m0.30", + "andreasmadsen/efficient_mlm_m0.40", + "andreasmadsen/efficient_mlm_m0.50", + "andreasmadsen/efficient_mlm_m0.60", + "andreasmadsen/efficient_mlm_m0.70", + "andreasmadsen/efficient_mlm_m0.80", + ] +) + +ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"weiweishi/roc-bert-base-zh": "https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json"} +) + +ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["weiweishi/roc-bert-base-zh"]) + +ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/config.json", + "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/config.json", + "junnyu/roformer_chinese_char_small": "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/config.json", + "junnyu/roformer_chinese_char_base": "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/config.json", + "junnyu/roformer_small_discriminator": "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/config.json", + "junnyu/roformer_small_generator": "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/config.json", + } +) + +ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "junnyu/roformer_chinese_small", + "junnyu/roformer_chinese_base", + "junnyu/roformer_chinese_char_small", + "junnyu/roformer_chinese_char_base", + "junnyu/roformer_small_discriminator", + "junnyu/roformer_small_generator", + ] +) + +TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "junnyu/roformer_chinese_small", + "junnyu/roformer_chinese_base", + "junnyu/roformer_chinese_char_small", + "junnyu/roformer_chinese_char_base", + "junnyu/roformer_small_discriminator", + "junnyu/roformer_small_generator", + ] +) + +RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "RWKV/rwkv-4-169m-pile": "https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json", + "RWKV/rwkv-4-430m-pile": "https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json", + "RWKV/rwkv-4-1b5-pile": "https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json", + "RWKV/rwkv-4-3b-pile": "https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json", + "RWKV/rwkv-4-7b-pile": "https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json", + "RWKV/rwkv-4-14b-pile": "https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json", + "RWKV/rwkv-raven-1b5": "https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json", + "RWKV/rwkv-raven-3b": "https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json", + "RWKV/rwkv-raven-7b": "https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json", + "RWKV/rwkv-raven-14b": "https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json", + } +) + +RWKV_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "RWKV/rwkv-4-169m-pile", + "RWKV/rwkv-4-430m-pile", + "RWKV/rwkv-4-1b5-pile", + "RWKV/rwkv-4-3b-pile", + "RWKV/rwkv-4-7b-pile", + "RWKV/rwkv-4-14b-pile", + "RWKV/rwkv-raven-1b5", + "RWKV/rwkv-raven-3b", + "RWKV/rwkv-raven-7b", + "RWKV/rwkv-raven-14b", + ] +) + +SAM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/sam-vit-huge": "https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json", + "facebook/sam-vit-large": "https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json", + "facebook/sam-vit-base": "https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json", + } +) + +SAM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/sam-vit-huge", "facebook/sam-vit-large", "facebook/sam-vit-base"] +) + +TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["facebook/sam-vit-huge", "facebook/sam-vit-large", "facebook/sam-vit-base"] +) + +SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/hf-seamless-m4t-medium": "https://huggingface.co/facebook/hf-seamless-m4t-medium/resolve/main/config.json" + } +) + +SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/hf-seamless-m4t-medium"]) + +SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"": "https://huggingface.co//resolve/main/config.json"} +) + +SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/seamless-m4t-v2-large"]) + +SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "nvidia/segformer-b0-finetuned-ade-512-512": "https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json" + } +) + +SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["nvidia/segformer-b0-finetuned-ade-512-512"]) + +TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["nvidia/segformer-b0-finetuned-ade-512-512"]) + +SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"BAAI/seggpt-vit-large": "https://huggingface.co/BAAI/seggpt-vit-large/resolve/main/config.json"} +) + +SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["BAAI/seggpt-vit-large"]) + +SEW_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"asapp/sew-tiny-100k": "https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json"} +) + +SEW_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["asapp/sew-tiny-100k", "asapp/sew-small-100k", "asapp/sew-mid-100k"] +) + +SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"asapp/sew-d-tiny-100k": "https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json"} +) + +SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "asapp/sew-d-tiny-100k", + "asapp/sew-d-small-100k", + "asapp/sew-d-mid-100k", + "asapp/sew-d-mid-k127-100k", + "asapp/sew-d-base-100k", + "asapp/sew-d-base-plus-100k", + "asapp/sew-d-mid-400k", + "asapp/sew-d-mid-k127-400k", + "asapp/sew-d-base-plus-400k", + ] +) + +SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/siglip-base-patch16-224": "https://huggingface.co/google/siglip-base-patch16-224/resolve/main/config.json" + } +) + +SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/siglip-base-patch16-224"]) + +SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/s2t-small-librispeech-asr": "https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json" + } +) + +SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/s2t-small-librispeech-asr"]) + +TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/s2t-small-librispeech-asr"]) + +SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/s2t-wav2vec2-large-en-de": "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json" + } +) + +SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/speecht5_asr": "https://huggingface.co/microsoft/speecht5_asr/resolve/main/config.json", + "microsoft/speecht5_tts": "https://huggingface.co/microsoft/speecht5_tts/resolve/main/config.json", + "microsoft/speecht5_vc": "https://huggingface.co/microsoft/speecht5_vc/resolve/main/config.json", + } +) + +SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json"} +) + +SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["microsoft/speecht5_asr", "microsoft/speecht5_tts", "microsoft/speecht5_vc"] +) + +SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "tau/splinter-base": "https://huggingface.co/tau/splinter-base/resolve/main/config.json", + "tau/splinter-base-qass": "https://huggingface.co/tau/splinter-base-qass/resolve/main/config.json", + "tau/splinter-large": "https://huggingface.co/tau/splinter-large/resolve/main/config.json", + "tau/splinter-large-qass": "https://huggingface.co/tau/splinter-large-qass/resolve/main/config.json", + } +) + +SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["tau/splinter-base", "tau/splinter-base-qass", "tau/splinter-large", "tau/splinter-large-qass"] +) + +SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "squeezebert/squeezebert-uncased": "https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/config.json", + "squeezebert/squeezebert-mnli": "https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/config.json", + "squeezebert/squeezebert-mnli-headless": "https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/config.json", + } +) + +SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["squeezebert/squeezebert-uncased", "squeezebert/squeezebert-mnli", "squeezebert/squeezebert-mnli-headless"] +) + +STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"stabilityai/stablelm-3b-4e1t": "https://huggingface.co/stabilityai/stablelm-3b-4e1t/resolve/main/config.json"} +) STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({}) -SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "MBZUAI/swiftformer-xs": "https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json" -}) - -SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "MBZUAI/swiftformer-xs" -]) - -SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/swin-tiny-patch4-window7-224": "https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json" -}) - -SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/swin-tiny-patch4-window7-224" -]) - -TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/swin-tiny-patch4-window7-224" -]) - -SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "caidas/swin2sr-classicalsr-x2-64": "https://huggingface.co/caidas/swin2sr-classicalsr-x2-64/resolve/main/config.json" -}) - -SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "caidas/swin2SR-classical-sr-x2-64" -]) - -SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/swinv2-tiny-patch4-window8-256": "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json" -}) - -SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/swinv2-tiny-patch4-window8-256" -]) - -SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/switch-base-8": "https://huggingface.co/google/switch-base-8/blob/main/config.json" -}) - -SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/switch-base-8", - "google/switch-base-16", - "google/switch-base-32", - "google/switch-base-64", - "google/switch-base-128", - "google/switch-base-256", - "google/switch-large-128", - "google/switch-xxl-128", - "google/switch-c-2048" -]) - -T5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google-t5/t5-small": "https://huggingface.co/google-t5/t5-small/resolve/main/config.json", - "google-t5/t5-base": "https://huggingface.co/google-t5/t5-base/resolve/main/config.json", - "google-t5/t5-large": "https://huggingface.co/google-t5/t5-large/resolve/main/config.json", - "google-t5/t5-3b": "https://huggingface.co/google-t5/t5-3b/resolve/main/config.json", - "google-t5/t5-11b": "https://huggingface.co/google-t5/t5-11b/resolve/main/config.json" -}) - -T5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google-t5/t5-small", - "google-t5/t5-base", - "google-t5/t5-large", - "google-t5/t5-3b", - "google-t5/t5-11b" -]) - -TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google-t5/t5-small", - "google-t5/t5-base", - "google-t5/t5-large", - "google-t5/t5-3b", - "google-t5/t5-11b" -]) - -TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/table-transformer-detection": "https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json" -}) - -TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/table-transformer-detection" -]) - -TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/tapas-base-finetuned-sqa": "https://huggingface.co/google/tapas-base-finetuned-sqa/resolve/main/config.json", - "google/tapas-base-finetuned-wtq": "https://huggingface.co/google/tapas-base-finetuned-wtq/resolve/main/config.json", - "google/tapas-base-finetuned-wikisql-supervised": "https://huggingface.co/google/tapas-base-finetuned-wikisql-supervised/resolve/main/config.json", - "google/tapas-base-finetuned-tabfact": "https://huggingface.co/google/tapas-base-finetuned-tabfact/resolve/main/config.json" -}) - -TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/tapas-large", - "google/tapas-large-finetuned-sqa", - "google/tapas-large-finetuned-wtq", - "google/tapas-large-finetuned-wikisql-supervised", - "google/tapas-large-finetuned-tabfact", - "google/tapas-base", - "google/tapas-base-finetuned-sqa", - "google/tapas-base-finetuned-wtq", - "google/tapas-base-finetuned-wikisql-supervised", - "google/tapas-base-finetuned-tabfact", - "google/tapas-small", - "google/tapas-small-finetuned-sqa", - "google/tapas-small-finetuned-wtq", - "google/tapas-small-finetuned-wikisql-supervised", - "google/tapas-small-finetuned-tabfact", - "google/tapas-mini", - "google/tapas-mini-finetuned-sqa", - "google/tapas-mini-finetuned-wtq", - "google/tapas-mini-finetuned-wikisql-supervised", - "google/tapas-mini-finetuned-tabfact", - "google/tapas-tiny", - "google/tapas-tiny-finetuned-sqa", - "google/tapas-tiny-finetuned-wtq", - "google/tapas-tiny-finetuned-wikisql-supervised", - "google/tapas-tiny-finetuned-tabfact" -]) - -TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/tapas-large", - "google/tapas-large-finetuned-sqa", - "google/tapas-large-finetuned-wtq", - "google/tapas-large-finetuned-wikisql-supervised", - "google/tapas-large-finetuned-tabfact", - "google/tapas-base", - "google/tapas-base-finetuned-sqa", - "google/tapas-base-finetuned-wtq", - "google/tapas-base-finetuned-wikisql-supervised", - "google/tapas-base-finetuned-tabfact", - "google/tapas-small", - "google/tapas-small-finetuned-sqa", - "google/tapas-small-finetuned-wtq", - "google/tapas-small-finetuned-wikisql-supervised", - "google/tapas-small-finetuned-tabfact", - "google/tapas-mini", - "google/tapas-mini-finetuned-sqa", - "google/tapas-mini-finetuned-wtq", - "google/tapas-mini-finetuned-wikisql-supervised", - "google/tapas-mini-finetuned-tabfact", - "google/tapas-tiny", - "google/tapas-tiny-finetuned-sqa", - "google/tapas-tiny-finetuned-wtq", - "google/tapas-tiny-finetuned-wikisql-supervised", - "google/tapas-tiny-finetuned-tabfact" -]) - -TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "huggingface/time-series-transformer-tourism-monthly": "https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json" -}) - -TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "huggingface/time-series-transformer-tourism-monthly" -]) - -TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/timesformer": "https://huggingface.co/facebook/timesformer/resolve/main/config.json" -}) - -TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/timesformer-base-finetuned-k400" -]) - -TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/trocr-base-handwritten": "https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json" -}) - -TROCR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/trocr-base-handwritten" -]) - -TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "ZinengTang/tvlt-base": "https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json" -}) - -TVLT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "ZinengTang/tvlt-base" -]) - -TVP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "Intel/tvp-base": "https://huggingface.co/Intel/tvp-base/resolve/main/config.json" -}) - -TVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "Intel/tvp-base", - "Intel/tvp-base-ANet" -]) - -UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/udop-large": "https://huggingface.co/microsoft/udop-large/resolve/main/config.json" -}) - -UDOP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/udop-large" -]) - -UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/unispeech-large-1500h-cv": "https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json" -}) - -UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/unispeech-large-1500h-cv", - "microsoft/unispeech-large-multi-lingual-1500h-cv" -]) - -UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/unispeech-sat-base-100h-libri-ft": "https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json" -}) +SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"MBZUAI/swiftformer-xs": "https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json"} +) + +SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["MBZUAI/swiftformer-xs"]) + +SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/swin-tiny-patch4-window7-224": "https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json" + } +) + +SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/swin-tiny-patch4-window7-224"]) + +TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/swin-tiny-patch4-window7-224"]) + +SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "caidas/swin2sr-classicalsr-x2-64": "https://huggingface.co/caidas/swin2sr-classicalsr-x2-64/resolve/main/config.json" + } +) + +SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["caidas/swin2SR-classical-sr-x2-64"]) + +SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/swinv2-tiny-patch4-window8-256": "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json" + } +) + +SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/swinv2-tiny-patch4-window8-256"]) + +SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/switch-base-8": "https://huggingface.co/google/switch-base-8/blob/main/config.json"} +) + +SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/switch-base-8", + "google/switch-base-16", + "google/switch-base-32", + "google/switch-base-64", + "google/switch-base-128", + "google/switch-base-256", + "google/switch-large-128", + "google/switch-xxl-128", + "google/switch-c-2048", + ] +) + +T5_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google-t5/t5-small": "https://huggingface.co/google-t5/t5-small/resolve/main/config.json", + "google-t5/t5-base": "https://huggingface.co/google-t5/t5-base/resolve/main/config.json", + "google-t5/t5-large": "https://huggingface.co/google-t5/t5-large/resolve/main/config.json", + "google-t5/t5-3b": "https://huggingface.co/google-t5/t5-3b/resolve/main/config.json", + "google-t5/t5-11b": "https://huggingface.co/google-t5/t5-11b/resolve/main/config.json", + } +) + +T5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["google-t5/t5-small", "google-t5/t5-base", "google-t5/t5-large", "google-t5/t5-3b", "google-t5/t5-11b"] +) + +TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["google-t5/t5-small", "google-t5/t5-base", "google-t5/t5-large", "google-t5/t5-3b", "google-t5/t5-11b"] +) + +TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/table-transformer-detection": "https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json" + } +) + +TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/table-transformer-detection"]) + +TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/tapas-base-finetuned-sqa": "https://huggingface.co/google/tapas-base-finetuned-sqa/resolve/main/config.json", + "google/tapas-base-finetuned-wtq": "https://huggingface.co/google/tapas-base-finetuned-wtq/resolve/main/config.json", + "google/tapas-base-finetuned-wikisql-supervised": "https://huggingface.co/google/tapas-base-finetuned-wikisql-supervised/resolve/main/config.json", + "google/tapas-base-finetuned-tabfact": "https://huggingface.co/google/tapas-base-finetuned-tabfact/resolve/main/config.json", + } +) + +TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/tapas-large", + "google/tapas-large-finetuned-sqa", + "google/tapas-large-finetuned-wtq", + "google/tapas-large-finetuned-wikisql-supervised", + "google/tapas-large-finetuned-tabfact", + "google/tapas-base", + "google/tapas-base-finetuned-sqa", + "google/tapas-base-finetuned-wtq", + "google/tapas-base-finetuned-wikisql-supervised", + "google/tapas-base-finetuned-tabfact", + "google/tapas-small", + "google/tapas-small-finetuned-sqa", + "google/tapas-small-finetuned-wtq", + "google/tapas-small-finetuned-wikisql-supervised", + "google/tapas-small-finetuned-tabfact", + "google/tapas-mini", + "google/tapas-mini-finetuned-sqa", + "google/tapas-mini-finetuned-wtq", + "google/tapas-mini-finetuned-wikisql-supervised", + "google/tapas-mini-finetuned-tabfact", + "google/tapas-tiny", + "google/tapas-tiny-finetuned-sqa", + "google/tapas-tiny-finetuned-wtq", + "google/tapas-tiny-finetuned-wikisql-supervised", + "google/tapas-tiny-finetuned-tabfact", + ] +) + +TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "google/tapas-large", + "google/tapas-large-finetuned-sqa", + "google/tapas-large-finetuned-wtq", + "google/tapas-large-finetuned-wikisql-supervised", + "google/tapas-large-finetuned-tabfact", + "google/tapas-base", + "google/tapas-base-finetuned-sqa", + "google/tapas-base-finetuned-wtq", + "google/tapas-base-finetuned-wikisql-supervised", + "google/tapas-base-finetuned-tabfact", + "google/tapas-small", + "google/tapas-small-finetuned-sqa", + "google/tapas-small-finetuned-wtq", + "google/tapas-small-finetuned-wikisql-supervised", + "google/tapas-small-finetuned-tabfact", + "google/tapas-mini", + "google/tapas-mini-finetuned-sqa", + "google/tapas-mini-finetuned-wtq", + "google/tapas-mini-finetuned-wikisql-supervised", + "google/tapas-mini-finetuned-tabfact", + "google/tapas-tiny", + "google/tapas-tiny-finetuned-sqa", + "google/tapas-tiny-finetuned-wtq", + "google/tapas-tiny-finetuned-wikisql-supervised", + "google/tapas-tiny-finetuned-tabfact", + ] +) + +TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "huggingface/time-series-transformer-tourism-monthly": "https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json" + } +) + +TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["huggingface/time-series-transformer-tourism-monthly"] +) + +TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/timesformer": "https://huggingface.co/facebook/timesformer/resolve/main/config.json"} +) + +TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/timesformer-base-finetuned-k400"]) + +TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/trocr-base-handwritten": "https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json" + } +) + +TROCR_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/trocr-base-handwritten"]) + +TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"ZinengTang/tvlt-base": "https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json"} +) + +TVLT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["ZinengTang/tvlt-base"]) + +TVP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"Intel/tvp-base": "https://huggingface.co/Intel/tvp-base/resolve/main/config.json"} +) + +TVP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["Intel/tvp-base", "Intel/tvp-base-ANet"]) + +UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/udop-large": "https://huggingface.co/microsoft/udop-large/resolve/main/config.json"} +) + +UDOP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/udop-large"]) + +UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/unispeech-large-1500h-cv": "https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json" + } +) + +UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["microsoft/unispeech-large-1500h-cv", "microsoft/unispeech-large-multi-lingual-1500h-cv"] +) + +UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/unispeech-sat-base-100h-libri-ft": "https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json" + } +) UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([]) -UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "dg845/univnet-dev": "https://huggingface.co/dg845/univnet-dev/resolve/main/config.json" -}) - -UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "dg845/univnet-dev" -]) - -VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "MCG-NJU/videomae-base": "https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json" -}) - -VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "MCG-NJU/videomae-base" -]) - -VILT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "dandelin/vilt-b32-mlm": "https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json" -}) - -VILT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "dandelin/vilt-b32-mlm" -]) - -VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "ybelkada/vip-llava-7b-hf": "https://huggingface.co/llava-hf/vip-llava-7b-hf/resolve/main/config.json" -}) - -VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "llava-hf/vip-llava-7b-hf" -]) - -VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "uclanlp/visualbert-vqa": "https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json", - "uclanlp/visualbert-vqa-pre": "https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json", - "uclanlp/visualbert-vqa-coco-pre": "https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json", - "uclanlp/visualbert-vcr": "https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json", - "uclanlp/visualbert-vcr-pre": "https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json", - "uclanlp/visualbert-vcr-coco-pre": "https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json", - "uclanlp/visualbert-nlvr2": "https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json", - "uclanlp/visualbert-nlvr2-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json", - "uclanlp/visualbert-nlvr2-coco-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json" -}) - -VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "uclanlp/visualbert-vqa", - "uclanlp/visualbert-vqa-pre", - "uclanlp/visualbert-vqa-coco-pre", - "uclanlp/visualbert-vcr", - "uclanlp/visualbert-vcr-pre", - "uclanlp/visualbert-vcr-coco-pre", - "uclanlp/visualbert-nlvr2", - "uclanlp/visualbert-nlvr2-pre", - "uclanlp/visualbert-nlvr2-coco-pre" -]) - -VIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/vit-base-patch16-224": "https://huggingface.co/vit-base-patch16-224/resolve/main/config.json" -}) - -VIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/vit-base-patch16-224" -]) - -VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/vit-hybrid-base-bit-384": "https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json" -}) - -VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/vit-hybrid-base-bit-384" -]) - -VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/vit-mae-base": "https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json" -}) - -VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/vit-mae-base" -]) - -VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "sayakpaul/vit-msn-base": "https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json" -}) - -VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/vit-msn-small" -]) - -VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/vit-det-base": "https://huggingface.co/facebook/vit-det-base/resolve/main/config.json" -}) - -VITDET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/vit-det-base" -]) - -VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "hustvl/vitmatte-small-composition-1k": "https://huggingface.co/hustvl/vitmatte-small-composition-1k/resolve/main/config.json" -}) - -VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "hustvl/vitmatte-small-composition-1k" -]) - -VITS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/mms-tts-eng": "https://huggingface.co/facebook/mms-tts-eng/resolve/main/config.json" -}) - -VITS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/mms-tts-eng" -]) - -VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "google/vivit-b-16x2-kinetics400": "https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json" -}) - -VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "google/vivit-b-16x2-kinetics400" -]) - -WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/wav2vec2-base-960h": "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json" -}) - -WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/wav2vec2-base-960h", - "facebook/wav2vec2-large-960h", - "facebook/wav2vec2-large-960h-lv60", - "facebook/wav2vec2-large-960h-lv60-self" -]) - -TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/wav2vec2-base-960h", - "facebook/wav2vec2-large-960h", - "facebook/wav2vec2-large-960h-lv60", - "facebook/wav2vec2-large-960h-lv60-self" -]) - -WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/w2v-bert-2.0": "https://huggingface.co/facebook/w2v-bert-2.0/resolve/main/config.json" -}) - -WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/w2v-bert-2.0" -]) - -WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/wav2vec2-conformer-rel-pos-large": "https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large/resolve/main/config.json" -}) - -WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/wav2vec2-conformer-rel-pos-large" -]) - -WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/wavlm-base": "https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json" -}) - -WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/wavlm-base", - "microsoft/wavlm-base-plus", - "microsoft/wavlm-large" -]) - -WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/config.json" -}) - -WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai/whisper-base" -]) - -TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "openai/whisper-base" -]) - -XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/xclip-base-patch32": "https://huggingface.co/microsoft/xclip-base-patch32/resolve/main/config.json" -}) - -XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/xclip-base-patch32" -]) - -XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/xglm-564M": "https://huggingface.co/facebook/xglm-564M/resolve/main/config.json" -}) - -XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/xglm-564M" -]) - -TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/xglm-564M" -]) - -XLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "FacebookAI/xlm-mlm-en-2048": "https://huggingface.co/FacebookAI/xlm-mlm-en-2048/resolve/main/config.json", - "FacebookAI/xlm-mlm-ende-1024": "https://huggingface.co/FacebookAI/xlm-mlm-ende-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enfr-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-enro-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enro-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-xnli15-1024/resolve/main/config.json", - "FacebookAI/xlm-clm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-clm-enfr-1024/resolve/main/config.json", - "FacebookAI/xlm-clm-ende-1024": "https://huggingface.co/FacebookAI/xlm-clm-ende-1024/resolve/main/config.json", - "FacebookAI/xlm-mlm-17-1280": "https://huggingface.co/FacebookAI/xlm-mlm-17-1280/resolve/main/config.json", - "FacebookAI/xlm-mlm-100-1280": "https://huggingface.co/FacebookAI/xlm-mlm-100-1280/resolve/main/config.json" -}) - -XLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "FacebookAI/xlm-mlm-en-2048", - "FacebookAI/xlm-mlm-ende-1024", - "FacebookAI/xlm-mlm-enfr-1024", - "FacebookAI/xlm-mlm-enro-1024", - "FacebookAI/xlm-mlm-tlm-xnli15-1024", - "FacebookAI/xlm-mlm-xnli15-1024", - "FacebookAI/xlm-clm-enfr-1024", - "FacebookAI/xlm-clm-ende-1024", - "FacebookAI/xlm-mlm-17-1280", - "FacebookAI/xlm-mlm-100-1280" -]) - -TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "FacebookAI/xlm-mlm-en-2048", - "FacebookAI/xlm-mlm-ende-1024", - "FacebookAI/xlm-mlm-enfr-1024", - "FacebookAI/xlm-mlm-enro-1024", - "FacebookAI/xlm-mlm-tlm-xnli15-1024", - "FacebookAI/xlm-mlm-xnli15-1024", - "FacebookAI/xlm-clm-enfr-1024", - "FacebookAI/xlm-clm-ende-1024", - "FacebookAI/xlm-mlm-17-1280", - "FacebookAI/xlm-mlm-100-1280" -]) - -XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "microsoft/xprophetnet-large-wiki100-cased": "https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json" -}) - -XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "microsoft/xprophetnet-large-wiki100-cased" -]) - -XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "FacebookAI/xlm-roberta-base": "https://huggingface.co/FacebookAI/xlm-roberta-base/resolve/main/config.json", - "FacebookAI/xlm-roberta-large": "https://huggingface.co/FacebookAI/xlm-roberta-large/resolve/main/config.json", - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json", - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json", - "FacebookAI/xlm-roberta-large-finetuned-conll03-english": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json", - "FacebookAI/xlm-roberta-large-finetuned-conll03-german": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json" -}) - -XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "FacebookAI/xlm-roberta-base", - "FacebookAI/xlm-roberta-large", - "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch", - "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish", - "FacebookAI/xlm-roberta-large-finetuned-conll03-english", - "FacebookAI/xlm-roberta-large-finetuned-conll03-german" -]) - -TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "FacebookAI/xlm-roberta-base", - "FacebookAI/xlm-roberta-large", - "joeddav/xlm-roberta-large-xnli", - "cardiffnlp/twitter-xlm-roberta-base-sentiment" -]) - -FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "FacebookAI/xlm-roberta-base", - "FacebookAI/xlm-roberta-large" -]) - -XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/xlm-roberta-xl": "https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json", - "facebook/xlm-roberta-xxl": "https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json" -}) - -XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/xlm-roberta-xl", - "facebook/xlm-roberta-xxl" -]) - -XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "xlnet/xlnet-base-cased": "https://huggingface.co/xlnet/xlnet-base-cased/resolve/main/config.json", - "xlnet/xlnet-large-cased": "https://huggingface.co/xlnet/xlnet-large-cased/resolve/main/config.json" -}) - -XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "xlnet/xlnet-base-cased", - "xlnet/xlnet-large-cased" -]) - -TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "xlnet/xlnet-base-cased", - "xlnet/xlnet-large-cased" -]) - -XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "facebook/xmod-base": "https://huggingface.co/facebook/xmod-base/resolve/main/config.json", - "facebook/xmod-large-prenorm": "https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json", - "facebook/xmod-base-13-125k": "https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json", - "facebook/xmod-base-30-125k": "https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json", - "facebook/xmod-base-30-195k": "https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json", - "facebook/xmod-base-60-125k": "https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json", - "facebook/xmod-base-60-265k": "https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json", - "facebook/xmod-base-75-125k": "https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json", - "facebook/xmod-base-75-269k": "https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json" -}) - -XMOD_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "facebook/xmod-base", - "facebook/xmod-large-prenorm", - "facebook/xmod-base-13-125k", - "facebook/xmod-base-30-125k", - "facebook/xmod-base-30-195k", - "facebook/xmod-base-60-125k", - "facebook/xmod-base-60-265k", - "facebook/xmod-base-75-125k", - "facebook/xmod-base-75-269k" -]) - -YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json" -}) - -YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "hustvl/yolos-small" -]) - -YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict({ - "uw-madison/yoso-4096": "https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json" -}) - -YOSO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList([ - "uw-madison/yoso-4096" -]) +UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"dg845/univnet-dev": "https://huggingface.co/dg845/univnet-dev/resolve/main/config.json"} +) + +UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["dg845/univnet-dev"]) + +VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"MCG-NJU/videomae-base": "https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json"} +) + +VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["MCG-NJU/videomae-base"]) + +VILT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"dandelin/vilt-b32-mlm": "https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json"} +) + +VILT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["dandelin/vilt-b32-mlm"]) + +VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"ybelkada/vip-llava-7b-hf": "https://huggingface.co/llava-hf/vip-llava-7b-hf/resolve/main/config.json"} +) + +VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["llava-hf/vip-llava-7b-hf"]) + +VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "uclanlp/visualbert-vqa": "https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json", + "uclanlp/visualbert-vqa-pre": "https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json", + "uclanlp/visualbert-vqa-coco-pre": "https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json", + "uclanlp/visualbert-vcr": "https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json", + "uclanlp/visualbert-vcr-pre": "https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json", + "uclanlp/visualbert-vcr-coco-pre": "https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json", + "uclanlp/visualbert-nlvr2": "https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json", + "uclanlp/visualbert-nlvr2-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json", + "uclanlp/visualbert-nlvr2-coco-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json", + } +) + +VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "uclanlp/visualbert-vqa", + "uclanlp/visualbert-vqa-pre", + "uclanlp/visualbert-vqa-coco-pre", + "uclanlp/visualbert-vcr", + "uclanlp/visualbert-vcr-pre", + "uclanlp/visualbert-vcr-coco-pre", + "uclanlp/visualbert-nlvr2", + "uclanlp/visualbert-nlvr2-pre", + "uclanlp/visualbert-nlvr2-coco-pre", + ] +) + +VIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/vit-base-patch16-224": "https://huggingface.co/vit-base-patch16-224/resolve/main/config.json"} +) + +VIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/vit-base-patch16-224"]) + +VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"google/vit-hybrid-base-bit-384": "https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json"} +) + +VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/vit-hybrid-base-bit-384"]) + +VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/vit-mae-base": "https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json"} +) + +VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/vit-mae-base"]) + +VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"sayakpaul/vit-msn-base": "https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json"} +) + +VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/vit-msn-small"]) +VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/vit-det-base": "https://huggingface.co/facebook/vit-det-base/resolve/main/config.json"} +) + +VITDET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/vit-det-base"]) + +VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "hustvl/vitmatte-small-composition-1k": "https://huggingface.co/hustvl/vitmatte-small-composition-1k/resolve/main/config.json" + } +) + +VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["hustvl/vitmatte-small-composition-1k"]) + +VITS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/mms-tts-eng": "https://huggingface.co/facebook/mms-tts-eng/resolve/main/config.json"} +) + +VITS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/mms-tts-eng"]) + +VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "google/vivit-b-16x2-kinetics400": "https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json" + } +) + +VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["google/vivit-b-16x2-kinetics400"]) + +WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/wav2vec2-base-960h": "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json"} +) + +WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "facebook/wav2vec2-base-960h", + "facebook/wav2vec2-large-960h", + "facebook/wav2vec2-large-960h-lv60", + "facebook/wav2vec2-large-960h-lv60-self", + ] +) + +TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "facebook/wav2vec2-base-960h", + "facebook/wav2vec2-large-960h", + "facebook/wav2vec2-large-960h-lv60", + "facebook/wav2vec2-large-960h-lv60-self", + ] +) + +WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/w2v-bert-2.0": "https://huggingface.co/facebook/w2v-bert-2.0/resolve/main/config.json"} +) + +WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/w2v-bert-2.0"]) + +WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/wav2vec2-conformer-rel-pos-large": "https://huggingface.co/facebook/wav2vec2-conformer-rel-pos-large/resolve/main/config.json" + } +) + +WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/wav2vec2-conformer-rel-pos-large"]) + +WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/wavlm-base": "https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json"} +) + +WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["microsoft/wavlm-base", "microsoft/wavlm-base-plus", "microsoft/wavlm-large"] +) + +WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"openai/whisper-base": "https://huggingface.co/openai/whisper-base/resolve/main/config.json"} +) + +WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openai/whisper-base"]) + +TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["openai/whisper-base"]) + +XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"microsoft/xclip-base-patch32": "https://huggingface.co/microsoft/xclip-base-patch32/resolve/main/config.json"} +) + +XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/xclip-base-patch32"]) + +XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"facebook/xglm-564M": "https://huggingface.co/facebook/xglm-564M/resolve/main/config.json"} +) + +XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/xglm-564M"]) + +TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/xglm-564M"]) + +XLM_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "FacebookAI/xlm-mlm-en-2048": "https://huggingface.co/FacebookAI/xlm-mlm-en-2048/resolve/main/config.json", + "FacebookAI/xlm-mlm-ende-1024": "https://huggingface.co/FacebookAI/xlm-mlm-ende-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enfr-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-enro-1024": "https://huggingface.co/FacebookAI/xlm-mlm-enro-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-xnli15-1024": "https://huggingface.co/FacebookAI/xlm-mlm-xnli15-1024/resolve/main/config.json", + "FacebookAI/xlm-clm-enfr-1024": "https://huggingface.co/FacebookAI/xlm-clm-enfr-1024/resolve/main/config.json", + "FacebookAI/xlm-clm-ende-1024": "https://huggingface.co/FacebookAI/xlm-clm-ende-1024/resolve/main/config.json", + "FacebookAI/xlm-mlm-17-1280": "https://huggingface.co/FacebookAI/xlm-mlm-17-1280/resolve/main/config.json", + "FacebookAI/xlm-mlm-100-1280": "https://huggingface.co/FacebookAI/xlm-mlm-100-1280/resolve/main/config.json", + } +) + +XLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "FacebookAI/xlm-mlm-en-2048", + "FacebookAI/xlm-mlm-ende-1024", + "FacebookAI/xlm-mlm-enfr-1024", + "FacebookAI/xlm-mlm-enro-1024", + "FacebookAI/xlm-mlm-tlm-xnli15-1024", + "FacebookAI/xlm-mlm-xnli15-1024", + "FacebookAI/xlm-clm-enfr-1024", + "FacebookAI/xlm-clm-ende-1024", + "FacebookAI/xlm-mlm-17-1280", + "FacebookAI/xlm-mlm-100-1280", + ] +) + +TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "FacebookAI/xlm-mlm-en-2048", + "FacebookAI/xlm-mlm-ende-1024", + "FacebookAI/xlm-mlm-enfr-1024", + "FacebookAI/xlm-mlm-enro-1024", + "FacebookAI/xlm-mlm-tlm-xnli15-1024", + "FacebookAI/xlm-mlm-xnli15-1024", + "FacebookAI/xlm-clm-enfr-1024", + "FacebookAI/xlm-clm-ende-1024", + "FacebookAI/xlm-mlm-17-1280", + "FacebookAI/xlm-mlm-100-1280", + ] +) + +XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "microsoft/xprophetnet-large-wiki100-cased": "https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json" + } +) + +XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["microsoft/xprophetnet-large-wiki100-cased"]) + +XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "FacebookAI/xlm-roberta-base": "https://huggingface.co/FacebookAI/xlm-roberta-base/resolve/main/config.json", + "FacebookAI/xlm-roberta-large": "https://huggingface.co/FacebookAI/xlm-roberta-large/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll03-english": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json", + "FacebookAI/xlm-roberta-large-finetuned-conll03-german": "https://huggingface.co/FacebookAI/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json", + } +) + +XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "FacebookAI/xlm-roberta-base", + "FacebookAI/xlm-roberta-large", + "FacebookAI/xlm-roberta-large-finetuned-conll02-dutch", + "FacebookAI/xlm-roberta-large-finetuned-conll02-spanish", + "FacebookAI/xlm-roberta-large-finetuned-conll03-english", + "FacebookAI/xlm-roberta-large-finetuned-conll03-german", + ] +) + +TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "FacebookAI/xlm-roberta-base", + "FacebookAI/xlm-roberta-large", + "joeddav/xlm-roberta-large-xnli", + "cardiffnlp/twitter-xlm-roberta-base-sentiment", + ] +) + +FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + ["FacebookAI/xlm-roberta-base", "FacebookAI/xlm-roberta-large"] +) + +XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/xlm-roberta-xl": "https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json", + "facebook/xlm-roberta-xxl": "https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json", + } +) + +XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["facebook/xlm-roberta-xl", "facebook/xlm-roberta-xxl"]) + +XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "xlnet/xlnet-base-cased": "https://huggingface.co/xlnet/xlnet-base-cased/resolve/main/config.json", + "xlnet/xlnet-large-cased": "https://huggingface.co/xlnet/xlnet-large-cased/resolve/main/config.json", + } +) + +XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["xlnet/xlnet-base-cased", "xlnet/xlnet-large-cased"]) + +TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["xlnet/xlnet-base-cased", "xlnet/xlnet-large-cased"]) + +XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + { + "facebook/xmod-base": "https://huggingface.co/facebook/xmod-base/resolve/main/config.json", + "facebook/xmod-large-prenorm": "https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json", + "facebook/xmod-base-13-125k": "https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json", + "facebook/xmod-base-30-125k": "https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json", + "facebook/xmod-base-30-195k": "https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json", + "facebook/xmod-base-60-125k": "https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json", + "facebook/xmod-base-60-265k": "https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json", + "facebook/xmod-base-75-125k": "https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json", + "facebook/xmod-base-75-269k": "https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json", + } +) + +XMOD_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList( + [ + "facebook/xmod-base", + "facebook/xmod-large-prenorm", + "facebook/xmod-base-13-125k", + "facebook/xmod-base-30-125k", + "facebook/xmod-base-30-195k", + "facebook/xmod-base-60-125k", + "facebook/xmod-base-60-265k", + "facebook/xmod-base-75-125k", + "facebook/xmod-base-75-269k", + ] +) + +YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json"} +) + +YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["hustvl/yolos-small"]) + +YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP = DeprecatedDict( + {"uw-madison/yoso-4096": "https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json"} +) + +YOSO_PRETRAINED_MODEL_ARCHIVE_LIST = DeprecatedList(["uw-madison/yoso-4096"]) + + +CONFIG_ARCHIVE_MAP_MAPPING_NAMES = OrderedDict( + [ + # Add archive maps here) + ("albert", "ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("align", "ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("altclip", "ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("audio-spectrogram-transformer", "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("autoformer", "AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bark", "BARK_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bart", "BART_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("beit", "BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bert", "BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("big_bird", "BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bigbird_pegasus", "BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("biogpt", "BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bit", "BIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("blenderbot", "BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("blenderbot-small", "BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("blip", "BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("blip-2", "BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bloom", "BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bridgetower", "BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("bros", "BROS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("camembert", "CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("canine", "CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("chinese_clip", "CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("clap", "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST"), + ("clip", "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("clipseg", "CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("clvp", "CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("codegen", "CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("conditional_detr", "CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("convbert", "CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("convnext", "CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("convnextv2", "CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("cpmant", "CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("ctrl", "CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("cvt", "CVT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("data2vec-audio", "DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("data2vec-text", "DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("data2vec-vision", "DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("deberta", "DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("deberta-v2", "DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("deformable_detr", "DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("deit", "DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("depth_anything", "DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("deta", "DETA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("detr", "DETR_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("dinat", "DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("dinov2", "DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("distilbert", "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("donut-swin", "DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("dpr", "DPR_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("dpt", "DPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("efficientformer", "EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("efficientnet", "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("electra", "ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("encodec", "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("ernie", "ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("ernie_m", "ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("esm", "ESM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("falcon", "FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("fastspeech2_conformer", "FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("flaubert", "FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("flava", "FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("fnet", "FNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("focalnet", "FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("fsmt", "FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("funnel", "FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("fuyu", "FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gemma", "GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("git", "GIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("glpn", "GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gpt2", "GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gpt_bigcode", "GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gpt_neo", "GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gpt_neox", "GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gpt_neox_japanese", "GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gptj", "GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("gptsan-japanese", "GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("graphormer", "GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("groupvit", "GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("hubert", "HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("ibert", "IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("idefics", "IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("imagegpt", "IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("informer", "INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("instructblip", "INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("jukebox", "JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("kosmos-2", "KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("layoutlm", "LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("layoutlmv2", "LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("layoutlmv3", "LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("led", "LED_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("levit", "LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("lilt", "LILT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("llama", "LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("llava", "LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("longformer", "LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("longt5", "LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("luke", "LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("lxmert", "LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("m2m_100", "M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mamba", "MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("markuplm", "MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mask2former", "MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("maskformer", "MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mbart", "MBART_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mctct", "MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mega", "MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("megatron-bert", "MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mgp-str", "MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mistral", "MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mixtral", "MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mobilenet_v1", "MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mobilenet_v2", "MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mobilevit", "MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mobilevitv2", "MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mpnet", "MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mpt", "MPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mra", "MRA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("musicgen", "MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("mvp", "MVP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("nat", "NAT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("nezha", "NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("nllb-moe", "NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("nystromformer", "NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("oneformer", "ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("open-llama", "OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("openai-gpt", "OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("opt", "OPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("owlv2", "OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("owlvit", "OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("patchtsmixer", "PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("patchtst", "PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("pegasus", "PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("pegasus_x", "PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("perceiver", "PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("persimmon", "PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("phi", "PHI_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("pix2struct", "PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("plbart", "PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("poolformer", "POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("pop2piano", "POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("prophetnet", "PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("pvt", "PVT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("qdqbert", "QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("qwen2", "QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("realm", "REALM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("regnet", "REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("rembert", "REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("resnet", "RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("retribert", "RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("roberta", "ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("roberta-prelayernorm", "ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("roc_bert", "ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("roformer", "ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("rwkv", "RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("sam", "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("seamless_m4t", "SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("seamless_m4t_v2", "SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("segformer", "SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("seggpt", "SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("sew", "SEW_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("sew-d", "SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("siglip", "SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("speech_to_text", "SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("speech_to_text_2", "SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("speecht5", "SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("splinter", "SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("squeezebert", "SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("stablelm", "STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("starcoder2", "STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("swiftformer", "SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("swin", "SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("swin2sr", "SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("swinv2", "SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("switch_transformers", "SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("t5", "T5_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("table-transformer", "TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("tapas", "TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("time_series_transformer", "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("timesformer", "TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("transfo-xl", "TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("tvlt", "TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("tvp", "TVP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("udop", "UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("unispeech", "UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("unispeech-sat", "UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("univnet", "UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("van", "VAN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("videomae", "VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vilt", "VILT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vipllava", "VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("visual_bert", "VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vit", "VIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vit_hybrid", "VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vit_mae", "VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vit_msn", "VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vitdet", "VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vitmatte", "VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vits", "VITS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("vivit", "VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("wav2vec2", "WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("wav2vec2-bert", "WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("wav2vec2-conformer", "WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("whisper", "WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("xclip", "XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("xglm", "XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("xlm", "XLM_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("xlm-prophetnet", "XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("xlm-roberta", "XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("xlnet", "XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("xmod", "XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("yolos", "YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ("yoso", "YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP"), + ] +) diff --git a/src/transformers/models/deprecated/mctct/configuration_mctct.py b/src/transformers/models/deprecated/mctct/configuration_mctct.py index c5de7347807733..6546b18eab0522 100644 --- a/src/transformers/models/deprecated/mctct/configuration_mctct.py +++ b/src/transformers/models/deprecated/mctct/configuration_mctct.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from .._archive_maps import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MCTCTConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MCTCTModel`]. It is used to instantiate an diff --git a/src/transformers/models/deprecated/mctct/modeling_mctct.py b/src/transformers/models/deprecated/mctct/modeling_mctct.py index 95c860fa9a49c5..2d9ef6cf724c28 100755 --- a/src/transformers/models/deprecated/mctct/modeling_mctct.py +++ b/src/transformers/models/deprecated/mctct/modeling_mctct.py @@ -52,6 +52,9 @@ _CTC_EXPECTED_LOSS = 1885.65 +from .._archive_maps import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class MCTCTConv1dSubsampler(nn.Module): """ Convolutional subsampler: a stack of 1D convolution (along temporal dimension) followed by non-linear activation diff --git a/src/transformers/models/deprecated/open_llama/configuration_open_llama.py b/src/transformers/models/deprecated/open_llama/configuration_open_llama.py index 7ffe618d46dcb0..6b6fc04a46f673 100644 --- a/src/transformers/models/deprecated/open_llama/configuration_open_llama.py +++ b/src/transformers/models/deprecated/open_llama/configuration_open_llama.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from .._archive_maps import OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class OpenLlamaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`OpenLlamaModel`]. It is used to instantiate an diff --git a/src/transformers/models/deprecated/retribert/configuration_retribert.py b/src/transformers/models/deprecated/retribert/configuration_retribert.py index dfa7d3b65b6f23..c188c7347a8fb8 100644 --- a/src/transformers/models/deprecated/retribert/configuration_retribert.py +++ b/src/transformers/models/deprecated/retribert/configuration_retribert.py @@ -20,6 +20,8 @@ logger = logging.get_logger(__name__) +from .._archive_maps import RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + class RetriBertConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/deprecated/retribert/modeling_retribert.py b/src/transformers/models/deprecated/retribert/modeling_retribert.py index d8af23fb49ef00..7dba8a276eeb56 100644 --- a/src/transformers/models/deprecated/retribert/modeling_retribert.py +++ b/src/transformers/models/deprecated/retribert/modeling_retribert.py @@ -33,6 +33,9 @@ logger = logging.get_logger(__name__) +from .._archive_maps import RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # INTERFACE FOR ENCODER AND TASK SPECIFIC MODEL # class RetriBertPreTrainedModel(PreTrainedModel): """ diff --git a/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py b/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py index 06ec12161fc31b..eccb71fcc429e7 100644 --- a/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py +++ b/src/transformers/models/deprecated/trajectory_transformer/configuration_trajectory_transformer.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from .._archive_maps import TRAJECTORY_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TrajectoryTransformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TrajectoryTransformerModel`]. It is used to diff --git a/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py b/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py index 24e1815218b256..5c98aa45dc2739 100644 --- a/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py +++ b/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py @@ -42,6 +42,9 @@ _CONFIG_FOR_DOC = "TrajectoryTransformerConfig" +from .._archive_maps import TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_trajectory_transformer(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py index c9dde2e8fd2709..50bf94ae7ea398 100644 --- a/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py +++ b/src/transformers/models/deprecated/transfo_xl/configuration_transfo_xl.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from .._archive_maps import TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TransfoXLConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`TransfoXLModel`] or a [`TFTransfoXLModel`]. It is diff --git a/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py index e490eb8dba3b80..27200a5d63f18b 100644 --- a/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py +++ b/src/transformers/models/deprecated/transfo_xl/modeling_tf_transfo_xl.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "TransfoXLConfig" +from .._archive_maps import TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFPositionalEmbedding(keras.layers.Layer): def __init__(self, demb, **kwargs): super().__init__(**kwargs) diff --git a/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py b/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py index 52989cfd13eae6..897a3899c74cbd 100644 --- a/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py +++ b/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl.py @@ -43,6 +43,9 @@ _CONFIG_FOR_DOC = "TransfoXLConfig" +from .._archive_maps import TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def build_tf_to_pytorch_map(model, config): """ A map of modules from TF to PyTorch. This time I use a map to keep the PyTorch model as identical to the original diff --git a/src/transformers/models/deprecated/van/configuration_van.py b/src/transformers/models/deprecated/van/configuration_van.py index 68a139ffdfcebc..f58d0215694a93 100644 --- a/src/transformers/models/deprecated/van/configuration_van.py +++ b/src/transformers/models/deprecated/van/configuration_van.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from .._archive_maps import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VanConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`VanModel`]. It is used to instantiate a VAN model diff --git a/src/transformers/models/deprecated/van/modeling_van.py b/src/transformers/models/deprecated/van/modeling_van.py index 0f5940707c1152..6fa2b73482e358 100644 --- a/src/transformers/models/deprecated/van/modeling_van.py +++ b/src/transformers/models/deprecated/van/modeling_van.py @@ -48,6 +48,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from .._archive_maps import VAN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.convnext.modeling_convnext.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: """ diff --git a/src/transformers/models/depth_anything/configuration_depth_anything.py b/src/transformers/models/depth_anything/configuration_depth_anything.py index b6d6f388b0910d..3d58a3874eedf3 100644 --- a/src/transformers/models/depth_anything/configuration_depth_anything.py +++ b/src/transformers/models/depth_anything/configuration_depth_anything.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DEPTH_ANYTHING_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DepthAnythingConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DepthAnythingModel`]. It is used to instantiate an DepthAnything diff --git a/src/transformers/models/depth_anything/modeling_depth_anything.py b/src/transformers/models/depth_anything/modeling_depth_anything.py index efa55adbdcd469..788b0d911396f1 100644 --- a/src/transformers/models/depth_anything/modeling_depth_anything.py +++ b/src/transformers/models/depth_anything/modeling_depth_anything.py @@ -39,6 +39,9 @@ _CONFIG_FOR_DOC = "DepthAnythingConfig" +from ..deprecated._archive_maps import DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + DEPTH_ANYTHING_START_DOCSTRING = r""" This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and diff --git a/src/transformers/models/deta/configuration_deta.py b/src/transformers/models/deta/configuration_deta.py index b876e843c0f14c..1604bc56e6396d 100644 --- a/src/transformers/models/deta/configuration_deta.py +++ b/src/transformers/models/deta/configuration_deta.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DetaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DetaModel`]. It is used to instantiate a DETA diff --git a/src/transformers/models/deta/modeling_deta.py b/src/transformers/models/deta/modeling_deta.py index 62773b47abbfe2..35d9b67d2f9923 100644 --- a/src/transformers/models/deta/modeling_deta.py +++ b/src/transformers/models/deta/modeling_deta.py @@ -152,6 +152,9 @@ def backward(context, grad_output): _CHECKPOINT_FOR_DOC = "jozhang97/deta-swin-large-o365" +from ..deprecated._archive_maps import DETA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.deformable_detr.modeling_deformable_detr.DeformableDetrDecoderOutput with DeformableDetr->Deta class DetaDecoderOutput(ModelOutput): diff --git a/src/transformers/models/detr/configuration_detr.py b/src/transformers/models/detr/configuration_detr.py index acecf8aa915f62..9b9b5afacd0b7f 100644 --- a/src/transformers/models/detr/configuration_detr.py +++ b/src/transformers/models/detr/configuration_detr.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DETR_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DetrConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DetrModel`]. It is used to instantiate a DETR diff --git a/src/transformers/models/detr/modeling_detr.py b/src/transformers/models/detr/modeling_detr.py index b10d4ce02c93ca..d7fcdfc5bc7e83 100644 --- a/src/transformers/models/detr/modeling_detr.py +++ b/src/transformers/models/detr/modeling_detr.py @@ -61,6 +61,9 @@ _CHECKPOINT_FOR_DOC = "facebook/detr-resnet-50" +from ..deprecated._archive_maps import DETR_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class DetrDecoderOutput(BaseModelOutputWithCrossAttentions): """ diff --git a/src/transformers/models/dinat/configuration_dinat.py b/src/transformers/models/dinat/configuration_dinat.py index 6138e8072b671a..4bd38c73857a97 100644 --- a/src/transformers/models/dinat/configuration_dinat.py +++ b/src/transformers/models/dinat/configuration_dinat.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DinatConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DinatModel`]. It is used to instantiate a Dinat diff --git a/src/transformers/models/dinat/modeling_dinat.py b/src/transformers/models/dinat/modeling_dinat.py index 03c0fe33a2838b..72bf6d1170094c 100644 --- a/src/transformers/models/dinat/modeling_dinat.py +++ b/src/transformers/models/dinat/modeling_dinat.py @@ -68,6 +68,9 @@ def natten2dav(*args, **kwargs): _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import DINAT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # drop_path and DinatDropPath are from the timm library. diff --git a/src/transformers/models/dinov2/configuration_dinov2.py b/src/transformers/models/dinov2/configuration_dinov2.py index 48feba23b118e3..b5fe872a706fc7 100644 --- a/src/transformers/models/dinov2/configuration_dinov2.py +++ b/src/transformers/models/dinov2/configuration_dinov2.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Dinov2Config(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Dinov2Model`]. It is used to instantiate an diff --git a/src/transformers/models/dinov2/modeling_dinov2.py b/src/transformers/models/dinov2/modeling_dinov2.py index 806608afb184a1..c25022f6ec22d8 100644 --- a/src/transformers/models/dinov2/modeling_dinov2.py +++ b/src/transformers/models/dinov2/modeling_dinov2.py @@ -58,6 +58,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class Dinov2Embeddings(nn.Module): """ Construct the CLS token, mask token, position and patch embeddings. diff --git a/src/transformers/models/distilbert/configuration_distilbert.py b/src/transformers/models/distilbert/configuration_distilbert.py index 45e2d3b3f060d2..5f6b004dc0bbb9 100644 --- a/src/transformers/models/distilbert/configuration_distilbert.py +++ b/src/transformers/models/distilbert/configuration_distilbert.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DistilBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DistilBertModel`] or a [`TFDistilBertModel`]. It diff --git a/src/transformers/models/distilbert/modeling_distilbert.py b/src/transformers/models/distilbert/modeling_distilbert.py index bd2d745055a3de..d33ffc8844607a 100755 --- a/src/transformers/models/distilbert/modeling_distilbert.py +++ b/src/transformers/models/distilbert/modeling_distilbert.py @@ -63,6 +63,9 @@ _CONFIG_FOR_DOC = "DistilBertConfig" +from ..deprecated._archive_maps import DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # UTILS AND BUILDING BLOCKS OF THE ARCHITECTURE # diff --git a/src/transformers/models/distilbert/modeling_tf_distilbert.py b/src/transformers/models/distilbert/modeling_tf_distilbert.py index 1e663c92293c78..c41deac3f2e57e 100644 --- a/src/transformers/models/distilbert/modeling_tf_distilbert.py +++ b/src/transformers/models/distilbert/modeling_tf_distilbert.py @@ -63,6 +63,9 @@ _CONFIG_FOR_DOC = "DistilBertConfig" +from ..deprecated._archive_maps import TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFEmbeddings(keras.layers.Layer): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/donut/configuration_donut_swin.py b/src/transformers/models/donut/configuration_donut_swin.py index 80418e71442f6c..e57ddb255a7118 100644 --- a/src/transformers/models/donut/configuration_donut_swin.py +++ b/src/transformers/models/donut/configuration_donut_swin.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DonutSwinConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DonutSwinModel`]. It is used to instantiate a diff --git a/src/transformers/models/donut/modeling_donut_swin.py b/src/transformers/models/donut/modeling_donut_swin.py index 6e71e0841b7a94..b2aa8d61b1d8d1 100644 --- a/src/transformers/models/donut/modeling_donut_swin.py +++ b/src/transformers/models/donut/modeling_donut_swin.py @@ -49,6 +49,9 @@ _EXPECTED_OUTPUT_SHAPE = [1, 49, 768] +from ..deprecated._archive_maps import DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.swin.modeling_swin.SwinEncoderOutput with Swin->DonutSwin class DonutSwinEncoderOutput(ModelOutput): diff --git a/src/transformers/models/dpr/configuration_dpr.py b/src/transformers/models/dpr/configuration_dpr.py index 3d7abec3ebed25..74ac90a4beb508 100644 --- a/src/transformers/models/dpr/configuration_dpr.py +++ b/src/transformers/models/dpr/configuration_dpr.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DPR_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DPRConfig(PretrainedConfig): r""" [`DPRConfig`] is the configuration class to store the configuration of a *DPRModel*. diff --git a/src/transformers/models/dpr/modeling_dpr.py b/src/transformers/models/dpr/modeling_dpr.py index b228b0a9b76a41..0a45ec75207c29 100644 --- a/src/transformers/models/dpr/modeling_dpr.py +++ b/src/transformers/models/dpr/modeling_dpr.py @@ -40,6 +40,13 @@ _CHECKPOINT_FOR_DOC = "facebook/dpr-ctx_encoder-single-nq-base" +from ..deprecated._archive_maps import ( # noqa: F401, E402 + DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, # noqa: F401, E402 + DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, # noqa: F401, E402 + DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, # noqa: F401, E402 +) + + ########## # Outputs ########## diff --git a/src/transformers/models/dpr/modeling_tf_dpr.py b/src/transformers/models/dpr/modeling_tf_dpr.py index a2e539f73fc26c..e8cb1464f70da8 100644 --- a/src/transformers/models/dpr/modeling_tf_dpr.py +++ b/src/transformers/models/dpr/modeling_tf_dpr.py @@ -40,6 +40,13 @@ _CONFIG_FOR_DOC = "DPRConfig" +from ..deprecated._archive_maps import ( # noqa: F401, E402 + TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, # noqa: F401, E402 + TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST, # noqa: F401, E402 + TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST, # noqa: F401, E402 +) + + ########## # Outputs ########## diff --git a/src/transformers/models/dpt/configuration_dpt.py b/src/transformers/models/dpt/configuration_dpt.py index b21864e9b0bd22..9bdc8d1ef0affb 100644 --- a/src/transformers/models/dpt/configuration_dpt.py +++ b/src/transformers/models/dpt/configuration_dpt.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DPTConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DPTModel`]. It is used to instantiate an DPT diff --git a/src/transformers/models/dpt/modeling_dpt.py b/src/transformers/models/dpt/modeling_dpt.py index 74990b1684bc13..aad3330279f051 100755 --- a/src/transformers/models/dpt/modeling_dpt.py +++ b/src/transformers/models/dpt/modeling_dpt.py @@ -55,6 +55,9 @@ _EXPECTED_OUTPUT_SHAPE = [1, 577, 1024] +from ..deprecated._archive_maps import DPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class BaseModelOutputWithIntermediateActivations(ModelOutput): """ diff --git a/src/transformers/models/efficientformer/configuration_efficientformer.py b/src/transformers/models/efficientformer/configuration_efficientformer.py index 0cc7635ea0cde6..1641c90711f5d4 100644 --- a/src/transformers/models/efficientformer/configuration_efficientformer.py +++ b/src/transformers/models/efficientformer/configuration_efficientformer.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class EfficientFormerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`EfficientFormerModel`]. It is used to diff --git a/src/transformers/models/efficientformer/modeling_efficientformer.py b/src/transformers/models/efficientformer/modeling_efficientformer.py index c077edc17dc8b6..70075cff55d7d9 100644 --- a/src/transformers/models/efficientformer/modeling_efficientformer.py +++ b/src/transformers/models/efficientformer/modeling_efficientformer.py @@ -50,6 +50,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "Egyptian cat" +from ..deprecated._archive_maps import EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class EfficientFormerPatchEmbeddings(nn.Module): """ This class performs downsampling between two stages. For the input tensor with the shape [batch_size, num_channels, diff --git a/src/transformers/models/efficientformer/modeling_tf_efficientformer.py b/src/transformers/models/efficientformer/modeling_tf_efficientformer.py index 605487e6feccdf..77b62999e772ec 100644 --- a/src/transformers/models/efficientformer/modeling_tf_efficientformer.py +++ b/src/transformers/models/efficientformer/modeling_tf_efficientformer.py @@ -59,6 +59,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "LABEL_281" +from ..deprecated._archive_maps import TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFEfficientFormerPatchEmbeddings(keras.layers.Layer): """ This class performs downsampling between two stages. For the input tensor with the shape [batch_size, num_channels, diff --git a/src/transformers/models/efficientnet/configuration_efficientnet.py b/src/transformers/models/efficientnet/configuration_efficientnet.py index 63480a9a6dd7e7..77106c70d7d553 100644 --- a/src/transformers/models/efficientnet/configuration_efficientnet.py +++ b/src/transformers/models/efficientnet/configuration_efficientnet.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class EfficientNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`EfficientNetModel`]. It is used to instantiate an diff --git a/src/transformers/models/efficientnet/modeling_efficientnet.py b/src/transformers/models/efficientnet/modeling_efficientnet.py index cfa2a593183848..5b7ff534eedfe4 100644 --- a/src/transformers/models/efficientnet/modeling_efficientnet.py +++ b/src/transformers/models/efficientnet/modeling_efficientnet.py @@ -53,6 +53,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + EFFICIENTNET_START_DOCSTRING = r""" This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and diff --git a/src/transformers/models/electra/configuration_electra.py b/src/transformers/models/electra/configuration_electra.py index f4ca3049837996..b6d1368a9d22d2 100644 --- a/src/transformers/models/electra/configuration_electra.py +++ b/src/transformers/models/electra/configuration_electra.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ElectraConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ElectraModel`] or a [`TFElectraModel`]. It is diff --git a/src/transformers/models/electra/modeling_electra.py b/src/transformers/models/electra/modeling_electra.py index 3b05f982c8700c..2138aa97c6dca9 100644 --- a/src/transformers/models/electra/modeling_electra.py +++ b/src/transformers/models/electra/modeling_electra.py @@ -54,6 +54,9 @@ _CONFIG_FOR_DOC = "ElectraConfig" +from ..deprecated._archive_maps import ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_electra(model, config, tf_checkpoint_path, discriminator_or_generator="discriminator"): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/electra/modeling_tf_electra.py b/src/transformers/models/electra/modeling_tf_electra.py index b903e7f082c6a1..ba60cd8f5d5754 100644 --- a/src/transformers/models/electra/modeling_tf_electra.py +++ b/src/transformers/models/electra/modeling_tf_electra.py @@ -66,6 +66,9 @@ _CONFIG_FOR_DOC = "ElectraConfig" +from ..deprecated._archive_maps import TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bert.modeling_tf_bert.TFBertSelfAttention with Bert->Electra class TFElectraSelfAttention(keras.layers.Layer): def __init__(self, config: ElectraConfig, **kwargs): diff --git a/src/transformers/models/encodec/configuration_encodec.py b/src/transformers/models/encodec/configuration_encodec.py index 4d8611a1788c0d..4e18bb178adf23 100644 --- a/src/transformers/models/encodec/configuration_encodec.py +++ b/src/transformers/models/encodec/configuration_encodec.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class EncodecConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`EncodecModel`]. It is used to instantiate a diff --git a/src/transformers/models/encodec/modeling_encodec.py b/src/transformers/models/encodec/modeling_encodec.py index 762999cdf504c5..bd56661b198009 100644 --- a/src/transformers/models/encodec/modeling_encodec.py +++ b/src/transformers/models/encodec/modeling_encodec.py @@ -40,6 +40,9 @@ _CONFIG_FOR_DOC = "EncodecConfig" +from ..deprecated._archive_maps import ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class EncodecOutput(ModelOutput): """ diff --git a/src/transformers/models/ernie/configuration_ernie.py b/src/transformers/models/ernie/configuration_ernie.py index 16f14489903fde..81ed03596303ee 100644 --- a/src/transformers/models/ernie/configuration_ernie.py +++ b/src/transformers/models/ernie/configuration_ernie.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ErnieConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ErnieModel`] or a [`TFErnieModel`]. It is used to diff --git a/src/transformers/models/ernie/modeling_ernie.py b/src/transformers/models/ernie/modeling_ernie.py index c91032d376b9c2..a65f453205d5c5 100644 --- a/src/transformers/models/ernie/modeling_ernie.py +++ b/src/transformers/models/ernie/modeling_ernie.py @@ -56,6 +56,9 @@ _CONFIG_FOR_DOC = "ErnieConfig" +from ..deprecated._archive_maps import ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class ErnieEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/ernie_m/configuration_ernie_m.py b/src/transformers/models/ernie_m/configuration_ernie_m.py index 9c67a8642131f9..96451c9d9c999c 100644 --- a/src/transformers/models/ernie_m/configuration_ernie_m.py +++ b/src/transformers/models/ernie_m/configuration_ernie_m.py @@ -20,6 +20,7 @@ from typing import Dict from ...configuration_utils import PretrainedConfig +from ..deprecated._archive_maps import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 class ErnieMConfig(PretrainedConfig): diff --git a/src/transformers/models/ernie_m/modeling_ernie_m.py b/src/transformers/models/ernie_m/modeling_ernie_m.py index b8f7e87c850248..ac56e120a0c3d4 100755 --- a/src/transformers/models/ernie_m/modeling_ernie_m.py +++ b/src/transformers/models/ernie_m/modeling_ernie_m.py @@ -45,6 +45,9 @@ _TOKENIZER_FOR_DOC = "ErnieMTokenizer" +from ..deprecated._archive_maps import ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Adapted from paddlenlp.transformers.ernie_m.modeling.ErnieEmbeddings class ErnieMEmbeddings(nn.Module): """Construct the embeddings from word and position embeddings.""" diff --git a/src/transformers/models/esm/configuration_esm.py b/src/transformers/models/esm/configuration_esm.py index feb06031e5afcf..31d309cb04a017 100644 --- a/src/transformers/models/esm/configuration_esm.py +++ b/src/transformers/models/esm/configuration_esm.py @@ -25,6 +25,8 @@ # TODO Update this +from ..deprecated._archive_maps import ESM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + class EsmConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/esm/modeling_esm.py b/src/transformers/models/esm/modeling_esm.py index e5683a3c99c264..a97ea58d7b81d9 100755 --- a/src/transformers/models/esm/modeling_esm.py +++ b/src/transformers/models/esm/modeling_esm.py @@ -41,6 +41,9 @@ _CONFIG_FOR_DOC = "EsmConfig" +from ..deprecated._archive_maps import ESM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def rotate_half(x): x1, x2 = x.chunk(2, dim=-1) return torch.cat((-x2, x1), dim=-1) diff --git a/src/transformers/models/falcon/configuration_falcon.py b/src/transformers/models/falcon/configuration_falcon.py index 48fcefc502464a..16d9dec47c7f94 100644 --- a/src/transformers/models/falcon/configuration_falcon.py +++ b/src/transformers/models/falcon/configuration_falcon.py @@ -20,6 +20,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class FalconConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FalconModel`]. It is used to instantiate a Falcon diff --git a/src/transformers/models/falcon/modeling_falcon.py b/src/transformers/models/falcon/modeling_falcon.py index 1caaa785e09dc9..f1cff3f181ac56 100644 --- a/src/transformers/models/falcon/modeling_falcon.py +++ b/src/transformers/models/falcon/modeling_falcon.py @@ -58,6 +58,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FALCON_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + _CHECKPOINT_FOR_DOC = "Rocketknight1/falcon-rw-1b" _CONFIG_FOR_DOC = "FalconConfig" diff --git a/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py b/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py index b8e1ae851232ce..adb038ad1b2a0b 100644 --- a/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py +++ b/src/transformers/models/fastspeech2_conformer/configuration_fastspeech2_conformer.py @@ -23,6 +23,13 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ( # noqa: F401, E402 + FASTSPEECH2_CONFORMER_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, # noqa: F401, E402 + FASTSPEECH2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, # noqa: F401, E402 + FASTSPEECH2_CONFORMER_WITH_HIFIGAN_PRETRAINED_CONFIG_ARCHIVE_MAP, # noqa: F401, E402 +) + + class FastSpeech2ConformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FastSpeech2ConformerModel`]. It is used to diff --git a/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py b/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py index 01c2cece550adf..c46ef2a8365f0c 100644 --- a/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py +++ b/src/transformers/models/fastspeech2_conformer/modeling_fastspeech2_conformer.py @@ -34,6 +34,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class FastSpeech2ConformerModelOutput(ModelOutput): """ diff --git a/src/transformers/models/flaubert/configuration_flaubert.py b/src/transformers/models/flaubert/configuration_flaubert.py index 98939e7091f5a4..fb4ef2992cbb88 100644 --- a/src/transformers/models/flaubert/configuration_flaubert.py +++ b/src/transformers/models/flaubert/configuration_flaubert.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class FlaubertConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`FlaubertModel`] or a [`TFFlaubertModel`]. It is diff --git a/src/transformers/models/flaubert/modeling_flaubert.py b/src/transformers/models/flaubert/modeling_flaubert.py index 17600c96d91324..4077d1b7b0e55f 100644 --- a/src/transformers/models/flaubert/modeling_flaubert.py +++ b/src/transformers/models/flaubert/modeling_flaubert.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "FlaubertConfig" +from ..deprecated._archive_maps import FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.xlm.modeling_xlm.create_sinusoidal_embeddings def create_sinusoidal_embeddings(n_pos, dim, out): position_enc = np.array([[pos / np.power(10000, 2 * (j // 2) / dim) for j in range(dim)] for pos in range(n_pos)]) diff --git a/src/transformers/models/flaubert/modeling_tf_flaubert.py b/src/transformers/models/flaubert/modeling_tf_flaubert.py index 0538fa061c4023..08e573daa99458 100644 --- a/src/transformers/models/flaubert/modeling_tf_flaubert.py +++ b/src/transformers/models/flaubert/modeling_tf_flaubert.py @@ -68,6 +68,9 @@ _CONFIG_FOR_DOC = "FlaubertConfig" +from ..deprecated._archive_maps import TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + FLAUBERT_START_DOCSTRING = r""" This model inherits from [`TFPreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/flava/configuration_flava.py b/src/transformers/models/flava/configuration_flava.py index b78b5fdeac79ef..2c8642bfd2759f 100644 --- a/src/transformers/models/flava/configuration_flava.py +++ b/src/transformers/models/flava/configuration_flava.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class FlavaImageConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FlavaImageModel`]. It is used to instantiate an diff --git a/src/transformers/models/flava/modeling_flava.py b/src/transformers/models/flava/modeling_flava.py index 2edec2777b64bc..19f19d4c9d5666 100644 --- a/src/transformers/models/flava/modeling_flava.py +++ b/src/transformers/models/flava/modeling_flava.py @@ -55,6 +55,10 @@ _CONFIG_CLASS_FOR_MULTIMODAL_MODEL_DOC = "FlavaMultimodalConfig" _EXPECTED_IMAGE_OUTPUT_SHAPE = [1, 197, 768] +from ..deprecated._archive_maps import FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + +FLAVA_CODEBOOK_PRETRAINED_MODEL_ARCHIVE_LIST = ["facebook/flava-image-codebook"] LOGIT_SCALE_CLAMP_MIN = 0 LOGIT_SCALE_CLAMP_MAX = 4.6052 diff --git a/src/transformers/models/fnet/configuration_fnet.py b/src/transformers/models/fnet/configuration_fnet.py index 18ad6187998003..4678cae92e2a29 100644 --- a/src/transformers/models/fnet/configuration_fnet.py +++ b/src/transformers/models/fnet/configuration_fnet.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class FNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FNetModel`]. It is used to instantiate an FNet diff --git a/src/transformers/models/fnet/modeling_fnet.py b/src/transformers/models/fnet/modeling_fnet.py index f1cd0e3f3ded28..5724faee56cf85 100755 --- a/src/transformers/models/fnet/modeling_fnet.py +++ b/src/transformers/models/fnet/modeling_fnet.py @@ -60,6 +60,9 @@ _CONFIG_FOR_DOC = "FNetConfig" +from ..deprecated._archive_maps import FNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Adapted from https://github.com/google-research/google-research/blob/master/f_net/fourier.py def _two_dim_matmul(x, matrix_dim_one, matrix_dim_two): """Applies 2D matrix multiplication to 3D input arrays.""" diff --git a/src/transformers/models/focalnet/configuration_focalnet.py b/src/transformers/models/focalnet/configuration_focalnet.py index 1b2cca8b48367b..7f590b9c2c00a4 100644 --- a/src/transformers/models/focalnet/configuration_focalnet.py +++ b/src/transformers/models/focalnet/configuration_focalnet.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class FocalNetConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FocalNetModel`]. It is used to instantiate a diff --git a/src/transformers/models/focalnet/modeling_focalnet.py b/src/transformers/models/focalnet/modeling_focalnet.py index 2b8b6158dd12a0..a452f4171d1b6a 100644 --- a/src/transformers/models/focalnet/modeling_focalnet.py +++ b/src/transformers/models/focalnet/modeling_focalnet.py @@ -54,6 +54,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class FocalNetEncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/fsmt/configuration_fsmt.py b/src/transformers/models/fsmt/configuration_fsmt.py index 7ed34a679273cd..68abe47c019aba 100644 --- a/src/transformers/models/fsmt/configuration_fsmt.py +++ b/src/transformers/models/fsmt/configuration_fsmt.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class DecoderConfig(PretrainedConfig): r""" Configuration class for FSMT's decoder specific things. note: this is a private helper class diff --git a/src/transformers/models/funnel/configuration_funnel.py b/src/transformers/models/funnel/configuration_funnel.py index c3d6ff9ee49eb9..0b49c22fb4c345 100644 --- a/src/transformers/models/funnel/configuration_funnel.py +++ b/src/transformers/models/funnel/configuration_funnel.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class FunnelConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FunnelModel`] or a [`TFBertModel`]. It is used to diff --git a/src/transformers/models/funnel/modeling_funnel.py b/src/transformers/models/funnel/modeling_funnel.py index 1e7c95ab721e4e..ce0c7789487d8f 100644 --- a/src/transformers/models/funnel/modeling_funnel.py +++ b/src/transformers/models/funnel/modeling_funnel.py @@ -50,6 +50,9 @@ _CHECKPOINT_FOR_DOC = "funnel-transformer/small" +from ..deprecated._archive_maps import FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + INF = 1e6 diff --git a/src/transformers/models/funnel/modeling_tf_funnel.py b/src/transformers/models/funnel/modeling_tf_funnel.py index dea3ad550c5db9..b50b96df1c5408 100644 --- a/src/transformers/models/funnel/modeling_tf_funnel.py +++ b/src/transformers/models/funnel/modeling_tf_funnel.py @@ -63,6 +63,9 @@ _CONFIG_FOR_DOC = "FunnelConfig" +from ..deprecated._archive_maps import TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + INF = 1e6 diff --git a/src/transformers/models/fuyu/configuration_fuyu.py b/src/transformers/models/fuyu/configuration_fuyu.py index 8ca7302566a82a..4f1e5da0217065 100644 --- a/src/transformers/models/fuyu/configuration_fuyu.py +++ b/src/transformers/models/fuyu/configuration_fuyu.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class FuyuConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`FuyuForCausalLM`]. It is used to instantiate an diff --git a/src/transformers/models/gemma/configuration_gemma.py b/src/transformers/models/gemma/configuration_gemma.py index c8a55045166751..87e5a2c6693f0d 100644 --- a/src/transformers/models/gemma/configuration_gemma.py +++ b/src/transformers/models/gemma/configuration_gemma.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GEMMA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GemmaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GemmaModel`]. It is used to instantiate an Gemma diff --git a/src/transformers/models/git/configuration_git.py b/src/transformers/models/git/configuration_git.py index 21091445bc85ff..0c28bbabff6b0b 100644 --- a/src/transformers/models/git/configuration_git.py +++ b/src/transformers/models/git/configuration_git.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GitVisionConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GitVisionModel`]. It is used to instantiate a GIT diff --git a/src/transformers/models/git/modeling_git.py b/src/transformers/models/git/modeling_git.py index 090c85b2856d1a..c8953d498428ea 100644 --- a/src/transformers/models/git/modeling_git.py +++ b/src/transformers/models/git/modeling_git.py @@ -46,6 +46,9 @@ _CONFIG_FOR_DOC = "GitConfig" +from ..deprecated._archive_maps import GIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.clip.modeling_clip.CLIPVisionModelOutput with CLIP->Git class GitVisionModelOutput(ModelOutput): diff --git a/src/transformers/models/glpn/configuration_glpn.py b/src/transformers/models/glpn/configuration_glpn.py index e1e4b535050ca4..c3341192169aa0 100644 --- a/src/transformers/models/glpn/configuration_glpn.py +++ b/src/transformers/models/glpn/configuration_glpn.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GLPNConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GLPNModel`]. It is used to instantiate an GLPN diff --git a/src/transformers/models/glpn/modeling_glpn.py b/src/transformers/models/glpn/modeling_glpn.py index 2160e977c091cd..e5d30b62720c9d 100755 --- a/src/transformers/models/glpn/modeling_glpn.py +++ b/src/transformers/models/glpn/modeling_glpn.py @@ -47,6 +47,9 @@ _EXPECTED_OUTPUT_SHAPE = [1, 512, 15, 20] +from ..deprecated._archive_maps import GLPN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: """ diff --git a/src/transformers/models/gpt2/configuration_gpt2.py b/src/transformers/models/gpt2/configuration_gpt2.py index 249decbbaa7659..45495c0012fdd8 100644 --- a/src/transformers/models/gpt2/configuration_gpt2.py +++ b/src/transformers/models/gpt2/configuration_gpt2.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GPT2Config(PretrainedConfig): """ This is the configuration class to store the configuration of a [`GPT2Model`] or a [`TFGPT2Model`]. It is used to diff --git a/src/transformers/models/gpt2/modeling_gpt2.py b/src/transformers/models/gpt2/modeling_gpt2.py index f29ebee9065334..9511baafca36ac 100644 --- a/src/transformers/models/gpt2/modeling_gpt2.py +++ b/src/transformers/models/gpt2/modeling_gpt2.py @@ -55,6 +55,9 @@ _CONFIG_FOR_DOC = "GPT2Config" +from ..deprecated._archive_maps import GPT2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_gpt2(model, config, gpt2_checkpoint_path): """Load tf checkpoints in a pytorch model""" try: diff --git a/src/transformers/models/gpt2/modeling_tf_gpt2.py b/src/transformers/models/gpt2/modeling_tf_gpt2.py index c6f5883e228ea6..26a4e7a398ae8d 100644 --- a/src/transformers/models/gpt2/modeling_tf_gpt2.py +++ b/src/transformers/models/gpt2/modeling_tf_gpt2.py @@ -59,6 +59,9 @@ _CONFIG_FOR_DOC = "GPT2Config" +from ..deprecated._archive_maps import TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFAttention(keras.layers.Layer): def __init__(self, nx, config, scale=False, is_cross_attention=False, **kwargs): super().__init__(**kwargs) diff --git a/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py b/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py index 0c295e17a12cec..ef5e02ffdc43af 100644 --- a/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py +++ b/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GPTBigCodeConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`GPTBigCodeModel`]. It is used to instantiate a diff --git a/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py b/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py index 012cf436719aa3..4e3b8498480c9e 100644 --- a/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py +++ b/src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py @@ -53,6 +53,9 @@ _CONFIG_FOR_DOC = "GPTBigCodeConfig" +from ..deprecated._archive_maps import GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Fused kernels # Use separate functions for each case because conditionals prevent kernel fusion. # TODO: Could have better fused kernels depending on scaling, dropout and head mask. diff --git a/src/transformers/models/gpt_neo/configuration_gpt_neo.py b/src/transformers/models/gpt_neo/configuration_gpt_neo.py index 66c3b6812d1a47..411b392180b018 100644 --- a/src/transformers/models/gpt_neo/configuration_gpt_neo.py +++ b/src/transformers/models/gpt_neo/configuration_gpt_neo.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GPTNeoConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GPTNeoModel`]. It is used to instantiate a GPT diff --git a/src/transformers/models/gpt_neo/modeling_gpt_neo.py b/src/transformers/models/gpt_neo/modeling_gpt_neo.py index b2891526b3ddef..2fbf4677ca6f44 100755 --- a/src/transformers/models/gpt_neo/modeling_gpt_neo.py +++ b/src/transformers/models/gpt_neo/modeling_gpt_neo.py @@ -68,6 +68,9 @@ _CONFIG_FOR_DOC = "GPTNeoConfig" +from ..deprecated._archive_maps import GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + _CHECKPOINT_FOR_DOC = "EleutherAI/gpt-neo-1.3B" diff --git a/src/transformers/models/gpt_neox/configuration_gpt_neox.py b/src/transformers/models/gpt_neox/configuration_gpt_neox.py index 2e0683722db154..a9d20f7a63d876 100644 --- a/src/transformers/models/gpt_neox/configuration_gpt_neox.py +++ b/src/transformers/models/gpt_neox/configuration_gpt_neox.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GPTNeoXConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GPTNeoXModel`]. It is used to instantiate an diff --git a/src/transformers/models/gpt_neox/modeling_gpt_neox.py b/src/transformers/models/gpt_neox/modeling_gpt_neox.py index 3dafda8bd06d6e..83c99202ac9379 100755 --- a/src/transformers/models/gpt_neox/modeling_gpt_neox.py +++ b/src/transformers/models/gpt_neox/modeling_gpt_neox.py @@ -53,6 +53,9 @@ _CONFIG_FOR_DOC = "GPTNeoXConfig" +from ..deprecated._archive_maps import GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py b/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py index bde828790d9828..8ee73257b64c7c 100644 --- a/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py +++ b/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GPTNeoXJapaneseConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GPTNeoXModelJapanese`]. It is used to instantiate diff --git a/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py b/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py index ea934581aa4f21..9fdff2c8387006 100755 --- a/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py +++ b/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py @@ -35,6 +35,9 @@ _CONFIG_FOR_DOC = "GPTNeoXJapaneseConfig" +from ..deprecated._archive_maps import GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class GPTNeoXJapanesePreTrainedModel(PreTrainedModel): """ An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained diff --git a/src/transformers/models/gptj/configuration_gptj.py b/src/transformers/models/gptj/configuration_gptj.py index c9c6c4a1c50e91..56d6042764a19a 100644 --- a/src/transformers/models/gptj/configuration_gptj.py +++ b/src/transformers/models/gptj/configuration_gptj.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GPTJConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GPTJModel`]. It is used to instantiate a GPT-J diff --git a/src/transformers/models/gptj/modeling_gptj.py b/src/transformers/models/gptj/modeling_gptj.py index 5f1e1d6612999d..3c6ddac4ecf4ca 100644 --- a/src/transformers/models/gptj/modeling_gptj.py +++ b/src/transformers/models/gptj/modeling_gptj.py @@ -57,6 +57,9 @@ _CONFIG_FOR_DOC = "GPTJConfig" +from ..deprecated._archive_maps import GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py b/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py index 7630d67bff2165..e0a17d1c114aef 100644 --- a/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py +++ b/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py @@ -20,6 +20,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GPTSanJapaneseConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GPTSanJapaneseModel`]. It is used to instantiate diff --git a/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py b/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py index 1b4f5c72270144..59252bc567a462 100644 --- a/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py +++ b/src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py @@ -45,6 +45,8 @@ # for the pretrained weights provided with the models #################################################### +from ..deprecated._archive_maps import GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + # Copied from transformers.models.switch_transformers.modeling_switch_transformers.router_z_loss_func def router_z_loss_func(router_logits: torch.Tensor) -> float: diff --git a/src/transformers/models/graphormer/configuration_graphormer.py b/src/transformers/models/graphormer/configuration_graphormer.py index 7aaba3aa76a64f..8d1f1359843174 100644 --- a/src/transformers/models/graphormer/configuration_graphormer.py +++ b/src/transformers/models/graphormer/configuration_graphormer.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GraphormerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`~GraphormerModel`]. It is used to instantiate an diff --git a/src/transformers/models/graphormer/modeling_graphormer.py b/src/transformers/models/graphormer/modeling_graphormer.py index 45ffb91a916f0a..8b484fe1e433e5 100755 --- a/src/transformers/models/graphormer/modeling_graphormer.py +++ b/src/transformers/models/graphormer/modeling_graphormer.py @@ -37,6 +37,9 @@ _CONFIG_FOR_DOC = "GraphormerConfig" +from ..deprecated._archive_maps import GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def quant_noise(module: nn.Module, p: float, block_size: int): """ From: diff --git a/src/transformers/models/groupvit/configuration_groupvit.py b/src/transformers/models/groupvit/configuration_groupvit.py index 1f17a0a7e60ad9..3c46c277f3519e 100644 --- a/src/transformers/models/groupvit/configuration_groupvit.py +++ b/src/transformers/models/groupvit/configuration_groupvit.py @@ -31,6 +31,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class GroupViTTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`GroupViTTextModel`]. It is used to instantiate an diff --git a/src/transformers/models/groupvit/modeling_groupvit.py b/src/transformers/models/groupvit/modeling_groupvit.py index 72eedf52bd0e44..ec383b0fcfa6cb 100644 --- a/src/transformers/models/groupvit/modeling_groupvit.py +++ b/src/transformers/models/groupvit/modeling_groupvit.py @@ -44,6 +44,9 @@ _CHECKPOINT_FOR_DOC = "nvidia/groupvit-gcc-yfcc" +from ..deprecated._archive_maps import GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # contrastive loss function, adapted from # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/groupvit/modeling_tf_groupvit.py b/src/transformers/models/groupvit/modeling_tf_groupvit.py index 4efb2f38bc4cea..31c76083e02287 100644 --- a/src/transformers/models/groupvit/modeling_tf_groupvit.py +++ b/src/transformers/models/groupvit/modeling_tf_groupvit.py @@ -67,6 +67,9 @@ _CHECKPOINT_FOR_DOC = "nvidia/groupvit-gcc-yfcc" +from ..deprecated._archive_maps import TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/hubert/configuration_hubert.py b/src/transformers/models/hubert/configuration_hubert.py index 293b9f76f2cfce..00a3244a31074d 100644 --- a/src/transformers/models/hubert/configuration_hubert.py +++ b/src/transformers/models/hubert/configuration_hubert.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class HubertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`HubertModel`]. It is used to instantiate an diff --git a/src/transformers/models/hubert/modeling_hubert.py b/src/transformers/models/hubert/modeling_hubert.py index 289f1825b6ca1f..f9e223f9a384d0 100755 --- a/src/transformers/models/hubert/modeling_hubert.py +++ b/src/transformers/models/hubert/modeling_hubert.py @@ -58,6 +58,9 @@ _SEQ_CLASS_EXPECTED_LOSS = 8.53 +from ..deprecated._archive_maps import HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( shape: Tuple[int, int], diff --git a/src/transformers/models/hubert/modeling_tf_hubert.py b/src/transformers/models/hubert/modeling_tf_hubert.py index 142ab0961dd5cb..0dc696f8a78917 100644 --- a/src/transformers/models/hubert/modeling_tf_hubert.py +++ b/src/transformers/models/hubert/modeling_tf_hubert.py @@ -46,6 +46,9 @@ _CONFIG_FOR_DOC = "HubertConfig" +from ..deprecated._archive_maps import TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/ibert/configuration_ibert.py b/src/transformers/models/ibert/configuration_ibert.py index afa67d6d6acab4..94e040d417ef8d 100644 --- a/src/transformers/models/ibert/configuration_ibert.py +++ b/src/transformers/models/ibert/configuration_ibert.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class IBertConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`IBertModel`]. It is used to instantiate a I-BERT diff --git a/src/transformers/models/ibert/modeling_ibert.py b/src/transformers/models/ibert/modeling_ibert.py index f3975f18e942bc..54c37f507e3a63 100644 --- a/src/transformers/models/ibert/modeling_ibert.py +++ b/src/transformers/models/ibert/modeling_ibert.py @@ -48,6 +48,9 @@ _CONFIG_FOR_DOC = "IBertConfig" +from ..deprecated._archive_maps import IBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class IBertEmbeddings(nn.Module): """ Same as BertEmbeddings with a tiny tweak for positional embeddings indexing. diff --git a/src/transformers/models/idefics/configuration_idefics.py b/src/transformers/models/idefics/configuration_idefics.py index 8b61238ed90fb8..07a92432aee3af 100644 --- a/src/transformers/models/idefics/configuration_idefics.py +++ b/src/transformers/models/idefics/configuration_idefics.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class IdeficsVisionConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`IdeficsModel`]. It is used to instantiate an diff --git a/src/transformers/models/idefics/modeling_idefics.py b/src/transformers/models/idefics/modeling_idefics.py index 1ca40e56ecad7c..47024d24e60623 100644 --- a/src/transformers/models/idefics/modeling_idefics.py +++ b/src/transformers/models/idefics/modeling_idefics.py @@ -49,6 +49,9 @@ _CONFIG_FOR_DOC = "IdeficsConfig" +from ..deprecated._archive_maps import IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class IdeficsBaseModelOutputWithPast(ModelOutput): """ diff --git a/src/transformers/models/imagegpt/configuration_imagegpt.py b/src/transformers/models/imagegpt/configuration_imagegpt.py index 906e61eeef5c24..2a8d62f9b5e629 100644 --- a/src/transformers/models/imagegpt/configuration_imagegpt.py +++ b/src/transformers/models/imagegpt/configuration_imagegpt.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ImageGPTConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`ImageGPTModel`] or a [`TFImageGPTModel`]. It is diff --git a/src/transformers/models/imagegpt/modeling_imagegpt.py b/src/transformers/models/imagegpt/modeling_imagegpt.py index c6fee91445d13a..3b9be17246e81e 100755 --- a/src/transformers/models/imagegpt/modeling_imagegpt.py +++ b/src/transformers/models/imagegpt/modeling_imagegpt.py @@ -43,6 +43,9 @@ _CONFIG_FOR_DOC = "ImageGPTConfig" +from ..deprecated._archive_maps import IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_imagegpt(model, config, imagegpt_checkpoint_path): """ Load tf checkpoints in a pytorch model diff --git a/src/transformers/models/informer/configuration_informer.py b/src/transformers/models/informer/configuration_informer.py index d933ac6fd530fe..93b3f3556c97fe 100644 --- a/src/transformers/models/informer/configuration_informer.py +++ b/src/transformers/models/informer/configuration_informer.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class InformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`InformerModel`]. It is used to instantiate an diff --git a/src/transformers/models/informer/modeling_informer.py b/src/transformers/models/informer/modeling_informer.py index 6a05583bbea224..2955eb7a6aacc3 100644 --- a/src/transformers/models/informer/modeling_informer.py +++ b/src/transformers/models/informer/modeling_informer.py @@ -40,6 +40,9 @@ _CONFIG_FOR_DOC = "InformerConfig" +from ..deprecated._archive_maps import INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.time_series_transformer.modeling_time_series_transformer.TimeSeriesFeatureEmbedder with TimeSeries->Informer class InformerFeatureEmbedder(nn.Module): """ diff --git a/src/transformers/models/instructblip/configuration_instructblip.py b/src/transformers/models/instructblip/configuration_instructblip.py index 23b743ecb52d91..152389d337f19b 100644 --- a/src/transformers/models/instructblip/configuration_instructblip.py +++ b/src/transformers/models/instructblip/configuration_instructblip.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class InstructBlipVisionConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`InstructBlipVisionModel`]. It is used to diff --git a/src/transformers/models/instructblip/modeling_instructblip.py b/src/transformers/models/instructblip/modeling_instructblip.py index 4234c7de24d808..b18d46723179e2 100644 --- a/src/transformers/models/instructblip/modeling_instructblip.py +++ b/src/transformers/models/instructblip/modeling_instructblip.py @@ -48,6 +48,9 @@ _CHECKPOINT_FOR_DOC = "Salesforce/instructblip-flan-t5-xl" +from ..deprecated._archive_maps import INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.blip_2.modeling_blip_2.Blip2ForConditionalGenerationModelOutput with Blip2->InstructBlip class InstructBlipForConditionalGenerationModelOutput(ModelOutput): diff --git a/src/transformers/models/jukebox/configuration_jukebox.py b/src/transformers/models/jukebox/configuration_jukebox.py index 19203732a9e782..4c680513102488 100644 --- a/src/transformers/models/jukebox/configuration_jukebox.py +++ b/src/transformers/models/jukebox/configuration_jukebox.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + _LARGE_ATTENTION = [ "block_attn", "transpose_block_attn", diff --git a/src/transformers/models/jukebox/modeling_jukebox.py b/src/transformers/models/jukebox/modeling_jukebox.py index 9af8dbd6847170..282cfdc5b4439b 100755 --- a/src/transformers/models/jukebox/modeling_jukebox.py +++ b/src/transformers/models/jukebox/modeling_jukebox.py @@ -34,6 +34,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def filter_logits(logits, top_k=0, top_p=0.0, filter_value=-float("Inf")): """ Filter a distribution of logits using top-k and/or nucleus (top-p) filtering diff --git a/src/transformers/models/kosmos2/configuration_kosmos2.py b/src/transformers/models/kosmos2/configuration_kosmos2.py index f922b6093406b4..ae5afd637b28be 100644 --- a/src/transformers/models/kosmos2/configuration_kosmos2.py +++ b/src/transformers/models/kosmos2/configuration_kosmos2.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Kosmos2TextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Kosmos2TextModel`]. It is used to instantiate a diff --git a/src/transformers/models/kosmos2/modeling_kosmos2.py b/src/transformers/models/kosmos2/modeling_kosmos2.py index 161ebbf95c1fd6..2e3a945c331592 100644 --- a/src/transformers/models/kosmos2/modeling_kosmos2.py +++ b/src/transformers/models/kosmos2/modeling_kosmos2.py @@ -47,6 +47,9 @@ _CONFIG_FOR_DOC = Kosmos2Config +from ..deprecated._archive_maps import KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None): """ Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`. diff --git a/src/transformers/models/layoutlm/configuration_layoutlm.py b/src/transformers/models/layoutlm/configuration_layoutlm.py index 88081831bc5166..c7c6886fedbec5 100644 --- a/src/transformers/models/layoutlm/configuration_layoutlm.py +++ b/src/transformers/models/layoutlm/configuration_layoutlm.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LayoutLMConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LayoutLMModel`]. It is used to instantiate a diff --git a/src/transformers/models/layoutlm/modeling_layoutlm.py b/src/transformers/models/layoutlm/modeling_layoutlm.py index 519bce91257b9b..c570fdb124adc1 100644 --- a/src/transformers/models/layoutlm/modeling_layoutlm.py +++ b/src/transformers/models/layoutlm/modeling_layoutlm.py @@ -44,6 +44,9 @@ _CHECKPOINT_FOR_DOC = "microsoft/layoutlm-base-uncased" +from ..deprecated._archive_maps import LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LayoutLMLayerNorm = nn.LayerNorm diff --git a/src/transformers/models/layoutlm/modeling_tf_layoutlm.py b/src/transformers/models/layoutlm/modeling_tf_layoutlm.py index 42bcbe00d94d08..0125fc3ed60232 100644 --- a/src/transformers/models/layoutlm/modeling_tf_layoutlm.py +++ b/src/transformers/models/layoutlm/modeling_tf_layoutlm.py @@ -55,6 +55,9 @@ _CONFIG_FOR_DOC = "LayoutLMConfig" +from ..deprecated._archive_maps import TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFLayoutLMEmbeddings(keras.layers.Layer): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py b/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py index 6a2eb9ff39d762..4528923a5d7598 100644 --- a/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py +++ b/src/transformers/models/layoutlmv2/configuration_layoutlmv2.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + # soft dependency if is_detectron2_available(): import detectron2 diff --git a/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py b/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py index 817bf1f8cc0da8..41939b044a8438 100755 --- a/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py +++ b/src/transformers/models/layoutlmv2/modeling_layoutlmv2.py @@ -54,6 +54,9 @@ _CONFIG_FOR_DOC = "LayoutLMv2Config" +from ..deprecated._archive_maps import LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class LayoutLMv2Embeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py b/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py index 592adaa2f57ecf..d6f9b6c9f10f9a 100644 --- a/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py +++ b/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py @@ -33,6 +33,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LayoutLMv3Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LayoutLMv3Model`]. It is used to instantiate an diff --git a/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py b/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py index 43ba0f522ff604..0db2bd775fe439 100644 --- a/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py +++ b/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py @@ -42,6 +42,9 @@ _CONFIG_FOR_DOC = "LayoutLMv3Config" +from ..deprecated._archive_maps import LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LAYOUTLMV3_START_DOCSTRING = r""" This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and diff --git a/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py b/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py index 7479754f0f833c..531eb59d876359 100644 --- a/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py +++ b/src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py @@ -58,6 +58,9 @@ ] +from ..deprecated._archive_maps import TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/led/configuration_led.py b/src/transformers/models/led/configuration_led.py index 9933ef225367e2..59a2793cc89e08 100644 --- a/src/transformers/models/led/configuration_led.py +++ b/src/transformers/models/led/configuration_led.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LED_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LEDConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LEDModel`]. It is used to instantiate an LED diff --git a/src/transformers/models/led/modeling_led.py b/src/transformers/models/led/modeling_led.py index 982de403c25c23..b2a5f440e0f25d 100755 --- a/src/transformers/models/led/modeling_led.py +++ b/src/transformers/models/led/modeling_led.py @@ -53,6 +53,9 @@ _CONFIG_FOR_DOC = "LEDConfig" +from ..deprecated._archive_maps import LED_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ Shift input ids one token to the right. diff --git a/src/transformers/models/levit/configuration_levit.py b/src/transformers/models/levit/configuration_levit.py index 197e5fe5ec2c0d..fd840f519f26f9 100644 --- a/src/transformers/models/levit/configuration_levit.py +++ b/src/transformers/models/levit/configuration_levit.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LevitConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LevitModel`]. It is used to instantiate a LeViT diff --git a/src/transformers/models/levit/modeling_levit.py b/src/transformers/models/levit/modeling_levit.py index 8f9d7a8be738c7..11eda7bcc57938 100644 --- a/src/transformers/models/levit/modeling_levit.py +++ b/src/transformers/models/levit/modeling_levit.py @@ -48,6 +48,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class LevitForImageClassificationWithTeacherOutput(ModelOutput): """ diff --git a/src/transformers/models/lilt/configuration_lilt.py b/src/transformers/models/lilt/configuration_lilt.py index fdfa2192a143ff..f1cfa98c6c3c13 100644 --- a/src/transformers/models/lilt/configuration_lilt.py +++ b/src/transformers/models/lilt/configuration_lilt.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LiltConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LiltModel`]. It is used to instantiate a LiLT diff --git a/src/transformers/models/lilt/modeling_lilt.py b/src/transformers/models/lilt/modeling_lilt.py index 4e4ee12c3dec1c..adf8edcdc2ab71 100644 --- a/src/transformers/models/lilt/modeling_lilt.py +++ b/src/transformers/models/lilt/modeling_lilt.py @@ -41,6 +41,9 @@ _CONFIG_FOR_DOC = "LiltConfig" +from ..deprecated._archive_maps import LILT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class LiltTextEmbeddings(nn.Module): def __init__(self, config): super().__init__() diff --git a/src/transformers/models/llama/configuration_llama.py b/src/transformers/models/llama/configuration_llama.py index 24b77ccf57f359..242d24af2d0ba9 100644 --- a/src/transformers/models/llama/configuration_llama.py +++ b/src/transformers/models/llama/configuration_llama.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LlamaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LlamaModel`]. It is used to instantiate an LLaMA diff --git a/src/transformers/models/llava/configuration_llava.py b/src/transformers/models/llava/configuration_llava.py index f14601450578f8..8c322f41de7de2 100644 --- a/src/transformers/models/llava/configuration_llava.py +++ b/src/transformers/models/llava/configuration_llava.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LlavaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LlavaForConditionalGeneration`]. It is used to instantiate an diff --git a/src/transformers/models/llava/modeling_llava.py b/src/transformers/models/llava/modeling_llava.py index b7fdf318b0f8b7..f195c1140be86b 100644 --- a/src/transformers/models/llava/modeling_llava.py +++ b/src/transformers/models/llava/modeling_llava.py @@ -39,6 +39,9 @@ _CONFIG_FOR_DOC = "LlavaConfig" +from ..deprecated._archive_maps import LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast with Idefics->Llava class LlavaCausalLMOutputWithPast(ModelOutput): diff --git a/src/transformers/models/longformer/configuration_longformer.py b/src/transformers/models/longformer/configuration_longformer.py index 0cafbf5d6936cc..7dce8a74a631c7 100644 --- a/src/transformers/models/longformer/configuration_longformer.py +++ b/src/transformers/models/longformer/configuration_longformer.py @@ -29,6 +29,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LongformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LongformerModel`] or a [`TFLongformerModel`]. It diff --git a/src/transformers/models/longformer/modeling_longformer.py b/src/transformers/models/longformer/modeling_longformer.py index 78ad8a5eb5fdea..f8c7c44ef9918c 100755 --- a/src/transformers/models/longformer/modeling_longformer.py +++ b/src/transformers/models/longformer/modeling_longformer.py @@ -43,6 +43,9 @@ _CONFIG_FOR_DOC = "LongformerConfig" +from ..deprecated._archive_maps import LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class LongformerBaseModelOutput(ModelOutput): """ diff --git a/src/transformers/models/longformer/modeling_tf_longformer.py b/src/transformers/models/longformer/modeling_tf_longformer.py index be3ccf761b2e21..907fbbddf1e68f 100644 --- a/src/transformers/models/longformer/modeling_tf_longformer.py +++ b/src/transformers/models/longformer/modeling_tf_longformer.py @@ -57,6 +57,9 @@ LARGE_NEGATIVE = -1e8 +from ..deprecated._archive_maps import TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class TFLongformerBaseModelOutput(ModelOutput): """ diff --git a/src/transformers/models/longt5/configuration_longt5.py b/src/transformers/models/longt5/configuration_longt5.py index 839428f27ef682..f6e8284ed0af84 100644 --- a/src/transformers/models/longt5/configuration_longt5.py +++ b/src/transformers/models/longt5/configuration_longt5.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LongT5Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LongT5Model`] or a [`FlaxLongT5Model`]. It is diff --git a/src/transformers/models/longt5/modeling_longt5.py b/src/transformers/models/longt5/modeling_longt5.py index 314785b82c193e..e16e0951208f77 100644 --- a/src/transformers/models/longt5/modeling_longt5.py +++ b/src/transformers/models/longt5/modeling_longt5.py @@ -52,6 +52,8 @@ # TODO: Update before the merge +from ..deprecated._archive_maps import LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + def _pad_to_multiple(x: torch.Tensor, block_len: int, dim: int, pad_value: int = 0) -> torch.Tensor: """Pad a tensor so that a sequence length will be a multiple of `block_len`""" diff --git a/src/transformers/models/luke/configuration_luke.py b/src/transformers/models/luke/configuration_luke.py index d3f14decac9664..257c9a25535f33 100644 --- a/src/transformers/models/luke/configuration_luke.py +++ b/src/transformers/models/luke/configuration_luke.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LukeConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LukeModel`]. It is used to instantiate a LUKE diff --git a/src/transformers/models/luke/modeling_luke.py b/src/transformers/models/luke/modeling_luke.py index 803f4396a2b6a1..3523e739f5b69f 100644 --- a/src/transformers/models/luke/modeling_luke.py +++ b/src/transformers/models/luke/modeling_luke.py @@ -44,6 +44,9 @@ _CHECKPOINT_FOR_DOC = "studio-ousia/luke-base" +from ..deprecated._archive_maps import LUKE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class BaseLukeModelOutputWithPooling(BaseModelOutputWithPooling): """ diff --git a/src/transformers/models/lxmert/configuration_lxmert.py b/src/transformers/models/lxmert/configuration_lxmert.py index ec3a7c1864becc..b79fb67908d27e 100644 --- a/src/transformers/models/lxmert/configuration_lxmert.py +++ b/src/transformers/models/lxmert/configuration_lxmert.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class LxmertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`LxmertModel`] or a [`TFLxmertModel`]. It is used diff --git a/src/transformers/models/lxmert/modeling_tf_lxmert.py b/src/transformers/models/lxmert/modeling_tf_lxmert.py index 2b51fb7510308d..c4741196031a79 100644 --- a/src/transformers/models/lxmert/modeling_tf_lxmert.py +++ b/src/transformers/models/lxmert/modeling_tf_lxmert.py @@ -54,6 +54,9 @@ _CONFIG_FOR_DOC = "LxmertConfig" +from ..deprecated._archive_maps import TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class TFLxmertModelOutput(ModelOutput): """ diff --git a/src/transformers/models/m2m_100/configuration_m2m_100.py b/src/transformers/models/m2m_100/configuration_m2m_100.py index 73840e5132d348..b211527e8088b4 100644 --- a/src/transformers/models/m2m_100/configuration_m2m_100.py +++ b/src/transformers/models/m2m_100/configuration_m2m_100.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class M2M100Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`M2M100Model`]. It is used to instantiate an diff --git a/src/transformers/models/m2m_100/modeling_m2m_100.py b/src/transformers/models/m2m_100/modeling_m2m_100.py index 0cb6a969cc6839..9e2ff11ad88184 100755 --- a/src/transformers/models/m2m_100/modeling_m2m_100.py +++ b/src/transformers/models/m2m_100/modeling_m2m_100.py @@ -49,6 +49,9 @@ _CHECKPOINT_FOR_DOC = "facebook/m2m100_418M" +from ..deprecated._archive_maps import M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/mamba/configuration_mamba.py b/src/transformers/models/mamba/configuration_mamba.py index 871a793d66d238..695d9a62737dca 100644 --- a/src/transformers/models/mamba/configuration_mamba.py +++ b/src/transformers/models/mamba/configuration_mamba.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MambaConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`MambaModel`]. It is used to instantiate a MAMBA diff --git a/src/transformers/models/mamba/modeling_mamba.py b/src/transformers/models/mamba/modeling_mamba.py index 4459ec05a123f1..a990ebddb5365e 100644 --- a/src/transformers/models/mamba/modeling_mamba.py +++ b/src/transformers/models/mamba/modeling_mamba.py @@ -57,6 +57,8 @@ _CONFIG_FOR_DOC = "MambaConfig" +from ..deprecated._archive_maps import MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + class MambaCache: def __init__(self, config, batch_size, dtype=torch.float16, device=None): self.seqlen_offset = 0 diff --git a/src/transformers/models/markuplm/configuration_markuplm.py b/src/transformers/models/markuplm/configuration_markuplm.py index 581cc0f349c3e7..aeb80ae51f96ba 100644 --- a/src/transformers/models/markuplm/configuration_markuplm.py +++ b/src/transformers/models/markuplm/configuration_markuplm.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MarkupLMConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MarkupLMModel`]. It is used to instantiate a diff --git a/src/transformers/models/markuplm/modeling_markuplm.py b/src/transformers/models/markuplm/modeling_markuplm.py index ef27256ac2d973..2058ce27951676 100755 --- a/src/transformers/models/markuplm/modeling_markuplm.py +++ b/src/transformers/models/markuplm/modeling_markuplm.py @@ -53,6 +53,9 @@ _CONFIG_FOR_DOC = "MarkupLMConfig" +from ..deprecated._archive_maps import MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class XPathEmbeddings(nn.Module): """Construct the embeddings from xpath tags and subscripts. diff --git a/src/transformers/models/mask2former/configuration_mask2former.py b/src/transformers/models/mask2former/configuration_mask2former.py index ed97ed24582363..f0d13b8e030ed1 100644 --- a/src/transformers/models/mask2former/configuration_mask2former.py +++ b/src/transformers/models/mask2former/configuration_mask2former.py @@ -18,6 +18,7 @@ from ...configuration_utils import PretrainedConfig from ...utils import logging from ..auto import CONFIG_MAPPING +from ..deprecated._archive_maps import MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 logger = logging.get_logger(__name__) diff --git a/src/transformers/models/mask2former/modeling_mask2former.py b/src/transformers/models/mask2former/modeling_mask2former.py index f37b5b14fcaab0..3a9a74345363a6 100644 --- a/src/transformers/models/mask2former/modeling_mask2former.py +++ b/src/transformers/models/mask2former/modeling_mask2former.py @@ -55,6 +55,9 @@ _IMAGE_PROCESSOR_FOR_DOC = "Mask2FormerImageProcessor" +from ..deprecated._archive_maps import MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class Mask2FormerPixelDecoderOutput(ModelOutput): """ diff --git a/src/transformers/models/maskformer/configuration_maskformer.py b/src/transformers/models/maskformer/configuration_maskformer.py index f82fe199b7bc34..653350ca056dda 100644 --- a/src/transformers/models/maskformer/configuration_maskformer.py +++ b/src/transformers/models/maskformer/configuration_maskformer.py @@ -18,6 +18,7 @@ from ...configuration_utils import PretrainedConfig from ...utils import logging from ..auto import CONFIG_MAPPING +from ..deprecated._archive_maps import MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 from ..detr import DetrConfig from ..swin import SwinConfig diff --git a/src/transformers/models/maskformer/modeling_maskformer.py b/src/transformers/models/maskformer/modeling_maskformer.py index 74cc6cc4c9e9e3..4419a36e9f840a 100644 --- a/src/transformers/models/maskformer/modeling_maskformer.py +++ b/src/transformers/models/maskformer/modeling_maskformer.py @@ -58,6 +58,9 @@ _CHECKPOINT_FOR_DOC = "facebook/maskformer-swin-base-ade" +from ..deprecated._archive_maps import MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.detr.modeling_detr.DetrDecoderOutput class DetrDecoderOutput(BaseModelOutputWithCrossAttentions): diff --git a/src/transformers/models/mega/configuration_mega.py b/src/transformers/models/mega/configuration_mega.py index 8287a3938e2445..993a21cf7035d6 100644 --- a/src/transformers/models/mega/configuration_mega.py +++ b/src/transformers/models/mega/configuration_mega.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MegaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MegaModel`]. It is used to instantiate a Mega diff --git a/src/transformers/models/mega/modeling_mega.py b/src/transformers/models/mega/modeling_mega.py index 65fff1cd49735a..069c717a737572 100644 --- a/src/transformers/models/mega/modeling_mega.py +++ b/src/transformers/models/mega/modeling_mega.py @@ -51,6 +51,9 @@ _CONFIG_FOR_DOC = "MegaConfig" +from ..deprecated._archive_maps import MEGA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class MegaEmbeddings(nn.Module): """ Mega's basic implementation does not incorporate token type embeddings, so this is a stripped-down version of diff --git a/src/transformers/models/megatron_bert/configuration_megatron_bert.py b/src/transformers/models/megatron_bert/configuration_megatron_bert.py index d3be4db99bcbb2..177bc146a22261 100644 --- a/src/transformers/models/megatron_bert/configuration_megatron_bert.py +++ b/src/transformers/models/megatron_bert/configuration_megatron_bert.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MegatronBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MegatronBertModel`]. It is used to instantiate a diff --git a/src/transformers/models/megatron_bert/modeling_megatron_bert.py b/src/transformers/models/megatron_bert/modeling_megatron_bert.py index 96f85a5d6c368b..528bcca3d9bc00 100755 --- a/src/transformers/models/megatron_bert/modeling_megatron_bert.py +++ b/src/transformers/models/megatron_bert/modeling_megatron_bert.py @@ -58,6 +58,9 @@ _CHECKPOINT_FOR_DOC = "nvidia/megatron-bert-cased-345m" +from ..deprecated._archive_maps import MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_megatron_bert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/mgp_str/configuration_mgp_str.py b/src/transformers/models/mgp_str/configuration_mgp_str.py index 2ce4ffd0c61b10..2d341309a8a41c 100644 --- a/src/transformers/models/mgp_str/configuration_mgp_str.py +++ b/src/transformers/models/mgp_str/configuration_mgp_str.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MgpstrConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`MgpstrModel`]. It is used to instantiate an diff --git a/src/transformers/models/mgp_str/modeling_mgp_str.py b/src/transformers/models/mgp_str/modeling_mgp_str.py index bd2a4b1eaa1ed0..e35c414d735fc4 100644 --- a/src/transformers/models/mgp_str/modeling_mgp_str.py +++ b/src/transformers/models/mgp_str/modeling_mgp_str.py @@ -45,6 +45,9 @@ _CHECKPOINT_FOR_DOC = "alibaba-damo/mgp-str-base" +from ..deprecated._archive_maps import MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: """ diff --git a/src/transformers/models/mistral/configuration_mistral.py b/src/transformers/models/mistral/configuration_mistral.py index e281802792d325..83dd0e7a621cff 100644 --- a/src/transformers/models/mistral/configuration_mistral.py +++ b/src/transformers/models/mistral/configuration_mistral.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MistralConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MistralModel`]. It is used to instantiate an diff --git a/src/transformers/models/mixtral/configuration_mixtral.py b/src/transformers/models/mixtral/configuration_mixtral.py index d1c501ab6cc5ac..93dfbbbda518f7 100644 --- a/src/transformers/models/mixtral/configuration_mixtral.py +++ b/src/transformers/models/mixtral/configuration_mixtral.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MixtralConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MixtralModel`]. It is used to instantiate an diff --git a/src/transformers/models/mobilebert/configuration_mobilebert.py b/src/transformers/models/mobilebert/configuration_mobilebert.py index 7d39186025fa8b..2dfbf87b80a711 100644 --- a/src/transformers/models/mobilebert/configuration_mobilebert.py +++ b/src/transformers/models/mobilebert/configuration_mobilebert.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MobileBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MobileBertModel`] or a [`TFMobileBertModel`]. It diff --git a/src/transformers/models/mobilebert/modeling_mobilebert.py b/src/transformers/models/mobilebert/modeling_mobilebert.py index 013131ea2d82ef..8dc0aafa70fc25 100644 --- a/src/transformers/models/mobilebert/modeling_mobilebert.py +++ b/src/transformers/models/mobilebert/modeling_mobilebert.py @@ -77,6 +77,9 @@ _SEQ_CLASS_EXPECTED_LOSS = "4.72" +from ..deprecated._archive_maps import MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_mobilebert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/mobilebert/modeling_tf_mobilebert.py b/src/transformers/models/mobilebert/modeling_tf_mobilebert.py index bab2cbac8ed5fd..8526e636a2ac48 100644 --- a/src/transformers/models/mobilebert/modeling_tf_mobilebert.py +++ b/src/transformers/models/mobilebert/modeling_tf_mobilebert.py @@ -85,6 +85,9 @@ _SEQ_CLASS_EXPECTED_LOSS = "4.72" +from ..deprecated._archive_maps import TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bert.modeling_tf_bert.TFBertPreTrainingLoss class TFMobileBertPreTrainingLoss: """ diff --git a/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py b/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py index 70075bcc94e622..2b575cb6a1dc48 100644 --- a/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py +++ b/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MobileNetV1Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MobileNetV1Model`]. It is used to instantiate a diff --git a/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py b/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py index 825c0f660a7f85..adfb5c5670d81b 100755 --- a/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py +++ b/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py @@ -43,6 +43,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def _build_tf_to_pytorch_map(model, config, tf_weights=None): """ A map of modules from TF to PyTorch. diff --git a/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py b/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py index 81e590d5a357f9..dd9f6d17cd340a 100644 --- a/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py +++ b/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MobileNetV2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MobileNetV2Model`]. It is used to instantiate a diff --git a/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py b/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py index 0440487f227498..789da484010fb8 100755 --- a/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py +++ b/src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py @@ -53,6 +53,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def _build_tf_to_pytorch_map(model, config, tf_weights=None): """ A map of modules from TF to PyTorch. diff --git a/src/transformers/models/mobilevit/configuration_mobilevit.py b/src/transformers/models/mobilevit/configuration_mobilevit.py index 5650002b3c55b0..8f13112447f113 100644 --- a/src/transformers/models/mobilevit/configuration_mobilevit.py +++ b/src/transformers/models/mobilevit/configuration_mobilevit.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MobileViTConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MobileViTModel`]. It is used to instantiate a diff --git a/src/transformers/models/mobilevit/modeling_mobilevit.py b/src/transformers/models/mobilevit/modeling_mobilevit.py index 2e493c810cc269..939982148cc606 100755 --- a/src/transformers/models/mobilevit/modeling_mobilevit.py +++ b/src/transformers/models/mobilevit/modeling_mobilevit.py @@ -59,6 +59,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the diff --git a/src/transformers/models/mobilevit/modeling_tf_mobilevit.py b/src/transformers/models/mobilevit/modeling_tf_mobilevit.py index 179f209e871b8a..8434c9685e570f 100644 --- a/src/transformers/models/mobilevit/modeling_tf_mobilevit.py +++ b/src/transformers/models/mobilevit/modeling_tf_mobilevit.py @@ -61,6 +61,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ Ensure that all layers have a channel count that is divisible by `divisor`. This function is taken from the diff --git a/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py b/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py index 957a43f770fc7e..f8f1be141b52bd 100644 --- a/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py +++ b/src/transformers/models/mobilevitv2/configuration_mobilevitv2.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MobileViTV2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MobileViTV2Model`]. It is used to instantiate a diff --git a/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py b/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py index 1ca0e143d8be26..c6c446b1862adc 100644 --- a/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py +++ b/src/transformers/models/mobilevitv2/modeling_mobilevitv2.py @@ -57,6 +57,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.mobilevit.modeling_mobilevit.make_divisible def make_divisible(value: int, divisor: int = 8, min_value: Optional[int] = None) -> int: """ diff --git a/src/transformers/models/mpnet/configuration_mpnet.py b/src/transformers/models/mpnet/configuration_mpnet.py index 9c53e45d98fce8..a8cb07894bde1c 100644 --- a/src/transformers/models/mpnet/configuration_mpnet.py +++ b/src/transformers/models/mpnet/configuration_mpnet.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MPNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MPNetModel`] or a [`TFMPNetModel`]. It is used to diff --git a/src/transformers/models/mpnet/modeling_mpnet.py b/src/transformers/models/mpnet/modeling_mpnet.py index e220247144706d..d9b9f90d398d90 100644 --- a/src/transformers/models/mpnet/modeling_mpnet.py +++ b/src/transformers/models/mpnet/modeling_mpnet.py @@ -45,6 +45,9 @@ _CONFIG_FOR_DOC = "MPNetConfig" +from ..deprecated._archive_maps import MPNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class MPNetPreTrainedModel(PreTrainedModel): config_class = MPNetConfig base_model_prefix = "mpnet" diff --git a/src/transformers/models/mpnet/modeling_tf_mpnet.py b/src/transformers/models/mpnet/modeling_tf_mpnet.py index f0afba869b81d7..b57132d81398d0 100644 --- a/src/transformers/models/mpnet/modeling_tf_mpnet.py +++ b/src/transformers/models/mpnet/modeling_tf_mpnet.py @@ -64,6 +64,9 @@ _CONFIG_FOR_DOC = "MPNetConfig" +from ..deprecated._archive_maps import TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFMPNetPreTrainedModel(TFPreTrainedModel): """ An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained diff --git a/src/transformers/models/mpt/configuration_mpt.py b/src/transformers/models/mpt/configuration_mpt.py index 5d18b1419e37b5..5c1cb4d783b307 100644 --- a/src/transformers/models/mpt/configuration_mpt.py +++ b/src/transformers/models/mpt/configuration_mpt.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MPT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MptAttentionConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`MptAttention`] class. It is used to instantiate diff --git a/src/transformers/models/mpt/modeling_mpt.py b/src/transformers/models/mpt/modeling_mpt.py index cffb4b7117e4aa..864e9c09ca3cb7 100644 --- a/src/transformers/models/mpt/modeling_mpt.py +++ b/src/transformers/models/mpt/modeling_mpt.py @@ -43,6 +43,9 @@ _CONFIG_FOR_DOC = "MptConfig" +from ..deprecated._archive_maps import MPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def build_mpt_alibi_tensor(num_heads, sequence_length, alibi_bias_max=8, device=None): r""" Link to paper: https://arxiv.org/abs/2108.12409 - Alibi tensor is not causal as the original paper mentions, it diff --git a/src/transformers/models/mra/configuration_mra.py b/src/transformers/models/mra/configuration_mra.py index 30c38795b57fc7..2b3bec041633ea 100644 --- a/src/transformers/models/mra/configuration_mra.py +++ b/src/transformers/models/mra/configuration_mra.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MraConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`MraModel`]. It is used to instantiate an MRA diff --git a/src/transformers/models/mra/modeling_mra.py b/src/transformers/models/mra/modeling_mra.py index c7a3073714ec15..846578997c4a84 100644 --- a/src/transformers/models/mra/modeling_mra.py +++ b/src/transformers/models/mra/modeling_mra.py @@ -54,6 +54,9 @@ _TOKENIZER_FOR_DOC = "AutoTokenizer" +from ..deprecated._archive_maps import MRA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + mra_cuda_kernel = None diff --git a/src/transformers/models/musicgen/configuration_musicgen.py b/src/transformers/models/musicgen/configuration_musicgen.py index 6f552d074974a9..9d835835df3266 100644 --- a/src/transformers/models/musicgen/configuration_musicgen.py +++ b/src/transformers/models/musicgen/configuration_musicgen.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class MusicgenDecoderConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`MusicgenDecoder`]. It is used to instantiate a diff --git a/src/transformers/models/musicgen/modeling_musicgen.py b/src/transformers/models/musicgen/modeling_musicgen.py index 7ca1cc1c561c22..99e06f7df14b83 100644 --- a/src/transformers/models/musicgen/modeling_musicgen.py +++ b/src/transformers/models/musicgen/modeling_musicgen.py @@ -57,6 +57,9 @@ _CHECKPOINT_FOR_DOC = "facebook/musicgen-small" +from ..deprecated._archive_maps import MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class MusicgenUnconditionalInput(ModelOutput): """ diff --git a/src/transformers/models/mvp/modeling_mvp.py b/src/transformers/models/mvp/modeling_mvp.py index 7c0f47856778cd..fe289dc81e6a43 100644 --- a/src/transformers/models/mvp/modeling_mvp.py +++ b/src/transformers/models/mvp/modeling_mvp.py @@ -54,6 +54,9 @@ _EXPECTED_OUTPUT_SHAPE = [1, 8, 1024] +from ..deprecated._archive_maps import MVP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/nat/configuration_nat.py b/src/transformers/models/nat/configuration_nat.py index baf0ea13a5f902..bb3b85a80c263b 100644 --- a/src/transformers/models/nat/configuration_nat.py +++ b/src/transformers/models/nat/configuration_nat.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class NatConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`NatModel`]. It is used to instantiate a Nat model diff --git a/src/transformers/models/nat/modeling_nat.py b/src/transformers/models/nat/modeling_nat.py index b9c332c894e775..2434b65161a47c 100644 --- a/src/transformers/models/nat/modeling_nat.py +++ b/src/transformers/models/nat/modeling_nat.py @@ -68,6 +68,9 @@ def natten2dav(*args, **kwargs): _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" +from ..deprecated._archive_maps import NAT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # drop_path and NatDropPath are from the timm library. diff --git a/src/transformers/models/nezha/configuration_nezha.py b/src/transformers/models/nezha/configuration_nezha.py index 4e145e4b687529..a19c27d62a4a92 100644 --- a/src/transformers/models/nezha/configuration_nezha.py +++ b/src/transformers/models/nezha/configuration_nezha.py @@ -1,4 +1,5 @@ from ... import PretrainedConfig +from ..deprecated._archive_maps import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 class NezhaConfig(PretrainedConfig): diff --git a/src/transformers/models/nezha/modeling_nezha.py b/src/transformers/models/nezha/modeling_nezha.py index f42760d5b136bd..6d983bd2378903 100644 --- a/src/transformers/models/nezha/modeling_nezha.py +++ b/src/transformers/models/nezha/modeling_nezha.py @@ -56,6 +56,9 @@ _CONFIG_FOR_DOC = "NezhaConfig" +from ..deprecated._archive_maps import NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_nezha(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/nllb_moe/configuration_nllb_moe.py b/src/transformers/models/nllb_moe/configuration_nllb_moe.py index 98c8397c185b81..48172824ff2425 100644 --- a/src/transformers/models/nllb_moe/configuration_nllb_moe.py +++ b/src/transformers/models/nllb_moe/configuration_nllb_moe.py @@ -20,6 +20,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class NllbMoeConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`NllbMoeModel`]. It is used to instantiate an diff --git a/src/transformers/models/nllb_moe/modeling_nllb_moe.py b/src/transformers/models/nllb_moe/modeling_nllb_moe.py index d4a2135843417c..4ef66b7bd5740c 100644 --- a/src/transformers/models/nllb_moe/modeling_nllb_moe.py +++ b/src/transformers/models/nllb_moe/modeling_nllb_moe.py @@ -54,6 +54,8 @@ # for the pretrained weights provided with the models #################################################### +from ..deprecated._archive_maps import NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): diff --git a/src/transformers/models/nystromformer/configuration_nystromformer.py b/src/transformers/models/nystromformer/configuration_nystromformer.py index ca277e266d5a16..af6e8d2c21b099 100644 --- a/src/transformers/models/nystromformer/configuration_nystromformer.py +++ b/src/transformers/models/nystromformer/configuration_nystromformer.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class NystromformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`NystromformerModel`]. It is used to instantiate diff --git a/src/transformers/models/nystromformer/modeling_nystromformer.py b/src/transformers/models/nystromformer/modeling_nystromformer.py index 465164af1cd231..1da61bc59e6a7a 100755 --- a/src/transformers/models/nystromformer/modeling_nystromformer.py +++ b/src/transformers/models/nystromformer/modeling_nystromformer.py @@ -44,6 +44,9 @@ _CONFIG_FOR_DOC = "NystromformerConfig" +from ..deprecated._archive_maps import NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class NystromformerEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/oneformer/configuration_oneformer.py b/src/transformers/models/oneformer/configuration_oneformer.py index f3c01191d98fb8..1cbd2ab7dbc18f 100644 --- a/src/transformers/models/oneformer/configuration_oneformer.py +++ b/src/transformers/models/oneformer/configuration_oneformer.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class OneFormerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`OneFormerModel`]. It is used to instantiate a diff --git a/src/transformers/models/oneformer/modeling_oneformer.py b/src/transformers/models/oneformer/modeling_oneformer.py index fff665b2ffbda5..6af4226995bfa1 100644 --- a/src/transformers/models/oneformer/modeling_oneformer.py +++ b/src/transformers/models/oneformer/modeling_oneformer.py @@ -52,6 +52,9 @@ _CHECKPOINT_FOR_DOC = "shi-labs/oneformer_ade20k_swin_tiny" +from ..deprecated._archive_maps import ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + if is_scipy_available(): from scipy.optimize import linear_sum_assignment diff --git a/src/transformers/models/openai/configuration_openai.py b/src/transformers/models/openai/configuration_openai.py index 64411455eefd35..422922c7912dec 100644 --- a/src/transformers/models/openai/configuration_openai.py +++ b/src/transformers/models/openai/configuration_openai.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class OpenAIGPTConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`OpenAIGPTModel`] or a [`TFOpenAIGPTModel`]. It is diff --git a/src/transformers/models/openai/modeling_openai.py b/src/transformers/models/openai/modeling_openai.py index 1c754daa0e317a..637aa90cff9f1d 100644 --- a/src/transformers/models/openai/modeling_openai.py +++ b/src/transformers/models/openai/modeling_openai.py @@ -47,6 +47,9 @@ _CONFIG_FOR_DOC = "OpenAIGPTConfig" +from ..deprecated._archive_maps import OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_openai_gpt(model, config, openai_checkpoint_folder_path): """Load tf pre-trained weights in a pytorch model (from NumPy arrays here)""" import re diff --git a/src/transformers/models/openai/modeling_tf_openai.py b/src/transformers/models/openai/modeling_tf_openai.py index e2d0ae885cea52..b826936c51fbd6 100644 --- a/src/transformers/models/openai/modeling_tf_openai.py +++ b/src/transformers/models/openai/modeling_tf_openai.py @@ -56,6 +56,9 @@ _CONFIG_FOR_DOC = "OpenAIGPTConfig" +from ..deprecated._archive_maps import TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFAttention(keras.layers.Layer): def __init__(self, nx, config, scale=False, **kwargs): super().__init__(**kwargs) diff --git a/src/transformers/models/opt/modeling_opt.py b/src/transformers/models/opt/modeling_opt.py index f93c3866aeca58..5e9e53a2ac3251 100644 --- a/src/transformers/models/opt/modeling_opt.py +++ b/src/transformers/models/opt/modeling_opt.py @@ -61,6 +61,9 @@ _SEQ_CLASS_EXPECTED_OUTPUT = "'LABEL_0'" +from ..deprecated._archive_maps import OPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/owlv2/configuration_owlv2.py b/src/transformers/models/owlv2/configuration_owlv2.py index 4b09166b70c2bc..fe96ff8fa4c5f1 100644 --- a/src/transformers/models/owlv2/configuration_owlv2.py +++ b/src/transformers/models/owlv2/configuration_owlv2.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + # Copied from transformers.models.owlvit.configuration_owlvit.OwlViTTextConfig with OwlViT->Owlv2, owlvit-base-patch32->owlv2-base-patch16, owlvit->owlv2, OWL-ViT->OWLv2 class Owlv2TextConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/owlv2/modeling_owlv2.py b/src/transformers/models/owlv2/modeling_owlv2.py index bbeeb386d4afae..d99b269012d183 100644 --- a/src/transformers/models/owlv2/modeling_owlv2.py +++ b/src/transformers/models/owlv2/modeling_owlv2.py @@ -48,6 +48,8 @@ # See all Owlv2 models at https://huggingface.co/models?filter=owlv2 +from ..deprecated._archive_maps import OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + # Copied from transformers.models.clip.modeling_clip.contrastive_loss with clip->owlv2 def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/owlvit/configuration_owlvit.py b/src/transformers/models/owlvit/configuration_owlvit.py index 747f1c3ccbe78a..d223cdf81270d7 100644 --- a/src/transformers/models/owlvit/configuration_owlvit.py +++ b/src/transformers/models/owlvit/configuration_owlvit.py @@ -31,6 +31,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class OwlViTTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`OwlViTTextModel`]. It is used to instantiate an diff --git a/src/transformers/models/owlvit/modeling_owlvit.py b/src/transformers/models/owlvit/modeling_owlvit.py index 8d0673341c6f71..751f9c9a52ee9f 100644 --- a/src/transformers/models/owlvit/modeling_owlvit.py +++ b/src/transformers/models/owlvit/modeling_owlvit.py @@ -48,6 +48,8 @@ # See all OwlViT models at https://huggingface.co/models?filter=owlvit +from ..deprecated._archive_maps import OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + # Copied from transformers.models.clip.modeling_clip.contrastive_loss with clip->owlvit def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py b/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py index c3766c33250cfc..2f4f1dc7619215 100644 --- a/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py +++ b/src/transformers/models/patchtsmixer/configuration_patchtsmixer.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PatchTSMixerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PatchTSMixerModel`]. It is used to instantiate a diff --git a/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py b/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py index a824faa0409456..dade06dfde053a 100644 --- a/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py +++ b/src/transformers/models/patchtsmixer/modeling_patchtsmixer.py @@ -39,6 +39,9 @@ _CONFIG_FOR_DOC = "PatchTSMixerConfig" +from ..deprecated._archive_maps import PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + PATCHTSMIXER_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/patchtst/configuration_patchtst.py b/src/transformers/models/patchtst/configuration_patchtst.py index acae3d0dc60d29..dc95429d90995a 100644 --- a/src/transformers/models/patchtst/configuration_patchtst.py +++ b/src/transformers/models/patchtst/configuration_patchtst.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PatchTSTConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of an [`PatchTSTModel`]. It is used to instantiate an diff --git a/src/transformers/models/patchtst/modeling_patchtst.py b/src/transformers/models/patchtst/modeling_patchtst.py index 884cd44c83e86b..22b206726e16d3 100755 --- a/src/transformers/models/patchtst/modeling_patchtst.py +++ b/src/transformers/models/patchtst/modeling_patchtst.py @@ -34,6 +34,9 @@ _CONFIG_FOR_DOC = "PatchTSTConfig" +from ..deprecated._archive_maps import PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.BartAttention with Bart->PatchTST class PatchTSTAttention(nn.Module): """Multi-headed attention from 'Attention Is All You Need' paper""" diff --git a/src/transformers/models/pegasus/configuration_pegasus.py b/src/transformers/models/pegasus/configuration_pegasus.py index 7dff1a7f85a32c..39d3865fd57b4e 100644 --- a/src/transformers/models/pegasus/configuration_pegasus.py +++ b/src/transformers/models/pegasus/configuration_pegasus.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PegasusConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PegasusModel`]. It is used to instantiate an diff --git a/src/transformers/models/pegasus_x/configuration_pegasus_x.py b/src/transformers/models/pegasus_x/configuration_pegasus_x.py index 166f3b18ab0623..fa1f3da6d364a3 100644 --- a/src/transformers/models/pegasus_x/configuration_pegasus_x.py +++ b/src/transformers/models/pegasus_x/configuration_pegasus_x.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PegasusXConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PegasusXModel`]. It is used to instantiate a diff --git a/src/transformers/models/pegasus_x/modeling_pegasus_x.py b/src/transformers/models/pegasus_x/modeling_pegasus_x.py index ff26cde4f5b80a..f31ccccbb16348 100755 --- a/src/transformers/models/pegasus_x/modeling_pegasus_x.py +++ b/src/transformers/models/pegasus_x/modeling_pegasus_x.py @@ -49,6 +49,9 @@ _CONFIG_FOR_DOC = "PegasusXConfig" +from ..deprecated._archive_maps import PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclasses.dataclass class DimensionInfo: """Wrapper for dimension info.""" diff --git a/src/transformers/models/perceiver/configuration_perceiver.py b/src/transformers/models/perceiver/configuration_perceiver.py index b4b996aef02a4b..eb9458989cad01 100644 --- a/src/transformers/models/perceiver/configuration_perceiver.py +++ b/src/transformers/models/perceiver/configuration_perceiver.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PerceiverConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PerceiverModel`]. It is used to instantiate an diff --git a/src/transformers/models/perceiver/modeling_perceiver.py b/src/transformers/models/perceiver/modeling_perceiver.py index f768df991b09c0..5de7635355ddb3 100755 --- a/src/transformers/models/perceiver/modeling_perceiver.py +++ b/src/transformers/models/perceiver/modeling_perceiver.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "PerceiverConfig" +from ..deprecated._archive_maps import PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class PerceiverModelOutput(ModelOutput): """ diff --git a/src/transformers/models/persimmon/configuration_persimmon.py b/src/transformers/models/persimmon/configuration_persimmon.py index 88dca72106d642..e520d916858210 100644 --- a/src/transformers/models/persimmon/configuration_persimmon.py +++ b/src/transformers/models/persimmon/configuration_persimmon.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PersimmonConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PersimmonModel`]. It is used to instantiate an diff --git a/src/transformers/models/phi/configuration_phi.py b/src/transformers/models/phi/configuration_phi.py index e8aa2287cdf7d8..456f500b616f7a 100644 --- a/src/transformers/models/phi/configuration_phi.py +++ b/src/transformers/models/phi/configuration_phi.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PHI_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PhiConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PhiModel`]. It is used to instantiate an Phi diff --git a/src/transformers/models/phi/modeling_phi.py b/src/transformers/models/phi/modeling_phi.py index df8ab2e91513a5..13719166edf9d9 100644 --- a/src/transformers/models/phi/modeling_phi.py +++ b/src/transformers/models/phi/modeling_phi.py @@ -63,6 +63,9 @@ _CONFIG_FOR_DOC = "PhiConfig" +from ..deprecated._archive_maps import PHI_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/pix2struct/configuration_pix2struct.py b/src/transformers/models/pix2struct/configuration_pix2struct.py index 2ad2509e441d25..12bf998d58c00a 100644 --- a/src/transformers/models/pix2struct/configuration_pix2struct.py +++ b/src/transformers/models/pix2struct/configuration_pix2struct.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Pix2StructTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Pix2StructTextModel`]. It is used to instantiate diff --git a/src/transformers/models/pix2struct/modeling_pix2struct.py b/src/transformers/models/pix2struct/modeling_pix2struct.py index 86ccb1dd740786..e8032fcef6690b 100644 --- a/src/transformers/models/pix2struct/modeling_pix2struct.py +++ b/src/transformers/models/pix2struct/modeling_pix2struct.py @@ -49,6 +49,9 @@ _CONFIG_FOR_DOC = "Pix2StructConfig" +from ..deprecated._archive_maps import PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Adapted from transformers.models.t5.modeling_t5.T5LayerNorm with T5->Pix2Struct class Pix2StructLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-6): diff --git a/src/transformers/models/plbart/configuration_plbart.py b/src/transformers/models/plbart/configuration_plbart.py index b899847b04c73a..555a2fcc7572ff 100644 --- a/src/transformers/models/plbart/configuration_plbart.py +++ b/src/transformers/models/plbart/configuration_plbart.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PLBartConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PLBartModel`]. It is used to instantiate an diff --git a/src/transformers/models/plbart/modeling_plbart.py b/src/transformers/models/plbart/modeling_plbart.py index 28e9e6fefaff47..d60b7ee4b046ee 100644 --- a/src/transformers/models/plbart/modeling_plbart.py +++ b/src/transformers/models/plbart/modeling_plbart.py @@ -55,6 +55,9 @@ _CONFIG_FOR_DOC = "PLBartConfig" +from ..deprecated._archive_maps import PLBART_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.mbart.modeling_mbart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int): """ diff --git a/src/transformers/models/poolformer/configuration_poolformer.py b/src/transformers/models/poolformer/configuration_poolformer.py index 1f297077fe166b..be0f18c0a31035 100644 --- a/src/transformers/models/poolformer/configuration_poolformer.py +++ b/src/transformers/models/poolformer/configuration_poolformer.py @@ -26,6 +26,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PoolFormerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of [`PoolFormerModel`]. It is used to instantiate a diff --git a/src/transformers/models/poolformer/modeling_poolformer.py b/src/transformers/models/poolformer/modeling_poolformer.py index 5e620780f39290..80208bd1fc33e0 100755 --- a/src/transformers/models/poolformer/modeling_poolformer.py +++ b/src/transformers/models/poolformer/modeling_poolformer.py @@ -44,6 +44,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: """ diff --git a/src/transformers/models/pop2piano/configuration_pop2piano.py b/src/transformers/models/pop2piano/configuration_pop2piano.py index 8bb46b008d846b..ff0d4f37b23e0b 100644 --- a/src/transformers/models/pop2piano/configuration_pop2piano.py +++ b/src/transformers/models/pop2piano/configuration_pop2piano.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Pop2PianoConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Pop2PianoForConditionalGeneration`]. It is used diff --git a/src/transformers/models/pop2piano/modeling_pop2piano.py b/src/transformers/models/pop2piano/modeling_pop2piano.py index 5952c030012683..e944940689e5f5 100644 --- a/src/transformers/models/pop2piano/modeling_pop2piano.py +++ b/src/transformers/models/pop2piano/modeling_pop2piano.py @@ -65,6 +65,9 @@ _CHECKPOINT_FOR_DOC = "sweetcocoa/pop2piano" +from ..deprecated._archive_maps import POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + POP2PIANO_INPUTS_DOCSTRING = r""" Args: input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`): diff --git a/src/transformers/models/prophetnet/configuration_prophetnet.py b/src/transformers/models/prophetnet/configuration_prophetnet.py index 1b40c9a2c07cd8..e07936a14cd302 100644 --- a/src/transformers/models/prophetnet/configuration_prophetnet.py +++ b/src/transformers/models/prophetnet/configuration_prophetnet.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ProphetNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ProphetNetModel`]. It is used to instantiate a diff --git a/src/transformers/models/prophetnet/modeling_prophetnet.py b/src/transformers/models/prophetnet/modeling_prophetnet.py index b7eca9c2b3eacc..c7d9028cdaf709 100644 --- a/src/transformers/models/prophetnet/modeling_prophetnet.py +++ b/src/transformers/models/prophetnet/modeling_prophetnet.py @@ -44,6 +44,9 @@ _CHECKPOINT_FOR_DOC = "microsoft/prophetnet-large-uncased" +from ..deprecated._archive_maps import PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + PROPHETNET_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads diff --git a/src/transformers/models/pvt/configuration_pvt.py b/src/transformers/models/pvt/configuration_pvt.py index 82b48224354038..7fc99b49cf0d78 100644 --- a/src/transformers/models/pvt/configuration_pvt.py +++ b/src/transformers/models/pvt/configuration_pvt.py @@ -29,6 +29,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import PVT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class PvtConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`PvtModel`]. It is used to instantiate an Pvt diff --git a/src/transformers/models/pvt/modeling_pvt.py b/src/transformers/models/pvt/modeling_pvt.py index 7480a71a569f63..b169af0cbd5668 100755 --- a/src/transformers/models/pvt/modeling_pvt.py +++ b/src/transformers/models/pvt/modeling_pvt.py @@ -50,6 +50,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import PVT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: """ diff --git a/src/transformers/models/qdqbert/configuration_qdqbert.py b/src/transformers/models/qdqbert/configuration_qdqbert.py index 40ae3cc3108aa2..9a48424cc063c1 100644 --- a/src/transformers/models/qdqbert/configuration_qdqbert.py +++ b/src/transformers/models/qdqbert/configuration_qdqbert.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class QDQBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`QDQBertModel`]. It is used to instantiate an diff --git a/src/transformers/models/qdqbert/modeling_qdqbert.py b/src/transformers/models/qdqbert/modeling_qdqbert.py index b99cb51964b83e..c5e9af7025842b 100755 --- a/src/transformers/models/qdqbert/modeling_qdqbert.py +++ b/src/transformers/models/qdqbert/modeling_qdqbert.py @@ -70,6 +70,9 @@ _CONFIG_FOR_DOC = "QDQBertConfig" +from ..deprecated._archive_maps import QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_qdqbert(model, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/qwen2/configuration_qwen2.py b/src/transformers/models/qwen2/configuration_qwen2.py index c2a99dfa8b2a49..2513866d3e62d8 100644 --- a/src/transformers/models/qwen2/configuration_qwen2.py +++ b/src/transformers/models/qwen2/configuration_qwen2.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Qwen2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Qwen2Model`]. It is used to instantiate a diff --git a/src/transformers/models/realm/configuration_realm.py b/src/transformers/models/realm/configuration_realm.py index fd21f44a558de8..3725c37922a6ad 100644 --- a/src/transformers/models/realm/configuration_realm.py +++ b/src/transformers/models/realm/configuration_realm.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import REALM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class RealmConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of diff --git a/src/transformers/models/realm/modeling_realm.py b/src/transformers/models/realm/modeling_realm.py index 7ae450552fcc4b..86f28942893399 100644 --- a/src/transformers/models/realm/modeling_realm.py +++ b/src/transformers/models/realm/modeling_realm.py @@ -43,6 +43,9 @@ _CONFIG_FOR_DOC = "RealmConfig" +from ..deprecated._archive_maps import REALM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_realm(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/reformer/configuration_reformer.py b/src/transformers/models/reformer/configuration_reformer.py index eecd67cc06ba08..35e8628ce0fa45 100755 --- a/src/transformers/models/reformer/configuration_reformer.py +++ b/src/transformers/models/reformer/configuration_reformer.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ReformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ReformerModel`]. It is used to instantiate a diff --git a/src/transformers/models/reformer/modeling_reformer.py b/src/transformers/models/reformer/modeling_reformer.py index 4db776e24c200e..e6768e897eca0c 100755 --- a/src/transformers/models/reformer/modeling_reformer.py +++ b/src/transformers/models/reformer/modeling_reformer.py @@ -51,6 +51,9 @@ _CONFIG_FOR_DOC = "ReformerConfig" +from ..deprecated._archive_maps import REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Define named tuples for nn.Modules here LSHSelfAttentionOutput = namedtuple("LSHSelfAttentionOutput", ["hidden_states", "attention_probs", "buckets"]) LocalSelfAttentionOutput = namedtuple("LocalSelfAttentionOutput", ["hidden_states", "attention_probs"]) diff --git a/src/transformers/models/regnet/configuration_regnet.py b/src/transformers/models/regnet/configuration_regnet.py index e24bc70a891c77..629ac733917e3a 100644 --- a/src/transformers/models/regnet/configuration_regnet.py +++ b/src/transformers/models/regnet/configuration_regnet.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class RegNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`RegNetModel`]. It is used to instantiate a RegNet diff --git a/src/transformers/models/regnet/modeling_regnet.py b/src/transformers/models/regnet/modeling_regnet.py index 75d16e04c43934..915e4cbae46bee 100644 --- a/src/transformers/models/regnet/modeling_regnet.py +++ b/src/transformers/models/regnet/modeling_regnet.py @@ -47,6 +47,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import REGNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class RegNetConvLayer(nn.Module): def __init__( self, diff --git a/src/transformers/models/regnet/modeling_tf_regnet.py b/src/transformers/models/regnet/modeling_tf_regnet.py index 24ebb3f5caf5c9..a8c296027fc6c3 100644 --- a/src/transformers/models/regnet/modeling_tf_regnet.py +++ b/src/transformers/models/regnet/modeling_tf_regnet.py @@ -51,6 +51,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFRegNetConvLayer(keras.layers.Layer): def __init__( self, diff --git a/src/transformers/models/rembert/configuration_rembert.py b/src/transformers/models/rembert/configuration_rembert.py index 471f2f75213a53..fa51a79f6012b6 100644 --- a/src/transformers/models/rembert/configuration_rembert.py +++ b/src/transformers/models/rembert/configuration_rembert.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class RemBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`RemBertModel`]. It is used to instantiate an diff --git a/src/transformers/models/rembert/modeling_rembert.py b/src/transformers/models/rembert/modeling_rembert.py index e92418fcffaaed..9c04ed10b8e9d8 100755 --- a/src/transformers/models/rembert/modeling_rembert.py +++ b/src/transformers/models/rembert/modeling_rembert.py @@ -53,6 +53,9 @@ _CHECKPOINT_FOR_DOC = "google/rembert" +from ..deprecated._archive_maps import REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def load_tf_weights_in_rembert(model, config, tf_checkpoint_path): """Load tf checkpoints in a pytorch model.""" try: diff --git a/src/transformers/models/rembert/modeling_tf_rembert.py b/src/transformers/models/rembert/modeling_tf_rembert.py index daceef108076a0..94667c25379b02 100644 --- a/src/transformers/models/rembert/modeling_tf_rembert.py +++ b/src/transformers/models/rembert/modeling_tf_rembert.py @@ -63,6 +63,9 @@ _CONFIG_FOR_DOC = "RemBertConfig" +from ..deprecated._archive_maps import TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFRemBertEmbeddings(keras.layers.Layer): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/resnet/configuration_resnet.py b/src/transformers/models/resnet/configuration_resnet.py index 46ccd96cd9ccfc..8e1938cb9ce986 100644 --- a/src/transformers/models/resnet/configuration_resnet.py +++ b/src/transformers/models/resnet/configuration_resnet.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ResNetConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ResNetModel`]. It is used to instantiate an diff --git a/src/transformers/models/resnet/modeling_resnet.py b/src/transformers/models/resnet/modeling_resnet.py index a7e65f07ea4c8f..ab2ff4814e8722 100644 --- a/src/transformers/models/resnet/modeling_resnet.py +++ b/src/transformers/models/resnet/modeling_resnet.py @@ -54,6 +54,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" +from ..deprecated._archive_maps import RESNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class ResNetConvLayer(nn.Module): def __init__( self, in_channels: int, out_channels: int, kernel_size: int = 3, stride: int = 1, activation: str = "relu" diff --git a/src/transformers/models/resnet/modeling_tf_resnet.py b/src/transformers/models/resnet/modeling_tf_resnet.py index 4d68775c922ae9..98e9a32d293fe4 100644 --- a/src/transformers/models/resnet/modeling_tf_resnet.py +++ b/src/transformers/models/resnet/modeling_tf_resnet.py @@ -50,6 +50,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tiger cat" +from ..deprecated._archive_maps import TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFResNetConvLayer(keras.layers.Layer): def __init__( self, diff --git a/src/transformers/models/roberta/configuration_roberta.py b/src/transformers/models/roberta/configuration_roberta.py index 0ecd57b23a5ddf..aa549556d949fd 100644 --- a/src/transformers/models/roberta/configuration_roberta.py +++ b/src/transformers/models/roberta/configuration_roberta.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class RobertaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`RobertaModel`] or a [`TFRobertaModel`]. It is diff --git a/src/transformers/models/roberta/modeling_roberta.py b/src/transformers/models/roberta/modeling_roberta.py index 5984529eb041d6..e1f15722e43bdf 100644 --- a/src/transformers/models/roberta/modeling_roberta.py +++ b/src/transformers/models/roberta/modeling_roberta.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "RobertaConfig" +from ..deprecated._archive_maps import ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class RobertaEmbeddings(nn.Module): """ Same as BertEmbeddings with a tiny tweak for positional embeddings indexing. diff --git a/src/transformers/models/roberta/modeling_tf_roberta.py b/src/transformers/models/roberta/modeling_tf_roberta.py index 84448a168defdb..f48bb796c17b4c 100644 --- a/src/transformers/models/roberta/modeling_tf_roberta.py +++ b/src/transformers/models/roberta/modeling_tf_roberta.py @@ -66,6 +66,9 @@ _CONFIG_FOR_DOC = "RobertaConfig" +from ..deprecated._archive_maps import TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFRobertaEmbeddings(keras.layers.Layer): """ Same as BertEmbeddings with a tiny tweak for positional embeddings indexing. diff --git a/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py b/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py index e7e74b0cdf24d1..379a71abf1fbb1 100644 --- a/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py +++ b/src/transformers/models/roberta_prelayernorm/configuration_roberta_prelayernorm.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + # Copied from transformers.models.roberta.configuration_roberta.RobertaConfig with FacebookAI/roberta-base->andreasmadsen/efficient_mlm_m0.40,RoBERTa->RoBERTa-PreLayerNorm,Roberta->RobertaPreLayerNorm,roberta->roberta-prelayernorm class RobertaPreLayerNormConfig(PretrainedConfig): r""" diff --git a/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py b/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py index cfbf5e11aa233d..468cb1a243ca89 100644 --- a/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py +++ b/src/transformers/models/roberta_prelayernorm/modeling_roberta_prelayernorm.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "RobertaPreLayerNormConfig" +from ..deprecated._archive_maps import ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->RobertaPreLayerNorm class RobertaPreLayerNormEmbeddings(nn.Module): """ diff --git a/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py b/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py index beb9c383e1d4ff..b3a0070788eaf7 100644 --- a/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py +++ b/src/transformers/models/roberta_prelayernorm/modeling_tf_roberta_prelayernorm.py @@ -66,6 +66,9 @@ _CONFIG_FOR_DOC = "RobertaPreLayerNormConfig" +from ..deprecated._archive_maps import TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.roberta.modeling_tf_roberta.TFRobertaEmbeddings with Roberta->RobertaPreLayerNorm class TFRobertaPreLayerNormEmbeddings(keras.layers.Layer): """ diff --git a/src/transformers/models/roc_bert/configuration_roc_bert.py b/src/transformers/models/roc_bert/configuration_roc_bert.py index 752c791cf91f7a..26f74ee4c462d0 100644 --- a/src/transformers/models/roc_bert/configuration_roc_bert.py +++ b/src/transformers/models/roc_bert/configuration_roc_bert.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class RoCBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`RoCBertModel`]. It is used to instantiate a diff --git a/src/transformers/models/roc_bert/modeling_roc_bert.py b/src/transformers/models/roc_bert/modeling_roc_bert.py index 6a060b412f5d50..51850c9af1d5c0 100644 --- a/src/transformers/models/roc_bert/modeling_roc_bert.py +++ b/src/transformers/models/roc_bert/modeling_roc_bert.py @@ -73,6 +73,8 @@ # Maske language modeling +from ..deprecated._archive_maps import ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + # Copied from transformers.models.bert.modeling_bert.load_tf_weights_in_bert with bert->roc_bert def load_tf_weights_in_roc_bert(model, config, tf_checkpoint_path): diff --git a/src/transformers/models/roformer/configuration_roformer.py b/src/transformers/models/roformer/configuration_roformer.py index 0732c3a9e09061..adde64345d9ee4 100644 --- a/src/transformers/models/roformer/configuration_roformer.py +++ b/src/transformers/models/roformer/configuration_roformer.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class RoFormerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`RoFormerModel`]. It is used to instantiate an diff --git a/src/transformers/models/roformer/modeling_roformer.py b/src/transformers/models/roformer/modeling_roformer.py index 0a6335c6d06649..b2a63221a8dc90 100644 --- a/src/transformers/models/roformer/modeling_roformer.py +++ b/src/transformers/models/roformer/modeling_roformer.py @@ -53,6 +53,9 @@ _CONFIG_FOR_DOC = "RoFormerConfig" +from ..deprecated._archive_maps import ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.marian.modeling_marian.MarianSinusoidalPositionalEmbedding with Marian->RoFormer class RoFormerSinusoidalPositionalEmbedding(nn.Embedding): """This module produces sinusoidal positional embeddings of any length.""" diff --git a/src/transformers/models/roformer/modeling_tf_roformer.py b/src/transformers/models/roformer/modeling_tf_roformer.py index e3f84cc78aa23a..3c1ba63ce1863c 100644 --- a/src/transformers/models/roformer/modeling_tf_roformer.py +++ b/src/transformers/models/roformer/modeling_tf_roformer.py @@ -65,6 +65,9 @@ _CONFIG_FOR_DOC = "RoFormerConfig" +from ..deprecated._archive_maps import TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFRoFormerSinusoidalPositionalEmbedding(keras.layers.Layer): """This module produces sinusoidal positional embeddings of any length.""" diff --git a/src/transformers/models/rwkv/configuration_rwkv.py b/src/transformers/models/rwkv/configuration_rwkv.py index c163751d503f8f..a6abfc549e6670 100644 --- a/src/transformers/models/rwkv/configuration_rwkv.py +++ b/src/transformers/models/rwkv/configuration_rwkv.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class RwkvConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`RwkvModel`]. It is used to instantiate a RWKV diff --git a/src/transformers/models/rwkv/modeling_rwkv.py b/src/transformers/models/rwkv/modeling_rwkv.py index d9e4bfadf32013..79e06d141bb846 100644 --- a/src/transformers/models/rwkv/modeling_rwkv.py +++ b/src/transformers/models/rwkv/modeling_rwkv.py @@ -45,6 +45,9 @@ _CONFIG_FOR_DOC = "RwkvConfig" +from ..deprecated._archive_maps import RWKV_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + rwkv_cuda_kernel = None diff --git a/src/transformers/models/sam/configuration_sam.py b/src/transformers/models/sam/configuration_sam.py index 63dc5ff6307941..5afe75eb8eae43 100644 --- a/src/transformers/models/sam/configuration_sam.py +++ b/src/transformers/models/sam/configuration_sam.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SAM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SamPromptEncoderConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SamPromptEncoder`]. The [`SamPromptEncoder`] diff --git a/src/transformers/models/sam/modeling_sam.py b/src/transformers/models/sam/modeling_sam.py index 32774733911f93..385fb9c00aea4f 100644 --- a/src/transformers/models/sam/modeling_sam.py +++ b/src/transformers/models/sam/modeling_sam.py @@ -38,6 +38,9 @@ _CHECKPOINT_FOR_DOC = "facebook/sam-vit-huge" +from ..deprecated._archive_maps import SAM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class SamVisionEncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/sam/modeling_tf_sam.py b/src/transformers/models/sam/modeling_tf_sam.py index 5da1293e0f4d74..f527337cd6cdaa 100644 --- a/src/transformers/models/sam/modeling_tf_sam.py +++ b/src/transformers/models/sam/modeling_tf_sam.py @@ -41,6 +41,9 @@ _CHECKPOINT_FOR_DOC = "facebook/sam-vit-huge" +from ..deprecated._archive_maps import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class TFSamVisionEncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py b/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py index 2075c65fa89abe..8ae61f1defece6 100644 --- a/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py +++ b/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SeamlessM4TConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`~SeamlessM4TModel`]. It is used to instantiate an diff --git a/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py b/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py index 6d0c7b1a5d39f6..f619dd9e799919 100755 --- a/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py +++ b/src/transformers/models/seamless_m4t/modeling_seamless_m4t.py @@ -51,6 +51,12 @@ _CONFIG_FOR_DOC = "SeamlessM4TConfig" +from ..deprecated._archive_maps import ( # noqa: F401, E402 + SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST, # noqa: F401, E402 + SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP, # noqa: F401, E402 +) + + @dataclass class SeamlessM4TGenerationOutput(ModelOutput): """ diff --git a/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py b/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py index 051a86cba1e96c..e03523d3e0d8b4 100644 --- a/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py +++ b/src/transformers/models/seamless_m4t_v2/configuration_seamless_m4t_v2.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SeamlessM4Tv2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`~SeamlessM4Tv2Model`]. It is used to instantiate diff --git a/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py b/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py index a0fa7c234cc05c..c7f90f6c0a23f2 100644 --- a/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py +++ b/src/transformers/models/seamless_m4t_v2/modeling_seamless_m4t_v2.py @@ -51,6 +51,14 @@ _CONFIG_FOR_DOC = "SeamlessM4Tv2Config" +from ..deprecated._archive_maps import SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + +SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = { + "microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json", +} + + @dataclass # Copied from transformers.models.seamless_m4t.modeling_seamless_m4t.SeamlessM4TGenerationOutput with SeamlessM4T->SeamlessM4Tv2 class SeamlessM4Tv2GenerationOutput(ModelOutput): diff --git a/src/transformers/models/segformer/configuration_segformer.py b/src/transformers/models/segformer/configuration_segformer.py index 6aadb64b6fe683..aba2693ba33bbf 100644 --- a/src/transformers/models/segformer/configuration_segformer.py +++ b/src/transformers/models/segformer/configuration_segformer.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SegformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SegformerModel`]. It is used to instantiate an diff --git a/src/transformers/models/segformer/modeling_segformer.py b/src/transformers/models/segformer/modeling_segformer.py index d47219a0bd0d23..d1205630dd1042 100755 --- a/src/transformers/models/segformer/modeling_segformer.py +++ b/src/transformers/models/segformer/modeling_segformer.py @@ -52,6 +52,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class SegFormerImageClassifierOutput(ImageClassifierOutput): """ Base class for outputs of image classification models. diff --git a/src/transformers/models/segformer/modeling_tf_segformer.py b/src/transformers/models/segformer/modeling_tf_segformer.py index 0657f1b437e525..d215059ff611ab 100644 --- a/src/transformers/models/segformer/modeling_tf_segformer.py +++ b/src/transformers/models/segformer/modeling_tf_segformer.py @@ -56,6 +56,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.convnext.modeling_tf_convnext.TFConvNextDropPath with ConvNext->Segformer class TFSegformerDropPath(keras.layers.Layer): """Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). diff --git a/src/transformers/models/seggpt/configuration_seggpt.py b/src/transformers/models/seggpt/configuration_seggpt.py index bac482e97f875d..38607d775a6582 100644 --- a/src/transformers/models/seggpt/configuration_seggpt.py +++ b/src/transformers/models/seggpt/configuration_seggpt.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SEGGPT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SegGptConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SegGptModel`]. It is used to instantiate a SegGPT diff --git a/src/transformers/models/seggpt/modeling_seggpt.py b/src/transformers/models/seggpt/modeling_seggpt.py index df887a189134fd..79fd309eaf808f 100644 --- a/src/transformers/models/seggpt/modeling_seggpt.py +++ b/src/transformers/models/seggpt/modeling_seggpt.py @@ -47,6 +47,9 @@ _EXPECTED_OUTPUT_SHAPE = [3, 896, 448] +from ..deprecated._archive_maps import SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class SegGptEncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/sew/configuration_sew.py b/src/transformers/models/sew/configuration_sew.py index 33ea6d374fa71b..b14ce441d000cb 100644 --- a/src/transformers/models/sew/configuration_sew.py +++ b/src/transformers/models/sew/configuration_sew.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SEWConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SEWModel`]. It is used to instantiate a SEW model diff --git a/src/transformers/models/sew/modeling_sew.py b/src/transformers/models/sew/modeling_sew.py index d5d6963a0c7162..950a91fb6a54b1 100644 --- a/src/transformers/models/sew/modeling_sew.py +++ b/src/transformers/models/sew/modeling_sew.py @@ -56,6 +56,9 @@ _SEQ_CLASS_EXPECTED_LOSS = 9.52 +from ..deprecated._archive_maps import SEW_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( shape: Tuple[int, int], diff --git a/src/transformers/models/sew_d/configuration_sew_d.py b/src/transformers/models/sew_d/configuration_sew_d.py index aa4b60edc7e059..9e96a1f22b30bf 100644 --- a/src/transformers/models/sew_d/configuration_sew_d.py +++ b/src/transformers/models/sew_d/configuration_sew_d.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SEWDConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SEWDModel`]. It is used to instantiate a SEW-D diff --git a/src/transformers/models/sew_d/modeling_sew_d.py b/src/transformers/models/sew_d/modeling_sew_d.py index 342ea70a7f7e4c..aadcf6f6693c5b 100644 --- a/src/transformers/models/sew_d/modeling_sew_d.py +++ b/src/transformers/models/sew_d/modeling_sew_d.py @@ -56,6 +56,9 @@ _SEQ_CLASS_EXPECTED_LOSS = 3.16 +from ..deprecated._archive_maps import SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( shape: Tuple[int, int], diff --git a/src/transformers/models/siglip/configuration_siglip.py b/src/transformers/models/siglip/configuration_siglip.py index 7692f79abb333e..872e5c3b965ba9 100644 --- a/src/transformers/models/siglip/configuration_siglip.py +++ b/src/transformers/models/siglip/configuration_siglip.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SIGLIP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SiglipTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SiglipTextModel`]. It is used to instantiate a diff --git a/src/transformers/models/siglip/modeling_siglip.py b/src/transformers/models/siglip/modeling_siglip.py index 17e7a641eb542b..6e225803b4a00c 100644 --- a/src/transformers/models/siglip/modeling_siglip.py +++ b/src/transformers/models/siglip/modeling_siglip.py @@ -53,6 +53,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "LABEL_1" +from ..deprecated._archive_maps import SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def _trunc_normal_(tensor, mean, std, a, b): # Cut & paste from PyTorch official master until it's in a few official releases - RW # Method based on https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf diff --git a/src/transformers/models/speech_to_text/configuration_speech_to_text.py b/src/transformers/models/speech_to_text/configuration_speech_to_text.py index 2b8e3bd22e2d7b..67dee8dc0bc361 100644 --- a/src/transformers/models/speech_to_text/configuration_speech_to_text.py +++ b/src/transformers/models/speech_to_text/configuration_speech_to_text.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Speech2TextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Speech2TextModel`]. It is used to instantiate a diff --git a/src/transformers/models/speech_to_text/modeling_speech_to_text.py b/src/transformers/models/speech_to_text/modeling_speech_to_text.py index 155d6a5dfe3e62..6898cc081fe91f 100755 --- a/src/transformers/models/speech_to_text/modeling_speech_to_text.py +++ b/src/transformers/models/speech_to_text/modeling_speech_to_text.py @@ -44,6 +44,9 @@ _CONFIG_FOR_DOC = "Speech2TextConfig" +from ..deprecated._archive_maps import SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py b/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py index 91e6028332f0a9..8fd6bd21a593c9 100755 --- a/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py +++ b/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py @@ -56,6 +56,9 @@ _CHECKPOINT_FOR_DOC = "facebook/s2t-small-librispeech-asr" +from ..deprecated._archive_maps import TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py b/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py index 5c9ebbe00fb9cd..cbb3be82552266 100644 --- a/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py +++ b/src/transformers/models/speech_to_text_2/configuration_speech_to_text_2.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Speech2Text2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Speech2Text2ForCausalLM`]. It is used to diff --git a/src/transformers/models/speecht5/configuration_speecht5.py b/src/transformers/models/speecht5/configuration_speecht5.py index 91883253032497..36cb4995a83f05 100644 --- a/src/transformers/models/speecht5/configuration_speecht5.py +++ b/src/transformers/models/speecht5/configuration_speecht5.py @@ -24,6 +24,14 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + +SPEECHT5_PRETRAINED_HIFIGAN_CONFIG_ARCHIVE_MAP = { + "microsoft/speecht5_hifigan": "https://huggingface.co/microsoft/speecht5_hifigan/resolve/main/config.json", +} + + class SpeechT5Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SpeechT5Model`]. It is used to instantiate a diff --git a/src/transformers/models/speecht5/modeling_speecht5.py b/src/transformers/models/speecht5/modeling_speecht5.py index 2217a9270329e0..c4b9aca6f08d31 100644 --- a/src/transformers/models/speecht5/modeling_speecht5.py +++ b/src/transformers/models/speecht5/modeling_speecht5.py @@ -47,6 +47,9 @@ _CONFIG_FOR_DOC = "SpeechT5Config" +from ..deprecated._archive_maps import SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.shift_tokens_right def shift_tokens_right(input_ids: torch.Tensor, pad_token_id: int, decoder_start_token_id: int): """ diff --git a/src/transformers/models/splinter/configuration_splinter.py b/src/transformers/models/splinter/configuration_splinter.py index 83e78e4e4a2638..5248c74c1a3efc 100644 --- a/src/transformers/models/splinter/configuration_splinter.py +++ b/src/transformers/models/splinter/configuration_splinter.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SplinterConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SplinterModel`]. It is used to instantiate an diff --git a/src/transformers/models/splinter/modeling_splinter.py b/src/transformers/models/splinter/modeling_splinter.py index d2f4cd80e84624..b643601d0ebd49 100755 --- a/src/transformers/models/splinter/modeling_splinter.py +++ b/src/transformers/models/splinter/modeling_splinter.py @@ -38,6 +38,9 @@ _CONFIG_FOR_DOC = "SplinterConfig" +from ..deprecated._archive_maps import SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class SplinterEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/squeezebert/configuration_squeezebert.py b/src/transformers/models/squeezebert/configuration_squeezebert.py index ec79988849e4cf..2e8710bb5c5859 100644 --- a/src/transformers/models/squeezebert/configuration_squeezebert.py +++ b/src/transformers/models/squeezebert/configuration_squeezebert.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SqueezeBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SqueezeBertModel`]. It is used to instantiate a diff --git a/src/transformers/models/squeezebert/modeling_squeezebert.py b/src/transformers/models/squeezebert/modeling_squeezebert.py index 7144ee6ca74366..b5657f6e6f5003 100644 --- a/src/transformers/models/squeezebert/modeling_squeezebert.py +++ b/src/transformers/models/squeezebert/modeling_squeezebert.py @@ -43,6 +43,9 @@ _CONFIG_FOR_DOC = "SqueezeBertConfig" +from ..deprecated._archive_maps import SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class SqueezeBertEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" diff --git a/src/transformers/models/stablelm/configuration_stablelm.py b/src/transformers/models/stablelm/configuration_stablelm.py index 007b8cafee71c3..d702ba87af5e17 100644 --- a/src/transformers/models/stablelm/configuration_stablelm.py +++ b/src/transformers/models/stablelm/configuration_stablelm.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import STABLELM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class StableLmConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`~StableLmModel`]. diff --git a/src/transformers/models/starcoder2/configuration_starcoder2.py b/src/transformers/models/starcoder2/configuration_starcoder2.py index 3bb0d1b65519c7..8337135442c86f 100644 --- a/src/transformers/models/starcoder2/configuration_starcoder2.py +++ b/src/transformers/models/starcoder2/configuration_starcoder2.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import STARCODER2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Starcoder2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Starcoder2Model`]. It is used to instantiate a diff --git a/src/transformers/models/swiftformer/configuration_swiftformer.py b/src/transformers/models/swiftformer/configuration_swiftformer.py index d1e0e666429b77..3c7a9eebbd9101 100644 --- a/src/transformers/models/swiftformer/configuration_swiftformer.py +++ b/src/transformers/models/swiftformer/configuration_swiftformer.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SwiftFormerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SwiftFormerModel`]. It is used to instantiate an diff --git a/src/transformers/models/swiftformer/modeling_swiftformer.py b/src/transformers/models/swiftformer/modeling_swiftformer.py index d5da17d783345b..c447c0ce1204e4 100644 --- a/src/transformers/models/swiftformer/modeling_swiftformer.py +++ b/src/transformers/models/swiftformer/modeling_swiftformer.py @@ -52,6 +52,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class SwiftFormerPatchEmbedding(nn.Module): """ Patch Embedding Layer constructed of two 2D convolutional layers. diff --git a/src/transformers/models/swin/configuration_swin.py b/src/transformers/models/swin/configuration_swin.py index 281d0f047b2a68..9bf460870f9ee0 100644 --- a/src/transformers/models/swin/configuration_swin.py +++ b/src/transformers/models/swin/configuration_swin.py @@ -28,6 +28,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SwinConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SwinModel`]. It is used to instantiate a Swin diff --git a/src/transformers/models/swin/modeling_swin.py b/src/transformers/models/swin/modeling_swin.py index 9bf25306e7ce9e..c841faddf0df91 100644 --- a/src/transformers/models/swin/modeling_swin.py +++ b/src/transformers/models/swin/modeling_swin.py @@ -56,6 +56,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import SWIN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # drop_path, SwinPatchEmbeddings, SwinPatchMerging and SwinDropPath are from the timm library. diff --git a/src/transformers/models/swin/modeling_tf_swin.py b/src/transformers/models/swin/modeling_tf_swin.py index 99da3d7f1e2306..b9a10793406916 100644 --- a/src/transformers/models/swin/modeling_tf_swin.py +++ b/src/transformers/models/swin/modeling_tf_swin.py @@ -61,6 +61,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # drop_path, TFSwinPatchEmbeddings, TFSwinPatchMerging and TFSwinDropPath are tensorflow # implementations of PyTorch functionalities in the timm library. diff --git a/src/transformers/models/swin2sr/configuration_swin2sr.py b/src/transformers/models/swin2sr/configuration_swin2sr.py index 98177a804aee57..1858be52a5ab45 100644 --- a/src/transformers/models/swin2sr/configuration_swin2sr.py +++ b/src/transformers/models/swin2sr/configuration_swin2sr.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Swin2SRConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Swin2SRModel`]. It is used to instantiate a Swin diff --git a/src/transformers/models/swin2sr/modeling_swin2sr.py b/src/transformers/models/swin2sr/modeling_swin2sr.py index 310d1d4fb8748a..1ef628a1443d66 100644 --- a/src/transformers/models/swin2sr/modeling_swin2sr.py +++ b/src/transformers/models/swin2sr/modeling_swin2sr.py @@ -49,6 +49,9 @@ _EXPECTED_OUTPUT_SHAPE = [1, 180, 488, 648] +from ..deprecated._archive_maps import SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class Swin2SREncoderOutput(ModelOutput): """ diff --git a/src/transformers/models/swinv2/configuration_swinv2.py b/src/transformers/models/swinv2/configuration_swinv2.py index 17e924804ca61a..41acd48f53259c 100644 --- a/src/transformers/models/swinv2/configuration_swinv2.py +++ b/src/transformers/models/swinv2/configuration_swinv2.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Swinv2Config(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Swinv2Model`]. It is used to instantiate a Swin diff --git a/src/transformers/models/swinv2/modeling_swinv2.py b/src/transformers/models/swinv2/modeling_swinv2.py index 66156a84ae2818..16c68ee63f695d 100644 --- a/src/transformers/models/swinv2/modeling_swinv2.py +++ b/src/transformers/models/swinv2/modeling_swinv2.py @@ -56,6 +56,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "Egyptian cat" +from ..deprecated._archive_maps import SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # drop_path, Swinv2PatchEmbeddings, Swinv2PatchMerging and Swinv2DropPath are from https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/swin_transformer_v2.py. diff --git a/src/transformers/models/switch_transformers/configuration_switch_transformers.py b/src/transformers/models/switch_transformers/configuration_switch_transformers.py index fe96297777c98d..fb531003178af0 100644 --- a/src/transformers/models/switch_transformers/configuration_switch_transformers.py +++ b/src/transformers/models/switch_transformers/configuration_switch_transformers.py @@ -20,6 +20,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class SwitchTransformersConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`SwitchTransformersModel`]. It is used to diff --git a/src/transformers/models/switch_transformers/modeling_switch_transformers.py b/src/transformers/models/switch_transformers/modeling_switch_transformers.py index a30f597ee8b25f..375d94043e6c13 100644 --- a/src/transformers/models/switch_transformers/modeling_switch_transformers.py +++ b/src/transformers/models/switch_transformers/modeling_switch_transformers.py @@ -55,6 +55,8 @@ # for the pretrained weights provided with the models #################################################### +from ..deprecated._archive_maps import SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + def router_z_loss_func(router_logits: torch.Tensor) -> float: r""" diff --git a/src/transformers/models/t5/configuration_t5.py b/src/transformers/models/t5/configuration_t5.py index eec47e5eb2aba6..2633ee630dff90 100644 --- a/src/transformers/models/t5/configuration_t5.py +++ b/src/transformers/models/t5/configuration_t5.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import T5_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class T5Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`T5Model`] or a [`TFT5Model`]. It is used to diff --git a/src/transformers/models/t5/modeling_t5.py b/src/transformers/models/t5/modeling_t5.py index b8f80cec2df97c..9c4ceec4c2481e 100644 --- a/src/transformers/models/t5/modeling_t5.py +++ b/src/transformers/models/t5/modeling_t5.py @@ -60,6 +60,8 @@ # for the pretrained weights provided with the models #################################################### +from ..deprecated._archive_maps import T5_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + #################################################### # This is a conversion method from TF 1.0 to PyTorch diff --git a/src/transformers/models/t5/modeling_tf_t5.py b/src/transformers/models/t5/modeling_tf_t5.py index 7b97b26e2e53ad..8122c6a0ace1db 100644 --- a/src/transformers/models/t5/modeling_tf_t5.py +++ b/src/transformers/models/t5/modeling_tf_t5.py @@ -59,6 +59,9 @@ _CONFIG_FOR_DOC = "T5Config" +from ..deprecated._archive_maps import TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + #################################################### # TF 2.0 Models are constructed using Keras imperative API by sub-classing # - keras.layers.Layer for the layers and diff --git a/src/transformers/models/table_transformer/configuration_table_transformer.py b/src/transformers/models/table_transformer/configuration_table_transformer.py index 35ca9a6a4b9895..9a2ff6bbab3b24 100644 --- a/src/transformers/models/table_transformer/configuration_table_transformer.py +++ b/src/transformers/models/table_transformer/configuration_table_transformer.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TableTransformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TableTransformerModel`]. It is used to diff --git a/src/transformers/models/table_transformer/modeling_table_transformer.py b/src/transformers/models/table_transformer/modeling_table_transformer.py index a4bf4dfc119230..8e577a65a5fe00 100644 --- a/src/transformers/models/table_transformer/modeling_table_transformer.py +++ b/src/transformers/models/table_transformer/modeling_table_transformer.py @@ -61,6 +61,9 @@ _CHECKPOINT_FOR_DOC = "microsoft/table-transformer-detection" +from ..deprecated._archive_maps import TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.detr.modeling_detr.DetrDecoderOutput with DETR->TABLE_TRANSFORMER,Detr->TableTransformer class TableTransformerDecoderOutput(BaseModelOutputWithCrossAttentions): diff --git a/src/transformers/models/tapas/configuration_tapas.py b/src/transformers/models/tapas/configuration_tapas.py index cbc5cebf4e1b76..b448afd0022062 100644 --- a/src/transformers/models/tapas/configuration_tapas.py +++ b/src/transformers/models/tapas/configuration_tapas.py @@ -24,6 +24,7 @@ from ...configuration_utils import PretrainedConfig +from ..deprecated._archive_maps import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 class TapasConfig(PretrainedConfig): diff --git a/src/transformers/models/tapas/modeling_tapas.py b/src/transformers/models/tapas/modeling_tapas.py index 729e10e062f8fa..e2ce847926b38f 100644 --- a/src/transformers/models/tapas/modeling_tapas.py +++ b/src/transformers/models/tapas/modeling_tapas.py @@ -57,6 +57,9 @@ _CHECKPOINT_FOR_DOC = "google/tapas-base" +from ..deprecated._archive_maps import TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + EPSILON_ZERO_DIVISION = 1e-10 CLOSE_ENOUGH_TO_LOG_ZERO = -10000.0 diff --git a/src/transformers/models/tapas/modeling_tf_tapas.py b/src/transformers/models/tapas/modeling_tf_tapas.py index bc7e7b7d75922f..6b2ed5fab455a8 100644 --- a/src/transformers/models/tapas/modeling_tf_tapas.py +++ b/src/transformers/models/tapas/modeling_tf_tapas.py @@ -76,6 +76,9 @@ _CHECKPOINT_FOR_DOC = "google/tapas-base" +from ..deprecated._archive_maps import TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + EPSILON_ZERO_DIVISION = 1e-10 CLOSE_ENOUGH_TO_LOG_ZERO = -10000.0 diff --git a/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py b/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py index 8c74f151749f6b..f53f3aad1ec947 100644 --- a/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py +++ b/src/transformers/models/time_series_transformer/configuration_time_series_transformer.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TimeSeriesTransformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TimeSeriesTransformerModel`]. It is used to diff --git a/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py b/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py index dd7a2228a32790..ab46d3a92a1853 100644 --- a/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py +++ b/src/transformers/models/time_series_transformer/modeling_time_series_transformer.py @@ -46,6 +46,9 @@ _CONFIG_FOR_DOC = "TimeSeriesTransformerConfig" +from ..deprecated._archive_maps import TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TimeSeriesFeatureEmbedder(nn.Module): """ Embed a sequence of categorical features. diff --git a/src/transformers/models/timesformer/configuration_timesformer.py b/src/transformers/models/timesformer/configuration_timesformer.py index ebcfcc82482a6f..79a86b7b5b370d 100644 --- a/src/transformers/models/timesformer/configuration_timesformer.py +++ b/src/transformers/models/timesformer/configuration_timesformer.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TimesformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TimesformerModel`]. It is used to instantiate a diff --git a/src/transformers/models/timesformer/modeling_timesformer.py b/src/transformers/models/timesformer/modeling_timesformer.py index 51315922db9648..337447250842ee 100644 --- a/src/transformers/models/timesformer/modeling_timesformer.py +++ b/src/transformers/models/timesformer/modeling_timesformer.py @@ -37,6 +37,9 @@ _CHECKPOINT_FOR_DOC = "facebook/timesformer" +from ..deprecated._archive_maps import TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Adapted from https://github.com/facebookresearch/TimeSformer/blob/a5ef29a7b7264baff199a30b3306ac27de901133/timesformer/models/vit.py#L155 class TimesformerPatchEmbeddings(nn.Module): """Image to Patch Embedding""" diff --git a/src/transformers/models/trocr/configuration_trocr.py b/src/transformers/models/trocr/configuration_trocr.py index efa20d884e381d..ab282db97bfc55 100644 --- a/src/transformers/models/trocr/configuration_trocr.py +++ b/src/transformers/models/trocr/configuration_trocr.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TrOCRConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TrOCRForCausalLM`]. It is used to instantiate an diff --git a/src/transformers/models/trocr/modeling_trocr.py b/src/transformers/models/trocr/modeling_trocr.py index 5a6c4a89d16af2..72ead7143ad492 100644 --- a/src/transformers/models/trocr/modeling_trocr.py +++ b/src/transformers/models/trocr/modeling_trocr.py @@ -37,6 +37,9 @@ _CHECKPOINT_FOR_DOC = "microsoft/trocr-base-handwritten" +from ..deprecated._archive_maps import TROCR_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.bart.modeling_bart.BartLearnedPositionalEmbedding with Bart->TrOCR class TrOCRLearnedPositionalEmbedding(nn.Embedding): """ diff --git a/src/transformers/models/tvlt/configuration_tvlt.py b/src/transformers/models/tvlt/configuration_tvlt.py index fbf65effd96ea3..063befc9d77f92 100644 --- a/src/transformers/models/tvlt/configuration_tvlt.py +++ b/src/transformers/models/tvlt/configuration_tvlt.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TvltConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TvltModel`]. It is used to instantiate a TVLT diff --git a/src/transformers/models/tvlt/modeling_tvlt.py b/src/transformers/models/tvlt/modeling_tvlt.py index 0376570fe5a3b8..f841c47ea4bc56 100644 --- a/src/transformers/models/tvlt/modeling_tvlt.py +++ b/src/transformers/models/tvlt/modeling_tvlt.py @@ -46,6 +46,9 @@ _CHECKPOINT_FOR_DOC = "ZinengTang/tvlt-base" +from ..deprecated._archive_maps import TVLT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class TvltModelOutput(ModelOutput): """ diff --git a/src/transformers/models/tvp/configuration_tvp.py b/src/transformers/models/tvp/configuration_tvp.py index 65c4e3a5225b4a..85b7ac6a41cbcc 100644 --- a/src/transformers/models/tvp/configuration_tvp.py +++ b/src/transformers/models/tvp/configuration_tvp.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import TVP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class TvpConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`TvpModel`]. It is used to instantiate an Tvp diff --git a/src/transformers/models/tvp/modeling_tvp.py b/src/transformers/models/tvp/modeling_tvp.py index 121cd7b5f3f375..da8e85da74cfbd 100644 --- a/src/transformers/models/tvp/modeling_tvp.py +++ b/src/transformers/models/tvp/modeling_tvp.py @@ -35,6 +35,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import TVP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class TvpVideoGroundingOutput(ModelOutput): """ diff --git a/src/transformers/models/udop/configuration_udop.py b/src/transformers/models/udop/configuration_udop.py index 3802b6de01a75b..ba124d0aa15e6d 100644 --- a/src/transformers/models/udop/configuration_udop.py +++ b/src/transformers/models/udop/configuration_udop.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import UDOP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class UdopConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`UdopForConditionalGeneration`]. It is used to diff --git a/src/transformers/models/udop/modeling_udop.py b/src/transformers/models/udop/modeling_udop.py index 9c2e06f16825ce..6118600b5b249c 100644 --- a/src/transformers/models/udop/modeling_udop.py +++ b/src/transformers/models/udop/modeling_udop.py @@ -47,6 +47,9 @@ logger = logging.getLogger(__name__) +from ..deprecated._archive_maps import UDOP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + _CONFIG_FOR_DOC = "UdopConfig" diff --git a/src/transformers/models/unispeech/configuration_unispeech.py b/src/transformers/models/unispeech/configuration_unispeech.py index 18502adcb0ec4b..25a003ae9f5f9a 100644 --- a/src/transformers/models/unispeech/configuration_unispeech.py +++ b/src/transformers/models/unispeech/configuration_unispeech.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class UniSpeechConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`UniSpeechModel`]. It is used to instantiate an diff --git a/src/transformers/models/unispeech/modeling_unispeech.py b/src/transformers/models/unispeech/modeling_unispeech.py index fee3dadf9dd65f..473bc7d4ff12e4 100755 --- a/src/transformers/models/unispeech/modeling_unispeech.py +++ b/src/transformers/models/unispeech/modeling_unispeech.py @@ -57,6 +57,9 @@ _CTC_EXPECTED_LOSS = 17.17 +from ..deprecated._archive_maps import UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class UniSpeechForPreTrainingOutput(ModelOutput): """ diff --git a/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py b/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py index 87b4bc8506dd73..1e6e40ad48515e 100644 --- a/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py +++ b/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class UniSpeechSatConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`UniSpeechSatModel`]. It is used to instantiate an diff --git a/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py b/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py index 0faa4eba4eb172..f38da0d47f5c3d 100755 --- a/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py +++ b/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py @@ -73,6 +73,9 @@ _XVECTOR_EXPECTED_OUTPUT = 0.97 +from ..deprecated._archive_maps import UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class UniSpeechSatForPreTrainingOutput(ModelOutput): """ diff --git a/src/transformers/models/univnet/configuration_univnet.py b/src/transformers/models/univnet/configuration_univnet.py index 27850e114d3d2d..933db21d5ae381 100644 --- a/src/transformers/models/univnet/configuration_univnet.py +++ b/src/transformers/models/univnet/configuration_univnet.py @@ -20,6 +20,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class UnivNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`UnivNetModel`]. It is used to instantiate a diff --git a/src/transformers/models/univnet/modeling_univnet.py b/src/transformers/models/univnet/modeling_univnet.py index e4fc1215c08bd6..c2551d72653196 100644 --- a/src/transformers/models/univnet/modeling_univnet.py +++ b/src/transformers/models/univnet/modeling_univnet.py @@ -33,6 +33,9 @@ _CHECKPOINT_FOR_DOC = "dg845/univnet-dev" +from ..deprecated._archive_maps import UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class UnivNetModelOutput(ModelOutput): """ diff --git a/src/transformers/models/videomae/configuration_videomae.py b/src/transformers/models/videomae/configuration_videomae.py index b1cfcaecfae2c6..ba3d1d82736bc2 100644 --- a/src/transformers/models/videomae/configuration_videomae.py +++ b/src/transformers/models/videomae/configuration_videomae.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VideoMAEConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`VideoMAEModel`]. It is used to instantiate a diff --git a/src/transformers/models/videomae/modeling_videomae.py b/src/transformers/models/videomae/modeling_videomae.py index 100bee54389569..6beb18bb77ce0a 100644 --- a/src/transformers/models/videomae/modeling_videomae.py +++ b/src/transformers/models/videomae/modeling_videomae.py @@ -48,6 +48,9 @@ _CHECKPOINT_FOR_DOC = "MCG-NJU/videomae-base" +from ..deprecated._archive_maps import VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class VideoMAEDecoderOutput(ModelOutput): """ diff --git a/src/transformers/models/vilt/configuration_vilt.py b/src/transformers/models/vilt/configuration_vilt.py index ef0ce550d2a044..0ad4bde69494d7 100644 --- a/src/transformers/models/vilt/configuration_vilt.py +++ b/src/transformers/models/vilt/configuration_vilt.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VILT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ViltConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ViLTModel`]. It is used to instantiate an ViLT diff --git a/src/transformers/models/vilt/modeling_vilt.py b/src/transformers/models/vilt/modeling_vilt.py index f3eff9277c8a67..5545b881bd670a 100755 --- a/src/transformers/models/vilt/modeling_vilt.py +++ b/src/transformers/models/vilt/modeling_vilt.py @@ -49,6 +49,9 @@ _CHECKPOINT_FOR_DOC = "dandelin/vilt-b32-mlm" +from ..deprecated._archive_maps import VILT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class ViltForImagesAndTextClassificationOutput(ModelOutput): """ diff --git a/src/transformers/models/vipllava/configuration_vipllava.py b/src/transformers/models/vipllava/configuration_vipllava.py index e94d4be6c1e0b6..d57f4179492ea2 100644 --- a/src/transformers/models/vipllava/configuration_vipllava.py +++ b/src/transformers/models/vipllava/configuration_vipllava.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VIPLLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VipLlavaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`VipLlavaForConditionalGeneration`]. It is used to instantiate an diff --git a/src/transformers/models/vipllava/modeling_vipllava.py b/src/transformers/models/vipllava/modeling_vipllava.py index 82af43fab5def7..dda9549a4f2e8e 100644 --- a/src/transformers/models/vipllava/modeling_vipllava.py +++ b/src/transformers/models/vipllava/modeling_vipllava.py @@ -39,6 +39,9 @@ _CONFIG_FOR_DOC = "VipLlavaConfig" +from ..deprecated._archive_maps import VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast with Idefics->VipLlava class VipLlavaCausalLMOutputWithPast(ModelOutput): diff --git a/src/transformers/models/visual_bert/configuration_visual_bert.py b/src/transformers/models/visual_bert/configuration_visual_bert.py index bb146a143aab9f..2edf5466e347b8 100644 --- a/src/transformers/models/visual_bert/configuration_visual_bert.py +++ b/src/transformers/models/visual_bert/configuration_visual_bert.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VisualBertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`VisualBertModel`]. It is used to instantiate an diff --git a/src/transformers/models/visual_bert/modeling_visual_bert.py b/src/transformers/models/visual_bert/modeling_visual_bert.py index 805dd8776531db..07c8b7a4b5173c 100755 --- a/src/transformers/models/visual_bert/modeling_visual_bert.py +++ b/src/transformers/models/visual_bert/modeling_visual_bert.py @@ -49,6 +49,9 @@ _CHECKPOINT_FOR_DOC = "uclanlp/visualbert-vqa-coco-pre" +from ..deprecated._archive_maps import VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class VisualBertEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings and visual embeddings.""" diff --git a/src/transformers/models/vit/configuration_vit.py b/src/transformers/models/vit/configuration_vit.py index 286d302c7883d5..4b505b5d9cbb6d 100644 --- a/src/transformers/models/vit/configuration_vit.py +++ b/src/transformers/models/vit/configuration_vit.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ViTConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ViTModel`]. It is used to instantiate an ViT diff --git a/src/transformers/models/vit/modeling_vit.py b/src/transformers/models/vit/modeling_vit.py index 8aa43c5c43c500..4ccdd1deaf4ca1 100644 --- a/src/transformers/models/vit/modeling_vit.py +++ b/src/transformers/models/vit/modeling_vit.py @@ -57,6 +57,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "Egyptian cat" +from ..deprecated._archive_maps import VIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class ViTEmbeddings(nn.Module): """ Construct the CLS token, position and patch embeddings. Optionally, also the mask token. diff --git a/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py b/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py index 2b9dcd0a81159f..8a8a808ec60d05 100644 --- a/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py +++ b/src/transformers/models/vit_hybrid/configuration_vit_hybrid.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ViTHybridConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ViTHybridModel`]. It is used to instantiate a ViT diff --git a/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py b/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py index 20579e0d3db2cc..6fe9f8d2b6c9bd 100644 --- a/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py +++ b/src/transformers/models/vit_hybrid/modeling_vit_hybrid.py @@ -47,6 +47,9 @@ _IMAGE_CLASS_EXPECTED_OUTPUT = "tabby, tabby cat" +from ..deprecated._archive_maps import VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class ViTHybridEmbeddings(nn.Module): """ Construct the CLS token, position and patch embeddings. Optionally, also the mask token. diff --git a/src/transformers/models/vit_mae/configuration_vit_mae.py b/src/transformers/models/vit_mae/configuration_vit_mae.py index e4e46e7e4202d0..c5866ef40b497c 100644 --- a/src/transformers/models/vit_mae/configuration_vit_mae.py +++ b/src/transformers/models/vit_mae/configuration_vit_mae.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ViTMAEConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ViTMAEModel`]. It is used to instantiate an ViT diff --git a/src/transformers/models/vit_mae/modeling_vit_mae.py b/src/transformers/models/vit_mae/modeling_vit_mae.py index b652c9e71f9106..bfbe59ea903a1a 100755 --- a/src/transformers/models/vit_mae/modeling_vit_mae.py +++ b/src/transformers/models/vit_mae/modeling_vit_mae.py @@ -46,6 +46,9 @@ _CHECKPOINT_FOR_DOC = "facebook/vit-mae-base" +from ..deprecated._archive_maps import VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class ViTMAEModelOutput(ModelOutput): """ diff --git a/src/transformers/models/vit_msn/configuration_vit_msn.py b/src/transformers/models/vit_msn/configuration_vit_msn.py index 14acb15d549c04..296434346625f5 100644 --- a/src/transformers/models/vit_msn/configuration_vit_msn.py +++ b/src/transformers/models/vit_msn/configuration_vit_msn.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class ViTMSNConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`ViTMSNModel`]. It is used to instantiate an ViT diff --git a/src/transformers/models/vit_msn/modeling_vit_msn.py b/src/transformers/models/vit_msn/modeling_vit_msn.py index dd42ae26dffaf3..45d1779b5f8c80 100644 --- a/src/transformers/models/vit_msn/modeling_vit_msn.py +++ b/src/transformers/models/vit_msn/modeling_vit_msn.py @@ -38,6 +38,8 @@ _CONFIG_FOR_DOC = "ViTMSNConfig" _CHECKPOINT_FOR_DOC = "facebook/vit-msn-small" +from ..deprecated._archive_maps import VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + class ViTMSNEmbeddings(nn.Module): """ diff --git a/src/transformers/models/vitdet/configuration_vitdet.py b/src/transformers/models/vitdet/configuration_vitdet.py index f85558c254018d..2a7973dde87979 100644 --- a/src/transformers/models/vitdet/configuration_vitdet.py +++ b/src/transformers/models/vitdet/configuration_vitdet.py @@ -23,6 +23,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VitDetConfig(BackboneConfigMixin, PretrainedConfig): r""" This is the configuration class to store the configuration of a [`VitDetModel`]. It is used to instantiate an diff --git a/src/transformers/models/vitdet/modeling_vitdet.py b/src/transformers/models/vitdet/modeling_vitdet.py index 8d54da846950e9..5d12b0b58593bb 100644 --- a/src/transformers/models/vitdet/modeling_vitdet.py +++ b/src/transformers/models/vitdet/modeling_vitdet.py @@ -42,6 +42,9 @@ _CONFIG_FOR_DOC = "VitDetConfig" +from ..deprecated._archive_maps import VITDET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class VitDetEmbeddings(nn.Module): """ This class turns `pixel_values` of shape `(batch_size, num_channels, height, width)` into the initial diff --git a/src/transformers/models/vitmatte/configuration_vitmatte.py b/src/transformers/models/vitmatte/configuration_vitmatte.py index 67f562d2bd13d5..275640d1d079a1 100644 --- a/src/transformers/models/vitmatte/configuration_vitmatte.py +++ b/src/transformers/models/vitmatte/configuration_vitmatte.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VitMatteConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of [`VitMatteForImageMatting`]. It is used to diff --git a/src/transformers/models/vitmatte/modeling_vitmatte.py b/src/transformers/models/vitmatte/modeling_vitmatte.py index 75f13885ea994f..f371c608607a5f 100644 --- a/src/transformers/models/vitmatte/modeling_vitmatte.py +++ b/src/transformers/models/vitmatte/modeling_vitmatte.py @@ -28,6 +28,7 @@ replace_return_docstrings, ) from ...utils.backbone_utils import load_backbone +from ..deprecated._archive_maps import VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 from .configuration_vitmatte import VitMatteConfig diff --git a/src/transformers/models/vits/configuration_vits.py b/src/transformers/models/vits/configuration_vits.py index 8d5ffca36f3674..5538e53d4be1b8 100644 --- a/src/transformers/models/vits/configuration_vits.py +++ b/src/transformers/models/vits/configuration_vits.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VITS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VitsConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`VitsModel`]. It is used to instantiate a VITS diff --git a/src/transformers/models/vits/modeling_vits.py b/src/transformers/models/vits/modeling_vits.py index 905945e01ae1d8..df8cf9350b3128 100644 --- a/src/transformers/models/vits/modeling_vits.py +++ b/src/transformers/models/vits/modeling_vits.py @@ -42,6 +42,9 @@ _CONFIG_FOR_DOC = "VitsConfig" +from ..deprecated._archive_maps import VITS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class VitsModelOutput(ModelOutput): """ diff --git a/src/transformers/models/vivit/configuration_vivit.py b/src/transformers/models/vivit/configuration_vivit.py index 4cbebc7692c804..28ac13496f82f8 100644 --- a/src/transformers/models/vivit/configuration_vivit.py +++ b/src/transformers/models/vivit/configuration_vivit.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class VivitConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`VivitModel`]. It is used to instantiate a ViViT diff --git a/src/transformers/models/vivit/modeling_vivit.py b/src/transformers/models/vivit/modeling_vivit.py index 27035f4424f4ab..08efb85e1f0254 100755 --- a/src/transformers/models/vivit/modeling_vivit.py +++ b/src/transformers/models/vivit/modeling_vivit.py @@ -37,6 +37,9 @@ _CONFIG_FOR_DOC = "VivitConfig" +from ..deprecated._archive_maps import VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class VivitTubeletEmbeddings(nn.Module): """ Construct Vivit Tubelet embeddings. diff --git a/src/transformers/models/wav2vec2/configuration_wav2vec2.py b/src/transformers/models/wav2vec2/configuration_wav2vec2.py index 1d6777efcb74ee..252674bb3da3fd 100644 --- a/src/transformers/models/wav2vec2/configuration_wav2vec2.py +++ b/src/transformers/models/wav2vec2/configuration_wav2vec2.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Wav2Vec2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Wav2Vec2Model`]. It is used to instantiate an diff --git a/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py b/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py index efbae8f2324812..a8e39b0754af75 100644 --- a/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py +++ b/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py @@ -53,6 +53,9 @@ _CONFIG_FOR_DOC = "Wav2Vec2Config" +from ..deprecated._archive_maps import TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/wav2vec2/modeling_wav2vec2.py b/src/transformers/models/wav2vec2/modeling_wav2vec2.py index 94e172d28a9d5b..d40af1739c25db 100755 --- a/src/transformers/models/wav2vec2/modeling_wav2vec2.py +++ b/src/transformers/models/wav2vec2/modeling_wav2vec2.py @@ -89,6 +89,9 @@ _XVECTOR_EXPECTED_OUTPUT = 0.98 +from ..deprecated._archive_maps import WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class Wav2Vec2ForPreTrainingOutput(ModelOutput): """ diff --git a/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py b/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py index f6c364884bd2b4..4183c1e4c06e7b 100644 --- a/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py +++ b/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py @@ -22,6 +22,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import WAV2VEC2_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Wav2Vec2BertConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Wav2Vec2BertModel`]. It is used to diff --git a/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py b/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py index 9f0d631a402091..6519faa931d688 100644 --- a/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py +++ b/src/transformers/models/wav2vec2_bert/modeling_wav2vec2_bert.py @@ -64,6 +64,9 @@ _CTC_EXPECTED_LOSS = 17.04 +from ..deprecated._archive_maps import WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.seamless_m4t_v2.modeling_seamless_m4t_v2._compute_new_attention_mask def _compute_new_attention_mask(hidden_states: torch.Tensor, seq_lens: torch.Tensor): """ diff --git a/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py b/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py index 5c931342c9cf31..1b99edcece527b 100644 --- a/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py +++ b/src/transformers/models/wav2vec2_conformer/configuration_wav2vec2_conformer.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class Wav2Vec2ConformerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Wav2Vec2ConformerModel`]. It is used to diff --git a/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py b/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py index 1680b2a60c64ab..8354a88a517fa9 100644 --- a/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py +++ b/src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py @@ -65,6 +65,9 @@ _CTC_EXPECTED_LOSS = 64.21 +from ..deprecated._archive_maps import WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass # Copied from transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2ForPreTrainingOutput with Wav2Vec2->Wav2Vec2Conformer class Wav2Vec2ConformerForPreTrainingOutput(ModelOutput): diff --git a/src/transformers/models/wavlm/configuration_wavlm.py b/src/transformers/models/wavlm/configuration_wavlm.py index a860475336f931..c0f5f90fe321af 100644 --- a/src/transformers/models/wavlm/configuration_wavlm.py +++ b/src/transformers/models/wavlm/configuration_wavlm.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class WavLMConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`WavLMModel`]. It is used to instantiate an WavLM diff --git a/src/transformers/models/wavlm/modeling_wavlm.py b/src/transformers/models/wavlm/modeling_wavlm.py index f6d37cfaa17ceb..f46fc1ef4f01da 100755 --- a/src/transformers/models/wavlm/modeling_wavlm.py +++ b/src/transformers/models/wavlm/modeling_wavlm.py @@ -71,6 +71,9 @@ _XVECTOR_EXPECTED_OUTPUT = 0.97 +from ..deprecated._archive_maps import WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.wav2vec2.modeling_wav2vec2._compute_mask_indices def _compute_mask_indices( shape: Tuple[int, int], diff --git a/src/transformers/models/whisper/configuration_whisper.py b/src/transformers/models/whisper/configuration_whisper.py index c924a21c2a571c..ec9c64df1bdb81 100644 --- a/src/transformers/models/whisper/configuration_whisper.py +++ b/src/transformers/models/whisper/configuration_whisper.py @@ -30,6 +30,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + # fmt: off NON_SPEECH_TOKENS = [ 1, 2, 7, 8, 9, 10, 14, 25, diff --git a/src/transformers/models/whisper/modeling_tf_whisper.py b/src/transformers/models/whisper/modeling_tf_whisper.py index 8033bb584fd2aa..4d5dda71e8aaf3 100644 --- a/src/transformers/models/whisper/modeling_tf_whisper.py +++ b/src/transformers/models/whisper/modeling_tf_whisper.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "WhisperConfig" +from ..deprecated._archive_maps import TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/whisper/modeling_whisper.py b/src/transformers/models/whisper/modeling_whisper.py index ec06a24e6528a3..ab8fe750a596dd 100644 --- a/src/transformers/models/whisper/modeling_whisper.py +++ b/src/transformers/models/whisper/modeling_whisper.py @@ -59,6 +59,9 @@ _CHECKPOINT_FOR_DOC = "openai/whisper-tiny" +from ..deprecated._archive_maps import WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.llama.modeling_llama._get_unpad_data def _get_unpad_data(attention_mask): seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32) diff --git a/src/transformers/models/x_clip/configuration_x_clip.py b/src/transformers/models/x_clip/configuration_x_clip.py index 757429d6dfe61a..7795269b7e517a 100644 --- a/src/transformers/models/x_clip/configuration_x_clip.py +++ b/src/transformers/models/x_clip/configuration_x_clip.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XCLIPTextConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`XCLIPModel`]. It is used to instantiate an X-CLIP diff --git a/src/transformers/models/x_clip/modeling_x_clip.py b/src/transformers/models/x_clip/modeling_x_clip.py index 092ea947617398..c9791fdfcc00df 100644 --- a/src/transformers/models/x_clip/modeling_x_clip.py +++ b/src/transformers/models/x_clip/modeling_x_clip.py @@ -42,6 +42,9 @@ _CHECKPOINT_FOR_DOC = "microsoft/xclip-base-patch32" +from ..deprecated._archive_maps import XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # contrastive loss function, adapted from # https://sachinruk.github.io/blog/pytorch/pytorch%20lightning/loss%20function/gpu/2021/03/07/CLIP.html def contrastive_loss(logits: torch.Tensor) -> torch.Tensor: diff --git a/src/transformers/models/xglm/configuration_xglm.py b/src/transformers/models/xglm/configuration_xglm.py index 8eebcfaee68bbb..c67c67a4b29073 100644 --- a/src/transformers/models/xglm/configuration_xglm.py +++ b/src/transformers/models/xglm/configuration_xglm.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XGLMConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`XGLMModel`]. It is used to instantiate an XGLM diff --git a/src/transformers/models/xglm/modeling_tf_xglm.py b/src/transformers/models/xglm/modeling_tf_xglm.py index 6b563b665766cc..e3003fdbc53ab6 100644 --- a/src/transformers/models/xglm/modeling_tf_xglm.py +++ b/src/transformers/models/xglm/modeling_tf_xglm.py @@ -55,6 +55,9 @@ _CONFIG_FOR_DOC = "XGLMConfig" +from ..deprecated._archive_maps import TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + LARGE_NEGATIVE = -1e8 diff --git a/src/transformers/models/xglm/modeling_xglm.py b/src/transformers/models/xglm/modeling_xglm.py index faffd6e4741138..7ec48b6f9d2461 100755 --- a/src/transformers/models/xglm/modeling_xglm.py +++ b/src/transformers/models/xglm/modeling_xglm.py @@ -37,6 +37,9 @@ _CONFIG_FOR_DOC = "XGLMConfig" +from ..deprecated._archive_maps import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + XGLM_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads diff --git a/src/transformers/models/xlm/configuration_xlm.py b/src/transformers/models/xlm/configuration_xlm.py index 2f8b5d6ef29d82..3b1dadd5657e20 100644 --- a/src/transformers/models/xlm/configuration_xlm.py +++ b/src/transformers/models/xlm/configuration_xlm.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XLMConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`XLMModel`] or a [`TFXLMModel`]. It is used to diff --git a/src/transformers/models/xlm/modeling_tf_xlm.py b/src/transformers/models/xlm/modeling_tf_xlm.py index ff5211a27cf2b1..45447a4236e118 100644 --- a/src/transformers/models/xlm/modeling_tf_xlm.py +++ b/src/transformers/models/xlm/modeling_tf_xlm.py @@ -67,6 +67,9 @@ _CONFIG_FOR_DOC = "XLMConfig" +from ..deprecated._archive_maps import TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def create_sinusoidal_embeddings(n_pos, dim, out): position_enc = np.array([[pos / np.power(10000, 2 * (j // 2) / dim) for j in range(dim)] for pos in range(n_pos)]) out[:, 0::2] = tf.constant(np.sin(position_enc[:, 0::2])) diff --git a/src/transformers/models/xlm/modeling_xlm.py b/src/transformers/models/xlm/modeling_xlm.py index c26ef80a759b77..06e621da01674d 100755 --- a/src/transformers/models/xlm/modeling_xlm.py +++ b/src/transformers/models/xlm/modeling_xlm.py @@ -54,6 +54,9 @@ _CONFIG_FOR_DOC = "XLMConfig" +from ..deprecated._archive_maps import XLM_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def create_sinusoidal_embeddings(n_pos, dim, out): position_enc = np.array([[pos / np.power(10000, 2 * (j // 2) / dim) for j in range(dim)] for pos in range(n_pos)]) out[:, 0::2] = torch.FloatTensor(np.sin(position_enc[:, 0::2])) diff --git a/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py b/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py index bfb2a898f06ae8..f1a903c227bf59 100644 --- a/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py +++ b/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XLMProphetNetConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`XLMProphetNetModel`]. It is used to instantiate a diff --git a/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py b/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py index ccba8fde5db2e8..53b8a1fc20cbb5 100644 --- a/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py +++ b/src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py @@ -45,6 +45,9 @@ _CONFIG_FOR_DOC = "XLMProphetNetConfig" +from ..deprecated._archive_maps import XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from src.transformers.models.prophetnet.modeling_prophetnet.PROPHETNET_START_DOCSTRING with ProphetNetConfig->XLMProphetNetConfig XLM_PROPHETNET_START_DOCSTRING = r""" This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py b/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py index b9e348e498e4c9..3da0fbecd609fa 100644 --- a/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/configuration_xlm_roberta.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XLMRobertaConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`XLMRobertaModel`] or a [`TFXLMRobertaModel`]. It diff --git a/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py b/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py index e700fcd0244ad5..2caffc0b905f7f 100644 --- a/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py @@ -52,6 +52,9 @@ remat = nn_partitioning.remat +from ..deprecated._archive_maps import FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.roberta.modeling_flax_roberta.create_position_ids_from_input_ids def create_position_ids_from_input_ids(input_ids, padding_idx): """ diff --git a/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py b/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py index c0ad2c7c7dfc38..3b0efe6bd700b7 100644 --- a/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/modeling_tf_xlm_roberta.py @@ -68,6 +68,9 @@ _CONFIG_FOR_DOC = "XLMRobertaConfig" +from ..deprecated._archive_maps import TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + XLM_ROBERTA_START_DOCSTRING = r""" This model inherits from [`TFPreTrainedModel`]. Check the superclass documentation for the generic methods the diff --git a/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py b/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py index 53733704d78617..0d829aaee63582 100644 --- a/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py +++ b/src/transformers/models/xlm_roberta/modeling_xlm_roberta.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "XLMRobertaConfig" +from ..deprecated._archive_maps import XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->XLMRoberta class XLMRobertaEmbeddings(nn.Module): """ diff --git a/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py b/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py index ac7b13755cfea0..23deeea7435e7f 100644 --- a/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py +++ b/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XLMRobertaXLConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`XLMRobertaXLModel`] or a [`TFXLMRobertaXLModel`]. diff --git a/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py b/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py index 5b2eeec55ef518..1c17652dfa0cb4 100644 --- a/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py +++ b/src/transformers/models/xlm_roberta_xl/modeling_xlm_roberta_xl.py @@ -51,6 +51,9 @@ _CONFIG_FOR_DOC = "XLMRobertaXLConfig" +from ..deprecated._archive_maps import XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class XLMRobertaXLEmbeddings(nn.Module): """ Same as BertEmbeddings with a tiny tweak for positional embeddings indexing. diff --git a/src/transformers/models/xlnet/configuration_xlnet.py b/src/transformers/models/xlnet/configuration_xlnet.py index 957a09dbf61958..f81c456b61df69 100644 --- a/src/transformers/models/xlnet/configuration_xlnet.py +++ b/src/transformers/models/xlnet/configuration_xlnet.py @@ -24,6 +24,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XLNetConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`XLNetModel`] or a [`TFXLNetModel`]. It is used to diff --git a/src/transformers/models/xlnet/modeling_tf_xlnet.py b/src/transformers/models/xlnet/modeling_tf_xlnet.py index f998b19bb6d3ac..188f5e39a2fba1 100644 --- a/src/transformers/models/xlnet/modeling_tf_xlnet.py +++ b/src/transformers/models/xlnet/modeling_tf_xlnet.py @@ -61,6 +61,9 @@ _CONFIG_FOR_DOC = "XLNetConfig" +from ..deprecated._archive_maps import TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + class TFXLNetRelativeAttention(keras.layers.Layer): def __init__(self, config, **kwargs): super().__init__(**kwargs) diff --git a/src/transformers/models/xlnet/modeling_xlnet.py b/src/transformers/models/xlnet/modeling_xlnet.py index 7d04fe8cfa1b2d..78ca545751a4af 100755 --- a/src/transformers/models/xlnet/modeling_xlnet.py +++ b/src/transformers/models/xlnet/modeling_xlnet.py @@ -44,6 +44,9 @@ _CONFIG_FOR_DOC = "XLNetConfig" +from ..deprecated._archive_maps import XLNET_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + def build_tf_xlnet_to_pytorch_map(model, config, tf_weights=None): """ A map of modules from TF to PyTorch. I use a map to keep the PyTorch model as identical to the original PyTorch diff --git a/src/transformers/models/xmod/configuration_xmod.py b/src/transformers/models/xmod/configuration_xmod.py index 4ca52652513b3e..21eb9ba2ea2f7d 100644 --- a/src/transformers/models/xmod/configuration_xmod.py +++ b/src/transformers/models/xmod/configuration_xmod.py @@ -25,6 +25,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class XmodConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`XmodModel`]. It is used to instantiate an X-MOD diff --git a/src/transformers/models/xmod/modeling_xmod.py b/src/transformers/models/xmod/modeling_xmod.py index 2aa07ed48b44cd..2bf76a40d46974 100644 --- a/src/transformers/models/xmod/modeling_xmod.py +++ b/src/transformers/models/xmod/modeling_xmod.py @@ -42,6 +42,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import XMOD_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + # Copied from transformers.models.roberta.modeling_roberta.RobertaEmbeddings with Roberta->Xmod class XmodEmbeddings(nn.Module): """ diff --git a/src/transformers/models/yolos/configuration_yolos.py b/src/transformers/models/yolos/configuration_yolos.py index 2493403b4f375e..098210f1a732e2 100644 --- a/src/transformers/models/yolos/configuration_yolos.py +++ b/src/transformers/models/yolos/configuration_yolos.py @@ -27,6 +27,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class YolosConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`YolosModel`]. It is used to instantiate a YOLOS diff --git a/src/transformers/models/yolos/modeling_yolos.py b/src/transformers/models/yolos/modeling_yolos.py index 88d2497a1ea51d..864be38a7d786b 100755 --- a/src/transformers/models/yolos/modeling_yolos.py +++ b/src/transformers/models/yolos/modeling_yolos.py @@ -63,6 +63,9 @@ _EXPECTED_OUTPUT_SHAPE = [1, 3401, 384] +from ..deprecated._archive_maps import YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + @dataclass class YolosObjectDetectionOutput(ModelOutput): """ diff --git a/src/transformers/models/yoso/configuration_yoso.py b/src/transformers/models/yoso/configuration_yoso.py index 906856fa5d711d..fe2d4d4403780a 100644 --- a/src/transformers/models/yoso/configuration_yoso.py +++ b/src/transformers/models/yoso/configuration_yoso.py @@ -21,6 +21,9 @@ logger = logging.get_logger(__name__) +from ..deprecated._archive_maps import YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402 + + class YosoConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`YosoModel`]. It is used to instantiate an YOSO diff --git a/src/transformers/models/yoso/modeling_yoso.py b/src/transformers/models/yoso/modeling_yoso.py index d75d3f9aa1887c..b1fed0acc468df 100644 --- a/src/transformers/models/yoso/modeling_yoso.py +++ b/src/transformers/models/yoso/modeling_yoso.py @@ -52,6 +52,9 @@ _CONFIG_FOR_DOC = "YosoConfig" +from ..deprecated._archive_maps import YOSO_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + + lsh_cumulation = None diff --git a/src/transformers/utils/dummy_flax_objects.py b/src/transformers/utils/dummy_flax_objects.py index 627daa228c73d6..281ddf56a99450 100644 --- a/src/transformers/utils/dummy_flax_objects.py +++ b/src/transformers/utils/dummy_flax_objects.py @@ -1353,6 +1353,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) +FLAX_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FlaxXLMRobertaForCausalLM(metaclass=DummyObject): _backends = ["flax"] diff --git a/src/transformers/utils/dummy_pt_objects.py b/src/transformers/utils/dummy_pt_objects.py index ee3f2401f6bbe0..97d134c3412686 100644 --- a/src/transformers/utils/dummy_pt_objects.py +++ b/src/transformers/utils/dummy_pt_objects.py @@ -415,6 +415,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class AlbertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -475,6 +478,9 @@ def load_tf_weights_in_albert(*args, **kwargs): requires_backends(load_tf_weights_in_albert, ["torch"]) +ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class AlignModel(metaclass=DummyObject): _backends = ["torch"] @@ -503,6 +509,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class AltCLIPModel(metaclass=DummyObject): _backends = ["torch"] @@ -531,6 +540,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ASTForAudioClassification(metaclass=DummyObject): _backends = ["torch"] @@ -944,6 +956,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class AutoformerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -965,6 +980,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BARK_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BarkCausalModel(metaclass=DummyObject): _backends = ["torch"] @@ -1007,6 +1025,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BART_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BartForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1063,6 +1084,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BeitBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -1105,6 +1129,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -1211,6 +1238,9 @@ def load_tf_weights_in_bert_generation(*args, **kwargs): requires_backends(load_tf_weights_in_bert_generation, ["torch"]) +BIG_BIRD_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BigBirdForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1285,6 +1315,9 @@ def load_tf_weights_in_big_bird(*args, **kwargs): requires_backends(load_tf_weights_in_big_bird, ["torch"]) +BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BigBirdPegasusForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1327,6 +1360,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BioGptForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1362,6 +1398,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BitBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -1390,6 +1429,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BlenderbotForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1418,6 +1460,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BLENDERBOT_SMALL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BlenderbotSmallForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1446,6 +1491,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BlipForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -1495,6 +1543,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Blip2ForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -1530,6 +1581,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BloomForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1572,6 +1626,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BridgeTowerForContrastiveLearning(metaclass=DummyObject): _backends = ["torch"] @@ -1607,6 +1664,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +BROS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class BrosForTokenClassification(metaclass=DummyObject): _backends = ["torch"] @@ -1649,6 +1709,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CamembertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1705,6 +1768,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CANINE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CanineForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -1758,6 +1824,9 @@ def load_tf_weights_in_canine(*args, **kwargs): requires_backends(load_tf_weights_in_canine, ["torch"]) +CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ChineseCLIPModel(metaclass=DummyObject): _backends = ["torch"] @@ -1786,6 +1855,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CLAP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ClapAudioModel(metaclass=DummyObject): _backends = ["torch"] @@ -1835,6 +1907,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CLIPForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -1884,6 +1959,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CLIPSEG_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CLIPSegForImageSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -1919,6 +1997,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CLVP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ClvpDecoder(metaclass=DummyObject): _backends = ["torch"] @@ -1961,6 +2042,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CODEGEN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CodeGenForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -1982,6 +2066,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ConditionalDetrForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2010,6 +2097,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ConvBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -2070,6 +2160,9 @@ def load_tf_weights_in_convbert(*args, **kwargs): requires_backends(load_tf_weights_in_convbert, ["torch"]) +CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ConvNextBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -2098,6 +2191,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ConvNextV2Backbone(metaclass=DummyObject): _backends = ["torch"] @@ -2126,6 +2222,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CPMANT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CpmAntForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -2147,6 +2246,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CTRLForSequenceClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2175,6 +2277,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +CVT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class CvtForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2196,6 +2301,15 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Data2VecAudioForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2322,6 +2436,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DebertaForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -2364,6 +2481,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DebertaV2ForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -2413,6 +2533,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DecisionTransformerGPT2Model(metaclass=DummyObject): _backends = ["torch"] @@ -2441,6 +2564,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DEFORMABLE_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DeformableDetrForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2462,6 +2588,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DeiTForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2497,6 +2626,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MCTCTForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -2567,6 +2699,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RetriBertModel(metaclass=DummyObject): _backends = ["torch"] @@ -2581,6 +2716,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +TRAJECTORY_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TrajectoryTransformerModel(metaclass=DummyObject): _backends = ["torch"] @@ -2595,6 +2733,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class AdaptiveEmbedding(metaclass=DummyObject): _backends = ["torch"] @@ -2634,6 +2775,9 @@ def load_tf_weights_in_transfo_xl(*args, **kwargs): requires_backends(load_tf_weights_in_transfo_xl, ["torch"]) +VAN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VanForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2655,6 +2799,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DEPTH_ANYTHING_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DepthAnythingForDepthEstimation(metaclass=DummyObject): _backends = ["torch"] @@ -2669,6 +2816,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DETA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DetaForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2690,6 +2840,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DetrForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -2718,6 +2871,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DINAT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DinatBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -2746,6 +2902,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DINOV2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Dinov2Backbone(metaclass=DummyObject): _backends = ["torch"] @@ -2774,6 +2933,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DistilBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -2823,6 +2985,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DonutSwinModel(metaclass=DummyObject): _backends = ["torch"] @@ -2837,6 +3002,15 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DPRContextEncoder(metaclass=DummyObject): _backends = ["torch"] @@ -2886,6 +3060,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +DPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class DPTForDepthEstimation(metaclass=DummyObject): _backends = ["torch"] @@ -2914,6 +3091,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class EfficientFormerForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2942,6 +3122,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class EfficientNetForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -2963,6 +3146,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ElectraForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3030,6 +3216,9 @@ def load_tf_weights_in_electra(*args, **kwargs): requires_backends(load_tf_weights_in_electra, ["torch"]) +ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class EncodecModel(metaclass=DummyObject): _backends = ["torch"] @@ -3051,6 +3240,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ErnieForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3121,6 +3313,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ErnieMForInformationExtraction(metaclass=DummyObject): _backends = ["torch"] @@ -3170,6 +3365,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ESM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class EsmFoldPreTrainedModel(metaclass=DummyObject): _backends = ["torch"] @@ -3219,6 +3417,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +FALCON_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FalconForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3261,6 +3462,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +FASTSPEECH2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FastSpeech2ConformerHifiGan(metaclass=DummyObject): _backends = ["torch"] @@ -3289,6 +3493,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FlaubertForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -3345,6 +3552,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +FLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FlavaForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -3394,6 +3604,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +FNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FNetForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -3464,6 +3677,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FocalNetBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -3520,6 +3736,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class FunnelBaseModel(metaclass=DummyObject): _backends = ["torch"] @@ -3629,6 +3848,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GitForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3657,6 +3879,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GLPN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GLPNForDepthEstimation(metaclass=DummyObject): _backends = ["torch"] @@ -3678,6 +3903,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GPT2DoubleHeadsModel(metaclass=DummyObject): _backends = ["torch"] @@ -3731,6 +3959,9 @@ def load_tf_weights_in_gpt2(*args, **kwargs): requires_backends(load_tf_weights_in_gpt2, ["torch"]) +GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GPTBigCodeForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3766,6 +3997,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GPTNeoForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3812,6 +4046,9 @@ def load_tf_weights_in_gpt_neo(*args, **kwargs): requires_backends(load_tf_weights_in_gpt_neo, ["torch"]) +GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GPTNeoXForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3861,6 +4098,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GPTNeoXJapaneseForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3889,6 +4129,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GPTJForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -3924,6 +4167,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GPTSAN_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GPTSanJapaneseForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -3945,6 +4191,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GraphormerForGraphClassification(metaclass=DummyObject): _backends = ["torch"] @@ -3966,6 +4215,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class GroupViTModel(metaclass=DummyObject): _backends = ["torch"] @@ -3994,6 +4246,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class HubertForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -4022,6 +4277,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +IBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class IBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -4071,6 +4329,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +IDEFICS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class IdeficsForVisionText2Text(metaclass=DummyObject): _backends = ["torch"] @@ -4099,6 +4360,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ImageGPTForCausalImageModeling(metaclass=DummyObject): _backends = ["torch"] @@ -4131,6 +4395,9 @@ def load_tf_weights_in_imagegpt(*args, **kwargs): requires_backends(load_tf_weights_in_imagegpt, ["torch"]) +INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class InformerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -4152,6 +4419,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class InstructBlipForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4180,6 +4450,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class JukeboxModel(metaclass=DummyObject): _backends = ["torch"] @@ -4208,6 +4481,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +KOSMOS2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Kosmos2ForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4229,6 +4505,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LayoutLMForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -4271,6 +4550,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LayoutLMv2ForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -4306,6 +4588,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LayoutLMv3ForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -4341,6 +4626,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LED_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LEDForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4376,6 +4664,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LevitForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -4404,6 +4695,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LILT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LiltForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -4474,6 +4768,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LlavaForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4498,6 +4795,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LongformerForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -4554,6 +4854,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LONGT5_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LongT5EncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -4582,6 +4885,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +LUKE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class LukeForEntityClassification(metaclass=DummyObject): _backends = ["torch"] @@ -4701,6 +5007,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class M2M100ForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -4722,6 +5031,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MambaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -4764,6 +5076,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MarkupLMForQuestionAnswering(metaclass=DummyObject): _backends = ["torch"] @@ -4799,6 +5114,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Mask2FormerForUniversalSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -4820,6 +5138,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MaskFormerForInstanceSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -4890,6 +5211,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MEGA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MegaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -4946,6 +5270,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MegatronBertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5016,6 +5343,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MgpstrForSceneTextRecognition(metaclass=DummyObject): _backends = ["torch"] @@ -5093,6 +5423,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MobileBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5167,6 +5500,9 @@ def load_tf_weights_in_mobilebert(*args, **kwargs): requires_backends(load_tf_weights_in_mobilebert, ["torch"]) +MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MobileNetV1ForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5192,6 +5528,9 @@ def load_tf_weights_in_mobilenet_v1(*args, **kwargs): requires_backends(load_tf_weights_in_mobilenet_v1, ["torch"]) +MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MobileNetV2ForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5224,6 +5563,9 @@ def load_tf_weights_in_mobilenet_v2(*args, **kwargs): requires_backends(load_tf_weights_in_mobilenet_v2, ["torch"]) +MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MobileViTForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5252,6 +5594,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MobileViTV2ForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -5280,6 +5625,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MPNetForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5336,6 +5684,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MptForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5378,6 +5729,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MRA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MraForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5476,6 +5830,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MusicgenForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5511,6 +5868,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MVP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class MvpForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5553,6 +5913,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +NAT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class NatBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -5581,6 +5944,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class NezhaForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5644,6 +6010,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class NllbMoeForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -5679,6 +6048,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class NystromformerForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -5735,6 +6107,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ONEFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class OneFormerForUniversalSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -5756,6 +6131,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class OpenAIGPTDoubleHeadsModel(metaclass=DummyObject): _backends = ["torch"] @@ -5795,6 +6173,9 @@ def load_tf_weights_in_openai_gpt(*args, **kwargs): requires_backends(load_tf_weights_in_openai_gpt, ["torch"]) +OPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class OPTForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -5830,6 +6211,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +OWLV2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Owlv2ForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -5865,6 +6249,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class OwlViTForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -5900,6 +6287,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PATCHTSMIXER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PatchTSMixerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -5942,6 +6332,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PATCHTST_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PatchTSTForClassification(metaclass=DummyObject): _backends = ["torch"] @@ -6012,6 +6405,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PegasusXForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -6033,6 +6429,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PerceiverForImageClassificationConvProcessing(metaclass=DummyObject): _backends = ["torch"] @@ -6131,6 +6530,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PHI_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PhiForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6166,6 +6568,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Pix2StructForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -6194,6 +6599,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PLBART_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PLBartForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6229,6 +6637,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PoolFormerForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -6250,6 +6661,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +POP2PIANO_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Pop2PianoForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -6264,6 +6678,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ProphetNetDecoder(metaclass=DummyObject): _backends = ["torch"] @@ -6306,6 +6723,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +PVT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class PvtForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -6491,6 +6911,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +REALM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RealmEmbedder(metaclass=DummyObject): _backends = ["torch"] @@ -6544,6 +6967,9 @@ def load_tf_weights_in_realm(*args, **kwargs): requires_backends(load_tf_weights_in_realm, ["torch"]) +REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ReformerAttention(metaclass=DummyObject): _backends = ["torch"] @@ -6600,6 +7026,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RegNetForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -6621,6 +7050,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RemBertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6688,6 +7120,9 @@ def load_tf_weights_in_rembert(*args, **kwargs): requires_backends(load_tf_weights_in_rembert, ["torch"]) +RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ResNetBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -6716,6 +7151,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RobertaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6772,6 +7210,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RobertaPreLayerNormForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6828,6 +7269,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +ROC_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RoCBertForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6902,6 +7346,9 @@ def load_tf_weights_in_roc_bert(*args, **kwargs): requires_backends(load_tf_weights_in_roc_bert, ["torch"]) +ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RoFormerForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6969,6 +7416,9 @@ def load_tf_weights_in_roformer(*args, **kwargs): requires_backends(load_tf_weights_in_roformer, ["torch"]) +RWKV_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class RwkvForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -6990,6 +7440,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SAM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SamModel(metaclass=DummyObject): _backends = ["torch"] @@ -7004,6 +7457,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SEAMLESS_M4T_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SeamlessM4TCodeHifiGan(metaclass=DummyObject): _backends = ["torch"] @@ -7074,6 +7530,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SEAMLESS_M4T_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SeamlessM4Tv2ForSpeechToSpeech(metaclass=DummyObject): _backends = ["torch"] @@ -7116,6 +7575,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SegformerDecodeHead(metaclass=DummyObject): _backends = ["torch"] @@ -7158,6 +7620,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SEGGPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SegGptForImageSegmentation(metaclass=DummyObject): _backends = ["torch"] @@ -7179,6 +7644,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SEW_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SEWForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -7207,6 +7675,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SEWDForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -7235,6 +7706,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SIGLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SiglipForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -7277,6 +7751,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Speech2TextForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -7312,6 +7789,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SPEECHT5_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SpeechT5ForSpeechToSpeech(metaclass=DummyObject): _backends = ["torch"] @@ -7354,6 +7834,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SplinterForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -7389,6 +7872,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SqueezeBertForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -7501,6 +7987,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SwiftFormerForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -7522,6 +8011,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SwinBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -7557,6 +8049,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Swin2SRForImageSuperResolution(metaclass=DummyObject): _backends = ["torch"] @@ -7578,6 +8073,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Swinv2Backbone(metaclass=DummyObject): _backends = ["torch"] @@ -7613,6 +8111,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class SwitchTransformersEncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -7655,6 +8156,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +T5_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class T5EncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -7708,6 +8212,9 @@ def load_tf_weights_in_t5(*args, **kwargs): requires_backends(load_tf_weights_in_t5, ["torch"]) +TABLE_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TableTransformerForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -7729,6 +8236,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TapasForMaskedLM(metaclass=DummyObject): _backends = ["torch"] @@ -7768,6 +8278,9 @@ def load_tf_weights_in_tapas(*args, **kwargs): requires_backends(load_tf_weights_in_tapas, ["torch"]) +TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TimeSeriesTransformerForPrediction(metaclass=DummyObject): _backends = ["torch"] @@ -7789,6 +8302,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TimesformerForVideoClassification(metaclass=DummyObject): _backends = ["torch"] @@ -7817,6 +8333,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +TROCR_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TrOCRForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -7831,6 +8350,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +TVLT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TvltForAudioVisualClassification(metaclass=DummyObject): _backends = ["torch"] @@ -7859,6 +8381,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +TVP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TvpForVideoGrounding(metaclass=DummyObject): _backends = ["torch"] @@ -7880,6 +8405,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +UDOP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class UdopEncoderModel(metaclass=DummyObject): _backends = ["torch"] @@ -7957,6 +8485,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class UniSpeechForCTC(metaclass=DummyObject): _backends = ["torch"] @@ -7992,6 +8523,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class UniSpeechSatForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8041,6 +8575,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +UNIVNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class UnivNetModel(metaclass=DummyObject): _backends = ["torch"] @@ -8062,6 +8599,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VideoMAEForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -8090,6 +8630,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VILT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ViltForImageAndTextRetrieval(metaclass=DummyObject): _backends = ["torch"] @@ -8146,6 +8689,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VIPLLAVA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VipLlavaForConditionalGeneration(metaclass=DummyObject): _backends = ["torch"] @@ -8174,6 +8720,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VisualBertForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -8230,6 +8779,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ViTForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8258,6 +8810,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VIT_HYBRID_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ViTHybridForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8279,6 +8834,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ViTMAEForPreTraining(metaclass=DummyObject): _backends = ["torch"] @@ -8307,6 +8865,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class ViTMSNForImageClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8328,6 +8889,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VITDET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VitDetBackbone(metaclass=DummyObject): _backends = ["torch"] @@ -8349,6 +8913,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VITMATTE_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VitMatteForImageMatting(metaclass=DummyObject): _backends = ["torch"] @@ -8363,6 +8930,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VITS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VitsModel(metaclass=DummyObject): _backends = ["torch"] @@ -8377,6 +8947,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class VivitForVideoClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8398,6 +8971,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Wav2Vec2ForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8454,6 +9030,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +WAV2VEC2_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Wav2Vec2BertForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8496,6 +9075,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class Wav2Vec2ConformerForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8545,6 +9127,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class WavLMForAudioFrameClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8587,6 +9172,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class WhisperForAudioClassification(metaclass=DummyObject): _backends = ["torch"] @@ -8622,6 +9210,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XCLIPModel(metaclass=DummyObject): _backends = ["torch"] @@ -8650,6 +9241,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XGLMForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -8671,6 +9265,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +XLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XLMForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -8727,6 +9324,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XLMProphetNetDecoder(metaclass=DummyObject): _backends = ["torch"] @@ -8769,6 +9369,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XLMRobertaForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -8825,6 +9428,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XLMRobertaXLForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -8881,6 +9487,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XLNetForMultipleChoice(metaclass=DummyObject): _backends = ["torch"] @@ -8941,6 +9550,9 @@ def load_tf_weights_in_xlnet(*args, **kwargs): requires_backends(load_tf_weights_in_xlnet, ["torch"]) +XMOD_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class XmodForCausalLM(metaclass=DummyObject): _backends = ["torch"] @@ -8997,6 +9609,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class YolosForObjectDetection(metaclass=DummyObject): _backends = ["torch"] @@ -9018,6 +9633,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +YOSO_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class YosoForMaskedLM(metaclass=DummyObject): _backends = ["torch"] diff --git a/src/transformers/utils/dummy_tf_objects.py b/src/transformers/utils/dummy_tf_objects.py index 15986b567d4b2b..5441883b85a463 100644 --- a/src/transformers/utils/dummy_tf_objects.py +++ b/src/transformers/utils/dummy_tf_objects.py @@ -167,6 +167,9 @@ def shape_list(*args, **kwargs): requires_backends(shape_list, ["tf"]) +TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFAlbertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -478,6 +481,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFBertEmbeddings(metaclass=DummyObject): _backends = ["tf"] @@ -604,6 +610,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFBlipForConditionalGeneration(metaclass=DummyObject): _backends = ["tf"] @@ -653,6 +662,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFCamembertForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -709,6 +721,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFCLIPModel(metaclass=DummyObject): _backends = ["tf"] @@ -737,6 +752,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFConvBertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -835,6 +853,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFCTRLForSequenceClassification(metaclass=DummyObject): _backends = ["tf"] @@ -863,6 +884,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFCvtForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -912,6 +936,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFDebertaForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -954,6 +981,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFDebertaV2ForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1003,6 +1033,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFDeiTForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -1038,6 +1071,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFAdaptiveEmbedding(metaclass=DummyObject): _backends = ["tf"] @@ -1080,6 +1116,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFDistilBertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1136,6 +1175,15 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFDPRContextEncoder(metaclass=DummyObject): _backends = ["tf"] @@ -1178,6 +1226,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFEfficientFormerForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -1206,6 +1257,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFElectraForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1269,6 +1323,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +ESM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFEsmForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1304,6 +1361,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFFlaubertForMultipleChoice(metaclass=DummyObject): _backends = ["tf"] @@ -1353,6 +1413,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFFunnelBaseModel(metaclass=DummyObject): _backends = ["tf"] @@ -1416,6 +1479,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFGPT2DoubleHeadsModel(metaclass=DummyObject): _backends = ["tf"] @@ -1493,6 +1559,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFGroupViTModel(metaclass=DummyObject): _backends = ["tf"] @@ -1521,6 +1590,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFHubertForCTC(metaclass=DummyObject): _backends = ["tf"] @@ -1542,6 +1614,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFLayoutLMForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1591,6 +1666,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFLayoutLMv3ForQuestionAnswering(metaclass=DummyObject): _backends = ["tf"] @@ -1647,6 +1725,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFLongformerForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1703,6 +1784,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFLxmertForPreTraining(metaclass=DummyObject): _backends = ["tf"] @@ -1780,6 +1864,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFMobileBertForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1850,6 +1937,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFMobileViTForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -1878,6 +1968,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFMPNetForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -1955,6 +2048,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFOpenAIGPTDoubleHeadsModel(metaclass=DummyObject): _backends = ["tf"] @@ -2067,6 +2163,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFRegNetForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -2088,6 +2187,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFRemBertForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2151,6 +2253,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFResNetForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -2172,6 +2277,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFRobertaForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2235,6 +2343,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_ROBERTA_PRELAYERNORM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFRobertaPreLayerNormForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2298,6 +2409,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_ROFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFRoFormerForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2361,6 +2475,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFSamModel(metaclass=DummyObject): _backends = ["tf"] @@ -2375,6 +2492,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFSegformerDecodeHead(metaclass=DummyObject): _backends = ["tf"] @@ -2410,6 +2530,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFSpeech2TextForConditionalGeneration(metaclass=DummyObject): _backends = ["tf"] @@ -2431,6 +2554,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFSwinForImageClassification(metaclass=DummyObject): _backends = ["tf"] @@ -2459,6 +2585,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFT5EncoderModel(metaclass=DummyObject): _backends = ["tf"] @@ -2487,6 +2616,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFTapasForMaskedLM(metaclass=DummyObject): _backends = ["tf"] @@ -2578,6 +2710,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFWav2Vec2ForCTC(metaclass=DummyObject): _backends = ["tf"] @@ -2606,6 +2741,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFWhisperForConditionalGeneration(metaclass=DummyObject): _backends = ["tf"] @@ -2627,6 +2765,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFXGLMForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2648,6 +2789,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFXLMForMultipleChoice(metaclass=DummyObject): _backends = ["tf"] @@ -2704,6 +2848,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_XLM_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFXLMRobertaForCausalLM(metaclass=DummyObject): _backends = ["tf"] @@ -2760,6 +2907,9 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["tf"]) +TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST = None + + class TFXLNetForMultipleChoice(metaclass=DummyObject): _backends = ["tf"] diff --git a/tests/models/bloom/test_tokenization_bloom.py b/tests/models/bloom/test_tokenization_bloom.py index 4fbfcb8923ee0b..fec0f83af90bdb 100644 --- a/tests/models/bloom/test_tokenization_bloom.py +++ b/tests/models/bloom/test_tokenization_bloom.py @@ -132,13 +132,6 @@ def test_encodings_from_xnli_dataset(self): predicted_text = [tokenizer.decode(x, clean_up_tokenization_spaces=False) for x in output_tokens] self.assertListEqual(predicted_text, input_text) - def test_pretrained_model_lists(self): - # The test has to be overriden because BLOOM uses ALiBi positional embeddings that does not have - # any sequence length constraints. This test of the parent class will fail since it relies on the - # maximum sequence length of the positoonal embeddings. - self.assertGreaterEqual(len(self.tokenizer_class.pretrained_vocab_files_map), 1) - self.assertGreaterEqual(len(list(self.tokenizer_class.pretrained_vocab_files_map.values())[0]), 1) - @require_jinja def test_tokenization_for_chat(self): tokenizer = self.get_rust_tokenizer() diff --git a/tests/models/byt5/test_tokenization_byt5.py b/tests/models/byt5/test_tokenization_byt5.py index bfc36070b2ada3..3793241d7e1a7d 100644 --- a/tests/models/byt5/test_tokenization_byt5.py +++ b/tests/models/byt5/test_tokenization_byt5.py @@ -300,10 +300,6 @@ def test_decode_single_bytes(self): self.assertTrue(tokenizer.decode([255]) == "") - # tokenizer can be instantiated without any pretrained files, so no need for pretrained tokenizer list - def test_pretrained_model_lists(self): - pass - # tokenizer does not have vocabulary def test_get_vocab(self): pass diff --git a/tests/models/canine/test_tokenization_canine.py b/tests/models/canine/test_tokenization_canine.py index eb3e6d9b4af4c9..ec987f6dd64afb 100644 --- a/tests/models/canine/test_tokenization_canine.py +++ b/tests/models/canine/test_tokenization_canine.py @@ -320,10 +320,6 @@ def test_np_encode_plus_sent_to_model(self): def test_torch_encode_plus_sent_to_model(self): pass - # tokenizer can be instantiated without any pretrained files, so no need for pretrained tokenizer list - def test_pretrained_model_lists(self): - pass - # tokenizer does not have vocabulary def test_get_vocab(self): pass diff --git a/tests/models/gemma/test_tokenization_gemma.py b/tests/models/gemma/test_tokenization_gemma.py index 5e485da491f8fd..0e1fe54e355583 100644 --- a/tests/models/gemma/test_tokenization_gemma.py +++ b/tests/models/gemma/test_tokenization_gemma.py @@ -153,10 +153,6 @@ def test_pickle_subword_regularization_tokenizer(self): def test_subword_regularization_tokenizer(self): pass - @unittest.skip("This test will be removed from main @LysandreJik") - def test_pretrained_model_lists(self): - pass - @unittest.skip("Skipping") def test_torch_encode_plus_sent_to_model(self): pass diff --git a/tests/models/m2m_100/test_tokenization_m2m_100.py b/tests/models/m2m_100/test_tokenization_m2m_100.py index ced6cf13dea375..76cadf2f3bc3e0 100644 --- a/tests/models/m2m_100/test_tokenization_m2m_100.py +++ b/tests/models/m2m_100/test_tokenization_m2m_100.py @@ -94,10 +94,6 @@ def test_get_vocab(self): # The length of the vocab keys can be different # self.assertEqual(len(vocab_keys), tokenizer.vocab_size) - @unittest.skip("Skip this test while all models are still to be uploaded.") - def test_pretrained_model_lists(self): - pass - def test_full_tokenizer(self): tokenizer = self.get_tokenizer() diff --git a/tests/models/perceiver/test_tokenization_perceiver.py b/tests/models/perceiver/test_tokenization_perceiver.py index b5d149e5f29fb8..ff2b6e68dcc0c5 100644 --- a/tests/models/perceiver/test_tokenization_perceiver.py +++ b/tests/models/perceiver/test_tokenization_perceiver.py @@ -270,10 +270,6 @@ def test_decode_invalid_byte_id(self): tokenizer = self.perceiver_tokenizer self.assertEqual(tokenizer.decode([178]), "�") - # tokenizer can be instantiated without any pretrained files, so no need for pretrained tokenizer list - def test_pretrained_model_lists(self): - pass - # tokenizer does not have vocabulary def test_get_vocab(self): pass diff --git a/tests/models/siglip/test_tokenization_siglip.py b/tests/models/siglip/test_tokenization_siglip.py index fb3cb5b3f10400..839c0c32002ddc 100644 --- a/tests/models/siglip/test_tokenization_siglip.py +++ b/tests/models/siglip/test_tokenization_siglip.py @@ -348,14 +348,6 @@ def test_sentencepiece_tokenize_and_convert_tokens_to_string(self): special_tokens_string_rust = rust_tokenizer.convert_tokens_to_string(special_tokens) self.assertEqual(special_tokens_string, special_tokens_string_rust) - # overwritten from `test_tokenization_common` since Siglip has no max length - # Copied from tests.models.t5.test_tokenization_t5.T5TokenizationTest.test_pretrained_model_lists with T5->Siglip - def test_pretrained_model_lists(self): - # We should have at least one default checkpoint for each tokenizer - # We should specify the max input length as well (used in some part to list the pretrained checkpoints) - self.assertGreaterEqual(len(self.tokenizer_class.pretrained_vocab_files_map), 1) - self.assertGreaterEqual(len(list(self.tokenizer_class.pretrained_vocab_files_map.values())[0]), 1) - @slow def test_tokenizer_integration(self): tokenizer = SiglipTokenizer.from_pretrained("google/siglip-base-patch16-224") diff --git a/tests/models/t5/test_tokenization_t5.py b/tests/models/t5/test_tokenization_t5.py index 388388ff238861..e8716a79e9c744 100644 --- a/tests/models/t5/test_tokenization_t5.py +++ b/tests/models/t5/test_tokenization_t5.py @@ -362,12 +362,6 @@ def test_special_tokens_initialization_with_non_empty_additional_special_tokens( ) # overwritten from `test_tokenization_common` since T5 has no max length - def test_pretrained_model_lists(self): - # We should have at least one default checkpoint for each tokenizer - # We should specify the max input length as well (used in some part to list the pretrained checkpoints) - self.assertGreaterEqual(len(self.tokenizer_class.pretrained_vocab_files_map), 1) - self.assertGreaterEqual(len(list(self.tokenizer_class.pretrained_vocab_files_map.values())[0]), 1) - @slow def test_tokenizer_integration(self): expected_encoding = {'input_ids': [[31220, 7, 41, 14034, 801, 38, 3, 102, 63, 17, 127, 524, 18, 7031, 2032, 277, 11, 3, 102, 63, 17, 127, 524, 18, 2026, 17, 10761, 18, 7041, 61, 795, 879, 18, 19681, 4648, 7, 41, 12920, 382, 6, 350, 6383, 4949, 6, 2158, 12920, 382, 9, 6, 3, 4, 11160, 6, 2043, 17153, 279, 49, 17, 6, 3, 4, 434, 9688, 11439, 21, 6869, 10509, 17725, 41, 567, 9138, 61, 11, 6869, 10509, 11946, 41, 18207, 517, 61, 28, 147, 3538, 1220, 7140, 10761, 2250, 16, 910, 1220, 8024, 11, 1659, 1413, 32, 883, 2020, 344, 2215, 226, 6, 12901, 382, 127, 524, 11, 4738, 7, 127, 15390, 5, 1], [272, 24203, 19, 876, 12, 554, 18, 9719, 1659, 2647, 26352, 6497, 7, 45, 73, 9339, 400, 26, 1499, 57, 22801, 10760, 30, 321, 646, 11, 269, 2625, 16, 66, 7500, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [37, 1704, 4216, 3, 20400, 4418, 7, 147, 8, 19743, 1782, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], 'attention_mask': [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]} # fmt: skip diff --git a/tests/models/tapas/test_tokenization_tapas.py b/tests/models/tapas/test_tokenization_tapas.py index 4100e02b136c97..8f2bf9bb69d333 100644 --- a/tests/models/tapas/test_tokenization_tapas.py +++ b/tests/models/tapas/test_tokenization_tapas.py @@ -1268,10 +1268,6 @@ def test_full_tokenizer(self): self.assertListEqual(column_ids.tolist(), expected_results["column_ids"]) self.assertListEqual(row_ids.tolist(), expected_results["row_ids"]) - @unittest.skip("Skip this test while all models are still to be uploaded.") - def test_pretrained_model_lists(self): - pass - @unittest.skip("Doesn't support another framework than PyTorch") def test_np_encode_plus_sent_to_model(self): pass diff --git a/tests/models/udop/test_tokenization_udop.py b/tests/models/udop/test_tokenization_udop.py index 0519ee062237f7..720eb09952140d 100644 --- a/tests/models/udop/test_tokenization_udop.py +++ b/tests/models/udop/test_tokenization_udop.py @@ -1726,10 +1726,6 @@ def test_batch_encode_dynamic_overflowing(self): def test_alignement_methods(self): pass - @unittest.skip("#TODO will be removed in main") - def test_pretrained_model_lists(self): - pass - @unittest.skip("UDOP tokenizer requires boxes besides sequences.") def test_maximum_encoding_length_pair_input(self): pass diff --git a/tests/models/wav2vec2/test_tokenization_wav2vec2.py b/tests/models/wav2vec2/test_tokenization_wav2vec2.py index 44e328ac80325f..05109f973612e4 100644 --- a/tests/models/wav2vec2/test_tokenization_wav2vec2.py +++ b/tests/models/wav2vec2/test_tokenization_wav2vec2.py @@ -702,10 +702,6 @@ def test_offsets_integration(self): self.assertListEqual(expected_word_time_stamps_start, word_time_stamps_start) self.assertListEqual(expected_word_time_stamps_end, word_time_stamps_end) - def test_pretrained_model_lists(self): - # Wav2Vec2Model has no max model length => no testing - pass - # overwrite from test_tokenization_common def test_add_tokens_tokenizer(self): tokenizers = self.get_tokenizers(do_lower_case=False) diff --git a/tests/models/wav2vec2_phoneme/test_tokenization_wav2vec2_phoneme.py b/tests/models/wav2vec2_phoneme/test_tokenization_wav2vec2_phoneme.py index 56e38f2cf5d738..ea81c88ede2ee0 100644 --- a/tests/models/wav2vec2_phoneme/test_tokenization_wav2vec2_phoneme.py +++ b/tests/models/wav2vec2_phoneme/test_tokenization_wav2vec2_phoneme.py @@ -337,10 +337,6 @@ def test_internal_consistency(self): pass @unittest.skip("Wav2Vec2PhonemeModel has no max model length => no testing") - def test_pretrained_model_lists(self): - pass - - # overwrite common def test_add_tokens_tokenizer(self): tokenizers = self.get_tokenizers(do_lower_case=False) for tokenizer in tokenizers: diff --git a/tests/test_tokenization_common.py b/tests/test_tokenization_common.py index 8216db084cb5f7..4ff17ab5573a9c 100644 --- a/tests/test_tokenization_common.py +++ b/tests/test_tokenization_common.py @@ -1023,24 +1023,6 @@ def test_encode_decode_with_spaces(self): decoded = tokenizer.decode(encoded, spaces_between_special_tokens=False) self.assertIn(decoded, ["[ABC][SAMPLE][DEF]", "[ABC][SAMPLE][DEF]".lower()]) - def test_pretrained_model_lists(self): - # We should have at least one default checkpoint for each tokenizer - # We should specify the max input length as well (used in some part to list the pretrained checkpoints) - self.assertGreaterEqual(len(self.tokenizer_class.pretrained_vocab_files_map), 1) - self.assertGreaterEqual(len(list(self.tokenizer_class.pretrained_vocab_files_map.values())[0]), 1) - self.assertEqual( - len(list(self.tokenizer_class.pretrained_vocab_files_map.values())[0]), - len(self.tokenizer_class.max_model_input_sizes), - ) - - weights_list = list(self.tokenizer_class.max_model_input_sizes.keys()) - weights_lists_2 = [] - for file_id, map_list in self.tokenizer_class.pretrained_vocab_files_map.items(): - weights_lists_2.append(list(map_list.keys())) - - for weights_list_2 in weights_lists_2: - self.assertListEqual(weights_list, weights_list_2) - def test_mask_output(self): tokenizers = self.get_tokenizers(do_lower_case=False) for tokenizer in tokenizers: diff --git a/tests/tokenization/test_tokenization_fast.py b/tests/tokenization/test_tokenization_fast.py index 6e24009ecd0830..ac073529e251ea 100644 --- a/tests/tokenization/test_tokenization_fast.py +++ b/tests/tokenization/test_tokenization_fast.py @@ -70,11 +70,6 @@ def test_added_tokens_serialization(self): def test_additional_special_tokens_serialization(self): pass - def test_pretrained_model_lists(self): - # We disable this test for PreTrainedTokenizerFast because it is the only tokenizer that is not linked to any - # model - pass - def test_prepare_for_model(self): # We disable this test for PreTrainedTokenizerFast because it is the only tokenizer that is not linked to any # model From e42cc77f5426e01e925a23ebb954cdbb7dd6960c Mon Sep 17 00:00:00 2001 From: Lysandre Date: Thu, 14 Mar 2024 18:12:27 +0100 Subject: [PATCH 05/13] [test_all] PVT v2 support --- src/transformers/__init__.py | 16 +++++++--------- src/transformers/models/pvt_v2/__init__.py | 6 ++---- .../models/pvt_v2/configuration_pvt_v2.py | 10 ---------- .../models/pvt_v2/modeling_pvt_v2.py | 11 ----------- tests/models/pvt_v2/test_modeling_pvt_v2.py | 10 ++++------ 5 files changed, 13 insertions(+), 40 deletions(-) diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py index f46feafa8b3a0c..abc4783fe3f8b0 100644 --- a/src/transformers/__init__.py +++ b/src/transformers/__init__.py @@ -726,9 +726,9 @@ "ProphetNetConfig", "ProphetNetTokenizer", ], - "models.pvt": ["PvtConfig"], - "models.pvt_v2": ["PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtV2Config"], - "models.qdqbert": ["QDQBertConfig"], + "models.pvt": ["PVT_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtConfig"], + "models.pvt_v2": ["PvtV2Config"], + "models.qdqbert": ["QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "QDQBertConfig"], "models.qwen2": [ "QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Qwen2Config", @@ -3051,7 +3051,6 @@ ) _import_structure["models.pvt_v2"].extend( [ - "PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "PvtV2Backbone", "PvtV2ForImageClassification", "PvtV2Model", @@ -5602,10 +5601,10 @@ ProphetNetConfig, ProphetNetTokenizer, ) - from .models.pvt import PvtConfig - from .models.pvt_v2 import PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, PvtV2Config - from .models.qdqbert import QDQBertConfig - from .models.qwen2 import Qwen2Config, Qwen2Tokenizer + from .models.pvt import PVT_PRETRAINED_CONFIG_ARCHIVE_MAP, PvtConfig + from .models.pvt_v2 import PvtV2Config + from .models.qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig + from .models.qwen2 import QWEN2_PRETRAINED_CONFIG_ARCHIVE_MAP, Qwen2Config, Qwen2Tokenizer from .models.rag import RagConfig, RagRetriever, RagTokenizer from .models.realm import ( REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, @@ -7624,7 +7623,6 @@ PvtPreTrainedModel, ) from .models.pvt_v2 import ( - PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST, PvtV2Backbone, PvtV2ForImageClassification, PvtV2Model, diff --git a/src/transformers/models/pvt_v2/__init__.py b/src/transformers/models/pvt_v2/__init__.py index e9297e7908d3f7..4825eda165050a 100644 --- a/src/transformers/models/pvt_v2/__init__.py +++ b/src/transformers/models/pvt_v2/__init__.py @@ -25,7 +25,7 @@ _import_structure = { - "configuration_pvt_v2": ["PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP", "PvtV2Config"], + "configuration_pvt_v2": ["PvtV2Config"], } try: @@ -35,7 +35,6 @@ pass else: _import_structure["modeling_pvt_v2"] = [ - "PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST", "PvtV2ForImageClassification", "PvtV2Model", "PvtV2PreTrainedModel", @@ -44,7 +43,7 @@ if TYPE_CHECKING: - from .configuration_pvt_v2 import PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP, PvtV2Config + from .configuration_pvt_v2 import PvtV2Config try: if not is_torch_available(): @@ -53,7 +52,6 @@ pass else: from .modeling_pvt_v2 import ( - PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST, PvtV2Backbone, PvtV2ForImageClassification, PvtV2Model, diff --git a/src/transformers/models/pvt_v2/configuration_pvt_v2.py b/src/transformers/models/pvt_v2/configuration_pvt_v2.py index 1ff3a50232518b..f6d7de299ba37d 100644 --- a/src/transformers/models/pvt_v2/configuration_pvt_v2.py +++ b/src/transformers/models/pvt_v2/configuration_pvt_v2.py @@ -25,16 +25,6 @@ logger = logging.get_logger(__name__) -PVT_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "pvt_v2_b0": "https://huggingface.co/OpenGVLab/pvt_v2_b0", - "pvt_v2_b1": "https://huggingface.co/OpenGVLab/pvt_v2_b1", - "pvt_v2_b2": "https://huggingface.co/OpenGVLab/pvt_v2_b2", - "pvt_v2_b2_linear": "https://huggingface.co/OpenGVLab/pvt_v2_b2_linear", - "pvt_v2_b3": "https://huggingface.co/OpenGVLab/pvt_v2_b3", - "pvt_v2_b4": "https://huggingface.co/OpenGVLab/pvt_v2_b4", - "pvt_v2_b5": "https://huggingface.co/OpenGVLab/pvt_v2_b5", -} - class PvtV2Config(BackboneConfigMixin, PretrainedConfig): r""" diff --git a/src/transformers/models/pvt_v2/modeling_pvt_v2.py b/src/transformers/models/pvt_v2/modeling_pvt_v2.py index 7df2015c1ccb22..a2e1e7a674524f 100644 --- a/src/transformers/models/pvt_v2/modeling_pvt_v2.py +++ b/src/transformers/models/pvt_v2/modeling_pvt_v2.py @@ -49,17 +49,6 @@ _IMAGE_CLASS_CHECKPOINT = "OpenGVLab/pvt_v2_b0" _IMAGE_CLASS_EXPECTED_OUTPUT = "LABEL_281" # ImageNet ID for "tabby, tabby cat" -PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST = [ - "OpenGVLab/pvt_v2_b0", - "OpenGVLab/pvt_v2_b1", - "OpenGVLab/pvt_v2_b2", - "OpenGVLab/pvt_v2_b2_linear", - "OpenGVLab/pvt_v2_b3", - "OpenGVLab/pvt_v2_b4", - "OpenGVLab/pvt_v2_b5", - # See all PVT models at https://huggingface.co/models?filter=pvt_v2 -] - # Copied from transformers.models.beit.modeling_beit.drop_path def drop_path(input: torch.Tensor, drop_prob: float = 0.0, training: bool = False) -> torch.Tensor: diff --git a/tests/models/pvt_v2/test_modeling_pvt_v2.py b/tests/models/pvt_v2/test_modeling_pvt_v2.py index b8c53ac3e79921..e1efbf3cfd64f4 100644 --- a/tests/models/pvt_v2/test_modeling_pvt_v2.py +++ b/tests/models/pvt_v2/test_modeling_pvt_v2.py @@ -37,9 +37,7 @@ if is_torch_available(): import torch - from transformers import AutoImageProcessor, PvtV2ForImageClassification, PvtV2Model - from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES - from transformers.models.pvt_v2.modeling_pvt_v2 import PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST + from transformers import MODEL_MAPPING, AutoImageProcessor, PvtV2ForImageClassification, PvtV2Model if is_vision_available(): @@ -312,9 +310,9 @@ def test_forward_signature(self): @slow def test_model_from_pretrained(self): - for model_name in PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: - model = PvtV2Model.from_pretrained(model_name) - self.assertIsNotNone(model) + model_name = "OpenGVLab/pvt_v2_b0" + model = PvtV2Model.from_pretrained(model_name) + self.assertIsNotNone(model) @require_torch From e77b507027511841e6c04af0ce1964408e55f41b Mon Sep 17 00:00:00 2001 From: Lysandre Date: Thu, 14 Mar 2024 17:57:37 +0100 Subject: [PATCH 06/13] [test_all] Tests should all pass --- src/transformers/models/mobilebert/configuration_mobilebert.py | 2 ++ src/transformers/utils/dummy_pt_objects.py | 3 --- tests/models/t5/test_tokenization_t5.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/transformers/models/mobilebert/configuration_mobilebert.py b/src/transformers/models/mobilebert/configuration_mobilebert.py index 2dfbf87b80a711..d66dba8c02bde9 100644 --- a/src/transformers/models/mobilebert/configuration_mobilebert.py +++ b/src/transformers/models/mobilebert/configuration_mobilebert.py @@ -105,6 +105,8 @@ class MobileBertConfig(PretrainedConfig): ``` """ + model_type = "mobilebert" + def __init__( self, vocab_size=30522, diff --git a/src/transformers/utils/dummy_pt_objects.py b/src/transformers/utils/dummy_pt_objects.py index 97d134c3412686..6e00d3fe3bf155 100644 --- a/src/transformers/utils/dummy_pt_objects.py +++ b/src/transformers/utils/dummy_pt_objects.py @@ -6747,9 +6747,6 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) -PVT_V2_PRETRAINED_MODEL_ARCHIVE_LIST = None - - class PvtV2Backbone(metaclass=DummyObject): _backends = ["torch"] diff --git a/tests/models/t5/test_tokenization_t5.py b/tests/models/t5/test_tokenization_t5.py index e8716a79e9c744..ed753612fc30f7 100644 --- a/tests/models/t5/test_tokenization_t5.py +++ b/tests/models/t5/test_tokenization_t5.py @@ -227,7 +227,7 @@ def test_outputs_not_longer_than_maxlen(self): # Since T5 does NOT have a max input length, # this test should be changed to the following in Transformers v5: # self.assertEqual(batch.input_ids.shape, (2, 8001)) - self.assertEqual(batch.input_ids.shape, (2, 512)) + self.assertEqual(batch.input_ids.shape, (2, 8001)) def test_eos_in_input(self): tokenizer = self.t5_base_tokenizer From e029dac65a03c55c1bedf0dff70e1c8ed79ca368 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Fri, 15 Mar 2024 10:03:13 +0100 Subject: [PATCH 07/13] [test_all] Style --- tests/models/pvt_v2/test_modeling_pvt_v2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/models/pvt_v2/test_modeling_pvt_v2.py b/tests/models/pvt_v2/test_modeling_pvt_v2.py index e1efbf3cfd64f4..9d8dfafa7cffc0 100644 --- a/tests/models/pvt_v2/test_modeling_pvt_v2.py +++ b/tests/models/pvt_v2/test_modeling_pvt_v2.py @@ -19,6 +19,7 @@ import unittest from transformers import PvtV2Backbone, PvtV2Config, is_torch_available, is_vision_available +from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES from transformers.testing_utils import ( require_accelerate, require_torch, @@ -37,7 +38,7 @@ if is_torch_available(): import torch - from transformers import MODEL_MAPPING, AutoImageProcessor, PvtV2ForImageClassification, PvtV2Model + from transformers import AutoImageProcessor, PvtV2ForImageClassification, PvtV2Model if is_vision_available(): From fa84a6414c252140a6268611f68b4587f13bc4c1 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Fri, 22 Mar 2024 14:21:27 +0100 Subject: [PATCH 08/13] Address review comments --- src/transformers/__init__.py | 1 - .../retribert/tokenization_retribert.py | 18 --------------- .../retribert/tokenization_retribert_fast.py | 23 ------------------- .../deprecated/tapex/tokenization_tapex.py | 18 --------------- .../models/llama/tokenization_llama_fast.py | 2 ++ ...ce_{{cookiecutter.lowercase_modelname}}.py | 4 ++-- 6 files changed, 4 insertions(+), 62 deletions(-) diff --git a/src/transformers/__init__.py b/src/transformers/__init__.py index abc4783fe3f8b0..23e1d14114cb2e 100644 --- a/src/transformers/__init__.py +++ b/src/transformers/__init__.py @@ -24,7 +24,6 @@ # Check the dependencies satisfy the minimal versions required. from . import dependency_versions_check -from .models.deprecated._archive_maps import * from .utils import ( OptionalDependencyNotAvailable, _LazyModule, diff --git a/src/transformers/models/deprecated/retribert/tokenization_retribert.py b/src/transformers/models/deprecated/retribert/tokenization_retribert.py index cb2ef58139c1e3..c991f3972230bd 100644 --- a/src/transformers/models/deprecated/retribert/tokenization_retribert.py +++ b/src/transformers/models/deprecated/retribert/tokenization_retribert.py @@ -27,23 +27,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "yjernite/retribert-base-uncased": ( - "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/vocab.txt" - ), - } -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "yjernite/retribert-base-uncased": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "yjernite/retribert-base-uncased": {"do_lower_case": True}, -} - # Copied from transformers.models.bert.tokenization_bert.load_vocab def load_vocab(vocab_file): @@ -111,7 +94,6 @@ class RetriBertTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] # Copied from transformers.models.bert.tokenization_bert.BertTokenizer.__init__ diff --git a/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py b/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py index 3d56f3641e1c28..97fbfc07d30ca6 100644 --- a/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py +++ b/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py @@ -28,28 +28,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "yjernite/retribert-base-uncased": ( - "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/vocab.txt" - ), - }, - "tokenizer_file": { - "yjernite/retribert-base-uncased": ( - "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/tokenizer.json" - ), - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "yjernite/retribert-base-uncased": 512, -} - - -PRETRAINED_INIT_CONFIGURATION = { - "yjernite/retribert-base-uncased": {"do_lower_case": True}, -} - class RetriBertTokenizerFast(PreTrainedTokenizerFast): r""" @@ -95,7 +73,6 @@ class RetriBertTokenizerFast(PreTrainedTokenizerFast): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP slow_tokenizer_class = RetriBertTokenizer model_input_names = ["input_ids", "attention_mask"] diff --git a/src/transformers/models/deprecated/tapex/tokenization_tapex.py b/src/transformers/models/deprecated/tapex/tokenization_tapex.py index f05dbf56f955e5..cd3d353b526c4a 100644 --- a/src/transformers/models/deprecated/tapex/tokenization_tapex.py +++ b/src/transformers/models/deprecated/tapex/tokenization_tapex.py @@ -36,23 +36,6 @@ VOCAB_FILES_NAMES = {"vocab_file": "vocab.json", "merges_file": "merges.txt"} -PRETRAINED_VOCAB_FILES_MAP = { - "vocab_file": { - "microsoft/tapex-base": "https://huggingface.co/microsoft/tapex-base/resolve/main/vocab.json", - }, - "merges_file": { - "microsoft/tapex-base": "https://huggingface.co/microsoft/tapex-base/resolve/main/merges.txt", - }, -} - -PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { - "microsoft/tapex-base": 512, -} - -PRETRAINED_INIT_CONFIGURATION = { - "microsoft/tapex-base": {"do_lower_case": True}, -} - class TapexTruncationStrategy(ExplicitEnum): """ @@ -264,7 +247,6 @@ class TapexTokenizer(PreTrainedTokenizer): """ vocab_files_names = VOCAB_FILES_NAMES - pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP model_input_names = ["input_ids", "attention_mask"] def __init__( diff --git a/src/transformers/models/llama/tokenization_llama_fast.py b/src/transformers/models/llama/tokenization_llama_fast.py index 4a7e98c78855bf..07c01be893cf17 100644 --- a/src/transformers/models/llama/tokenization_llama_fast.py +++ b/src/transformers/models/llama/tokenization_llama_fast.py @@ -33,6 +33,8 @@ logger = logging.get_logger(__name__) VOCAB_FILES_NAMES = {"vocab_file": "tokenizer.model", "tokenizer_file": "tokenizer.json"} +B_INST, E_INST = "[INST]", "[/INST]" +B_SYS, E_SYS = "<>\n", "\n<>\n\n" # fmt: off DEFAULT_SYSTEM_PROMPT = """You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your \ diff --git a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py index 04f4f7c2a34d2b..f5ed661ade3625 100644 --- a/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py +++ b/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py @@ -127,7 +127,7 @@ # Replace with: {% if cookiecutter.is_encoder_decoder_model == "False" %} from .models.{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForMaskedLM, + {{cookiecutter.camelcase_modelname}}ForMaskedLM, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForMultipleChoice, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, @@ -140,7 +140,7 @@ ) {% else %} from .models.{{cookiecutter.lowercase_modelname}} import ( - {{cookiecutter.uppercase_modelname}} {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, + {{cookiecutter.camelcase_modelname}}ForConditionalGeneration, {{cookiecutter.camelcase_modelname}}ForCausalLM, {{cookiecutter.camelcase_modelname}}ForQuestionAnswering, {{cookiecutter.camelcase_modelname}}ForSequenceClassification, From afa617ab6fdfbbd8b677783ee767dfd2803514f2 Mon Sep 17 00:00:00 2001 From: Lysandre Debut Date: Fri, 22 Mar 2024 14:22:42 +0100 Subject: [PATCH 09/13] Update src/transformers/models/deprecated/_archive_maps.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> --- src/transformers/models/deprecated/_archive_maps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/models/deprecated/_archive_maps.py b/src/transformers/models/deprecated/_archive_maps.py index c534edc8bc691d..4c3dd400be7bc2 100644 --- a/src/transformers/models/deprecated/_archive_maps.py +++ b/src/transformers/models/deprecated/_archive_maps.py @@ -26,7 +26,7 @@ def __init__(self, *args, **kwargs): def __getitem__(self, item): logger.warning( - "Archive maps are deprecated and will be removed in version v4.39.0 as they are no longer relevant. " + "Archive maps are deprecated and will be removed in version v4.40.0 as they are no longer relevant. " "If looking to get all checkpoints for a given architecture, we recommend using `huggingface_hub` " "with the list_models method." ) From 2e8ef4bcb65913442fcf071516eaf495e802c8c9 Mon Sep 17 00:00:00 2001 From: Lysandre Debut Date: Fri, 22 Mar 2024 14:22:50 +0100 Subject: [PATCH 10/13] Update src/transformers/models/deprecated/_archive_maps.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> --- src/transformers/models/deprecated/_archive_maps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/models/deprecated/_archive_maps.py b/src/transformers/models/deprecated/_archive_maps.py index 4c3dd400be7bc2..f7b0679a3e4f57 100644 --- a/src/transformers/models/deprecated/_archive_maps.py +++ b/src/transformers/models/deprecated/_archive_maps.py @@ -39,7 +39,7 @@ def __init__(self, *args, **kwargs): def __getitem__(self, item): logger.warning_once( - "Archive maps are deprecated and will be removed in version v4.39.0 as they are no longer relevant. " + "Archive maps are deprecated and will be removed in version v4.40.0 as they are no longer relevant. " "If looking to get all checkpoints for a given architecture, we recommend using `huggingface_hub` " "with the `list_models` method." ) From 9ba7971bb5abf85f97046d432b4df211d5b06b51 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Mon, 25 Mar 2024 09:30:30 +0100 Subject: [PATCH 11/13] [test_all] trigger tests From 1b17eaf9b564520549d3fedc344983480f854ec3 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Mon, 25 Mar 2024 09:39:42 +0100 Subject: [PATCH 12/13] [test_all] LLAVA --- src/transformers/models/llava/__init__.py | 6 +++++- src/transformers/models/mamba/modeling_mamba.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/transformers/models/llava/__init__.py b/src/transformers/models/llava/__init__.py index 1732af9b0d29ef..79f7b3ea309559 100644 --- a/src/transformers/models/llava/__init__.py +++ b/src/transformers/models/llava/__init__.py @@ -16,7 +16,10 @@ from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available -_import_structure = {"configuration_llava": ["LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlavaConfig"]} +_import_structure = { + "configuration_llava": ["LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlavaConfig"], + "processing_llava": ["LlavaProcessor"], +} try: @@ -34,6 +37,7 @@ if TYPE_CHECKING: from .configuration_llava import LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlavaConfig + from .processing_llava import LlavaProcessor try: if not is_torch_available(): diff --git a/src/transformers/models/mamba/modeling_mamba.py b/src/transformers/models/mamba/modeling_mamba.py index a990ebddb5365e..0e233ae4304c80 100644 --- a/src/transformers/models/mamba/modeling_mamba.py +++ b/src/transformers/models/mamba/modeling_mamba.py @@ -59,6 +59,7 @@ from ..deprecated._archive_maps import MAMBA_PRETRAINED_MODEL_ARCHIVE_LIST # noqa: F401, E402 + class MambaCache: def __init__(self, config, batch_size, dtype=torch.float16, device=None): self.seqlen_offset = 0 From 32d0d07596eb5f479ed771120477d596e16cd590 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Mon, 25 Mar 2024 09:49:58 +0100 Subject: [PATCH 13/13] [test_all] Bad rebase --- src/transformers/utils/dummy_pt_objects.py | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/transformers/utils/dummy_pt_objects.py b/src/transformers/utils/dummy_pt_objects.py index 6e00d3fe3bf155..21a76a1d050e5a 100644 --- a/src/transformers/utils/dummy_pt_objects.py +++ b/src/transformers/utils/dummy_pt_objects.py @@ -2066,6 +2066,27 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +class CohereForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + +class CohereModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + +class CoherePreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + CONDITIONAL_DETR_PRETRAINED_MODEL_ARCHIVE_LIST = None @@ -4795,6 +4816,13 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +class LlavaNextPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None @@ -5868,6 +5896,37 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +MUSICGEN_MELODY_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +class MusicgenMelodyForCausalLM(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + +class MusicgenMelodyForConditionalGeneration(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + +class MusicgenMelodyModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + +class MusicgenMelodyPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + MVP_PRETRAINED_MODEL_ARCHIVE_LIST = None @@ -7984,6 +8043,23 @@ def __init__(self, *args, **kwargs): requires_backends(self, ["torch"]) +SUPERPOINT_PRETRAINED_MODEL_ARCHIVE_LIST = None + + +class SuperPointForKeypointDetection(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + +class SuperPointPreTrainedModel(metaclass=DummyObject): + _backends = ["torch"] + + def __init__(self, *args, **kwargs): + requires_backends(self, ["torch"]) + + SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST = None