Commit 050e0b4
authored
Proper build() methods for TF (#27794)
* Add a convenience method for building in your own name scope
* Second attempt at auto layer building
* Revert "Second attempt at auto layer building"
This reverts commit e03a3aaecf9ec41a805582b83cbdfe3290a631be.
* Attempt #3
* Revert "Attempt #3"
This reverts commit b9df7a0857560d29b5abbed6127d9e9eca77cf47.
* Add missing attributes that we're going to need later
* Add some attributes we're going to need later
* A fourth attempt! Feel the power flow through you!
* Revert "A fourth attempt! Feel the power flow through you!"
This reverts commit 6bf4aaf3875d6f28485f50187617a4c616c8aff7.
* Add more values we'll need later
* TF refactor that we'll need later
* Revert "TF refactor that we'll need later"
This reverts commit ca07202fb5b7b7436b893baa8d688b4f348ea7b9.
* Revert "Revert "TF refactor that we'll need later""
This reverts commit 1beb0f39f293ed9c27594575e1c849aadeb15c13.
* make fixup
* Attempt five!
* Revert "Attempt five!"
This reverts commit 3302207958dfd0374b0447a51c06eea51a506044.
* Attempt six - this time don't add empty methods
* Revert "Attempt six - this time don't add empty methods"
This reverts commit 67d60129be75416b6beb8f47c7d38d77b18d79bb.
* Attempt seven - better base model class detection!
* Revert "Attempt seven - better base model class detection!"
This reverts commit 5f14845e92ea0e87c598da933bfbfee10f553bc9.
* Another attribute we'll need later
* Try again with the missing attribute!
* Revert "Try again with the missing attribute!"
This reverts commit 760c6f30c5dffb3e04b0e73c34a77d1882a0fef7.
* This is the attempt that will pierce the heavens!
* Revert "This is the attempt that will pierce the heavens!"
This reverts commit c868bb657de057aca7a5260350a3f831fc4dfee6.
* Attempt seven - snag list is steadily decreasing
* Revert "Attempt seven - snag list is steadily decreasing"
This reverts commit 46fbd975deda64429bfb3e5fac4fc0370c00d316.
* Attempt eight - will an empty snag list do it?
* Revert "Attempt eight - will an empty snag list do it?"
This reverts commit 7c8a3c2b083253649569e9877e02054ae5cec67b.
* Fixes to Hubert issues that cause problems later
* Trying again with Conv1D/SeparableConv fixes
* Revert "Trying again with Conv1D/SeparableConv fixes"
This reverts commit 55092bca952bc0f750aa1ffe246a640bf1e2036e.
* Apply the build shape fixes to Wav2Vec2 as well
* One more attempt!
* Revert "One more attempt!"
This reverts commit 5ac3e4cb01b9458cc93312873725f9444ae7261c.
* Another attempt!
* Revert "Another attempt!"
This reverts commit ea16d890e019d7de8792a3b8e72f3b1c02adae50.
* Let's see how many failures we get without the internal build method
* Fix OpenAI
* Fix MobileBERT
* (Mostly) fix GroupVIT
* Fix BLIP
* One more BLIP fix
* One more BLIP fix!
* Fix Regnet
* Finally fully fix GroupViT
* Fix Data2Vec and add the new AdaptivePool
* Fix Segformer
* Fix Albert
* Fix Deberta/DebertaV2
* Fix XLM
* Actually fix XLM
* Fix Flaubert
* Fix lxmert
* Fix Resnet
* Fix ConvBERT
* Fix ESM
* Fix Convnext / ConvnextV2
* Fix SAM
* Fix Efficientformer
* Fix LayoutLMv3
* Fix speech_to_text
* Fix mpnet and mobilevit
* Fix Swin
* Fix CTRL
* Fix CVT
* Fix DPR
* Fix Wav2Vec2
* Fix T5
* Fix Hubert
* Fix GPT2
* Fix Whisper
* Fix DeiT
* Fix the encoder-decoder / dual-encoder classes
* make fix-copies
* build in name scope
* Fix summarization test
* Fix tied weight names for BART + Blenderbot
* Fix tied weight name building
* Fix to TFESM weight building
* Update TF SAM
* Expand all the shapes out into Big Boy Shapes1 parent 52c3788 commit 050e0b4
File tree
73 files changed
+11039
-503
lines changed- src/transformers
- models
- albert
- bart
- bert
- blenderbot_small
- blenderbot
- blip
- camembert
- clip
- convbert
- convnextv2
- convnext
- ctrl
- cvt
- data2vec
- deberta_v2
- deberta
- deit
- distilbert
- dpr
- efficientformer
- electra
- encoder_decoder
- esm
- flaubert
- funnel
- gpt2
- gptj
- groupvit
- hubert
- layoutlmv3
- layoutlm
- led
- longformer
- lxmert
- marian
- mbart
- mobilebert
- mobilevit
- mpnet
- openai
- opt
- pegasus
- rag
- regnet
- rembert
- resnet
- roberta_prelayernorm
- roberta
- roformer
- sam
- segformer
- speech_to_text
- swin
- t5
- tapas
- vision_encoder_decoder
- vision_text_dual_encoder
- vit_mae
- vit
- wav2vec2
- whisper
- xglm
- xlm_roberta
- xlm
- xlnet
- templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}
- tests
- models
- encoder_decoder
- opt
- vision_encoder_decoder
- whisper
- pipelines
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
73 files changed
+11039
-503
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
1122 | 1121 | | |
1123 | 1122 | | |
1124 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1125 | 1128 | | |
1126 | 1129 | | |
1127 | 1130 | | |
| |||
1130 | 1133 | | |
1131 | 1134 | | |
1132 | 1135 | | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
| 1136 | + | |
1142 | 1137 | | |
1143 | 1138 | | |
1144 | 1139 | | |
| |||
1869 | 1864 | | |
1870 | 1865 | | |
1871 | 1866 | | |
1872 | | - | |
| 1867 | + | |
1873 | 1868 | | |
1874 | 1869 | | |
1875 | 1870 | | |
| |||
1886 | 1881 | | |
1887 | 1882 | | |
1888 | 1883 | | |
1889 | | - | |
| 1884 | + | |
1890 | 1885 | | |
1891 | 1886 | | |
1892 | 1887 | | |
| |||
1906 | 1901 | | |
1907 | 1902 | | |
1908 | 1903 | | |
1909 | | - | |
| 1904 | + | |
1910 | 1905 | | |
1911 | 1906 | | |
1912 | 1907 | | |
| |||
1944 | 1939 | | |
1945 | 1940 | | |
1946 | 1941 | | |
1947 | | - | |
| 1942 | + | |
1948 | 1943 | | |
1949 | 1944 | | |
1950 | 1945 | | |
| |||
1962 | 1957 | | |
1963 | 1958 | | |
1964 | 1959 | | |
1965 | | - | |
| 1960 | + | |
1966 | 1961 | | |
1967 | 1962 | | |
1968 | 1963 | | |
| |||
2049 | 2044 | | |
2050 | 2045 | | |
2051 | 2046 | | |
2052 | | - | |
| 2047 | + | |
2053 | 2048 | | |
2054 | 2049 | | |
2055 | 2050 | | |
| |||
2914 | 2909 | | |
2915 | 2910 | | |
2916 | 2911 | | |
2917 | | - | |
| 2912 | + | |
2918 | 2913 | | |
2919 | | - | |
| 2914 | + | |
2920 | 2915 | | |
2921 | 2916 | | |
2922 | 2917 | | |
| |||
3215 | 3210 | | |
3216 | 3211 | | |
3217 | 3212 | | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
3218 | 3216 | | |
3219 | 3217 | | |
3220 | 3218 | | |
| |||
3398 | 3396 | | |
3399 | 3397 | | |
3400 | 3398 | | |
| 3399 | + | |
3401 | 3400 | | |
3402 | 3401 | | |
3403 | 3402 | | |
| |||
3450 | 3449 | | |
3451 | 3450 | | |
3452 | 3451 | | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
3453 | 3460 | | |
3454 | 3461 | | |
3455 | 3462 | | |
| |||
0 commit comments