Commit Graph

11726 Commits

Author SHA1 Message Date
Francisco Kurucz f821bea0ad
Fix link to speech encoder decoder model in speech recognition readme (#20633) 2022-12-06 15:46:41 -05:00
Steven Liu 4f78bcb287
add missing is_decoder param (#20631) 2022-12-06 12:18:58 -08:00
Sylvain Gugger 7586a1a367
Fix dtype of weights in from_pretrained when device_map is set (#20602) 2022-12-06 12:16:17 -05:00
Yih-Dar bf9a5882a7
Update some GH action versions (#20537)
* update actions versions

* update actions versions

* update actions versions

* update actions versions

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-06 16:54:40 +01:00
Arthur acc439ba17
Ci-jukebox (#20613)
* fix cuda OOM by using single Prior

* only send to device when used

* use custom model

* Skip the big slow test

* Update tests/models/jukebox/test_modeling_jukebox.py

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

Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2022-12-06 16:14:03 +01:00
Yih-Dar 9b14c1b6bf
Fix `AutomaticSpeechRecognitionPipelineTests.run_pipeline_test` (#20597)
* Remove assert exception not triggered

* Fix wrong expected exception string

* fix

* use assertRaisesRegex

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-06 15:48:49 +01:00
Sylvain Gugger 6a707cf586
Repo consistency 2022-12-06 08:08:37 -05:00
Sourab Mangrulkar 97a51b0c7d
updating T5 and BART models to support Prefix Tuning (#20601)
* updating T5 and BART models to support Prefix Tuning

* `make fix-copies`

* address comments

* address comments
2022-12-06 18:24:39 +05:30
xxyzz b9a0ede6ab
Check if docstring is None before formating it (#20592)
docstrings could be `None` if Python optimize level is set to 2.
2022-12-06 07:44:17 -05:00
Wang, Yi ae06bce888
exclude jit time from the speed metric calculation of evaluation and prediction (#20553)
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2022-12-06 07:37:01 -05:00
Sourab Mangrulkar 25e10da427
Adding anchor links to Hindi README (#20606) 2022-12-06 18:06:25 +05:30
Samuel Xu e842e181df
Documentation fixes (#20607) 2022-12-06 07:32:46 -05:00
Nicolas Patry 28f3d431d4
Rework the pipeline tutorial (#20437)
* [WIP] Rework the pipeline tutorial

- Switch to `asr` instead of another NLP task.
- It also has simpler to understand results.
- Added a section with interaction with `datasets`.
- Added a section with writing a simple webserver.

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Addressing comments.

* Links.

* Fixing docs format.

* Adding pipeline_webserver to _toctree.

* Warnig -> Tip warnings={true}.

* Fix link ?

* Links ?

* Fixing link, adding chunk batching.

* Oops.

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/pipeline_tutorial.mdx

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2022-12-06 10:47:31 +01:00
Sylvain Gugger 5764efe544
Fix test for file not found (#20604) 2022-12-05 18:33:56 -05:00
Steven Liu 720e9599c1
Split autoclasses on modality (#20559)
* split autoclasses on modality

* apply review

* auto classes
2022-12-05 12:28:44 -08:00
Steven Liu 7d1c1c5b21
Fix code sample in preprocess (#20561)
* change to image_processor

* apply review
2022-12-05 11:49:43 -08:00
Sourab Mangrulkar 73ec12eafb
README in Hindi 🇮🇳 (#20097)
* Created README_hd.md

A Hindi Translation for README

* updated check_copies.py

Added the Proper info for Hindi Translation of README File !

* updated README_hd.md

Fixed some translation issues !

* Update README_hd.md

* Update README_hd.md

* Update README_hd.md

* fixing 🐛 for `make fix-copies`

* run `make fix-copies`

* `make fix-copies` 😅

Co-authored-by: Akshit Gulyan <103456810+AkshitGulyan@users.noreply.github.com>
2022-12-06 01:04:40 +05:30
Arthur aef9aac312
Add-whisper-conversion (#20600)
* add whisper conversion scrip

* update conversion script

* update arg names

* fix missing encoder_ffn_dim

* fixup

* ast nits
2022-12-05 20:02:57 +01:00
Sanchit Gandhi 74fb524e20
[Whisper] Fix decoder ids methods (#20599)
* [Whisper] Fix decoder ids methods

* enum property
2022-12-05 18:45:22 +00:00
Younes Belkada ef0f85cd57
[Vision] `.to` function for ImageProcessors (#20536)
* add v1 with tests

* add checker

* simplified version

* update docstring

* better version

* fix docstring + change order

* make style

* tests + change conditions

* final tests

* modify docstring

* Update src/transformers/feature_extraction_utils.py

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

* replace by `ValueError`

* fix logic

* apply suggestions

* `dtype` is not needed

* adapt suggestions

* remove `_parse_args_to_device`

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
2022-12-05 19:10:54 +01:00
Yih-Dar 67d32f4649
Replace `set-output` by `$GITHUB_OUTPUT` (#20547)
* remove set-output

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 18:25:13 +01:00
Arthur 9763f829a5
Fix whisper and speech to text doc (#20595)
* Fix whisper and speech to text doc
# What does this PR do?
Previously the documentation was badly indented for both models and indicated that
> If `decoder_input_ids` and `decoder_inputs_embeds` are both unset, `decoder_inputs_embeds` takes the value of `inputs_embeds`.`
Which is on valid for the forward pass of the `ForConditionnalGeneration` not for the model alone.

* other fixes
2022-12-05 18:23:36 +01:00
Yih-Dar 4430b91298
clean up unused `classifier_dropout` in config (#20596)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-12-05 18:04:33 +01:00
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