Commit Graph

15053 Commits

Author SHA1 Message Date
Yih-Dar
18643ff29a
Skip test_export_to_onnx for LongT5 if torch < 1.11 (#19122)
* Skip if torch < 1.11

* fix quality

* fix import

* fix typo

* fix condition

* fix condition

* fix condition

* fix quality

* fix condition

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-20 21:52:18 +02:00
Santiago Castro
06f341de4f
Add a missing space in a script arg documentation (#19113) 2022-09-20 21:43:32 +02:00
Alara Dirik
36b9a99433
Fix BeitFeatureExtractor postprocessing (#19119)
* return post-processed segmentations as list, add test
* use torch to resize logits
* fix assertion error if no target_size is specified
2022-09-20 18:53:40 +03:00
Ryan X
36e356caa4
Fix: update ltp word segmentation call in mlm_wwm (#19047)
* Fix: update ltp word segmentation call in mlm_wwm

* Fix: update ltp word segmentation call in mlm_wwm

* Fix: update ltp word segmentation call in mlm_wwm
2022-09-20 09:20:38 -04:00
flozi00
de26241645
german processing (#19121)
* correct spelling in README

* processing
2022-09-20 09:18:21 -04:00
Ankur Goyal
67403413bd
Change document question answering pipeline to always return an array (#19071)
Co-authored-by: Ankur Goyal <ankur@impira.com>
2022-09-20 15:17:57 +02:00
Yih-Dar
cc567e0063
Fix the wrong schedule (#19117)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-20 13:46:55 +02:00
Alara Dirik
c81ebd1c39
Beit postprocessing (#19099)
* add post_process_semantic_segmentation method to BeiTFeatureExtractor
2022-09-20 10:41:56 +03:00
S.Kishore
261301d388
Added type hints for YolosForObjectDetection (#19086) 2022-09-20 00:04:25 +02:00
Sylvain Gugger
801ebd045d
Add documentation of Trainer.create_model_card (#19110)
* Add documentation of Trainer.create_model_card

* Expand to TF version
2022-09-19 16:55:50 -04:00
Wang, Yi
6227078d0a
HPO: keep the original logic if there's only one process, pass the trial to trainer (#19096)
need to find out solution for following cases
     *if we need to use trial in model_init, how to do it for non-main rank, sync the model with rank0 in app?
     *how to use optuna prune feature for DDP, if we do it in rank0, how does other rank know it.

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

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2022-09-19 16:42:18 -04:00
Sylvain Gugger
3b0cecb627
Don't warn of move if cache is empty (#19109) 2022-09-19 15:27:18 -04:00
flozi00
6be338f1b9
correct spelling in README (#19092) 2022-09-19 19:51:43 +02:00
NielsRogge
e7206ceab9
Improve vision models docs (#19103)
* Add tips

* Add BEiT figure

* Fix URL

* Move tip to start

* Add tip to TF model as well

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-09-19 19:22:34 +02:00
Partho
0d1ba2dd0b
added type hints (#19076) 2022-09-19 14:10:21 +01:00
S.Kishore
6f25d107fd
Added type hints to ResNetForImageClassification (#19084)
* Added type hints to ResNetForImageClassification

* Resolved check_repository_consistency failure issue

Running fix-copies changed the type hints for RegNetForImageClassification in modeling_regnet.py file
2022-09-19 13:42:13 +01:00
S.Kishore
fe5e7cea4a
Add type hints for TF MPNet models (#19089)
* Added type hints for TFMPNetModel

* Added type hints for TFMPNetForMaskedLM

* Added type hints for TFMPNetForSequenceClassification

* Added type hints for TFMPNetForMultipleChoice

* Added type hints for TFMPNetForTokenClassification

* Added Type hints for TFMPNetForQuestionAnswering
2022-09-19 13:37:32 +01:00
S.Kishore
1bbad7a2da
Added Type hints for VIT MAE (#19085)
* Added Type hints for VIT MAE

* Ran make fixup
2022-09-19 13:37:18 +01:00
S.Kishore
fbe8464b5b
Added type hints for TFConvBertModel (#19088) 2022-09-19 13:28:13 +01:00
Yih-Dar
22264f933d
fix working dir (#19101)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-19 07:09:24 -04:00
Yih-Dar
ba7f2173cc
Add runner availability check (#19054)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-19 12:27:06 +02:00
Sylvain Gugger
ca485e562b
Add tests for legacy load by url and fix bugs (#19078) 2022-09-16 23:20:02 +02:00
flozi00
ae219532e3
german autoclass (#19049)
* german autoclass

* Update _toctree.yml
2022-09-16 16:16:00 -04:00
dependabot[bot]
7d0486c106
Bump mako in /examples/research_projects/decision_transformer (#19077)
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 22:15:02 +02:00
Lysandre Debut
56c548f17c
Note about developer mode (#19075) 2022-09-16 22:12:59 +02:00
Sylvain Gugger
9017ba4ca4
Fix tokenizer load from one file (#19073)
* Fix tokenizer load from one file

* Add a test

* Style

Co-authored-by: Lysandre <lysandre.debut@reseau.eseo.fr>
2022-09-16 16:11:47 -04:00
fxmarty
773314ab80
replace logger.warn by logger.warning (#19068) 2022-09-16 21:01:57 +02:00
Partho
5e636eee4a
Add type hints for PyTorch UniSpeech, MPNet and Nystromformer (#19039)
* added type hints pytorch unispeech

* added type hints pytorch  MPNet

* added type hints nystromformer

* resolved copy inconsistencies

* make fix-copies

Co-authored-by: matt <rocketknight1@gmail.com>
2022-09-16 17:59:40 +01:00
Joao Gante
658010c739
TF: tests for (de)serializable models with resized tokens (#19013)
* resized models that we can actually load

* separate embeddings check

* add test for embeddings out of bounds

* add fake slows
2022-09-16 16:38:08 +01:00
Yih-Dar
70ba10e6d4
Fix LeViT checkpoint (#19069)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-16 16:23:58 +02:00
Omar Sanseviero
bc5d0b1046
Automatically tag CLIP repos as zero-shot-image-classification (#19064)
* Add CLIP to zero-shot-image-classification

* Make mapping private as it's not used for AutoClassing
2022-09-16 15:40:38 +02:00
Sylvain Gugger
820cb97a3f
Organize test jobs (#19058)
* Tests conditional run

* Syntax

* Deps

* Try early exit

* Another way

* Test with no tests to run

* Test all

* Typo

* Try this way

* With tests to run

* Mostly finished

* Typo

* With a modification in one file only

* No change, no tests

* Final cleanup

* Address review comments
2022-09-16 09:19:51 -04:00
Jim Briggs
d63bdf78d4
Add FP32 cast in ConvNext LayerNorm to prevent rounding errors with FP16 input (#18746)
* Adding cast to fp32 in convnext layernorm to prevent rounding errors in the case of fp16 input

* Trigger CI
2022-09-16 08:42:57 -04:00
Tom Aarsen
532ca05079
[doc] Fix link in PreTrainedModel documentation (#19065) 2022-09-16 07:31:39 -04:00
Michael Benayoun
c603c80f46
FX support for ConvNext, Wav2Vec2 and ResNet (#19053)
* Support for ConvNext

* Support for Wav2Vec2

* Support for Resnet

* Fix small issue in test_modeling_convnext
2022-09-16 10:57:41 +02:00
Younes Belkada
c8e40d6fa1
fix use_cache (#19060)
- set `use_cache` to `True` for consistency with other `transformers` models
2022-09-16 09:07:02 +02:00
Colin Dean
0b5c7e4838
Adds package and requirement spec output to version check exception (#18702)
* Adds package and requirement spec output to version check exception

It's difficult to understand what package is affected when `got_ver`
here comes back None, so output the requirement and the package. The
requirement probably contains the package but let's output both for good
measure.

Non-exhaustive references for this problem aside from my own encounter:

* https://stackoverflow.com/questions/70151167/valueerror-got-ver-is-none-when-importing-tensorflow
* https://discuss.huggingface.co/t/valueerror-got-ver-is-none/17465
* https://github.com/UKPLab/sentence-transformers/issues/1186
* https://github.com/huggingface/transformers/issues/13356

I speculate that the root of the error comes from a conflict of
conda-managed and pip-managed Python packages but I've not yet proven
this.

* Combines version presence check and streamlines exception message

See also: https://github.com/huggingface/transformers/pull/18702#discussion_r953223275

Co-authored-by: Stas Bekman <stas@stason.org>
2022-09-15 12:53:36 -07:00
Shijie Wu
f3d3863255
fix arg name in BLOOM testing and remove unused arg document (#18843) 2022-09-15 20:25:32 +02:00
Yih-Dar
16242e1bf0
Run torchdynamo tests (#19056)
* Enable torchdynamo tests

* make style

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-09-15 11:10:16 -07:00
Sylvain Gugger
f7ce4f1ff7
Fix custom tokenizers test (#19052)
* Fix CI for custom tokenizers

* Add nightly tests

* Run CI, run!

* Fix paths

* Typos

* Fix test
2022-09-15 11:31:09 -04:00
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