Commit Graph

15053 Commits

Author SHA1 Message Date
kmckiern
9b3eb81014
if learning rate is a tensor, get item (float) (#18861) 2022-09-02 07:46:31 -04:00
Steven Liu
142e12afb4
Split docs on modality (#18205)
* update

* 🖍 add missing files

* 📝 add nested sections

* 🖍 align titles with tasks

* oops

* remove quotes from titles
2022-09-01 15:19:11 -05:00
Ankur Goyal
23fab60b67
Pin revision for LayoutLMForQuestionAnswering and TFLayoutLMForQuestionAnswering tests (#18854)
* Pin revision for tests

* Fixup

* Update revision in models

* Shorten revisions

Co-authored-by: Ankur Goyal <ankur@impira.com>
2022-09-01 12:52:33 -04:00
OlivierDehaene
ddb69e5af8
Add Image To Text Generation pipeline (#18821)
* Add Image2TextGenerationPipeline to supported pipelines

* Add Flax and Tensorflow support

* Add Flax and Tensorflow small tests

* Add default model for Tensorflow

* Add docstring

* Fix doc style

* Add tiny models for pytorch and flax

* Remove flax from pipeline.
Fix tests

* Use ydshieh/vit-gpt2-coco-en as a default for both PyTorch and Tensorflow

* Fix Tensorflow support

Co-authored-by: Olivier Dehaene <olivier@huggingface.co>
2022-09-01 12:07:14 -04:00
Sylvain Gugger
c61f116b63
Tie weights after preparing the model in run_clm (#18855) 2022-09-01 12:06:56 -04:00
Cody Yu
1c381f3600
Cache results of is_torch_tpu_available() (#18777)
* Cache results of is_torch_tpu_available()

* Update src/transformers/utils/import_utils.py

* Update src/transformers/utils/import_utils.py
2022-09-01 11:45:33 -04:00
Sayak Paul
954e18ab97
TensorFlow MobileViT (#18555)
* initial implementation.

* add: working model till image classification.

* add: initial implementation that passes intg tests.

Co-authored-by: Amy <aeroberts4444@gmail.com>

* chore: formatting.

* add: tests (still breaking because of config mismatch).

Coo-authored-by: Yih <2521628+ydshieh@users.noreply.github.com>

* add: corrected tests and remaning changes.

* fix code style and repo consistency.

* address PR comments.

* address Amy's comments.

* chore: remove from_pt argument.

* chore: add full-stop.

* fix: TFLite model conversion in the doc.

* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py

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

* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py

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

* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py

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

* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py

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

* Update src/transformers/models/mobilevit/modeling_tf_mobilevit.py

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

* apply formatting.

* chore: remove comments from the example block.

* remove identation in the example.

Co-authored-by: Amy <aeroberts4444@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-09-01 10:35:15 -04:00
Gustavo de Rosa
fe58929ad6
Adds timeout argument to training_args to avoid socket timeouts in DDP (#18562)
* chore(training_args): Adds support for timeout argument.

* fix(training_args): Passes make style through changes.

* fix(training_args): Removes wrong docstring sentence.

* fix(training_args): Fixes timeout not being JSON serializable.

* fix(training_args_sm): Also updates timeout to timeout_delta.

* fix(training_args): Fixes PR according to suggestions.
2022-09-01 10:33:53 -04:00
kumapo
ab663b2274
reflect max_new_tokens in Seq2SeqTrainer (#18786)
* reflect max_new_tokens in gen_kwargs to `trainer.generate()`

* reflect max_new_tokens in `Seq2SeqTrainer`

* remove unnecessary variable

* Trigger CI

* fix style
2022-09-01 09:12:38 -04:00
Pedro Cuenca
f719c0377f
Minor typo in prose of model outputs documentation. (#18848) 2022-09-01 12:05:40 +02:00
Albert Villanova del Moral
fafbb57df1
Pin rouge_score (#18247)
* Pin rouge_score

* Pin also in dependency_versions_table

* Update excluded versions

* Revert "Update excluded versions"

This reverts commit 0d0362df30.

* Revert "Revert "Update excluded versions""

This reverts commit 66c47af8a6.
2022-09-01 12:04:49 +02:00
Yih-Dar
e7da38f5dc
add a script to get time info. from GA workflow jobs (#18822)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-01 12:02:52 +02:00
Joao Gante
6e016634f1
Generate: smaller TF serving test (#18840) 2022-09-01 10:53:39 +01:00
Yih-Dar
563a8d58db
Delete state_dict to release memory as early as possible (#18832)
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-01 10:55:30 +02:00
Albert Villanova del Moral
a26c752353
Unpin fsspec (#18846) 2022-09-01 10:20:15 +02:00
flozi00
359f7b4b8d
Create pipeline_tutorial.mdx german docs (#18625)
* Create pipeline_tutorial.mdx

* Update _toctree.yml
2022-09-01 09:57:59 +02:00
Alara Dirik
5d81a56833
Owlvit memory leak fix (#18734)
* fix memory leak
* fix typos
* use singular last hidden state variable names
* eliminate double call to self.owlvit to return last hidden states
* eliminate 2nd call to self.vision_model in OwlViTModel
2022-09-01 10:31:08 +03:00
lewtun
80367cd1fb
Add security warning about the from_pretrained() method (#18801)
* Add security warning about from_pretrained() method

* Add sentence about malware scanner

Co-authored-by: Julien Chaumond <julien@huggingface.co>
2022-08-31 21:48:40 +02:00
NielsRogge
7e7f743481
Add SegFormer ONNX support (#18006)
* Add ONNX support

* Make height and width dynamic axes

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-08-31 20:58:44 +02:00
Ekagra Ranjan
89514f0541
Improve Text Generation doc (#18788)
* fix args for bram search decoding in generation utils

* fix missing PAD token in gpt2

* add PAD EOS change to TF

* Update src/transformers/generation_tf_utils.py

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

* Update src/transformers/generation_utils.py

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

* Update src/transformers/generation_utils.py

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

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-08-31 20:30:29 +02:00
Felix Schneider
86387fe87f
Add an option to HfArgumentParser.parse_{dict,json_file} to raise an Exception when there extra keys (#18692)
* Update parser to track unneeded keys, off by default

* Fix formatting

* Fix docstrings and defaults in HfArgparser

* Fix formatting
2022-08-31 20:26:45 +02:00
Ekagra Ranjan
f210e2a414
Improve GPT2 doc (#18787)
* Minor typo in GPT2 doc

* improve gpt2 label doc

* update dim of label in GPT2ForTokenClassification

* add change to tf
2022-08-31 19:26:39 +02:00
Sylvain Gugger
74690b62a1
Pin ffspec (#18837)
* Pin ffspec

* Typo
2022-08-31 19:04:04 +02:00
NielsRogge
3b6943e7a3
[DETR] Add num_channels attribute (#18714)
* Add num_channels attribute

* Fix code quality

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-08-31 18:04:42 +02:00
Shu Takayama
811c4c9f79
fix bug: register_for_auto_class should be defined on TFPreTrainedModel instead of TFSequenceSummary (#18607) 2022-08-31 16:37:18 +02:00
Lysandre Debut
ee407024c4
Update location identification (#18834) 2022-08-31 15:10:25 +02:00
Zachary Mueller
e4910213be
Warn on TPUs when the custom optimizer and model device are not the same (#18668)
* Check optimizer for device on TPU

* Typo
2022-08-31 08:46:31 -04:00
Wang, Yi
cdde85a0a0
oob performance improvement for cpu DDP (#18595)
* oob performance improvement for cpu DDP

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

* add is_psutil_available check

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2022-08-31 14:35:10 +02:00
Peter Jung
c3be98ebab
Fix cost condition in DetrHungarianMatcher and YolosHungarianMatcher to allow zero-cost (#18647)
* Fix loss condition in DetrHungarianMatcher

* Fix costs condition in YolosHungarianMatcher
2022-08-31 14:28:58 +02:00
Joao Gante
fea4636cfa
Pin max tf version (#18818) 2022-08-31 10:07:53 +02:00
Ankur Goyal
5c4c869014
Add LayoutLMForQuestionAnswering model (#18407)
* Add LayoutLMForQuestionAnswering model

* Fix output

* Remove TF TODOs

* Add test cases

* Add docs

* TF implementation

* Fix PT/TF equivalence

* Fix loss

* make fixup

* Fix up documentation code examples

* Fix up documentation examples + test them

* Remove LayoutLMForQuestionAnswering from the auto mapping

* Docstrings

* Add better docstrings

* Undo whitespace changes

* Update tokenizers in comments

* Fixup code and remove `from_pt=True`

* Fix tests

* Revert some unexpected docstring changes

* Fix tests by overriding _prepare_for_class

Co-authored-by: Ankur Goyal <ankur@impira.com>
2022-08-31 10:05:33 +02:00
Yih-Dar
e88e9ff045
Disable nightly CI temporarily (#18820)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-08-30 18:33:09 +02:00
Nicolas Patry
73c6273d48
Improving the documentation for "word", within the pipeline. (#18763)
* Improving the documentation for "word", within the pipeline.

* Quality.
2022-08-30 15:29:48 +02:00
Dan Tegzes
5727dfcebe
Added Docstrings for Deberta and DebertaV2 [PyTorch] (#18610)
* Added Doctest for Deberta Pytorch

* Added path in documentation test file

* Added docstrings for DebertaV2

* Revert "Added docstrings for DebertaV2"

This reverts commit 307185e62a.

* Added DebertaV2 Docstrings
2022-08-30 14:46:21 +02:00
anthony2261
a98f6a1da0
LayoutXLMProcessor: ensure 1-to-1 mapping between samples and images, and add test for it (#18774) 2022-08-30 14:43:14 +02:00
Dhruv Karan
220da3b8a1
Adds GroupViT to models exportable with ONNX (#18628)
* groupvit to onnx

* dynamic shape for pixel values dim
2022-08-30 14:31:35 +02:00
Dhruv Karan
46d0e26a27
Adds OWLViT to models exportable with ONNX (#18588)
* onnx conversion for owlvit

* .T to .t()

* dynamic shapes for pixel values
2022-08-30 14:30:59 +02:00
NielsRogge
b83796ded7
Remove ViltForQuestionAnswering from check_repo (#18762)
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-08-30 14:15:36 +02:00
amyeroberts
ef91a2d135
Run tests if skip condition not met (#18764)
* Run tests if skip condition not met

* Update comment - remove outdated ref to TF 2.8
2022-08-30 14:03:28 +02:00
Christoffer Koo Øhrstrøm
de8548ebf3
[LayoutLMv3] Add TensorFlow implementation (#18678)
Co-authored-by: Esben Toke Christensen <esben.christensen@visma.com>
Co-authored-by: Lasse Reedtz <lasse.reedtz@visma.com>
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
2022-08-30 11:48:11 +01:00
NielsRogge
7320d95d98
[Swin, Swinv2] Fix attn_mask dtype (#18803)
* Add dtype

* Fix Swinv2 as well

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-08-30 12:31:34 +02:00
Li-Huai (Allan) Lin
5c702175eb
up (#18805) 2022-08-30 12:30:46 +02:00
Ekagra Ranjan
da02b4035c
Add docstring for BartForCausalLM (#18795)
* add docstring for BartForCausalLM

* doc-style fic
2022-08-30 12:19:03 +02:00
amyeroberts
8c4a11493f
Revert to and safely handle flag in owlvit config (#18750) 2022-08-29 18:48:24 +02:00
Yih-Dar
da5bb29219
send model to the correct device (#18800)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-08-29 18:46:30 +02:00
NielsRogge
f1fd460694
Add SegFormer and ViLT links (#18808)
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-08-29 18:46:07 +02:00
Lucain
169b8cde47
Fix mock in test_cached_files_are_used_when_internet_is_down (#18804) 2022-08-29 15:56:08 +02:00
Yih-Dar
8b67f20935
Fix memory leak issue in torch_fx tests (#18547)
Co-authored-by: Lysandre Debut <hi@lysand.re>
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-08-29 11:43:20 +02:00
fatih
b10a3b3760
fix a possible typo in auto feature extraction (#18779) 2022-08-29 11:24:53 +02:00
Yih-Dar
5f06a09b9f
fix missing block when there is no failure (#18775)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-08-29 09:10:13 +02:00