Commit Graph

5117 Commits

Author SHA1 Message Date
Lysandre a75c64d80c Black 20 release 2020-08-26 17:20:22 +02:00
Lysandre e78c110338 isort 5 2020-08-26 17:13:49 +02:00
Julien Plu 02e8cd5584
Fix optimizer (#6717) 2020-08-26 11:12:44 -04:00
Lysandre Debut 77abd1e79f
Centralize logging (#6434)
* Logging

* Style

* hf_logging > utils.logging

* Address @thomwolf's comments

* Update test

* Update src/transformers/benchmark/benchmark_utils.py

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

* Revert bad change

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2020-08-26 11:10:36 -04:00
Jay Yip 461ae86812
Fix tf boolean mask in graph mode (#6741) 2020-08-26 05:15:35 -04:00
Patrick von Platen 925f34bbbd
Add "tie_word_embeddings" config param (#6692)
* add tie_word_embeddings

* correct word embeddings in modeling utils

* make style

* make config param only relevant for torch

* make style

* correct typo

* delete deprecated arg in transo-xl
2020-08-26 04:58:21 -04:00
Patrick von Platen fa8ee8e855
fix torchscript docs (#6740) 2020-08-26 04:51:56 -04:00
Sylvain Gugger 64c7c2bc15
Install nlp for github actions test (#6728) 2020-08-25 14:58:38 -04:00
Sam Shleifer 624495706c
T5Tokenizer adds EOS token if not already added (#5866)
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2020-08-25 14:56:08 -04:00
Sam Shleifer e11d923bfc
Fix pegasus-xsum integration test (#6726) 2020-08-25 14:06:28 -04:00
Tomo Lazovich 7e6397a7d8
[squad] make examples and dataset accessible from SquadDataset object (#6710)
* [squad] make examples and dataset accessible from SquadDataset object

* [squad] add support for legacy cache files
2020-08-25 13:32:56 -04:00
Funtowicz Morgan ac9702c284
Fix ONNX test_quantize unittest (#6716) 2020-08-25 13:24:40 -04:00
Zane Lim 074340339a
Create README.md (#6721)
add model card for singbert large
2020-08-26 00:11:24 +08:00
Patrick von Platen d17cce2270
add missing keys (#6719) 2020-08-25 11:38:51 -04:00
Arnav Sharma a25c9fc8e1
Selected typo fix (#6687) 2020-08-25 15:39:02 +02:00
Funtowicz Morgan 625318f525
tensor.nonzero() is deprecated in PyTorch 1.6 (#6715)
Signed-off-by: Morgan Funtowicz <funtowiczmo@gmail.com>
2020-08-25 08:12:54 -04:00
Sylvain Gugger 124c3d6adc
Add tokenizer to Trainer (#6689) 2020-08-25 07:47:09 -04:00
Sylvain Gugger abc0202194
More tests to Trainer (#6699)
* More tests to Trainer

* Add warning in the doc
2020-08-25 07:07:36 -04:00
Sylvain Gugger f5bad031bc
Use generators tqdm progressbars (#6696) 2020-08-25 07:06:58 -04:00
Sam Shleifer a99d09c6f9
add new line to make examples run (#6706) 2020-08-25 06:26:29 -04:00
Joel Hanson 4db2fa77d7
Allow tests in examples to use cuda or fp16,if they are available (#5512)
* Allow tests in examples to use cuda or fp16,if they are available

The tests in examples didn't use the cuda or fp16 even if they where available.
- The text classification example (`run_glue.py`) didn't use the fp16 even if it was available but
  the device was take based on the availablity(cuda/cpu).
- The language-modeling example (`run_language_modeling.py`) was having `--no_cuda` argument
  which made the test to work without cuda. This example is having issue when running with fp16
  thus it not enabled (got an assertion error for perplexity due to it higher value).
- The cuda and fp16 is not enabled for question-answering example (`run_squad.py`) as it is having a
  difference in the f1 score.
- The text-generation example (`run_generation.py`) will take the cuda or fp16 whenever it is available.

Resolves some of: #5057

* Unwanted import of is_apex_available was removed

* Made changes to test examples file to have the pass --fp16 only if cuda and apex is avaliable
- run_glue.py: Removed the check for cuda and fp16.
- run_generation.py: Removed the check for cuda and fp16 also removed unwanted flag creation.

* Incorrectly sorted imports fixed

* The model needs to be converted to half precision

* Formatted single line if condition statement to multiline

* The torch_device also needed to be checked before running the test on examples
- The tests in examples which uses cuda should also depend from the USE_CUDA flag,
  similarly to the rest of the test suite. Even if we decide to set USE_CUDA to
  True by default, setting USE_CUDA to False should result in the examples not using CUDA

* Format some of the code in test_examples file

* The improper import of is_apex_available was sorted

* Formatted the code to keep the style standards

* The comma at the end of list giving a flake8 issue was fixed

* Import sort was fixed

* Removed the clean_test_dir function as its not used right now
2020-08-25 06:02:07 -04:00
Yohei Tamura 841f071569
Add typing.overload for convert_ids_tokens (#6637)
* add overload for type checker

* black
2020-08-25 04:57:08 -04:00
Quentin Lhoest 0f16dd0ac2
Add DPR to models summary (#6690)
* add dpr to models summary

* minor

* minor

* Update docs/source/model_summary.rst

qa -> question answering

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

* Update docs/source/model_summary.rst

qa -> question ansering (cont'd)

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

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2020-08-25 09:57:28 +02:00
Jay 4fca874ea9
Remove hard-coded uses of float32 to fix mixed precision use (#6648) 2020-08-25 15:42:32 +08:00
Sam Shleifer 0344428f79
[s2s] round bleu, rouge to 4 digits (#6704) 2020-08-25 00:33:11 -04:00
Zane Lim b6512d2357
Add model card for singbert. (#6674)
* Add model card for singbert.

Adding a model card for singbert- bert for singlish and manglish.

* Update README.md

Add additional tags and model name.

* Update README.md

Fix tag for malay.

* Update model_cards/zanelim/singbert/README.md

Fix language

Co-authored-by: Kevin Canwen Xu <canwenxu@126.com>

* Add examples and custom widget input.

Add examples and custom widget input.

Co-authored-by: Kevin Canwen Xu <canwenxu@126.com>
2020-08-25 10:09:13 +08:00
Sylvain Gugger d20cbb886b
Fix hyperparameter_search doc (#6695) 2020-08-24 21:04:08 -04:00
Sam Shleifer 0ebc9699fa
[fixdoc] Add import to pegasus usage doc (#6698) 2020-08-24 15:54:57 -04:00
Sylvain Gugger 6b4c617666
Move unused args to kwargs (#6694) 2020-08-24 13:20:03 -04:00
Stas Bekman 912a21ec78
remove BartForConditionalGeneration.generate (#6659)
As suggested here: https://github.com/huggingface/transformers/issues/6651#issuecomment-678594233
this removes generic `generate` doc with examples not-relevant to bart.
2020-08-25 00:42:34 +08:00
Stas Bekman a8d6716ecb
Create PULL_REQUEST_TEMPLATE.md (#6660)
* Create PULL_REQUEST_TEMPLATE.md

Proposing to copy this neat feature from pytorch. This is a small template that let's a PR submitter tell which issue that PR closes.

* Update .github/PULL_REQUEST_TEMPLATE.md

Co-authored-by: Kevin Canwen Xu <canwenxu@126.com>

Co-authored-by: Kevin Canwen Xu <canwenxu@126.com>
2020-08-25 00:30:38 +08:00
Sylvain Gugger 8f98faf934
Lat fix for Ray HP search (#6691) 2020-08-24 12:15:00 -04:00
Sylvain Gugger 3a7fdd3f52
Add hyperparameter search to Trainer (#6576)
* Add optuna hyperparameter search to Trainer

* @julien-c suggestions

Co-authored-by: Julien Chaumond <chaumond@gmail.com>

* Make compute_objective an arg function

* Formatting

* Rework to make it easier to add ray

* Formatting

* Initial support for Ray

* Formatting

* Polish and finalize

* Add trial id to checkpoint with Ray

* Smaller default

* Use GPU in ray if available

* Formatting

* Fix test

* Update install instruction

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>

* Address review comments

* Formatting post-merge

Co-authored-by: Julien Chaumond <chaumond@gmail.com>
Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
2020-08-24 11:48:45 -04:00
vblagoje dd522da004
Fix PL token classification examples (#6682) 2020-08-24 11:30:06 -04:00
Sylvain Gugger a573777901
Update repo to isort v5 (#6686)
* Run new isort

* More changes

* Update CI, CONTRIBUTING and benchmarks
2020-08-24 11:03:01 -04:00
Teven d329c9b05d
Fixed DataCollatorForLanguageModeling not accepting lists of lists (#6685)
* Fixed DataCollatorForLanguageModeling + PermutationLanguageModeling not accepting lists of lists

* Update data_collator.py

* black was grumpy
2020-08-24 15:31:44 +02:00
sgugger 0a850d210e Missing commit 2020-08-24 09:23:06 -04:00
Sylvain Gugger b30879fe0c
Don't reset the dataset type + plug for rm unused columns (#6683)
* Don't reset the type of the dataset

* Formatting

* Update trainer.py

Co-authored-by: Teven <teven.lescao@gmail.com>
2020-08-24 09:22:03 -04:00
Jared T Nielsen 1a779ad7ec
Specify config filename (#6626) 2020-08-24 07:27:58 -04:00
Sagor Sarker a622705ef3
added multiple model_cards for below models (#6666)
* Create README.md

* Update README.md

* Create README.md

* Update README.md

* added multiple codeswitch model
2020-08-24 05:08:32 -04:00
Patrick von Platen 16e38940bd
Add Roberta2Roberta shared 2020-08-23 17:02:22 +02:00
Sam Shleifer f230a64094
new paper bibtex (#6656) 2020-08-23 10:03:41 -04:00
Patrick von Platen f235ee2164
Add Roberta2Roberta model card 2020-08-23 10:01:58 +02:00
Sagor Sarker 068df740bd
added model_card for model codeswitch-hineng-lid-lince and codeswitch-spaeng-lid-lince (#6663)
* Create README.md

* Update README.md

* Create README.md

* Update README.md
2020-08-22 12:13:21 -04:00
Patrick von Platen 97bb2497ab
Correct bug in bert2bert-cnn_dailymail
Model was trained with the wrong tokenizer. Retrained with correct tokenizer - thanks for spotting @lhoestq !
2020-08-22 13:44:20 +02:00
Manuel Romero 0f94151dc7
Add model card for electricidad-base-generator (#6650)
I works like a charm!
Look at the output of the example code!
2020-08-21 14:18:15 -04:00
Suraj Patil cbda72932c
[Doc model summary] add MBart model summary (#6649) 2020-08-21 13:42:59 -04:00
Patrick von Platen 9e8c494da7
Add T5-11B disclaimer
@julien-c
2020-08-21 18:11:18 +02:00
Patrick von Platen a4db4e3032
[Docs model summaries] Add pegasus to docs (#6640)
* add pegasus to docs

* Update docs/source/model_summary.rst
2020-08-21 16:22:10 +02:00
Suraj Patil d0e42a7bed
CamembertForCausalLM (#6577)
* added CamembertForCausalLM

* add in __init__ and auto model

* style

* doc
2020-08-21 13:52:54 +02:00