Commit Graph

11486 Commits

Author SHA1 Message Date
Francisco Kurucz
e135a6c931
Fix flax GPT-J-6B linking model in tests (#20556) 2022-12-05 14:00:05 +01:00
Yih-Dar
24124709ca
Fix torch device issues (#20584)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 13:57:34 +01:00
szhublox
699e90437f
flan-t5.mdx: fix link to large model (#20555) 2022-12-02 19:27:46 +01:00
Matt
c54646b13d
Add ESM contact prediction (#20535)
* Draft addition of new head

* Finish adding contact heads + tests for ESM

* Add TF contact prediction head

* make fixup

* Minor fix to convert_esm.py

* Clean up function names and comments
2022-12-02 14:03:30 +00:00
fatih
cc3d0e1b01
[New Model] Add TimeSformer model (#18908)
* init timesformer

* apply fix-copies

* reformat style

* revert back some incoorect style updates

* init timesformer

* apply fix-copies

* reformat style

* revert back some incoorect style updates

* update timseformer doc

* add some functions and classes

* add new config params

* implement multiple classes

* update TimeSformerLayer

* update TimeSformerModel, TimeSformerPreTrainedModel, TimeSformerEncoder

* several fixes

* reformat

* temporary update

* fix some typos

* fix weight converter

* more fixes

* fix a typo

* fix typo

* remove redundant params

* fix for latest hf-hub

* merge fix

* fix some checks

* video classification works with einops

* add paper info to docs

* merge fix

* remove redundant line

* remove redundant docstring

* update config

* fix some typos

* fix converter

* update some test constants

* refactor einops functions

* reformat

* fix a comment

* remove redundat imports

* reformat

* fix a typo

* remove comment

* remove unused imports

* remove redundant doc line

* reformat

* add missing line

* fix docs

* fix timesformer auto feat ext

* add unittests

* reformat

* fix docs

* some fixes and updates

* fix readme

* fix modeling

* fix readme

* update index

* revert _toctree.yml changes

* update timseformer.mdx

* update drop_path_prob to drop_path_rate

* add dosctring for drop_path_rate

* update TimeSformerPatchEmbed naming

* remove to_2tuple

* explicit use of nn.functional

* reformat

* many updates from review comments

* fix a typo

* reformat

* remove assert, better variable name

* make variable names more explicit

* add some adapted from

* more explicit variable names

* remove redundant docstring

* fix initilaization

* move permute inside embedding

* update class names

* remove unused imports

* add test for video classification

* update PretrainedModel with PreTrainedModel

* remove double permute

* update based on sylvain's review

* aply auto fix

* update image_processing_auto for timesformer

* update hub urls

* reformat

* remove duplicate import

* update doc link
2022-12-02 09:13:25 +01:00
Arthur
3a9476d1b4
fix cuda OOM by using single Prior (#20486)
* fix cuda OOM by using single Prior

* only send to device when used

* use custom model
2022-12-02 09:05:45 +01:00
Sylvain Gugger
60d1f31bb0
v4.26.0.dev0 2022-12-01 16:19:33 -05:00
Steven Liu
5011efbec8
Fix link in pipeline device map (#20517)
* fix link in pipeline device map

* oops this is the correct link

* make style
2022-12-01 09:58:44 -08:00
Francisco Kurucz
504ae9181c
Fix Hubert models in TFHubertModel and TFHubertForCTC documentation code (#20516) 2022-12-01 12:22:23 -05:00
NielsRogge
6cb7d6ec36
Fix doctest (#20534)
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-12-01 18:19:37 +01:00
Wang, Yi
d752337baa
QnA example: add speed metric (#20522) 2022-12-01 12:04:19 -05:00
fatih
b67ac44296
update post_process_image_guided_detection (#20521) 2022-12-01 12:03:17 -05:00
Yih-Dar
d51e7c7e82
Update ZeroShotObjectDetectionPipeline doc example (#20528)
* Update ZeroShotObjectDetectionPipeline expect output

* Update src/transformers/pipelines/zero_shot_object_detection.py

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
2022-12-01 16:53:24 +01:00
Younes Belkada
8b486c0310
add doc for (#20525) 2022-12-01 16:52:13 +01:00
Yih-Dar
cdb7eeca46
Fix ConditionalDetrForSegmentation doc example (#20531)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-01 16:49:59 +01:00
Yih-Dar
876a9e084e
Fix PLBart doctest (#20527)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-01 16:49:04 +01:00
Yih-Dar
373bfe70a0
Change Doctests CI launch time (#20523)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-01 16:38:41 +01:00
Sanchit Gandhi
55ab71ee5b
[modelcard] Update dataset tags (#20506) 2022-12-01 10:52:17 +00:00
Sylvain Gugger
e342ac7e03
Add some warning for Dynamo and enable TF32 when it's set (#20515) 2022-11-30 15:42:17 -05:00
Francisco Kurucz
68cfffc4b4
Fix Data2VecTextForCasualLM example code documentation (#20510)
* Fix Data2VecTextForCasualLM example code documentation

* Change RobertaTokenizer to AutoTokenizer in data2vectext example code
2022-11-30 15:03:46 -05:00
Yih-Dar
dd6fb1319b
Add natten for CI (#20511)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-30 19:49:34 +01:00
Yih-Dar
afb66749a6
Update AutomaticSpeechRecognitionPipeline doc example (#20512)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-30 19:48:18 +01:00
Sylvain Gugger
04c653a354
Fix style 2022-11-30 13:32:19 -05:00
Yang An
721764028e
Add Chinese-CLIP implementation (#20368)
* init chinese-clip model from clip

* init model tests and docs

* implement chinese-clip into hf

* implement chinese-clip into hf

* implement chinese-clip into hf

* implement chinese-clip into hf

* implement chinese-clip into hf

* update usecase example in model implementation

* fix codestyle

* fix model_type typo in readme

* add placeholder in doc

* add placeholder in doc

* update the init script

* update usecase

* fix codestyle

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* update testcase

* forward the convert_rgb

* update testcase

* update testcase

* update testcase

* merge the recent update from clip about model_input_name property

* update the doc

* update the doc

* update the doc

* update the doc

* remove unused imports

* reformat code style

* update the doc

* fix isort style

* bypass a weird failed unit test which is unrelated with my PR

* update the doc

* implement independent vision config class

* implement independent vision model class

* fix refactor bug

* fix refactor bug

* fix refactor bug

* make style

* fix refactor bug

* make style

* fix refactor bug

* fix refactor bug

* make style

* fix refactor bug

* fix refactor bug

* doc-build restyle

* implement independent text config class

* implement independent text model class

* implement independent text model class

* make style

* make fix-copies

* fix refactor bug

* fix refactor bug

* fix refactor bug

* fix refactor bug

* fix refactor bug

* fix refactor bug

* fix refactor bug

* fix refactor bug

* fix refactor bug

* fix refactor bug

* make style

* update doc

* black and isort

* update doc

* Update src/transformers/models/chinese_clip/configuration_chinese_clip.py

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

* Update src/transformers/models/auto/tokenization_auto.py

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

* modify the model type from chinese-clip to chinese_clip

* format the example comment of ChineseCLIPVisionConfig

* correct the copyright comment

* fix the tokenizer specification

* add copied from for loss function

* remove unused class

* update CHINESE_CLIP_TEXT_INPUTS_DOCSTRING

* update CHINESE_CLIP_INPUTS_DOCSTRING

* update doc

* update doc

* update code comment in config

* update copied from statement

* make style

* rename the doc file

* add copied statement

* remove unused attention_mask, causal_attention_mask in ChineseCLIPVisionEncoder

* remove ChineseCLIPTextPreTrainedModel

* fix bug

* fix bug

* fix bug

* update doc

* make style

* Update src/transformers/models/chinese_clip/configuration_chinese_clip.py

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

* Update src/transformers/models/chinese_clip/configuration_chinese_clip.py

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

* update ChineseCLIPImageProcessor in image_processing_auto

* fix config_class of chinesecliptextmodel

* fix the test case

* update the docs

* remove the copied from comment for ChineseCLIPTextModel, since it has diverged from BertModel with customed config_class

* update the testcase

* final fix

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-30 19:22:23 +01:00
Sylvain Gugger
396a6a2ed0
Fix minimum version for device_map (#20489) 2022-11-30 11:10:55 -05:00
Sylvain Gugger
08b4621899
Repurpose torchdynamo training args towards torch._dynamo (#20498)
* Repurpose torchdynamo training args towards torch._dynamo

* Add doc
2022-11-30 11:10:45 -05:00
Julian Pollmann
829374e4fc
Fix Typo in Docs for GPU (#20509) 2022-11-30 10:41:18 -05:00
amyeroberts
17a7b49bda
Update doc examples feature extractor -> image processor (#20501)
* Update doc example feature extractor -> image processor

* Apply suggestions from code review
2022-11-30 14:50:55 +00:00
Matt
afad0c18d9
Fix TF nightly tests (#20507)
* Fixed test_saved_model_extended

* Fix TFGPT2 tests

* make fixup

* Make sure keras-nlp utils are available for type hinting too

* Update src/transformers/testing_utils.py

Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>

* make fixup

Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2022-11-30 14:47:54 +00:00
Arthur
761b3fad92
Expected output for the test changed (#20493) 2022-11-30 15:07:28 +01:00
Wang, Yi
a4beb37b81
fix ipex+fp32 jit trace error in ipex 1.13 (#20504)
error show like: “Currently the auto_kernel_selection does not support the grad mode! Please add torch.no_grad() before the inference runtime..”
since jit mode only work in inference mode, it's safe to add such logic.
2022-11-30 08:58:01 -05:00
jeffhataws
105c3a48be
Support extraction of both train and eval XLA graphs (#20492)
Neuron supports extraction of XLA graphs for compilation.
However, when both do_train and do_eval options are enabled,
sizes returned by tensor operator can be 0. To avoid
INVALID_ARGUMENT error, we use inequality in the check whether
a tensor needs padding or not.
2022-11-30 08:43:46 -05:00
Younes Belkada
b75255cd9d
[OPT/Galactica] Load large galactica models (#20390)
* fix `opt` bias

* revert unneeded assignment
2022-11-30 13:55:15 +01:00
Yih-Dar
293991d44b
Make add_special_tokens more clear (#20424)
* make add_special_tokens more clear

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-30 12:56:32 +01:00
Yih-Dar
d0c1ded5f3
remove attention_mask truncation in whisper (#20488)
* remove truncation

* For TFWhisper

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-30 11:46:01 +01:00
amyeroberts
de6d19ea92
Add segmentation + object detection image processors (#20160)
* Add transforms for object detection

* DETR models + Yolos

* Scrappy additions

* Maskformer image processor

* Fix up; MaskFormer tests

* Update owlvit processor

* Add to docs

* OwlViT tests

* Update pad logic

* Remove changes to transforms

* Import fn directly

* Update to include pad transformation

* Remove uninstended changes

* Add new owlvit post processing function

* Tidy up

* Fix copies

* Fix some copies

* Include device fix

* Fix scipy imports

* Update _pad_image

* Update padding functionality

* Fix bug

* Properly handle ignore index

* Fix up

* Remove defaults to None in docstrings

* Fix docstrings & docs

* Fix sizes bug

* Resolve conflicts in init

* Cast to float after resizing

* Tidy & add size if missing

* Allow kwards when processing for owlvit

* Update test values
2022-11-30 10:24:03 +00:00
Sanchit Gandhi
ae3cbc9548
[modelcard] Set model name if empty (#20496)
* [modelcard] Set model name if empty

* no magic

Co-authored-by: Sylvain Gugger <sylvain@huggingface.co>

Co-authored-by: Sylvain Gugger <sylvain@huggingface.co>
2022-11-30 09:55:43 +00:00
Sanchit Gandhi
08fad080e3
[modelcard] Check for IterableDataset (#20495) 2022-11-30 09:55:07 +00:00
Sylvain Gugger
ab9fe45236
Fix disk offload for full safetensors checkpoints (#20497) 2022-11-29 14:58:30 -05:00
Francisco Kurucz
4aa630eeab
Fix documentation code to import facebook/detr-resnet-50 model (#20491) 2022-11-29 13:30:26 -05:00
sandeep kumar
86e435bbb1
fixed small typo (#20490)
Co-authored-by: Sandeep Kumar <sandeep.kumar@woven-planet.global>
2022-11-29 11:35:12 -05:00
Billy Lee
73e2faa6c2
Replace assert statements with raise exceptions (#20478)
* replace assert statements with exceptions

* made conditions more readable
2022-11-29 11:34:08 -05:00
Pi Esposito
fb2b45e562
add in layer gpt2 tokenizer (#20421)
* add minimal working gpt2 tokenizer

* graph mode and output equivalence tests working

* not today tensorflow. serialization test passing!

* fix style, documentation, docstrings and all that jazz

* passing consistency checks

* move keras nlp to tf dependencies

* fix tf modeling utils and gpt2 attention to enable compiling

* fix (I hope) keras nlp dependencies

* rever changes on generation

* remove debug prints

* remove redundant tf dummy objects

* add from config, get config and max length settings to address review

* let flake ignore the error on distillation you are welcome

* test from config

* add padding test

* address sgugger review
2022-11-29 10:02:40 -05:00
Yih-Dar
e8d448edcf
extract warnings in GH workflows (#20487)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-29 15:58:54 +01:00
Sylvain Gugger
bbcd5eea3b
Fix init import_structure sorting (#20477)
* Fix init import_structure sorting

* Fix rebase
2022-11-29 09:46:10 -05:00
fxmarty
3b91f96fc9
Fix torch meshgrid warnings (#20475)
* fix torch meshgrid warnings

* support lower torch versions

* don't edit examples

* dont edit examples

* fix ci

* fix style

* rebase cleanup

* fix ci again
2022-11-29 08:38:23 -05:00
amyeroberts
ae1cffaf3c
Add Donut image processor (#20425)
* Add Donut image processor

* Update src/transformers/image_transforms.py

Co-authored-by: Alara Dirik <8944735+alaradirik@users.noreply.github.com>

* Fix docstrings

* Full var names in docstring

Co-authored-by: Alara Dirik <8944735+alaradirik@users.noreply.github.com>
2022-11-29 10:38:01 +00:00
Yih-Dar
28247e7881
Extract warnings from CI artifacts (#20474)
* extract warning from CI artifacts

* fix path

* fix logic

* fix comment

* update default values

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-11-28 21:14:33 +01:00
NielsRogge
6dc884abc8
[Maskformer] Add MaskFormerSwin backbone (#20344)
* First draft

* Fix backwards compatibility

* More fixes

* More fixes

* Make backbone more general

* Improve backbone

* Improve test

* Fix config checkpoint

* Address comments

* Use model_type

* Address more comments

* Fix special model names

* Remove MaskFormerSwinModel and MaskFormerSwinPreTrainedModel from main init

* Fix typo

* Update backbone

* Apply suggestion

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-11-28 20:33:49 +01:00
Henghui Zhu
955780d3ab
add timeout option for deepspeed engine (#20443) 2022-11-28 10:23:25 -08:00