Commit Graph

10663 Commits

Author SHA1 Message Date
Nicolas Patry 68bb33d770
Fixing OPT fast tokenizer option. (#18753)
* Fixing OPT fast tokenizer option.

* Remove dependency on `pt`.

* Move it to GPT2 tokenization tests.

* Added a few tests.
2022-09-15 17:12:58 +02:00
Ekagra Ranjan 578e18e002
🚨🚨🚨 Optimize Top P Sampler and fix edge case (#18984)
* init PR

* optimize top p and add edge case

* styling

* style

* revert tf and flax test

* add edge case test for FLAX and TF

* update doc with smallest set sampling for top p

* make style
2022-09-15 15:50:11 +02:00
Sylvain Gugger 2700ba66d9
Move cache: expand error message (#19051) 2022-09-15 09:39:59 -04:00
Matt 2322eb8e2f
Update serving signatures and make sure we actually use them (#19034)
* Override save() to use the serving signature as the default

* Replace int32 with int64 in all our serving signatures

* Remember one very important line so as not to break every test at once

* Dtype fix for TFLED

* dtype fix for shift_tokens_right in general

* Dtype fixes in mBART and RAG

* Fix dtypes for test_unpack_inputs

* More dtype fixes

* Yet more mBART + RAG dtype fixes

* Yet more mBART + RAG dtype fixes

* Add a check that the model actually has a serving method
2022-09-15 14:34:22 +01:00
lewtun 9b80a0bc18
Pin minimum PyTorch version for BLOOM ONNX export (#19046) 2022-09-15 15:22:31 +02:00
Yih-Dar 0a42b61ede
Fix `test_save_load` for `TFViTMAEModelTest` (#19040)
* Fix test_save_load for TFViTMAEModelTest

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-15 15:21:57 +02:00
amyeroberts 30a28f5227
Update image segmentation pipeline test (#18731)
* Updated test values

The image segmentation pipeline tests - tests/pipelines/test_pipelines_image_segmentation.py - were failing after the merging of #1849  (49e44b216b). This was due to the difference in rescaling. Previously the images were rescaled by `image = image / 255`. In the new commit, a `rescale` method was added, and images rescaled using `image = image * scale`. This was known to cause small differences in the processed images (see
[PR comment](https://github.com/huggingface/transformers/pull/18499#discussion_r940347575)).

Testing locally, changing the `rescale` method to divide by a scale factor (255) resulted in the tests passing. It was therefore decided the test values could be updated, as there was no logic difference between the commits.

* Use double quotes, like previous example

* Fix up
2022-09-15 07:32:31 -04:00
Younes Belkada 7743caccb9
[bnb] Small improvements on utils (#18646)
* Small replacement

- replace `modules_to_not_convert` by `module_to_not_convert`

* refactor a bit

- changed variables name
- now output a list
- change error message

* make style

* add list

* make style

* change args name

Co-authored-by: stas00 <stas00@users.noreply.github.com>

* fix comment

* fix typo

Co-authored-by: stas00 <stas00@users.noreply.github.com>

* Update src/transformers/modeling_utils.py

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

Co-authored-by: stas00 <stas00@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-09-15 13:01:19 +02:00
Stas Bekman 8edf196310
[doc] debug: fix import (#19042)
correct the import statement
2022-09-14 16:29:58 -07:00
Hakjin Lee abca1741cf
Fix a broken link for deepspeed ZeRO inference in the docs (#19001)
* Fix a broken link for deepspeed ZeRO inference

* fix link

Co-authored-by: Stas Bekman <stas@stason.org>
2022-09-14 16:21:06 -07:00
Lysandre 16913b3c92 Dev version 2022-09-14 14:58:20 -04:00
Sylvain Gugger 3774010161
Automate check for new pipelines and metadata update (#19029)
* Automate check for new pipelines and metadata update

* Add Datasets to quality extra
2022-09-14 14:06:49 -04:00
SaulLu 0efbb6e93e
fix GPT2 token's `special_tokens_mask` when used with `add_bos_token=True` (#19036) 2022-09-14 19:32:12 +02:00
Sylvain Gugger 0e24548081
Add safeguards for CUDA kernel load in Deformable DETR (#19037) 2022-09-14 13:28:40 -04:00
Joao Gante 31be02f14b
TF: tf.debugging assertions without tf.running_eagerly() protection (#19030) 2022-09-14 18:19:15 +01:00
lewtun 693ba2cc79
Fix GPT-NeoX doc examples (#19033) 2022-09-14 17:53:42 +02:00
Sylvain Gugger 4eb36f2921
Mark right save_load test as slow (#19031) 2022-09-14 10:38:39 -04:00
Shinya Otani f5f430e5c8
Add support for Japanese GPT-NeoX-based model by ABEJA, Inc. (#18814)
* add gpt-neox-japanese model and tokenizer as new model

* Correction to PR's comment for GPT NeoX Japanese
- Fix to be able to use gpu
- Add comment # Copied... at the top of RotaryEmbedding
- Implement nn.Linear instead of original linear class
- Add generation test under @slow

* fix bias treatment for gpt-neox-japanese

* Modidy gpt-neox-japanese following PR
- add doc for bias_dropout_add
- style change following a PR comment

* add document for gpt-neox-japanese

* remove unused import from gpt-neox-japanese

* fix README for gpt-neox-japanese
2022-09-14 10:17:40 -04:00
Yih-Dar 6a9726ec0e
Fix `DocumentQuestionAnsweringPipelineTests` (#19023)
* Fix DocumentQuestionAnsweringPipelineTests

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-14 16:13:20 +02:00
Sylvain Gugger 1207deb806 Typo fix 2022-09-14 10:02:14 -04:00
Sylvain Gugger e1224a2a0f Making save_load test slow as it times out 2022-09-14 10:01:22 -04:00
Sylvain Gugger 0b567aa430
Add Document QA pipeline metadata (#19028) 2022-09-14 09:25:15 -04:00
Yih-Dar 77b18783c2
Fix CI for `PegasusX` (#19025)
* Skip test_torchscript_output_attentions for PegasusXModelTest

* fix test_inference_no_head

* fix test_inference_head

* fix test_seq_to_seq_generation

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-14 14:45:00 +02:00
Partho 77ea35b93a
added type hints (#19015) 2022-09-14 12:58:05 +01:00
NielsRogge fc21c9be62
[CookieCutter] Clarify questions (#18959)
* Clarify cookiecutter questions

* Update first question

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-09-14 13:52:54 +02:00
Sylvain Gugger 6f8f2f6a77
Make AutoProcessor a magic loading class for all modalities (#18963)
* Make AutoProcessor a magic loading class for all modalities

* Quality
2022-09-14 07:36:12 -04:00
Sylvain Gugger a2a3afbc8d
PyTorch >= 1.7.0 and TensorFlow >= 2.4.0 (#19016) 2022-09-14 07:19:02 -04:00
Ekagra Ranjan 9f4acd059f
Generate: add missing comments after refactoring of generate() (#18981) 2022-09-14 11:06:29 +01:00
NielsRogge 59407bbeb3
Add Deformable DETR (#17281)
* First draft

* More improvements

* Improve model, add custom CUDA code

* Import torch before

* Add script that imports custom layer

* Add everything in new ops directory

* Import custom layer in modeling file

* Fix ARCHIVE_MAP typo

* Creating the custom kernel on the fly.

* Import custom layer in modeling file

* More improvements

* Fix CUDA loading

* More improvements

* Improve conversion script

* Improve conversion script

* Make it work until encoder_outputs

* Make forward pass work

* More improvements

* Make logits match original implementation

* Make implementation also support single_scale model

* Add support for single_scale and dilation checkpoint

* Add support for with_box_refine model

* Support also two stage model

* Improve tests

* Fix more tests

* Make more tests pass

* Upload all models to the hub

* Clean up some code

* Improve decoder outputs

* Rename intermediate hidden states and reference points

* Improve model outputs

* Move tests to dedicated folder

* Improve model outputs

* Fix retain_grad test

* Improve docs

* Clean up and make test_initialization pass

* Improve variable names

* Add copied from statements

* Improve docs

* Fix style

* Improve docs

* Improve docs, move tests to model folder

* Fix rebase

* Remove DetrForSegmentation from auto mapping

* Apply suggestions from code review

* Improve variable names and docstrings

* Apply some more suggestions from code review

* Apply suggestion from code review

* better docs and variables names

* hint to num_queries and two_stage confusion

* remove asserts and code refactor

* add exception if two_stage is True and with_box_refine is False

* use f-strings

* Improve docs and variable names

* Fix code quality

* Fix rebase

* Add require_torch_gpu decorator

* Add pip install ninja to CI jobs

* Apply suggestion of @sgugger

* Remove DeformableDetrForObjectDetection from auto mapping

* Remove DeformableDetrModel from auto mapping

* Add model to toctree

* Add model back to mappings, skip model in pipeline tests

* Apply @sgugger's suggestion

* Fix imports in the init

* Fix copies

* Add CPU implementation

* Comment out GPU function

* Undo previous change

* Apply more suggestions

* Remove require_torch_gpu annotator

* Fix quality

* Add logger.info

* Fix logger

* Fix variable names

* Fix initializaztion

* Add missing initialization

* Update checkpoint name

* Add model to doc tests

* Add CPU/GPU equivalence test

* Add Deformable DETR to pipeline tests

* Skip model for object detection pipeline

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Co-authored-by: Nouamane Tazi <nouamane98@gmail.com>
Co-authored-by: Sylvain Gugger <Sylvain.gugger@gmail.com>
2022-09-14 11:45:21 +02:00
Ahmed Elnaggar 5a70a77bfa
Add Support to Gradient Checkpointing for LongT5 (#18977)
FlaxLongT5PreTrainedModel is missing "enable_gradient_checkpointing" function. This gives an error if someone tries to enable gradient checkpointing for longt5.
This pull request fixes it.
2022-09-14 09:12:51 +01:00
Joao Gante 4157e3cd7e
new length penalty docstring (#19006) 2022-09-13 13:16:36 -04:00
Sylvain Gugger f89f16a51e
Re-add support for single url files in objects download (#19014) 2022-09-13 13:11:24 -04:00
Yih-Dar ad5045e3e3
add missing `require_tf` for `TFOPTGenerationTest` (#19010)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-13 18:10:11 +02:00
Wang, Yi d14af22c5c
add DDP HPO support for optuna (#19002)
only main_process will have HPO, and pass argument to other process

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

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2022-09-13 17:56:20 +02:00
Rahul A R 00fc9217d1
Fixed bug which caused overwrite_cache to always be True (#19000)
* fixed bug which caused overwrite_cache to always be True (#18967).

* reformatting changes
2022-09-13 11:29:48 -04:00
Ankur Goyal 420f6c5ee3
Update default revision for document-question-answering (#18938)
Co-authored-by: Ankur Goyal <ankur@impira.com>
2022-09-13 10:04:03 -04:00
Yih-Dar 2886f7f08a
Fix tokenizer for XLMRobertaXL (#19004)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-13 14:04:14 +02:00
Partho 2848c9ce42
Add type hints for M2M (#18998)
* added type hints

* fixed typo
2022-09-13 12:58:46 +01:00
Joao Gante 4bd36f1853
Generate: add model class validation (#18902) 2022-09-13 09:19:43 +01:00
Alara Dirik 69df33f180
Fix MaskFormerFeatureExtractor instance segmentation preprocessing bug (#18997)
* fix preprocessing for instance segmentation maps

* add support for per-image instance2class_id mapping

* edit docstrings for clarity
2022-09-13 09:36:03 +03:00
Chris Emezue 470799b3a6
Removed issue in wav2vec link (#18945)
Fix connected to [this issue](https://github.com/huggingface/transformers/issues/18944)
2022-09-12 21:59:19 +02:00
Tobias Nusser 4c2e983f44
Fixed typo (#18921)
Fixed typo itmes --> items
2022-09-12 21:03:48 +02:00
Joao Gante 1182b945a6
TF: TF 2.10 unpin + related onnx test skips (#18995) 2022-09-12 19:30:27 +01:00
Partho 7f4708e1a2
added type hints (#18996) 2022-09-12 19:11:40 +01:00
Yih-Dar 39b5bb79d9
fix checkpoint name for wav2vec2 conformer (#18994)
* fix checkpoint name for wav2vec2 conformer

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-12 19:39:01 +02:00
Joao Gante 8a6928e28b
TF: correct TFBart embeddings weights name when load_weight_prefix is passed (#18993) 2022-09-12 18:35:45 +01:00
Matt c126a239bc
Fix tflongformer int dtype (#18907)
* Use int64 throughout TFLongFormer

* make style

* Do some more fixed casting in TFLongFormer

* Fix some wonky "is None" conditionals

* Cast all the dtypes, salt the earth

* Fix copies to TFLED as well and do some casting there

* dtype fix in TFLongformer test

* Make fixup

* Expand tolerances on the LED tests too (I think this is a TF32 thing)

* Expand test tolerances for LED a tiny bit (probably a Tensorfloat thing again)
2022-09-12 17:51:10 +01:00
Sylvain Gugger f7ceda345d
Align try_to_load_from_cache with huggingface_hub (#18966)
* Align try_to_load_from_cache with huggingface_hub

* Fix tests
2022-09-12 12:09:37 -04:00
Matt cf450b776f
Fix TF start docstrings (#18991)
* Update our TF 2.0 input format tip across all models

* make style
2022-09-12 16:33:56 +01:00
Shijie Wu adbf3a40de
Remove dropout in embedding layer of OPT (#18845) 2022-09-12 16:32:38 +02:00