Commit Graph

15053 Commits

Author SHA1 Message Date
Arthur
a081f292ca
[RobertaPreLayernom] Fixes the CI daily test (#20886)
get correct checkpoint
2022-12-23 19:55:17 +01:00
Younes Belkada
cab7799f7b
Add japanese translation of template (#20870)
* add japanese translation of template

* fix japanese translation

- fix special cases
- fix typos
- manually translate special cases

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
2022-12-23 14:39:42 +01:00
Jasmijn Bastings
efed8a2794
Add script to convert T5X T5 (v1.0 and v1.1) checkpoints to PyTorch (#20801)
* Add script to convert T5X T5 (v1.0 and v1.1) checkpoints to PyTorch

* Remove unnecessary check and update docstring

* Format docstring

* Fix whitespace in docstring
2022-12-23 14:36:46 +01:00
Nicolas Patry
f7f0ec2f54
Adding support for fp16 for asr pipeline. (#20864)
* Supporting `fp16` for asr pipeline

* Adding test.

* Style.

* Oops.

* Flake8 update ?

* Fixing flake8 ?

* Revert "Flake8 update ?"

This reverts commit 0b917fcb52.

* Style (acctidentally deleted flake8 F401.)

* Move to a bigger test (no small whisper model, and s2t doesn't seem to
accept torch_dtype=fp16).

Also we need to use a GPU to actually compute on fp16.

* Using BatchFeature capability.
2022-12-23 10:18:45 +01:00
Syed Abdul Gaffar Shakhadri
15bc776fec
Add Onnx Config for PoolFormer (#20868)
poolformer onnx

Co-authored-by: syed <syed.abdul@sandlogic.com>
2022-12-23 01:30:57 -05:00
Sourab Mangrulkar
4a4cd6cd02
having new model entries in Hindi for Hindi README (#20869) 2022-12-23 12:00:48 +05:30
Younes Belkada
52dd2b61bf
[MobileNet-v2] Fix ONNX typo (#20860)
* fix typo `onnx`

* fix test
2022-12-22 18:52:54 +01:00
Younes Belkada
4d10ffd506
[FSMT] Make it compatible with xxxForConditionalGeneration models (#20825)
* add `get_encoder` and `get_decoder`

* add additional kwargs support

* fix condition

* add better checks

* better checks

* fix embed positions

* better test to consider padding

* fix debug statement

* Apply suggestions from code review

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* add arguments on docstring

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
2022-12-22 11:11:19 +01:00
dhansmair
2222740f50
change strings to f-strings in image_processing_utils.py (#20865)
change strings to f-strings
2022-12-22 02:06:50 -05:00
Joao Gante
829e889418
Generate: post-generate config doctest fix (#20804)
* fix doctests

* revert unwanted change
2022-12-21 19:18:45 +00:00
Yih-Dar
39e620c134
Update HubertModelIntegrationTest.test_inference_keyword_spotting (#20863)
fix ci

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-21 18:40:14 +01:00
Arthur
4a433e321f
Add-warning-tokenizer (#20826)
* add fast not use warning

* update
2022-12-21 18:18:34 +01:00
Arthur
76d02feadb
Fix doctest (#20843)
* fix doc for generation, dinat, nat and prelayernorm

* style

* update

* fix cpies

* use auto config and auto tokenizer

Co-authored-by: sgugger <sylvain.gugger@gmail.com>

* als modify roberta and the depending models

Co-authored-by: sgugger <sylvain.gugger@gmail.com>
2022-12-21 16:34:31 +01:00
Mohit Sharma
aaa6296de2
Fix whisper export (#20800)
* fix_whisper_export

* update input

* update input
2022-12-21 16:28:42 +01:00
Yih-Dar
3090e70857
Fix past CI by skipping LevitModelTest.test_problem_types (#20859)
* Fix past CI

* Fix past CI

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-21 14:29:13 +01:00
Maria Khalusova
04c560225b
Adding evaluate to the list of libraries required in generated notebooks (#20850)
Adding `evaluate` to the list of libraries to be installed for every generated notebook in transformers
2022-12-21 14:04:08 +01:00
İdil Sülo
0ae58204c6
Add visual prompt to processor of CLIPSeg model (#20816)
Adds visual_prompt argument to CLIPSegProcessor to enable image-guided segmentation
2022-12-21 15:23:45 +03:00
ValeKnappich
2da82bb4a7
fix past_key_values in GPTNeoXForCausalLM.prepare_inputs_for_generation (#20621)
* fix past_key_values in GPTNeoXForCausalLM.prepare_inputs_for_generation

* fix formatting
2022-12-21 11:46:04 +00:00
Yih-Dar
852e7ebaa2
Use config.num_channels in CLIP-like modeling files (#20857)
Use config.num_channels in CLIP-like modeling files

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-21 11:51:23 +01:00
NielsRogge
d87e381f93
[Examples] Update big table (#20845)
Update big table

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MBP.localdomain>
2022-12-21 11:34:31 +01:00
NielsRogge
9efad4efed
[Swin2SR] Add doc tests (#20829)
* Fix doc tests

* Use Auto API

* Apply suggestion

* Revert "Apply suggestion"

This reverts commit cd9507a866.

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MBP.localdomain>
2022-12-21 10:09:50 +01:00
Younes Belkada
0d284bd574
Add BLIP (#20716)
* add new model like

* add v1

* v1

* v1

* vision encoder logits match

* v2

* fix

* add docstring

* CI tests pass

* fix tests

* make fixup

* add to `toctree`

* fix processors

* fix processors

* fix doc

* fill title

* add content doc

* remove from tokenization auto

* fix config

* change order

* add `# Copied from`

* few fixes

- add correct license on modeling text
- remove dummy argument

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* replace name

* refactor a bit

* more refactor

* remove unused arg

* make fixup + remove some `# Adapted from ...`

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* more `# Copied from`

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* now `generate` supports no prefix

* remove `FeatureExtractor`

* fix path

* correct dependency

* fix tests

* few fixes

* add integration tests

* add correct conversion script

* Apply suggestions from code review

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

* add `blip` to tokenization auto

* fix docstrings

* fix test + add image

* remove processor from uncorrect place

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* clean up a bit

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* clean pixel mask

* clean pixel mask

* fix `F`

* Update src/transformers/models/blip/modeling_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix output

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix pad token id

* remove `token_type_ids`

* make fixup

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* make fixup

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* add comments

* Update src/transformers/models/blip/modeling_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* remove `token_type_ids`

* make fixup

* better name

* replace with `image_attention_mask`

* refactor

* make fixup

* better docstring

* replace `answer_xx`

* remove ununsed args

* add `labels`

* add `labels`

* fix processing tests

* make fixup

* make fixup

* put correct repo

* remove `pad`

* remove `crop` and `center_crop`

* Update src/transformers/models/blip/image_processing_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix

* remove `size_divisor`

* fix weights `init`

* remove unneeded functions

* add suggestions

* minor changes

- change slow test output for PT 1.13
- docstring order

* replace `feature_extractor` by `image_processor`

* fix doctests

* fix weight init order + add fp16 slow test

* add `blip` to doctest

* add correct repo name and fix test

* Update src/transformers/models/blip/processing_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix tests

* use `convert_to_rgb` from `image_transforms`

* make fixup

* fix large loading issue

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-12-21 09:39:10 +01:00
Steven Liu
3be028bc9d
Embed circle packing chart for model summary (#20791)
* embed circle packing chart

* trim whitespace from bottom

* explain bubble sizes
2022-12-20 10:26:52 -08:00
Sanchit Gandhi
bd1a43b699
[S2T, Whisper] Add copied from statements (#20787)
* [S2T, Whisper] Add copied from statements

* rebase and fix-copies
2022-12-20 18:13:56 +00:00
Steven Liu
5eecf3ff17
Clarify use_fast parameter in docstring (#20840)
* clarify use_fast parameter

* make style

* remove check frameworks, apply review
2022-12-20 08:42:26 -08:00
NielsRogge
2875fa971c
[SegFormer] Add support for segmentation masks with one label (#20279)
* Add support for binary segmentation

* Fix loss calculation and add test

* Remove space

* use fstring

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MBP.localdomain>
2022-12-20 16:46:50 +01:00
Yih-Dar
2280880cb7
remove unused use_cache in config classes (#20844)
remove unused use_cache in config classes

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-20 16:46:43 +01:00
Matt
d0bfdd20f4
TF AdamWeightDecay fix for 2.11 (#20848)
* Fix incorrect import for the base optimizer for AdamWeightDecay

* Fix incorrect import for the base optimizer for AdamWeightDecay
2022-12-20 13:40:45 +00:00
Sanchit Gandhi
d1d3ac9403
[mBART] fix erroneous italics in docstring (#20835)
* [mBART] fix erroneous italics in docstring

* fix-copies
2022-12-20 10:23:36 +00:00
Yih-Dar
244dd0f150
Remove unused max_position_embeddings in config classes (#20836)
Removed unused max_position_embeddings in config classes

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-20 10:09:34 +01:00
fzyzcjy
ae3cbbcaf6
Fix tiny typo (#20841)
* Fix typo

* Update README.md

* Update run_mlm_flax_stream.py

* Update README.md
2022-12-20 03:17:59 -05:00
Thomas-MMJ
7ef3f19c3c
fix typo output not ouput in bitsandbytes trainer test (#20839)
fix typo output not ouput

typo was causing an error on pytest collection
2022-12-20 03:16:26 -05:00
stanleycai95
bdb84e2bad
Add model resources for ViT (#20723)
* Set up overall resources documentation structure

* Update vit.mdx

* Removing irrelevant sections on text models

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx

* Update vit.mdx
2022-12-19 10:59:34 -08:00
Stas Bekman
f76518e56a
[clip] fix error message (#20818)
* [clip] fix error message

* sync
2022-12-19 08:25:16 -08:00
amyeroberts
76924384af
Vilt - use image_transforms pad (#20780)
Use image_transforms pad
2022-12-19 11:43:07 +00:00
Younes Belkada
ecd7de3dff
[Vision] [Refactor] Initialize weights on the correct place (#20803)
* fix nit

- initialization on `_init_weights`
- fix copies

* add copied from
2022-12-19 10:37:14 +01:00
daquexian
6b5a8f83ce
lazy import torch._softmax_backward_data for better compatibility (#20796)
lazy import torch._softmax_backward_data

Signed-off-by: daquexian <daquexian566@gmail.com>

Signed-off-by: daquexian <daquexian566@gmail.com>
2022-12-19 03:37:20 -05:00
Andreas Madsen
b4b613b102
Implement Roberta PreLayerNorm (#20305)
* Copy RoBERTa

* formatting

* implement RoBERTa with prelayer normalization

* update test expectations

* add documentation

* add convertion script for DinkyTrain weights

* update checkpoint repo

Unfortunately the original checkpoints assumes a hacked roberta model

* add to RoBERTa-PreLayerNorm docs to toc

* run utils/check_copies.py

* lint files

* remove unused import

* fix check_repo reporting wrongly a test is missing

* fix import error, caused by rebase

* run make fix-copies

* add RobertaPreLayerNormConfig to ROBERTA_EMBEDDING_ADJUSMENT_CONFIGS

* Fix documentation <Facebook> -> Facebook

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* fixup: Fix documentation <Facebook> -> Facebook

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* Add missing Flax header

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* expected_slice -> EXPECTED_SLICE

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* update copies after rebase

* add missing copied from statements

* make fix-copies

* make prelayernorm explicit in code

* fix checkpoint path for the original implementation

* add flax integration tests

* improve docs

* update utils/documentation_tests.txt

* lint files

* Remove Copyright notice

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

* make fix-copies

* Remove EXPECTED_SLICE calculation comments

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-12-19 09:30:17 +01:00
Yih-Dar
7032e02032
Install sentencepiece in DeepSpeed CI image (#20795)
* Install sentencepiece in DS CI image

* update

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-16 18:23:46 +01:00
NielsRogge
26dd041c6e
Add Swin2SR (#19784)
* First draft

* Add more improvements

* Improve forward pass

* Fix layernorm

* Add upscaler

* More improvements

* More improvements

* More improvements

* Improve conversion script

* Add preprocessing

* Make output match original implementation

* Add additional attributes

* Add support for more models

* Support more models

* Add support for real world sr

* Add initial Swin2SRFeatureExtractor

* Add ImageSuperResolutionOutput

* Make more tests pass

* Use BaseModelOutput

* Fix one more test

* Fix more tests

* Fix another test

* Fix all tests

* Rename to Swin2SRImageProcessor

* Fix toctree

* Fix toctree

* Fix rebase

* Improve Swin2SRImageProcessor

* Remove feature extractor file

* Improve model

* Improve conversion script

* Fix integration test

* Fix init

* Fix conversion script

* Address comments

* Improve upsampler

* Add NearestConvUpsampler

* Improve pixel shuffle upsampler

* Improve auxiliary upsampler

* Improve conversion script

* Rename conv_last to final_convolution

* Fix rebase

* Improve upsample module

* Add padding to image processor

* Fix bug

* Update padding

* Remove print statement and fix integration test

* Improve docs

* Add image processor tests

* Convert all checkpoints, fix testsé

* Remove print statements

* Fix import

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-12-16 16:24:01 +01:00
NielsRogge
7f99861218
Add Universal Segmentation class + mapping (#20766)
* Add mapping

* Add mapping to pipeline

* Apply suggestions

* Fix feature extractor tests

* Use ForInstance, add model to universal mapping

* More fixes

* Remove model from deprecated objectsé

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-12-16 14:22:46 +01:00
Matt
e65445b4d6
Stop calling expand_1d on newer TF versions (#20786) 2022-12-16 13:10:07 +00:00
Nicolas Patry
3ee958207a
Fix object detection2 (#20798)
* Revert "Fixing object detection with `layoutlm` (#20776)"

This reverts commit fca66abe2a.

* Better fix for layoutlm object detection.

* Style.
2022-12-16 13:25:36 +01:00
Younes Belkada
4341f4e224
[Pipeline] skip feature extraction test if in IMAGE_PROCESSOR_MAPPING (#20790)
skip feature extraction test if in `IMAGE_PROCESSOR_MAPPING`
2022-12-16 12:46:58 +01:00
Yih-Dar
1543cee7c8
Recompile apex in DeepSpeed CI image (#20788)
Recompile apex in DeepSpeed CI image

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-15 21:35:27 +01:00
amyeroberts
491e951875
Move convert_to_rgb to image_transforms module (#20784)
* Move convert_to_rgb to image_transforms module

* Fix tests
2022-12-15 18:47:04 +00:00
Joao Gante
4bc723f87d
Generate: use GenerationConfig as the basis for .generate() parametrization (#20388)
* generate from config mvp

* fix failing tests

* max_time test

* Load default gen config at model load time; Update docs

* further documentation; add tests

* adapt rag to the new structure

* handle models not instantiated with from_pretained (like in tests)

* better default generation config

* add can_generate fn

* handle legacy use case of ad hoc model config changes

* initialize gen config from config in individual methods, if gen config is none

* fix _get_decoder_start_token_id when called outside GenerationMixin

* correct model config load order (set attr > model config > decoder config)

* update rag to match latest changes

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* load gen config from model config in model.from_pretrained

* fix can_generate fn

* handle generate calls without a previous from_pretrained (e.g. tests)

* add legacy behavior (and a warning)

* lower logger severity

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-12-15 18:27:20 +00:00
Yih-Dar
b1706f6908
Install video dependency for pipeline CI (#20777)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-15 18:47:05 +01:00
Nicolas Patry
fca66abe2a
Fixing object detection with layoutlm (#20776)
* Fixing object detection with layoutlm.

* Fixup.
2022-12-15 18:46:43 +01:00
Younes Belkada
8891193e83
[Pipeline] fix failing bloom pipeline test (#20778)
fix failing `pipeline` test
2022-12-15 18:46:00 +01:00