Commit Graph

15053 Commits

Author SHA1 Message Date
Francisco Kurucz
eefae413d1
Fix link to table transformer detection microsoft model (#20560)
* Fix link to table transformer detection microsoft model

* Fix doc styles
2022-12-05 11:43:27 -05:00
Francisco Kurucz
d5af5a0c87
Fix link to swin transformers v2 microsoft model (#20558) 2022-12-05 11:43:04 -05:00
Francisco Kurucz
ac3bccdc74
Fix link to Swin Model contributor novice03 (#20557) 2022-12-05 11:42:29 -05:00
Erin
87282cb73c
Add RemBERT ONNX config (#20520)
* rembert onnx config

* formatting

Co-authored-by: Ho <erincho@bcd0745f972b.ant.amazon.com>
2022-12-05 11:39:09 -05:00
Matthew Hoffman
afe2a466bb
ESM openfold_utils type hints (#20544)
* add type annotations for esm chunk_utils

use isinstance builtin instead of 'type(x) is y'; add assertions to aid in type inferencing; use bools instead of ints in _get_minimal_slice_set for improved type clarity; refactor to avoid re-assigning to the same variable with a different type

* add type annotations for esm data_transforms

refactor to avoid re-assigning to the same variable with a different type

* add type annotations for esm feats utils

refactor to avoid re-assigning to the same variable with a different type

* add type annotations for esm loss utils

* add/fix type annotations for esm rigit_utils

refactor to avoid re-assigning to the same variable with a different type; fix Callable, Tuple type hints; match conditional structure to other methods; fix return type on Rotation.cat and Rotation.unsqueeze

* add type annotations for esm tensor_utils

overload for tree_map; use insinstance builtin instead of 'type(x) is y'; export dict_multimap, flatten_final_dims, permute_final_dims in openfold_utils

* add type annotations for esm protein utils

add FIXME for attempted string mutation; add missing None check in get_pdb_headers; fix potentially unbound variable 'chain_tag' in to_pdb; modify get_pdb_headers return type

* add type annotations for esm residue constants

hints on collection constants; remove magic trailing comma to reduce number of lines; change list -> tuple for rigid_group_atom_positions for improved hinting

* code style fixup

Co-authored-by: Matt <rocketknight1@gmail.com>
2022-12-05 16:23:15 +00:00
Mihai Cernusca
8ea6694d92
Make convert_to_onnx runable as script again (#20009)
* Make convert_to_onnx runable as script again

Fix `convert_graph_to_onnx.py` relative import so it can be run as a script again.

* Trigger CI
2022-12-05 11:08:39 -05:00
Arthur
84c9bf7421
cross platform from_pretrained (#20538)
* add support for `from_pt`

* add tf_flax utility file

* Update src/transformers/modeling_tf_flax_utils.py

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

* remove flax related modifications

* add test

* remove FLAX related commits

* fixup

* remove safetensor todos

* revert deletion

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-12-05 16:56:17 +01:00
Arthur
538e5248b0
Ci-whisper-asr (#20588)
* Expected output for the test changed

* fix failing asr test
2022-12-05 16:50:38 +01:00
Kamal Raj Kanakarajan
13e736685a
Add BioGPT (#20420)
* biogpt initial commit

* updated init

* fix faster decoding with use_cache

* 1. fix input_ids and input_embeds with correct device
2. added _keys_to_ignore_on_load_missing
3. updated prepare_inputs_for_generation

* add activation_dropout and scale_embedding

* replace fsmt attention with bart attention

* added test

* run make fix-copies

* doc init and fix build

* updated README with proper information

* 1. added tips to docs
2. updated BioGptTokenizer func

* 1. added tokenizer test
2. refactor tokenizer

* make fixup

* add biogpt fairseq to hf converter

* updated layer names more
similar to original checkpoints

* config update doc string and set defaults

* added "#copied" from bart model and
updated doc strings

* enable model_input_names in tokenizer

* 1.  positionalembedding depending on attention_mask
2. added attention mask to prepare for generation

* added test to verify past and generation

* BioGptLMHeadModel -> BioGptForCausalLM

* fix typo

* tokenization and test
Copyright and updated assertion

* updated Copyright and
one func at time in line

* Copyright updates and
minor doc fix

* replace assertion with ValueError

* rm extra space

* added code syntax

* revert cmnt position change

* add tokenizer to auto

* updated doc string

* tokenizer doc string update

* biogpt hub model update to microsoft/biogpt

* make fixup

* rm cmnt to fix flake8 5.0.4 vs 6 error
2022-12-05 10:12:03 -05:00
Yih-Dar
91182e3a70
Install tensorflow_probability for TF pipeline CI (#20586)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 16:07:25 +01:00
Yih-Dar
cc8aec6740
Add require_torch to 2 pipeline tests (#20585)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 16:06:39 +01:00
Sanchit Gandhi
e7e6d1818a
[Whisper] Move decoder id method to tokenizer (#20589) 2022-12-05 14:54:04 +00:00
Yih-Dar
9ffbed26c0
Cleanup some config attributes (#20554)
* Remove is_encoder_decoder from some vision models

* cleanup more

* cleanup more

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 15:12:10 +01:00
Yih-Dar
e17826539b
Add entries to FEATURE_EXTRACTOR_MAPPING_NAMES (#20551)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 15:10:17 +01:00
Yih-Dar
8639cfb4c2
Install natten with CUDA version (#20546)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 15:08:32 +01:00
Sylvain Gugger
6276b437a6
Fix repo consistency 2022-12-05 09:02:56 -05:00
Younes Belkada
0911057744
[Vision] fix small nit on BeitDropPath layers (#20587)
* fix small nit

* add last file
2022-12-05 14:53:49 +01:00
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