Commit Graph

8821 Commits

Author SHA1 Message Date
Stas Bekman
8362d07d63
[CI/pt-nightly] switch to cuda-11.3 (#14726) 2021-12-13 09:53:48 -05:00
Lysandre Debut
6e05bb1c96
Fix the perceiver docs (#14748) 2021-12-13 09:29:47 -05:00
Suzen Fylke
c17e7cde32
Add ability to get a list of supported pipeline tasks (#14732) 2021-12-13 08:31:50 -05:00
Lysandre Debut
3d66146afc
Fixing tests for Perceiver (#14745)
- Do not run image-classification pipeline (_CHECKPOINT_FOR_DOC uses the checkpoint for
langage, which cannot load a FeatureExtractor so current logic fails).
- Add a safeguard to not run tests when `tokenizer_class` or
`feature_extractor_class` **are** defined, but cannot be loaded
This happens for Perceiver for the "FastTokenizer" (which doesn't exist
so None) and FeatureExtractor (which does exist but cannot be loaded
because the checkpoint doesn't define one which is reasonable for the
said checkpoint)
- Added `get_vocab` function to `PerceiverTokenizer` since it is used by
`fill-mask` pipeline when the argument `targets` is used to narrow a
subset of possible values.

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
2021-12-13 08:13:39 -05:00
NielsRogge
4c99e553c1
Improve documentation of some models (#14695)
* Migrate docs to mdx

* Update TAPAS docs

* Remove lines

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Apply some more suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Add pt/tf switch to code examples

* More improvements

* Improve docstrings

* More improvements

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-12-13 13:24:36 +01:00
Yih-Dar
32eb29fef9
Fix doc examples: modify config before super().__init__ (#14697)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-12-13 12:50:02 +01:00
Nathan Cooper
48bf7e47a0
Code parrot minor fixes/niceties (#14666)
* Add some nicety flags for better controlling evaluation.

* Fix dependency issue with outdated requirement

* Add additional flag to example to ensure eval is done

* Wrap code into main function for accelerate launcher to find

* Fix valid batch size flag in readme

* Add note to install git-lfs when initializing/training the model

* Update examples/research_projects/codeparrot/scripts/arguments.py

Co-authored-by: Leandro von Werra <lvwerra@users.noreply.github.com>

* Update examples/research_projects/codeparrot/README.md

Co-authored-by: Leandro von Werra <lvwerra@users.noreply.github.com>

* Revert "Wrap code into main function for accelerate launcher to find"

This reverts commit ff11df1c81.

* Fix formatting issue

* Move git-lfs instructions to installation section

* Add a quick check before code generation for code evaluation

* Fix styling issue

* Update examples/research_projects/codeparrot/scripts/human_eval.py

Co-authored-by: Leandro von Werra <lvwerra@users.noreply.github.com>

* Make iterable dataset use passed in tokenizer rather than globally defined one

Co-authored-by: Leandro von Werra <lvwerra@users.noreply.github.com>
Co-authored-by: ncoop57 <nac33@students.uwf.edu>
2021-12-13 09:30:50 +01:00
Patrick von Platen
91f3dfbfdd
[Adafactor] Fix adafactor (#14713)
* correct changes

* add comment
2021-12-12 13:31:46 +01:00
Patrick von Platen
86dd23bb8b
Update bug-report.md (#14715) 2021-12-12 13:30:44 +01:00
Suraj Patil
6a025487a6
[Flax examples] remove dependancy on pytorch training args (#14636)
* use custom training arguments

* update tests
2021-12-12 09:19:12 +05:30
Stas Bekman
027074f4d0
[doc] document MoE model approach and current solutions (#14725)
* document MoE model approach

* additional info from Samyam

* fix
2021-12-10 18:24:38 -08:00
Nicolas Patry
7cb1fdd4d1
Fixing tests for perceiver (texts) (#14719)
* Fixing tests for perceiver (texts)

* For MaskedLM
2021-12-10 19:38:59 -05:00
Sylvain Gugger
39fbb068be Empty commit to retrigger build doc 2021-12-10 17:55:16 -05:00
Sylvain Gugger
5eca742f6c
Fix special character in MDX (#14721) 2021-12-10 16:02:48 -05:00
Sylvain Gugger
63c284c2d4 Prevent style_doc from tempering the config file 2021-12-10 15:31:43 -05:00
Sylvain Gugger
f46668282b Fix path for notebooks 2021-12-10 15:03:17 -05:00
Sylvain Gugger
3b2d1652e4 Fix typo in branch name 2021-12-10 14:38:21 -05:00
Sylvain Gugger
1b75d7238c
Automatically build doc notebooks (#14718)
* Test workflow

* Build doc

* Make a clean build

* Add doc config

* Restore other workflows

* Final job

* Print something in else statements

* Pull before making changes
2021-12-10 14:20:56 -05:00
Yih-Dar
ae82ee6a48
Fix doc examples: unexpected keyword argument (#14689)
* Fix doc examples: unexpected keyword argument

* Don't delete token_type_ids from inputs

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-12-10 11:44:08 -05:00
Nicolas Patry
5b00400198
Adding Perceiver to AutoTokenizer. (#14711) 2021-12-10 15:29:18 +01:00
Yih-Dar
59d684fa92
Fix examples: 'CausalLMOutputWithCrossAttentions' object has no attribute 'last_hidden_state' (#14678)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-12-10 14:55:54 +01:00
Yih-Dar
8395f14de6
Fix doc examples: KeyError (#14699)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-12-10 13:26:37 +05:30
Sylvain Gugger
bab1556456
Put back open in colab markers (#14684) 2021-12-09 12:00:06 -05:00
Tikeng Notsawo Pascal Junior
3bc7d70e9c
Fix : wrong link in the documentation (ConvBERT vs DistilBERT) (#14705) 2021-12-09 11:35:22 -05:00
Lysandre
4701a1a182 Patch release script 2021-12-09 17:21:08 +01:00
Lysandre
ab31b3e41b Docs for v4.14.0dev0 2021-12-09 17:09:23 +01:00
Lysandre
4da3a696e4 Release: v4.13.0 2021-12-09 16:55:21 +01:00
Mishig Davaadorj
60be4bf8ac
Fix typo in toctree (#14704) 2021-12-09 09:25:31 -05:00
Philipp Schmid
da7aabf2ca
add str hub token to repository when provided else fallback to default (#14682)
* add str hub token to repository when provided else fallback to default True

* make style
2021-12-09 08:42:23 -05:00
NielsRogge
7375758bee
Fix tests (#14703) 2021-12-09 08:32:35 -05:00
Sylvain Gugger
68e53e6fcd
Add a job to test doc building (for realsies this time) (#14662) 2021-12-09 07:01:03 -05:00
Sylvain Gugger
e9800122a6 Add kenlm dep to missing tests 2021-12-08 19:59:44 -05:00
Yih-Dar
ee6674d450
Fix doc examples: name '...' is not defined (#14687)
* Fix doc examples: name '...' is not defined

* remove >>> and ... in some docstrings in visual_bert

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-12-08 16:39:35 -05:00
Sylvain Gugger
e6219320b9
Make MLuke tokenizer tests slow (#14690) 2021-12-08 15:59:57 -05:00
Sylvain Gugger
13186d7152
Move pyctcdecode (#14686)
* Move pyctcdecode dep

* Fix doc and last objects

* Quality

* Style

* Ignore this black
2021-12-08 15:41:58 -05:00
Stas Bekman
d104dd46d9
[trainer] support UserDict inputs (torch-nightly) (#14688) 2021-12-08 12:21:43 -08:00
Stas Bekman
1228661285
[bf16 support] tweaks (#14580)
* [bf16 support] tweaks

* corrections

Co-authored-by: Manuel R. Ciosici <manuelrciosici@gmail.com>
2021-12-08 11:33:24 -08:00
Yih-Dar
16870d114b
Fix wrong checkpoint paths in doc examples (#14685)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-12-08 14:25:48 -05:00
Sylvain Gugger
01b8cd5932
Revert open-in-colab and add perceiver (#14683) 2021-12-08 13:52:31 -05:00
Sylvain Gugger
f6b87c5f30
Fixes in init (#14681)
* Fixes in init

* Style
2021-12-08 13:42:22 -05:00
Dhruv Nair
fe06f8dcac
Improvements to Comet Integration (#14680)
* change args to address overwriting issue

* remove project name from args

* remove passing args as kwargs to experiment object

* remove passing args as kwargs to offline experiment

* fix offline directory assignment in experiment kwargs

* log checkpoint folder on training end

* log entire output_dir as asset folder

* log asset folder  recursively

* end experiment at the end of training

* clean up

* clean up

* Default to always log training assets to Comet when using CometCallback

* change logging training assets to be true when running callback setup

* fix so that experiment always ends when training ends

* styling and quality fixes

* update docstring for COMET_LOG_ASSETS environment variable

* run styling and quality checks

* clean up to docstring

* remove merge markers

* change asset logging to false to avoid hitting max assets per experiment limit

* update training asset description

* fix styling
2021-12-08 13:39:10 -05:00
Gaurang Tandon
4ea19de80c
fix: verify jsonlines file in run_translation (#14660) (#14661)
* fix: verify jsonl in run_translation (#14660)

* fix(run_translation.py): json/jsonl validation

Both json and jsonl are to be accepted as valid jsonlines file extension

* fix(run_translation.py): make black happy

* Ran make style
2021-12-08 13:25:30 -05:00
Sylvain Gugger
cf36f4d7a8
Convert tutorials (#14665)
* Convert a few docs

* And another

* Last tutorials

* New syntax for colab links

* Convert a few docs

* And another

* Last tutorials

* New syntax for colab links
2021-12-08 13:19:46 -05:00
lewtun
0f4e39c559
Revert "Added support for other features for already supported models (#14358)" (#14679)
This reverts commit 0c70f145d1.
2021-12-08 13:04:40 -05:00
Michael Benayoun
0c70f145d1
Added support for other features for already supported models (#14358)
* Added support for other features for already supported models

* Partial support for causal and seq2seq models

* Partial support for causal and seq2seq models

* OnnxSeq2SeqConfigWithPast to support seq2seq models

* Parameterized the onnx tests

* Restored run_mlm.py

* Restored run_mlm.py

* [WIP] BART update

* BART and MBART

* Added comments

* Another sequence length of the past_key_values
2021-12-08 18:39:56 +01:00
Patrick von Platen
ee4fa2e465
[AutoProcessor] Add Wav2Vec2WithLM & small fix (#14675)
* [AutoProcessor] Add Wav2Vec2WithLM & small fix

* revert line removal

* Update src/transformers/__init__.py

* add test

* up

* up

* small fix
2021-12-08 15:51:28 +01:00
Lysandre Debut
2294071a0c
Fix doc builder (#14676) 2021-12-08 09:14:36 -05:00
ZOHETH
fab3b518ef
fix deprecated tf method (#14671)
tf.matrix_band_part -> tf.linalg.band_part
2021-12-08 13:43:21 +00:00
NielsRogge
65b20b739b
Add Perceiver IO (#14487)
* First draft

* Style and remove mlm

* Make forward pass work

* More improvements

* More improvements

* Fix bug

* More improvements

* More improvements

* Add PerceiverTokenizer first draft

* Improve conversion script

* More improvements

* Make conversion script work for the encoder

* Make conversion script work with local pickle files

* Style & quality, fix-copies

* Add dummy input to conversion script

* Add absolute position embeddings to TextPreProcessor

* Make forward pass of encoder work

* More improvements

* Move text preprocessor to separate script

* More improvements

* More improvements

* Add post processor

* Make MLM model work

* Style

* Add PerceiverForMaskedLM

* Add PerceiverImagePreprocessor

* Make style

* Make PerceiverForImageClassification work

* More improvements

* More improvements

* Use tokenizer in conversion script

* Use PerceiverForMaskedLM in conversion script

* Define custom PerceiverModelOutput

* Improve PerceiverAttention to make it work for both MLM and image classification

* More improvements

* More improvements

* More improvements to the conversion script

* Make conversion script work for both MLM and image classification

* Add PerceiverFeatureExtractor

* More improvements

* Style and quality

* Add center cropping

* Fix bug

* Small fix

* Add print statement

* Fix bug in image preprocessor

* Fix bug with conversion script

* Make output position embeddings an nn.Parameter layer instead of nn.Embedding

* Comment out print statements

* Add position encoding classes

* More improvements

* Use position_encoding_kwargs

* Add PerceiverForImageClassificationFourier

* Make style & quality

* Add PerceiverForImageClassificationConvProcessing

* Style & quality

* Add flow model

* Move processors to modeling file

* Make position encodings modular

* Make basic decoder use modular position encodings

* Add PerceiverForOpticalFlow to conversion script

* Add AudioPreprocessor

* Make it possible for the basic decoder to use Fourier position embeddings

* Add PerceiverForMultimodalAutoencoding

* Improve model for optical flow

* Improve _build_network_inputs method

* Add print statement

* Fix device issue

* Fix device of Fourier embeddings

* Add print statements for debugging

* Add another print statement

* Add another print statement

* Add another print statement

* Add another print statement

* Improve PerceiverAudioPreprocessor

* Improve conversion script for multimodal modal

* More improvements

* More improvements

* Improve multimodal model

* Make forward pass multimodal model work

* More improvements

* Improve tests

* Fix some more tests

* Add output dataclasses

* Make more tests pass

* Add print statements for debuggin

* Add tests for image classification

* Add PerceiverClassifierOutput

* More improvements

* Make more tests pass for the optical flow model

* Make style & quality

* Small improvements

* Don't support training for optical flow model for now

* Fix _prepare_for_class for tests

* Make more tests pass, add some docs

* Add multimodal model to tests

* Minor fixes

* Fix tests

* Improve conversion script

* Make fixup

* Remove pos_dim argument

* Fix device issue

* Potential fix for OOM

* Revert previous commit

* Fix test_initialization

* Add print statements for debugging

* Fix print statement

* Add print statement

* Add print statement

* Add print statement

* Add print statement

* Add print statement

* Add print statement

* Remove need for output_shape

* Comment out output_shape

* Remove unnecessary code

* Improve docs

* Fix make fixup

* Remove PerceiverTextProcessor from init

* Improve docs

* Small improvement

* Apply first batch of suggestions from code review

* Apply more suggestions from code review

* Update docstrings

* Define dicts beforehand for readability

* Rename task to architecture in conversion script, include PerceiverModel in tests

* Add print statements for debugging

* Fix tests on GPU

* Remove preprocessors, postprocessors and decoders from main init

* Add integration test

* Fix docs

* Replace einops by torch

* Update for new docs frontend

* Rename PerceiverForImageClassification

* Improve docs

* Improve docs

* Improve docs of PerceiverModel

* Fix some more tests

* Improve center_crop

* Add PerceiverForSequenceClassification

* Small improvements

* Fix tests

* Add integration test for optical flow model

* Clean up

* Add tests for tokenizer

* Fix tokenizer by adding special tokens properly

* Fix CI
2021-12-08 14:20:34 +01:00
Patrick von Platen
961732c276
[Wav2Vec2] PyCTCDecode Integration to support language model boosted decoding (#14339)
* up

* up

* up

* make it cleaner

* correct

* make styhahalal

* add more tests

* finish

* small fix

* make style

* up

* tryout to solve cicrle ci

* up

* fix more tests

* fix more tests

* apply sylvains suggestions

* fix import

* correct docs

* add pyctcdecode only to speech tests

* fix more tests

* add tf, flax and pt tests

* add pt

* fix last tests

* fix more tests

* Apply suggestions from code review

* change lines

* Apply suggestions from code review

Co-authored-by: Anton Lozhkov <aglozhkov@gmail.com>

* correct tests

* correct tests

* add doc string

Co-authored-by: Anton Lozhkov <aglozhkov@gmail.com>
2021-12-08 12:07:54 +01:00