Commit Graph

8821 Commits

Author SHA1 Message Date
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
Bhadresh Savani
c1e47bf4fe
[Flax] Addition of FlaxPegasus (#13420)
* added initial files

* fixes pipeline

* fixes style and quality

* fixes doc issue and positional encoding

* fixes layer norm and test

* fixes quality issue

* fixes code quality

* removed extra layer norm

* added layer norm back in encoder and decoder

* added more code copy quality checks

* update tests

* Apply suggestions from code review

* fix import

* fix test

Co-authored-by: patil-suraj <surajp815@gmail.com>
2021-09-14 17:15:19 +02:00
Suraj Patil
fc3551a6d7
add flax mbart in auto seq2seq lm (#13560) 2021-09-14 19:06:41 +05:30
Sylvain Gugger
3081d3868e
Push to hub when saving checkpoints (#13503)
* Push to hub when saving checkpoints

* Add model card

* Revert partial model card

* Small fix for checkpoint

* Add tests

* Add documentation

* Fix tests

* Bump huggingface_hub

* Fix test
2021-09-14 08:02:15 -04:00
Avital Oliver
51e5eca612
Add long overdue link to the Google TRC project (#13501)
* Add long-overdue link to the Google TRC project

* Apply suggestions from code review

Co-authored-by: Suraj Patil <surajp815@gmail.com>
Co-authored-by: Stefan Schweter <stefan@schweter.it>
2021-09-14 13:41:55 +05:30
Lysandre Debut
3ab0185b06
Nightly torch ci (#13550)
* Nightly CI torch

* Version

* Reformat

* Only subset
Fix

* Revert

* Better formatting

* New channel
2021-09-13 16:17:29 -04:00
Patrick von Platen
5c14fceac0
return attention mask in int32 (#13543) 2021-09-13 14:02:23 +02:00
SaulLu
149c833b75
Small changes in perplexity.rstto make the notebook executable on google collaboratory (#13541)
* add imports

* Update docs/source/perplexity.rst

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

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-09-13 13:32:32 +02:00
Stas Bekman
f1c22dae7d
[tokenizer] use use_auth_token for config (#13523)
* [tokenizer] use use_auth_token for config

* args order
2021-09-13 07:31:35 -04:00
Patrick von Platen
d2904264ab
up (#13538) 2021-09-13 13:07:59 +02:00
Nicolas Patry
65ee1a43e5
fixing BC in fill-mask (wasn't tested in theses test suites (#13540)
apparently).
2021-09-13 12:48:54 +02:00
Patrick von Platen
9d60eebeb5
up (#13536) 2021-09-13 11:30:10 +02:00
Xiaohan Zou
a2045067c5
Fix attention mask size checking for CLIP (#13535) 2021-09-13 13:38:38 +05:30
Alex Hedges
68b0baeedc
Ignore past_key_values during GPT-Neo inference (#13521) 2021-09-13 03:06:07 -04:00
holazzer
07c2607d4d
fix use_cache value assign (#13532)
fix use_cache value assign
2021-09-13 11:18:50 +05:30
Suraj Patil
010965dcde
[GPT-Neo] Simplify local attention (#13491)
* simplify local attention

* update tests

* add a comment and use torch.bitwise_xor
2021-09-10 22:52:20 +05:30
Patrick von Platen
a57d784df5
[Wav2Vec2] Fix dtype 64 bug (#13517)
* fix

* 2nd fix
2021-09-10 18:19:10 +02:00
patrickvonplaten
72ec2f3eb5 Docs for v4.10.1 2021-09-10 16:45:19 +02:00
Matt
26d9212e3c
TF multiple choice loss fix (#13513)
Fix issues with `TFMultipleChoiceLoss` if the choices dimension is None when `build()` is called.
2021-09-10 14:49:17 +01:00
Patrick von Platen
d7b3b709d0
[Wav2Vec2] Fix normalization for non-padded tensors (#13512)
* finalize

* Apply suggestions from code review

* finish cleaner implementation

* more tests

* small fix

* finish

* up
2021-09-10 15:27:16 +02:00
Nicolas Patry
c63fcabfe9
[Large PR] Entire rework of pipelines. (#13308)
* Enabling dataset iteration on pipelines.

Enabling dataset iteration on pipelines.

Unifying parameters under `set_parameters` function.

Small fix.

Last fixes after rebase

Remove print.

Fixing text2text `generate_kwargs`

No more `self.max_length`.

Fixing tf only conversational.

Consistency in start/stop index over TF/PT.

Speeding up drastically on TF (nasty bug where max_length would increase
a ton.)

Adding test for support for non fast tokenizers.

Fixign GPU usage on zero-shot.

Fix working on Tf.

Update src/transformers/pipelines/base.py

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

Update src/transformers/pipelines/base.py

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

Small cleanup.

Remove all asserts + simple format.

* Fixing audio-classification for large PR.

* Overly explicity null checking.

* Encapsulating GPU/CPU pytorch manipulation directly within `base.py`.

* Removed internal state for parameters of the  pipeline.

Instead of overriding implicitly internal state, we moved
to real named arguments on every `preprocess`, `_forward`,
`postprocess` function.

Instead `_sanitize_parameters` will be used to split all kwargs
of both __init__ and __call__ into the 3 kinds of named parameters.

* Move import warnings.

* Small fixes.

* Quality.

* Another small fix, using the CI to debug faster.

* Last fixes.

* Last fix.

* Small cleanup of tensor moving.

* is not None.

* Adding a bunch of docs + a iteration test.

* Fixing doc style.

* KeyDataset = None guard.

* RRemoving the Cuda test for pipelines (was testing).

* Even more simple iteration test.

* Correct import .

* Long day.

* Fixes in docs.

* [WIP] migrating object detection.

* Fixed the target_size bug.

* Fixup.

* Bad variable name.

* Fixing `ensure_on_device` respects original ModelOutput.
2021-09-10 14:47:48 +02:00