Commit Graph

10645 Commits

Author SHA1 Message Date
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
Yih-Dar 367026000b
create Past CI results as tables for GitHub issue (#18953)
* create Past CI results as tables for GitHub issue

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-12 15:20:31 +02:00
Yih-Dar 0b36970371
Remove `decoder_position_ids` from `check_decoder_model_past_large_inputs` (#18980)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-12 15:19:48 +02:00
Wang, Yi a86acb75ad
add DDP HPO support for sigopt (#18931)
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-12 07:37:25 -04:00
Shijie Wu 9faa9f9dac
remove unused activation dropout (#18842) 2022-09-12 11:00:24 +02:00
Sylvain Gugger a26114777e
Revert "TF: unpin maximum TF version (#18917)" (#18972)
This reverts commit d8cf3b2087.
2022-09-10 09:11:46 -04:00
Joao Gante d8cf3b2087
TF: unpin maximum TF version (#18917) 2022-09-10 13:33:01 +01:00
Joao Gante 00cbadb870
RFC: Replace custom TF embeddings by Keras embeddings (#18939) 2022-09-10 11:34:49 +01:00
Bram Vanroy 855dcae8bb
update black target version (#18955)
* update black target version

* add comment

as per https://github.com/huggingface/transformers/pull/18955#issuecomment-1242081649

* revert change

Will only update to 3.7 after black 2023 upgrade in January
2022-09-09 17:30:05 -04:00
Sylvain Gugger 645f174286
Exit early in load if no weights are in the sharded state dict (#18937) 2022-09-09 15:07:09 -04:00
Matt 660e0b97bd
Fix train_step, test_step and tests for CLIP (#18684)
* Fix train_step and test_step, correctly enable CLIP fit test

* Stop using get_args on older Python versions

* Don't use get_origin either

* UnionType is actually even newer, don't use that either

* Apply the same fix to test_loss_computation

* Just realized I was accidentally skipping a bunch of tests!

* Fix test_loss_computation for models without separable labels

* Fix scalar losses in test_step and train_step

* Stop committing your breakpoints

* Fix Swin loss shape

* Fix Tapas loss shape

* Shape fixes for TAPAS, DeIT, HuBERT and ViTMAE

* Add loss computation to TFMobileBertForPreTraining

* make fixup and move copied from statement

* make fixup and move copied from statement

* Correct copied from

* Add labels and next_sentence_label inputs to TFMobileBERT

* Make sure total_loss is always defined

* Update tests/test_modeling_tf_common.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* Fix copied from

* Ensure CTC models get labels in tests

* Ensure CTC models get labels in tests

* Fix tests for vit_mae

* Fix tests for vit_mae

* Fix tests for vit_mae

* Reduce batch size for wav2vec2 testing because it was causing OOM

* Skip some TAPAS tests that are failing

* Skip a failing HuBERT test

* make style

* Fix mobilebertforpretraining test

* Skip Wav2Vec2 tests that use huge amounts of mem

* Skip keras_fit for Wav2Vec2 as well

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
2022-09-09 20:01:02 +01:00
Ekagra Ranjan f1a6df3210
Generate: Simplify is_pad_token_not_equal_to_eos_token_id (#18933) 2022-09-09 16:44:56 +01:00
Rafał Jankowski 85125fcffd
Neptune.ai integration improvements (#18934)
* NeptuneCallback improvements

* After review suggestions and deduplication of initial run

* Added volatile checkpoints support due to missing post-rebase commit

* Update README per review comments

- Remove list formatting
- Correct Neptune docs link

Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
2022-09-09 11:37:34 -04:00
Sanchit Gandhi e6f221c8d4
[JAX] Replace all jax.tree_* calls with jax.tree_util.tree_* (#18361)
* [JAX] Replace all jax.tree_* calls with jax.tree_util.tree_*

* fix double tree_util
2022-09-09 15:18:56 +02:00
HuYong 22f7218560
add task_type_id to BERT to support ERNIE-2.0 and ERNIE-3.0 models (#18686)
* add_ernie

* remove Tokenizer in ernie

* polish code

* format code style

* polish code

* fix style

* update doc

* make fix-copies

* change model name

* change model name

* fix dependency

* add more copied from

* rename ErnieLMHeadModel to ErnieForCausalLM
do not expose ErnieLayer
update doc

* fix

* make style

* polish code

* polish code

* fix

* fix

* fix

* fix

* fix

* final fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-09 07:36:46 -04:00
Nima Boscarino 895c528886
Update translation requests contact (#18941)
* Update TRANSLATING.md

Update the contact to @GuggerSylvain

* Update docs/TRANSLATING.md

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

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-09-09 09:15:24 +02:00
NielsRogge bb6f6d5338
Add X-CLIP (#18852)
* First draft

* Improve conversion script

* Make vision encoder work

* More improvements

* Improve conversion script

* Fix quality

* Add MultiframeIntegrationTransformer

* More improvements

* Make MiT output work

* Fix quality

* Add prompts generator

* Add tests

* Fix some tests

* Fix some more tests

* Fix more tests

* Improve conversion script

* Fix model outputs

* Fix more tests

* Add XClipProcessor

* Use processor in conversion script

* Fix integration test

* Update README, fix docs

* Fix all tests

* Add MIT output to XClipOutput

* Create better variable names

* Rename XClip to XCLIP

* Extend conversion script

* Add support for large models

* Add support for 16 frame models

* Add another model'

* Fix module issue

* Apply suggestions from code review

* Add figure to docs

* Fix CLIPProcessor issue

* Apply suggestions from code review

* Delete file

* Convert more checkpoints

* Convert last checkpoint

* Update nielsr to microsoft
2022-09-08 14:50:30 +02:00
Devlee247 9832ac7c73
Fix LayoutXLM wrong link in README (#18932)
* fix LayoutXLM wrong link in README

* fix LayoutXLM worng link in index.mdx
2022-09-08 07:32:41 -04:00
Steven Liu 90f6fe9155
Skip some doctests in quicktour (#18927)
* skip some code examples for doctests

* make style

* fix code snippet formatting

* separate code snippet into two blocks
2022-09-07 14:45:22 -07:00