Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 4.7.0 -> 4.18.0 #37

Merged
merged 1,930 commits into from
Mar 15, 2022
Merged
Changes from 1 commit
Commits
Show all changes
1930 commits
Select commit Hold shift + click to select a range
1f60bc4
Make sure custom configs work with Transformers (#15569)
sgugger Feb 9, 2022
9e00566
Add Wav2Vec2 Adapter Weights to Flax (#15566)
sanchit-gandhi Feb 9, 2022
7029240
Upgrade click version (#15579)
LysandreJik Feb 9, 2022
f588cf4
[Flax tests/FlaxBert] make from_pretrained test faster (#15561)
patil-suraj Feb 9, 2022
0113aae
Add implementation of typical sampling (#15504)
cimeister Feb 9, 2022
2b5603f
Constrained Beam Search [without disjunctive decoding] (#15416)
cwkeam Feb 9, 2022
eed3186
Trigger doc build
sgugger Feb 9, 2022
b1ba03e
Fix quality
sgugger Feb 9, 2022
315e674
Fix tests hub failure (#15580)
sgugger Feb 9, 2022
2584808
update serving_output for some TF models (#15568)
ydshieh Feb 9, 2022
dee17d5
[trainer docs] document how to select specific gpus (#15551)
stas00 Feb 9, 2022
a86ee22
Add link (#15588)
NielsRogge Feb 9, 2022
c722753
Expand tutorial for custom models (#15587)
sgugger Feb 9, 2022
644ec05
Make slow tests slow
sgugger Feb 10, 2022
e923917
Reformat tokenization_fnet
LysandreJik Feb 10, 2022
cb7ed6e
Add Tensorflow handling of ONNX conversion (#13831)
Albertobegue Feb 10, 2022
3d5dea9
Add example batch size to all commands (#15596)
patrickvonplaten Feb 10, 2022
724e51c
Compute loss independent from decoder for TF EncDec models (as #14139…
ydshieh Feb 10, 2022
3a2ed96
Fix Seq2SeqTrainer (#15603)
NielsRogge Feb 10, 2022
2e8b85f
Add local and TensorFlow ONNX export examples to docs (#15604)
lewtun Feb 10, 2022
c0864d9
Correct JSON format (#15600)
ngoquanghuy99 Feb 10, 2022
45c7b5b
[Generate] Small refactor (#15611)
patrickvonplaten Feb 10, 2022
6cf06d1
Mark "code in the Hub" API as experimental (#15624)
sgugger Feb 11, 2022
7e4844f
Enable ONNX export when PyTorch and TensorFlow installed in the same …
lewtun Feb 11, 2022
3fae83d
TF: Add informative warning for inexistent CPU backprop ops (#15612)
gante Feb 11, 2022
8c03df1
Rebase (#15606)
mishig25 Feb 11, 2022
2f40c72
TF MT5 embeddings resize (#15567)
gante Feb 11, 2022
85aee09
🖍 remove broken link (#15615)
stevhliu Feb 11, 2022
2dce350
Fix _configuration_file argument getting passed to model (#15629)
sgugger Feb 11, 2022
f15c99f
[deepspeed docs] misc additions (#15585)
stas00 Feb 11, 2022
fcb0f74
[research_projects] deal with security alerts (#15594)
stas00 Feb 11, 2022
7a32e47
Custom feature extractor (#15630)
sgugger Feb 11, 2022
4f403ea
Fix grammar in tokenizer_summary (#15614)
derenrich Feb 11, 2022
52d2e6f
Add push to hub to feature extractor (#15632)
sgugger Feb 11, 2022
f52746d
[Fix doc example] FlaxVisionEncoderDecoder (#15626)
ydshieh Feb 14, 2022
2b8599b
Fix a bug that ignores max_seq_len in preprocess (#15238)
wptoux Feb 14, 2022
ec15da2
Report only the failed imports in `requires_backends` (#15636)
tkukurin Feb 14, 2022
b090b79
Make Swin work with VisionEncoderDecoderModel (#15527)
NielsRogge Feb 14, 2022
0f71c29
Remove redundant error logging in from_pretrained() method (#15631)
lewtun Feb 14, 2022
2e11a04
Register feature extractor (#15634)
sgugger Feb 14, 2022
e314c19
fix bug for the log of RNG states are not properly loaded exception…
muzhi1991 Feb 15, 2022
041fdc4
[SpeechEncoderDecoder] Make sure no EOS is generated in test (#15655)
patrickvonplaten Feb 15, 2022
41168a4
logger doc
FrancescoSaverioZuppichini Feb 15, 2022
05a8580
Revert "logger doc"
FrancescoSaverioZuppichini Feb 15, 2022
e1cbc07
Require tokenizers>=0.11.1 (#15266)
aphedges Feb 15, 2022
9eb7e9b
Fix ASR pipelines from local directories with wav2vec models that hav…
versae Feb 15, 2022
86a7845
Fix typo in speech2text2 doc (#15617)
jonrbates Feb 15, 2022
45f5658
Allow custom code for Processors (#15649)
sgugger Feb 15, 2022
67047b8
add scores to Wav2Vec2WithLMOutput (#15413)
arampacha Feb 15, 2022
7bc4a01
Update bad_words_ids usage (#15641)
ngoquanghuy99 Feb 15, 2022
80f1a59
updated with latest PL and Ray (#15653)
Feb 15, 2022
f45ac11
Add section about doc testing (#15659)
patrickvonplaten Feb 15, 2022
5d8be09
Fix quality
sgugger Feb 15, 2022
28e6155
add a network debug script and document it (#15652)
stas00 Feb 15, 2022
cdf19c5
Re-export `KeyDataset`. (#15645)
Narsil Feb 15, 2022
a3dbbc3
Add `decoder_kwargs` to send to LM on asr pipeline. (#15646)
Narsil Feb 15, 2022
2e12b90
TF generate refactor - Greedy Search (#15562)
patrickvonplaten Feb 15, 2022
faf4ff5
[pipeline doc] fix api (#15660)
stas00 Feb 15, 2022
1690319
Fix TFSequenceSummary's activation (#15643)
ydshieh Feb 15, 2022
943e2aa
Fix model equivalence tests (#15670)
LysandreJik Feb 15, 2022
1ddf3c2
Fix vit test (#15671)
LysandreJik Feb 15, 2022
e3d1a8d
Add a missing space in a deprecation message (#15651)
bryant1410 Feb 16, 2022
bee361c
[t5/t0/mt5 models] faster/leaner custom layer norm (#14656)
stas00 Feb 16, 2022
2d02f7b
Add push_to_hub method to processors (#15668)
sgugger Feb 16, 2022
b87c044
Usage examples for logger (#15657)
FrancescoSaverioZuppichini Feb 16, 2022
d4692ad
Fix dec_attn_mask in TFTransfoXLMainLayer (#15665)
ydshieh Feb 16, 2022
bc3379e
🔥 Remove build_doc_test github action (#15680)
coyotte508 Feb 16, 2022
cdc51ff
Add register method to AutoProcessor (#15669)
sgugger Feb 16, 2022
3a4376d
[Wav2Vec2ProcessorWithLM] Fix auto processor with lm (#15683)
patrickvonplaten Feb 16, 2022
66828a1
Fix Funnel configuration doc (#15686)
ydshieh Feb 16, 2022
f65fe36
Implementation of activations as pytorch modules (#15616)
eldarkurtic Feb 16, 2022
0e91f88
Add image classification notebook (#15667)
NielsRogge Feb 17, 2022
f84e0db
Add PoolFormer (#15531)
tanaymeh Feb 17, 2022
92a537d
Minor fix on README.md (#15688)
ydshieh Feb 17, 2022
426b962
Fix shapes in model docstrings (#15696)
gchhablani Feb 17, 2022
5788217
Add SimMIM (#15586)
NielsRogge Feb 17, 2022
240cc6c
Adding a model, more doc for pushing to the hub (#15690)
FrancescoSaverioZuppichini Feb 18, 2022
e93763d
fix CLIP fast tokenizer and change some properties of the slow versio…
SaulLu Feb 18, 2022
416dff7
Fix SiluActivation (#15718)
sgugger Feb 18, 2022
f8ff3fa
TF: add initializer_std with a small value in TFFunnelModelTester (#1…
ydshieh Feb 18, 2022
68dec6b
Fix DETR model deprecation warnings for int div (#15702)
gautierdag Feb 18, 2022
2f2fefd
Fix LongformerModel hidden states (#15537)
ydshieh Feb 18, 2022
ae1f835
Add PLBart (#13269)
gchhablani Feb 18, 2022
d5083c3
style_doc handles decorators in examples (#15719)
sgugger Feb 18, 2022
83f45cd
Fix auto (#15706)
LysandreJik Feb 18, 2022
3de1290
fix: hfdeepspeed config argument (#15711)
jaketae Feb 18, 2022
60ba482
fix bug in PT speech-encoder-decoder (#15699)
sanchit-gandhi Feb 18, 2022
2c2a31f
Add missing PLBart entry in README (#15721)
gchhablani Feb 18, 2022
a63bd36
Remove input and target reset after preprocessing (#15741)
SSardorf Feb 21, 2022
5444687
Fix minor comment typos (#15740)
Crabzmatic Feb 21, 2022
86119c1
add VisionTextDualEncoder and CLIP fine-tuning script (#15701)
patil-suraj Feb 21, 2022
142b69f
Add layer_idx to CrossAttention of GPT2 model (#15730)
hyunwoongko Feb 21, 2022
3956b13
TF text classification examples (#15704)
gante Feb 21, 2022
0187c6f
revert temporary addition to test next version of CLIPTokenizerFast (…
SaulLu Feb 21, 2022
38bed91
added link to our writing-doc document (#15756)
FrancescoSaverioZuppichini Feb 22, 2022
2c3fcc6
TF train_step docstring (#15755)
gante Feb 22, 2022
32295b1
Gelu10 (#15676)
mfuntowicz Feb 22, 2022
c44d367
Time stamps for CTC models (#15687)
patrickvonplaten Feb 22, 2022
2cdb6db
fixed pipeline code (#15607)
Moumeneb1 Feb 22, 2022
3db2e8f
Fix typo on examples/pytorch/question-answering (#15644)
dreamgonfly Feb 22, 2022
db57bb2
Cleanup transformers-cli (#15767)
julien-c Feb 22, 2022
05a12a0
Fix `HfArgumentParser` when passing a generator (#15758)
bryant1410 Feb 22, 2022
f9582c2
Adding ZeroShotImageClassificationPipeline (#12119)
Narsil Feb 23, 2022
24588c6
[M2M100, XGLM] fix create_position_ids_from_inputs_embeds (#15751)
patil-suraj Feb 23, 2022
a3e607d
Supporting Merges.txt files than contain an endline. (#15782)
Narsil Feb 23, 2022
de73786
[CLIP] fix grad ckpt (#15789)
patil-suraj Feb 23, 2022
1b23979
[ViLT] Fix checkpoint url in config (#15790)
patil-suraj Feb 23, 2022
9e71d46
Enable `image-segmentation` on `AutoModelForSemanticSegmentation` (#1…
Narsil Feb 23, 2022
32f5de1
[doc] custom_models: mention security features of the Hub (#15768)
julien-c Feb 23, 2022
3f76bf5
Align documentation with code defaults (#15468)
lsb Feb 23, 2022
a1efc82
HTML dev docs (#15678)
coyotte508 Feb 23, 2022
86636f5
Fix indent in doc-builder CI (#15798)
coyotte508 Feb 23, 2022
fecb08c
🧼 NLP task guides (#15731)
stevhliu Feb 23, 2022
29c10a4
[Test refactor 1/5] Per-folder tests reorganization (#15725)
LysandreJik Feb 23, 2022
0400b22
[Test refactor 2/5] Tests fetcher (#15726)
LysandreJik Feb 23, 2022
d3ae2bd
[Test refactor 3/5] Notification service improvement (#15727)
LysandreJik Feb 23, 2022
4c737f0
[Test refactor 4/5] Improve the scheduled tests (#15728)
LysandreJik Feb 23, 2022
a0e3480
[Test refactor 5/5] Build docker images (#15729)
LysandreJik Feb 23, 2022
6336017
Fix build_documentation CI (#15803)
coyotte508 Feb 23, 2022
c475f3c
Scheduled tests should only run on a daily basis
LysandreJik Feb 23, 2022
309e87e
Docker images should only run on a daily basis
LysandreJik Feb 23, 2022
bb7949b
Fix model templates (#15806)
LysandreJik Feb 23, 2022
7f921bc
Fix add-new-model-like when old model checkpoint is not found (#15805)
sgugger Feb 24, 2022
d1fcc90
Fix from_pretrained with default base_model_prefix (#15814)
sgugger Feb 24, 2022
35ecf99
Revert changes in logit size for semantic segmentation models (#15722)
sgugger Feb 24, 2022
ca57b45
[Unispeech] Fix slow tests (#15818)
patrickvonplaten Feb 24, 2022
2f0f903
[Barthez Tokenizer] Fix saving (#15815)
patrickvonplaten Feb 24, 2022
cbf4391
[TFXLNet] Correct tf xlnet generate (#15822)
patrickvonplaten Feb 24, 2022
b7e292a
Fix the push run (#15807)
LysandreJik Feb 24, 2022
074645e
Fix semantic segmentation pipeline test (#15826)
sgugger Feb 25, 2022
7963578
Fix dummy_inputs() to dummy_inputs in symbolic_trace doc (#15776)
pbelevich Feb 25, 2022
7566734
Add model specific output classes to PoolFormer model docs (#15746)
tanaymeh Feb 25, 2022
ad0d7d1
Adding the option to return_timestamps on pure CTC ASR models. (#15792)
Narsil Feb 25, 2022
4818bf7
HFTracer.trace should use/return self.graph to be compatible with tor…
pbelevich Feb 25, 2022
8635407
Fix tf.concatenate + test past_key_values for TF models (#15774)
ydshieh Feb 25, 2022
bf1fe32
[examples/summarization and translation] fix readme (#15833)
patil-suraj Feb 25, 2022
fd5b05e
Add ONNX Runtime quantization for text classification notebook (#15817)
echarlaix Feb 25, 2022
0118c4f
Re-enable doctests for the quicktour (#15828)
sgugger Feb 25, 2022
0b5bf6a
Framework split model report (#15825)
LysandreJik Feb 25, 2022
84eaa6a
Add TFConvNextModel (#15750)
sayakpaul Feb 25, 2022
935a76d
[UniSpeechSat] correct unispeech sat (#15847)
patrickvonplaten Feb 28, 2022
e3342ed
Flax Speech-Encoder-Decoder Model (#15613)
sanchit-gandhi Feb 28, 2022
410e26c
Fix (deprecated) ONNX exporter to account for new tf2onnx API (#15856)
lewtun Feb 28, 2022
97f9b8a
Fixing the timestamps with chunking. (#15843)
Narsil Feb 28, 2022
ddbb485
[TF-PT-Tests] Fix PyTorch - TF tests for different GPU devices (#15846)
patrickvonplaten Feb 28, 2022
df5a409
Add Data2Vec (#15507)
edugp Mar 1, 2022
9863f7d
[Benchmark tools] Deprecate all (#15848)
patrickvonplaten Mar 1, 2022
54f0db4
Add PT + TF automatic builds (#15860)
LysandreJik Mar 1, 2022
3f2e636
Update TF LM examples (#15855)
gante Mar 1, 2022
e064f08
Add time stamps for wav2vec2 with lm (#15854)
patrickvonplaten Mar 1, 2022
c008afe
Add link to notebooks (#15791)
NielsRogge Mar 1, 2022
7ff9d45
Scatter should run on CUDA (#15872)
LysandreJik Mar 1, 2022
286fdc6
[vision] Add problem_type support (#15851)
NielsRogge Mar 1, 2022
afca0d5
use python 3.7 for flax self-push tests (#15865)
patil-suraj Mar 1, 2022
00eaffc
Bump up doc node version to 16 (#15874)
mishig25 Mar 1, 2022
2642692
No self-hosted runner for dev documentation (#15710)
LysandreJik Mar 1, 2022
6ccfa21
Inference for multilingual models (#15836)
stevhliu Mar 1, 2022
b842d72
fix deepspeed tests (#15881)
stas00 Mar 2, 2022
d1a2907
Remove stash for now (#15882)
LysandreJik Mar 2, 2022
4bfe75b
M2M100 support for ONNX export (#15193)
michaelbenayoun Mar 2, 2022
4004072
[Bart] Fix implementation note doc (#15879)
patrickvonplaten Mar 2, 2022
8a13349
Add TF generate sample tests with all logit processors (#15852)
gante Mar 2, 2022
6e57a56
Adding timestamps for CTC with LM in ASR pipeline. (#15863)
Narsil Mar 2, 2022
05c237e
Update TF QA example (#15870)
gante Mar 2, 2022
2eb7bb1
Updates in Trainer to support new features in SM Model Parallel libra…
rahul003 Mar 2, 2022
e535c38
Fix tiny typo (#15884)
rhjohnstone Mar 2, 2022
d83d22f
Maskformer (#15682)
FrancescoSaverioZuppichini Mar 2, 2022
8fd4731
Fix Bug in FlaxWav2Vec2 Slow Test (#15887)
sanchit-gandhi Mar 2, 2022
96ae92b
[SegFormer] Add deprecation warning (#15889)
NielsRogge Mar 2, 2022
baab5e7
TF generate refactor - Sample (#15793)
gante Mar 2, 2022
130b987
[XGLM] run sampling test on CPU to be deterministic (#15892)
patil-suraj Mar 2, 2022
89be34c
Fix SegformerForImageClassification (#15895)
NielsRogge Mar 2, 2022
3d22428
Update delete-dev-doc job to match build-dev-doc (#15891)
sgugger Mar 2, 2022
39249c9
Fix doc links in release utils (#15903)
sgugger Mar 2, 2022
4cd7ed4
Fix a TF Vision Encoder Decoder test (#15896)
ydshieh Mar 3, 2022
439de3f
[Fix link in pipeline doc] (#15906)
patrickvonplaten Mar 3, 2022
7b3bd1f
Fix and improve REALM fine-tuning (#15297)
qqaatw Mar 3, 2022
3c4fbc6
Freeze FlaxWav2Vec2 Feature Encoder (#15873)
sanchit-gandhi Mar 3, 2022
b693cbf
The tests were not updated after the addition of `torch.diag` (#15890)
Narsil Mar 3, 2022
6cbfa7b
[Doctests] Fix ignore bug and add more doc tests (#15911)
patrickvonplaten Mar 3, 2022
79d28e8
v4.18.0.dev.0
sgugger Mar 3, 2022
3822e4a
Enabling MaskFormer in pipelines (#15917)
Narsil Mar 3, 2022
7c45fe7
Mark slow tests as slow
sgugger Mar 3, 2022
742273a
fix for the output from post_process_panoptic_segmentation (#15916)
FrancescoSaverioZuppichini Mar 3, 2022
9251427
Add vision models to doc tests (#15905)
NielsRogge Mar 3, 2022
c0281fe
Fix #15898 (#15928)
davidleonfdez Mar 3, 2022
a7df656
Update README.md (#15926)
patrickvonplaten Mar 3, 2022
a6e3b17
Re-enabling all fast pipeline tests. (#15924)
Narsil Mar 4, 2022
b714748
Update README.md
sanchit-gandhi Mar 4, 2022
6b104c5
Support CLIPTokenizerFast for CLIPProcessor (#15913)
cosmoquester Mar 4, 2022
7ade7c1
Updating the slow tests: (#15893)
Narsil Mar 4, 2022
89c7d9c
Making MaskFormerForInstanceSegmentation. (#15934)
Narsil Mar 4, 2022
01485ce
Add missing support for Flax XLM-RoBERTa (#15900)
versae Mar 4, 2022
10b7698
[FlaxT5 Example] fix flax t5 example pretraining (#15835)
patrickvonplaten Mar 4, 2022
f0aacc1
Do not change the output from tuple to list - to match PT's version (…
ydshieh Mar 4, 2022
040c11f
Tests for MaskFormerFeatureExtractor's post_process*** methods (#15929)
FrancescoSaverioZuppichini Mar 4, 2022
5c6f57e
Constrained Beam Search [*With* Disjunctive Decoding] (#15761)
cwkeam Mar 4, 2022
e8efaec
Move dependency to call method (#15941)
NielsRogge Mar 4, 2022
9932ee4
made MaskFormerModelTest faster (#15942)
FrancescoSaverioZuppichini Mar 4, 2022
ef9c3ca
[Bug Fix] Beam search example in docs fails & a fix (integrating `max…
cwkeam Mar 7, 2022
60b81df
remove re-defination of FlaxWav2Vec2ForCTCModule (#15965)
patil-suraj Mar 7, 2022
544fd98
Support modern list type hints in HfArgumentParser (#15951)
konstantinjdobler Mar 7, 2022
1a62b25
Backprop Test for Freeze FlaxWav2Vec2 Feature Encoder (#15938)
sanchit-gandhi Mar 7, 2022
2596f95
Fix Embedding Module Bug in Flax Models (#15920)
sanchit-gandhi Mar 7, 2022
e9fa7cd
Make is_thing_map in Feature Extractor post_process_panoptic_segmenta…
FrancescoSaverioZuppichini Mar 7, 2022
c87cfd6
Better error message when inputs are empty
sgugger Mar 7, 2022
38cc350
Update training scripts docs (#15931)
stevhliu Mar 7, 2022
8b9ae45
Set scale_embedding to False in some TF tests (#15952)
ydshieh Mar 7, 2022
9879a1d
Fix LayoutLMv2 test (#15939)
NielsRogge Mar 8, 2022
b19f3e6
[Tests] Fix ViTMAE integration test (#15949)
NielsRogge Mar 8, 2022
ea07064
Returning outputs only when asked for for MaskFormer. (#15936)
Narsil Mar 8, 2022
91fb62d
Speedup training by using numpy instead of jnp for batch shuffling (#…
yhavinga Mar 8, 2022
f5a080d
Do a pull in case docs were updated during build (#15922)
sgugger Mar 8, 2022
7298330
Fix TFEncoderDecoderModelTest - Pytorch device (#15979)
ydshieh Mar 8, 2022
ab2f8d1
add hf hub to env version command (#15981)
patrickvonplaten Mar 8, 2022
62d8476
Update TF multiple choice example (#15868)
gante Mar 8, 2022
70203b5
TF generate refactor - past without encoder outputs (#15944)
gante Mar 8, 2022
5b7dcc7
Seed _get_train_sampler's generator with arg seed to improve reproduc…
dlwh Mar 8, 2022
f4e4ad3
Add `ForInstanceSegmentation` models to `image-segmentation` pipeline…
Narsil Mar 9, 2022
c1aaa43
[Doctests] Move doctests to new GPU & Fix bugs (#15969)
patrickvonplaten Mar 9, 2022
3ea0469
Removed an outdated check about hdf5_version (#16011)
ydshieh Mar 9, 2022
e7f34cc
Swag example: Update doc format (#16014)
gante Mar 9, 2022
e493a3a
Fix github actions comment (#16009)
LysandreJik Mar 9, 2022
cec89e1
Simplify release utils (#15921)
sgugger Mar 9, 2022
38bce1d
Make `pos` optional to avoid crashing `PerceiverModel` operation (#15…
basilevh Mar 9, 2022
1e8f379
done (#16012)
FrancescoSaverioZuppichini Mar 9, 2022
8feede2
Fix broken code blocks in README.md (#15967)
upura Mar 9, 2022
b7fa1e3
Use tiny models for get_pretrained_model in TFEncoderDecoderModelTest…
ydshieh Mar 9, 2022
50dd314
Add ONNX export for ViT (#15658)
lewtun Mar 9, 2022
b256f35
Add FlaxBartForCausalLM (#15995)
sanchit-gandhi Mar 9, 2022
a69e185
add doctests for bart like seq2seq models (#15987)
patil-suraj Mar 9, 2022
65f9653
Fix warning message in ElectraForCausalLM (#16023)
pbelevich Mar 9, 2022
fde9018
Freeze Feature Encoder in FlaxSpeechEncoderDecoder (#15997)
sanchit-gandhi Mar 10, 2022
6c9010e
Update README.md
sanchit-gandhi Mar 10, 2022
0835119
Add Document Image Transformer (DiT) (#15984)
NielsRogge Mar 10, 2022
0951d31
Fix dependency error message in ServeCommand (#16033)
andstor Mar 10, 2022
6ce11c2
[Docs] Improve PyTorch, Flax generate API (#15988)
patrickvonplaten Mar 10, 2022
8d83ebd
[Tests] Add attentions_option to ModelTesterMixin (#15909)
NielsRogge Mar 10, 2022
b2a1c99
[README] fix url for Preprocessing tutorial (#16042)
patil-suraj Mar 10, 2022
1da84ae
Fix Bug in Flax-Speech-Encoder-Decoder Test (#16041)
sanchit-gandhi Mar 10, 2022
2f463ef
Fix TFDebertaV2ConvLayer in TFDebertaV2Model (#16031)
ydshieh Mar 10, 2022
1059139
Build the doc in a seperate folder then move it (#16020)
sgugger Mar 10, 2022
1959799
Don't compute metrics in LM examples on TPU (#16029)
sgugger Mar 10, 2022
b7018ab
TF: Unpack model inputs through a decorator (#15907)
gante Mar 10, 2022
741e493
Fix Bug in Flax Seq2Seq Models (#16021)
sanchit-gandhi Mar 10, 2022
e66743e
DeBERTa/DeBERTa-v2/SEW Support for torch 1.11 (#16043)
LysandreJik Mar 10, 2022
ba21001
support new marian models (#15831)
patil-suraj Mar 10, 2022
6b09328
Fix duplicate arguments passed to dummy inputs in ONNX export (#16045)
lewtun Mar 10, 2022
7d1bb5f
Update: Add QatMatMul and sync with update
KSGulin Mar 10, 2022
454ea60
Merge remote-tracking branch 'origin/master' into update-4.18.0-refactor
KSGulin Mar 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix SegformerForImageClassification (huggingface#15895)
* Fix reshape

* Apply suggestion from code review

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
  • Loading branch information
NielsRogge and Niels Rogge authored Mar 2, 2022
commit 89be34c36c1a44a9d420e746d654a29c96ca353e
16 changes: 14 additions & 2 deletions src/transformers/models/segformer/modeling_segformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,11 @@ def forward(

sequence_output = outputs[0]

# reshape last hidden states to (batch_size, height*width, hidden_size)
# convert last hidden states to (batch_size, height*width, hidden_size)
batch_size = sequence_output.shape[0]
if self.config.reshape_last_stage:
# (batch_size, num_channels, height, width) -> (batch_size, height, width, num_channels)
sequence_output = sequence_output.permute(0, 2, 3, 1)
sequence_output = sequence_output.reshape(batch_size, -1, self.config.hidden_sizes[-1])

# global average pooling
Expand Down Expand Up @@ -660,10 +663,19 @@ def __init__(self, config):
self.dropout = nn.Dropout(config.classifier_dropout_prob)
self.classifier = nn.Conv2d(config.decoder_hidden_size, config.num_labels, kernel_size=1)

self.config = config

def forward(self, encoder_hidden_states):
batch_size, _, _, _ = encoder_hidden_states[-1].shape
batch_size = encoder_hidden_states[-1].shape[0]

all_hidden_states = ()
for encoder_hidden_state, mlp in zip(encoder_hidden_states, self.linear_c):
if self.config.reshape_last_stage is False and encoder_hidden_state.ndim == 3:
height = width = int(math.sqrt(encoder_hidden_state.shape[-1]))
encoder_hidden_state = (
encoder_hidden_state.reshape(batch_size, height, width, -1).permute(0, 3, 1, 2).contiguous()
)

# unify channel dimension
height, width = encoder_hidden_state.shape[2], encoder_hidden_state.shape[3]
encoder_hidden_state = mlp(encoder_hidden_state)
Expand Down