Commit Graph

7991 Commits

Author SHA1 Message Date
Patrick von Platen
8e908c8c74
[AutoTokenizer] Allow creation of tokenizers by tokenizer type (#13668)
* up

* up
2021-09-22 00:29:38 +02:00
Patrick von Platen
2608944dc2
up (#13688) 2021-09-22 00:28:43 +02:00
Kamal Raj
8565d38f30
Update modeling_flax_wav2vec2.py (#13680)
conv kernel_size to Tuple,
Flax Version 0.3.5 breaking change, https://github.com/google/flax/releases/tag/v0.3.5
2021-09-21 23:36:13 +02:00
Sylvain Gugger
d16bec9530 Skip FlaxWav2Vec2 test until fixed 2021-09-21 16:17:01 -04:00
Nishant Prabhu
ddd4d02f30
Layoutlm onnx support (Issue #13300) (#13562)
* Add support for exporting PyTorch LayoutLM to ONNX

* Added tests for converting LayoutLM to ONNX

* Add support for exporting PyTorch LayoutLM to ONNX

* Added tests for converting LayoutLM to ONNX

* cleanup

* Removed regression/ folder

* Add support for exporting PyTorch LayoutLM to ONNX

* Added tests for converting LayoutLM to ONNX

* cleanup

* Fixed import error

* Remove unnecessary import statements

* Changed max_2d_positions from class variable to instance variable of the config class

* Add support for exporting PyTorch LayoutLM to ONNX

* Added tests for converting LayoutLM to ONNX

* cleanup

* Add support for exporting PyTorch LayoutLM to ONNX

* cleanup

* Fixed import error

* Changed max_2d_positions from class variable to instance variable of the config class

* Use super class generate_dummy_inputs method

Co-authored-by: Michael Benayoun <mickbenayoun@gmail.com>

* Add support for Masked LM, sequence classification and token classification

Co-authored-by: Michael Benayoun <mickbenayoun@gmail.com>

* Removed uncessary import and method

* Fixed code styling

* Raise error if PyTorch is not installed

* Remove unnecessary import statement

Co-authored-by: Michael Benayoun <mickbenayoun@gmail.com>
2021-09-21 15:39:37 -04:00
Sylvain Gugger
b7d264be0d
Add push_to_hub to no_trainer examples (#13659)
* Add push_to_hub to no_trainer examples

* Quality

* Document integration

* Roll out to other examples
2021-09-21 13:13:30 -04:00
Stas Bekman
a722c301bf
[SinusoidalPositionalEmbedding] incorrect dtype when make_weights in forward (#13665) 2021-09-21 09:05:05 -07:00
Anton Lozhkov
1417978cd4
[SequenceFeatureExtractor] Rewrite padding logic from pure python to numpy (#13650)
* Test np padding

* Pass feature extraction tests

* Update type hints

* Fix flaky integration tests

* Try a more stable waveform

* Add to_numpy jax support

* int32 attention masks

* Refactor normalization tests
2021-09-21 17:10:13 +03:00
Kamal Raj
8d533e6ad6
Typo "UNKWOWN" -> "UNKNOWN" (#13675) 2021-09-21 09:11:26 -04:00
Kamal Raj
78807d86eb
[FLAX] Question Answering Example (#13649)
* flax qa example

* Updated README:  Added Large model

* added utils_qa.py FULL_COPIES

* Updates:
1. Copyright Year updated
2. added dtype arg
3. passing seed and dtype to load model
4. Check eval flag before running eval

* updated README

* updated code comment
2021-09-21 18:34:48 +05:30
Kamal Raj
a2dec768a2
beit-flax (#13515)
* beit-flax

* updated FLAX_BEIT_MLM_DOCSTRING

* removed bool_masked_pos from classification

* updated Copyright

* code refactoring: x -> embeddings

* updated test: rm from_pt

* Update docs/source/model_doc/beit.rst

* model code dtype updates and
other changes according to review

* relative_position_bias
revert back to pytorch design
2021-09-21 13:34:19 +02:00
Patrick von Platen
48fa42e5d5
Add Speech AutoModels (#13655)
* upload

* correct

* correct

* correct

* finish

* up

* up

* up again
2021-09-21 08:50:33 +02:00
flozi00
ea92136597
Fix typo distilbert doc (#13643) 2021-09-20 15:10:33 -04:00
Lowin
28d5700aae
fix research_projects/mlm_wwm readme.md examples (#13646)
the variables of run example is not correct
2021-09-20 15:01:35 -04:00
Sylvain Gugger
002a078aff
Dynamically load model code from the Hub (#13467)
* Dynamic model

* Use defensive flag

* Style

* Doc and arg rename

* Arg rename

* Add tests

* Apply suggestions from code review

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>

* Apply suggestions from code review

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>

* Address review comments

* Apply suggestions from code review

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
2021-09-20 13:59:21 -04:00
flozi00
aeb2dac04d
Change https:/ to https:// (#13644) 2021-09-20 12:31:46 -04:00
Stas Bekman
0af901e83f
[megatron_gpt2] checkpoint v3 (#13508)
* [megatron_gpt2] checkpoint v3

* bug fix

* fixes

* switch to default  from  - which is what the current megatron-lm uses

* cleanup

* back compat
2021-09-20 08:50:54 -07:00
Kamal Raj
936b3fdeaa
Update modeling_tf_deberta.py (#13654)
Fixed expand_dims axis
2021-09-20 11:11:04 -04:00
Ayaka Mikazuki
04976a32dc
Fix mT5 documentation (#13639)
* Fix MT5 documentation

The abstract is incomplete

* MT5 -> mT5
2021-09-20 07:53:31 -04:00
Chengjiang Li
fe379f856b
[Fix]Make sure the args tb_writer passed to the TensorBoardCallback works (#13636) 2021-09-20 07:50:03 -04:00
Gunjan Chhablani
d8049331dc
Add FNet (#13045)
* Init FNet

* Update config

* Fix config

* Update model classes

* Update tokenizers to use sentencepiece

* Fix errors in model

* Fix defaults in config

* Remove position embedding type completely

* Fix typo and take only real numbers

* Fix type vocab size in configuration

* Add projection layer to embeddings

* Fix position ids bug in embeddings

* Add minor changes

* Add conversion script and remove CausalLM vestiges

* Fix conversion script

* Fix conversion script

* Remove CausalLM Test

* Update checkpoint names to dummy checkpoints

* Add tokenizer mapping

* Fix modeling file and corresponding tests

* Add tokenization test file

* Add PreTraining model test

* Make style and quality

* Make tokenization base tests work

* Update docs

* Add FastTokenizer tests

* Fix fast tokenizer special tokens

* Fix style and quality

* Remove load_tf_weights vestiges

* Add FNet to  main README

* Fix configuration example indentation

* Comment tokenization slow test

* Fix style

* Add changes from review

* Fix style

* Remove bos and eos tokens from tokenizers

* Add tokenizer slow test, TPU transforms, NSP

* Add scipy check

* Add scipy availabilty check to test

* Fix tokenizer and use correct inputs

* Remove remaining TODOs

* Fix tests

* Fix tests

* Comment Fourier Test

* Uncomment Fourier Test

* Change to google checkpoint

* Add changes from review

* Fix activation function

* Fix model integration test

* Add more integration tests

* Add comparison steps to MLM integration test

* Fix style

* Add masked tokenization fix

* Improve mask tokenization fix

* Fix index docs

* Add changes from review

* Fix issue

* Fix failing import in test

* some more fixes

* correct fast tokenizer

* finalize

* make style

* Remove additional tokenization logic

* Set do_lower_case to False

* Allow keeping accents

* Fix tokenization test

* Fix FNet Tokenizer Fast

* fix tests

* make style

* Add tips to FNet docs

Co-authored-by: patrickvonplaten <patrick.v.platen@gmail.com>
2021-09-20 13:24:30 +02:00
Suraj Patil
87d5057d86
fix typo (#13647) 2021-09-20 13:22:26 +05:30
calpt
b518aaf193
Fix GPT2Config parameters in GPT2ModelTester (#13630) 2021-09-17 15:36:23 -04:00
Lysandre Debut
300ee0c7b2
Updated tiny distilbert models (#13631) 2021-09-17 15:35:34 -04:00
Yih-Dar
afb07a79ab
fix some docstring in encoder-decoder models (#13611)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-09-17 17:39:35 +02:00
Alessandro Suglia
19b7acdd61
Cloned tensors after indexing in _compute_attn_output_with_global_indices (#13613)
Co-authored-by: Alessandro Suglia <asuglia@fb.com>
2021-09-17 17:05:49 +02:00
Alex Hedges
ce32c69c0b
Use config_dict_or_path for deepspeed.zero.Init (#13614) 2021-09-17 07:57:27 -07:00
Matt
0eb02871dd
Removed console spam from misfiring warnings (#13625)
* Removed misfiring warnings

* Revert "Removed misfiring warnings"

This reverts commit cea90de325056b9c1cbcda2bd2613a785c1639ce.

* Retain the warning, but only when the user actually overrides things

* Fix accidentally breaking just about every model on the hub simultaneously

* Style pass
2021-09-17 15:44:33 +01:00
Li-Huai (Allan) Lin
da8beaaf76
Fix special tokens not correctly tokenized (#13489)
* Fix special tokens not correctly tokenized

* Add testing

* Fix

* Fix

* Use user workflows instead of directly assigning variables

* Enable test of fast tokenizers

* Update test of canine tokenizer
2021-09-17 10:28:28 -04:00
Patrick von Platen
1f9dcfc1ef
[Trainer] Add nan/inf logging filter (#13619)
* finish

* add test

* push

* remove unnecessary code

* up

* correct test

* Update src/transformers/training_args.py
2021-09-17 16:21:59 +02:00
Ibraheem Moosa
eae7a96b7d
Optimize Token Classification models for TPU (#13096)
* Optimize Token Classification models for TPU

As per the XLA document XLA cannot handle masked indexing well. So token classification
models for BERT and others use an implementation based on `torch.where`. This implementation
works well on TPU. 

ALBERT token classification model uses the masked indexing which causes performance issues
on TPU. This PR fixes this issue by following the BERT implementation.

* Same fix for ELECTRA

* Same fix for LayoutLM
2021-09-17 10:07:52 -04:00
Benjamin Davidson
e02ed0ee7e
XLMR tokenizer is fully picklable (#13577)
* made tokenizer fully picklable

* remove whitespace

* added testcase
2021-09-16 16:30:05 -04:00
Sylvain Gugger
af5c6ae5ed
Properly use test_fetcher for examples (#13604)
* Properly use test_fetcher for examples

* Fake example modification

* Fake modeling file modification

* Clean fake modifications

* Run example tests for any modification.
2021-09-16 15:13:00 -04:00
Stas Bekman
bec2e3f55c
[deepspeed] replaced deprecated init arg (#13587)
* [deepspeed] replaced deprecated init arg

* Trigger CI
2021-09-16 12:12:16 -07:00
Patrick von Platen
4d5b4c7863
Feature Extractor: Wav2Vec2 & Speech2Text - Allow truncation + padding=longest (#13600)
* correct

* add tests

* Update src/transformers/feature_extraction_sequence_utils.py

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

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-09-16 20:02:54 +02:00
Matt
e59041684e
DataCollatorForTokenClassification numpy fix (#13609)
* Fix issue when labels are supplied as Numpy array instead of list

* Fix issue when labels are supplied as Numpy array instead of list

* Fix same issue in the `TokenClassification` data collator

* Style pass
2021-09-16 18:00:59 +01:00
Sylvain Gugger
88dbbfb2d6
Fix make fix-copies with type annotations (#13586) 2021-09-16 11:55:37 -04:00
Lysandre Debut
cec1c63642
Fix test (#13608) 2021-09-16 11:33:08 -04:00
Matt
5c5937182a
Fix DataCollatorForSeq2Seq when labels are supplied as Numpy array instead of list (#13582)
* Fix issue when labels are supplied as Numpy array instead of list

* Fix issue when labels are supplied as Numpy array instead of list
2021-09-16 15:35:57 +01:00
Patrick von Platen
421929b556
finish (#13593) 2021-09-16 10:07:47 +02:00
Patrick von Platen
b5bab710f7
correct (#13585) 2021-09-16 09:07:20 +02:00
Stas Bekman
89da1bfeac
[ci] nightly: add deepspeed master (#13589) 2021-09-15 20:18:34 -04:00
Patrick von Platen
95f933ea85
[Pretrained Model] Add resize_position_embeddings (#13559)
* finish

* delete bogus file

* correct some stuff

* finish

* finish
2021-09-15 19:03:56 +02:00
elishowk
c783e14887
upgrade sentencepiece version (#13564) 2021-09-15 15:25:03 +02:00
Suraj Patil
e86c02ea90
Fix GPTNeo onnx export (#13524)
Update GPT Neo ONNX config to match the changes implied by the simplification of the local attention

Co-authored-by: Michael Benayoun <michael@huggingface.co>
2021-09-15 13:08:41 +02:00
Bhadresh Savani
3fbb55c757
[Flax] Fixes typo in Bart based Flax Models (#13565) 2021-09-15 11:03:52 +05:30
Sylvain Gugger
7bd16b8776
Fix test_fetcher when setup is updated (#13566)
* Fix test_fetcher when setup is updated

* Remove example
2021-09-14 13:33:41 -04:00
elishowk
054b6013c2
separate model card git push from the rest (#13514)
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-09-14 18:07:36 +02:00
Sylvain Gugger
9f318be3d3 Fix yml syntax error 2021-09-14 11:31:17 -04:00
Sylvain Gugger
801ec115cf
Add checks to build cleaner model cards (#13542)
* Add checks to build cleaner model cards

* Address review comments
2021-09-14 11:27:32 -04:00