Commit Graph

11371 Commits

Author SHA1 Message Date
Yih-Dar
f10cdba22e
Pin TF 2.10.1 for Push CI (#20319)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-18 18:24:35 +01:00
Zachary Mueller
9d1ef009b8
Fix flakey test with seed (#20318) 2022-11-18 11:33:25 -05:00
Nicolas Patry
8e777b3ba4
[Proposal] Breaking change zero-shot-object-detection for improved consistency. (#20280)
* [Proposal] Breaking change `zero-shot-object-detection` for improved
consistency.

This is a proposal to modify the output of `zero-shot-object-detection`
to provide better alignment with other pipelines.

The output is now strictly the same as `object-detection` whereas before
it would output lists of lists.

The name `candidate_labels` is used throughout for consistency with
other `zero-shot` pipelines.

The pipeline is changed to `ChunkPipeline` to support batching cleanly.

This removes all the lists and list of lists shenanigans, it's now a
matter of the base pipeline handling all this not this specific one.

**Breaking change**: It did remove complex calls potentials `pipe(images = [image1, image2],
text_queries=[candidates1, candidates2])` to support only
`pipe([{"image": image1, "candidate_labels": candidates1}, {"image": image2, "candidate_labels": candidates2}])`
when dealing with lists and/or datasets.
We could keep them, but it will add a lot of complexity to the code
base, since the pipeline is rather young, I'd rather break to keep the
code simpler, but we can revert this.

**Breaking change**: The name of the argument is now `image` instead of
`images` since it expects by default only 1 image. This is revertable
like the previous one.

**Breaking change**: The types is now simplified and flattened:

`pipe(inputs) == [{**object1}, {**object2}]`
instead of the previous
`pipe(inputs) == [[{**object1}, {**object1}], [{**object2}]]`
Where the different instances would be grouped by candidate labels
within lists.
IMHO this is not really desirable, since it would output empty lists and
is only adding superflous indirection compared to
`zero-shot-object-detection`.

It is relatively change free in terms of how the results, it does change
computation however since now the batching is handled by the pipeline
itself. It **did** change the results for the small models so there
seems to be a real difference in how the models handle this.

* Fixing the doctests.

* Behind is_torch_available.
2022-11-18 15:57:28 +01:00
atturaioe
84c9cc6d15
Add AnyPrecisionAdamW optimizer (#18961)
* Add AnyPrecisionAdamW optimizer

* Add optim_args argument to TrainingArgs

* Add tests for AnyPrecisionOptimizer

* Change AnyPrecisionAdam default params to float32

* Move default_anyprecision_kwargs in trainer test

* Rename AnyPrecisionAdamW
2022-11-18 09:27:08 -05:00
Sylvain Gugger
37e016331f
Also pin TensorFlow CPU 2022-11-18 08:50:56 -05:00
Sylvain Gugger
a3f7458066
Pin to the right version... 2022-11-18 07:12:55 -05:00
Sylvain Gugger
f7ab8c4251
Pin TensorFlow (#20313) 2022-11-18 06:57:15 -05:00
amyeroberts
b98269425e
Add padding image transformation (#19838)
* Add padding transformation

* Add in upstream changes

* Update tests & docs

* Code formatting tuples in docstring
2022-11-18 11:27:21 +00:00
Sanchit Gandhi
c29a2f7c9c
[ASR Examples] Update README for Whisper (#20230)
* [ASR Examples] Update README for seq2seq

* add language info

* add training results

* re-word
2022-11-18 11:24:25 +00:00
Arthur
95754b47a6
remove two tokens that should not be suppressed (#20302) 2022-11-18 08:57:42 +01:00
Arthur
532e60bedf
Fix blender bot missleading doc (#20301)
* fix the doc to specify that add_prefix_space = False

* add correct expected output
2022-11-18 08:57:07 +01:00
Yih-Dar
df56c843be
[Tiny model creation] deal with ImageProcessor (#20298)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-17 20:49:46 +01:00
Younes Belkada
4bb0764750
refactor test (#20300)
- simplifies the devce checking test
2022-11-17 15:59:22 +01:00
Yih-Dar
700e0cd65f
Add missing report button for Example test (#20293)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-17 15:55:00 +01:00
NielsRogge
6b217c52e6
Add AutoBackbone + ResNetBackbone (#20229)
* Add ResNetBackbone

* Define channels and strides as property

* Remove file

* Add test for backbone

* Update BackboneOutput class

* Remove strides property

* Fix docstring

* Add backbones to SHOULD_HAVE_THEIR_OWN_PAGE

* Fix auto mapping name

* Add sanity check for out_features

* Set stage names based on depths

* Update to tuple

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-11-17 15:43:20 +01:00
raghavanone
904ac21020
Add docstrings for canine model (#19457)
* Add docstrings for canine model

* Update CanineForTokenClassification

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-17 09:41:11 -05:00
Wang, Yi
8b8b23a8cd
set the default cache_enable to True, aligned with the default value in pytorch cpu/cuda amp autocast (#20289)
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2022-11-17 09:21:06 -05:00
Nicolas Patry
07b8f249cd
Fixing the doctests failures. (#20294)
* Fixing the doctests failures.

* Fixup.
2022-11-17 15:13:32 +01:00
Joao Gante
0f78529f98
Generate: general TF XLA constrastive search are now slow tests (#20277)
* move contrastive search test to slow
2022-11-17 12:34:46 +00:00
Joao Gante
2062c28552
TF: add test for PushToHubCallback (#20231)
* test hub tf callback

* create repo before cloning it
2022-11-17 12:33:44 +00:00
amyeroberts
3a780cc57a
Image transforms functionality used instead (#20278)
* Image transforms functionality used instead

* Import torch

* Import rather than copy

* Update src/transformers/models/conditional_detr/feature_extraction_conditional_detr.py
2022-11-17 11:16:13 +00:00
Nicolas Patry
3fad6ae3fd
Adding doctest for object-detection pipeline. (#20258)
* Adding doctest for `object-detection` pipeline.

* Removed nested_simplify.
2022-11-17 11:59:59 +01:00
Nicolas Patry
6c2be845dd
Adding zero-shot-object-detection pipeline doctest. (#20274)
* Adding `zero-shot-object-detection` pipeline doctest.

* Remove nested_simplify.
2022-11-17 10:55:55 +01:00
Younes Belkada
7d65efec29
[bnb] Let's warn users when saving 8-bit models (#20282)
* add warning on 8-bit models

- added tests
- added wrapper

* move to a private attribute

- remove wrapper
- changed `save_pretrained` method

* Apply suggestions from code review

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

* fix suggestions

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-11-17 08:16:36 +01:00
Arthur
0a144b8c6b
[DOCTEST] Fix the documentation of RoCBert (#20142)
* update part of the doc

* add temp values, fix part of the doc

* add template outputs

* add correct models and outputss

* style

* fixup
2022-11-17 06:40:47 +01:00
Zachary Mueller
441811ecd7
Fix summarization script (#20286) 2022-11-16 15:57:07 -05:00
Saad Mahmud
5e012f8e3c
[Doctest] Add configuration_deformable_detr.py (#20273)
* Update configuration_deformable_detr.py comment

* Add DeformableDetrConfig to documentation_tests.txt
2022-11-16 18:20:06 +01:00
Alexander Markov
610acc5ae9
Data collator for token classification pads labels column when receives pytorch tensors (#20244)
* token cls data_collator pads labels column

* remove walrus operator for code quality

* remove redundat space

* remove comment that was fixed

* PR comments fix

Co-authored-by: Alexander Markov <amarkov.me@gmail.com>
2022-11-16 12:18:46 -05:00
IMvision12
d4d23141c4
remaining pytorch type hints (#20217)
* Update modeling_flava.py

* Update modeling_markuplm.py

* Update modeling_glpn.py

* Update modeling_roc_bert.py

* Update modeling_segformer.py

* Update modeling_tapas.py

* Update modeling_tapas.py

* Update modeling_tapas.py

* Update modeling_tapas.py

* Update modeling_trocr.py

* Update modeling_videomae.py

* Update modeling_videomae.py

* Update modeling_videomae.py

* Update modeling_yolos.py

* Update modeling_wav2vec2.py

* Update modeling_jukebox.py

* Update modeling_jukebox.py

* Update modeling_jukebox.py

* Update modeling_jukebox.py
2022-11-16 16:53:40 +00:00
Nicolas Patry
9ea1dbd2be
Adding doctest for token-classification pipeline. (#20265)
* Adding doctest for `token-classification` pipeline.

* Adding doctest to `token-classification` pipeline.

* Remove nested_simplify.
2022-11-16 17:22:00 +01:00
Nicolas Patry
21b0ad05a0
Adding doctest for image-to-text pipeline. (#20257)
* Adding `zero-shot-object-detection` pipeline doctest.

* Adding doctest for `image-to-text` pipeline.

* Remove nested_simplify.
2022-11-16 17:17:40 +01:00
Shogo Hida
389702242d
[Docs] Add resources of OpenAI GPT (#20084)
* Add resources of OpenAI GPT

* Delete Deploy section and add .

* Add scripts

* Update docs/source/en/model_doc/openai-gpt.mdx

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Delete causal-language-modeling section

* Add TFOpenAIGPTLMHeadModel

* Add resources from community

* Delete a link

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2022-11-16 11:17:32 -05:00
Nicolas Patry
9accbe531e
Adding doctest for question-answering pipeline. (#20259)
* Adding doctest for `question-answering` pipeline.

* Remove nested simplify.
2022-11-16 17:16:19 +01:00
Nicolas Patry
d9efb36cf6
Adding doctest for text-classification pipeline. (#20262)
* Adding doctest for `text-classification` pipeline.

* Remove nested_simplify.
2022-11-16 17:15:34 +01:00
Nicolas Patry
c282e93a74
Adding doctest for visual-question-answering pipeline. (#20266)
* Adding doctest for `visual-question-answering` pipeline.

* Remove nested_simplify.
2022-11-16 17:15:25 +01:00
Nicolas Patry
e06657a798
Adding doctest for zero-shot-classification pipeline. (#20268)
* Adding doctest for `zero-shot-classification` pipeline.

* Removing nested_simplify.
2022-11-16 17:15:01 +01:00
Nicolas Patry
69715f2ee0
Adding doctest for zero-shot-image-classification pipeline. (#20272)
* Adding doctest for `zero-shot-image-classification` pipeline.

* Remove nested_simplify.
2022-11-16 17:14:48 +01:00
Nicolas Patry
291c17f608
Adding doctest example for image-classification pipeline. (#20254)
* adding doctest example for `image-classification` pipeline.

* Remove nested simplify.
2022-11-16 17:09:57 +01:00
Nicolas Patry
a239bdd28f
Rephrasing the link. (#20253)
* Rephrasing the link.

* Removing `nested_simplify` within doctests.

* Fixup.
2022-11-16 17:09:45 +01:00
Matt
e9d9982e7c
Add TF protein notebook to notebooks doc (#20271) 2022-11-16 16:08:51 +00:00
Nicolas Patry
5ca479d252
Adding doctest for text-generation pipeline. (#20264) 2022-11-16 16:57:46 +01:00
Nicolas Patry
449f2ae459
Adding doctest for text2text-generation pipeline. (#20261) 2022-11-16 16:57:08 +01:00
Nicolas Patry
f6490180eb
Adding doctest for image-segmentation pipeline. (#20256)
* Adding doctest for `image-segmentation` pipeline.

* Fixup.
2022-11-16 16:56:54 +01:00
Nicolas Patry
c389d35a7f
Adding a doctest for table-question-answering pipeline. (#20260) 2022-11-16 16:45:42 +01:00
Jiahao Li
9681f052a1
Fix result saving errors of pytorch examples (#20276) 2022-11-16 09:51:04 -05:00
Mishig
e627e9b5ae
Complete doc migration (#20267) 2022-11-16 08:43:37 -05:00
Nicolas Patry
4fb34de99e
Adding an example for depth-estimation pipeline. (#20237)
* Adding an example for `depth-estimation` pipeline.

* Adding missing internal link to tutorial.
2022-11-16 09:52:45 +01:00
Nicolas Patry
1f029b6ae7
Adding doctest for document-question-answering (#20239)
* Adding doctest for doc qa.

* Adding doctest for doc qa.

* Fixup.
2022-11-16 09:52:35 +01:00
Nicolas Patry
443aaaa1a7
Adding ASR pipeline example. (#20226)
* Adding ASR pipeline example.

* De indent.

* Example deindent.

* Fixing example ?

* Putting the example in a more prominent place.

* Fixup.

* Adding the file.

* Adding the doctest to the daily test.

* Fixing comments.

* transcriber name.

* Adding `>>>`.

* Removing assert.
2022-11-16 09:51:45 +01:00
Nicolas Patry
e434627858
Adding doctest for feature-extraction. (#20240)
* Adding doctest for `feature-extraction`.

* Update feature_extraction.py
2022-11-16 09:51:31 +01:00