Commit Graph

12993 Commits

Author SHA1 Message Date
Nicolas Patry e30ceae07b
small fix to remove unused eos in processor when it's not used. (#23408) 2023-05-23 09:27:36 +02:00
NielsRogge 2f424d7979
[image-to-text pipeline] Add conditional text support + GIT (#23362)
* First draft

* Remove print statements

* Add conditional generation

* Add more tests

* Remove scripts

* Remove BLIP specific linkes

* Add support for pix2struct

* Add fast test

* Address comment

* Fix style
2023-05-22 21:45:50 +02:00
Yih-Dar e69feab8a1
Update workflow files (#23658)
* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-22 21:26:51 +02:00
Zachary Mueller b191d7db44
Update all no_trainer with skip_first_batches (#23664) 2023-05-22 14:49:31 -04:00
Matt 26a06814a1
Fix SAM tests and use smaller checkpoints (#23656)
* Fix SAM tests and use smaller checkpoints

* Override test_model_from_pretrained to use sam-vit-base as well

* make fixup
2023-05-22 19:42:35 +02:00
sshahrokhi 6f72e71f97
changing the requirements to a cpu torch version that works (#23483) 2023-05-22 12:58:55 -04:00
LWprogramming 5de2a6d5e5
Fix wav2vec2 is_batched check to include 2-D numpy arrays (#23223)
* Fix wav2vec2 is_batched check to include 2-D numpy arrays

* address comment

* Add tests

* oops

* oops

* Switch to np array

Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>

* Switch to np array

* condition merge

* Specify mono channel only in comment

* oops, add other comment too

* make style

* Switch list check from falsiness to empty

---------

Co-authored-by: Sanchit Gandhi <93869735+sanchit-gandhi@users.noreply.github.com>
2023-05-22 12:57:45 -04:00
Tim Dettmers 4ddd9de9d3
Bugfix: LLaMA layer norm incorrectly changes input type and consumers lots of memory (#23535)
* Fixed bug where LLaMA layer norm would change input type.

* make fix-copies

---------

Co-authored-by: younesbelkada <younesbelkada@gmail.com>
2023-05-22 18:20:38 +02:00
Zachary Mueller fe34486f12
Muellerzr fix deepspeed (#23657)
* Fix deepspeed recursion

* Better fix
2023-05-22 11:22:54 -04:00
Younes Belkada 7bbdfd7b24
Fix accelerate logger bug (#23650)
* fix logger bug

* Update tests/mixed_int8/test_mixed_int8.py

Co-authored-by: Zachary Mueller <muellerzr@gmail.com>

* import `PartialState`

---------

Co-authored-by: Zachary Mueller <muellerzr@gmail.com>
2023-05-22 15:39:47 +02:00
zspo 29294b0e68
Fix tensor device while attention_mask is not None (#23538)
* Fix tensor device while attention_mask is not None

* Fix tensor device while attention_mask is not None
2023-05-22 09:30:46 -04:00
Joshua Lochner 12ec7f0c20
Remove erroneous `img` closing tag (#23646)
See https://github.com/huggingface/transformers/pull/23625
2023-05-22 09:28:26 -04:00
Tyler 6397b7f008
Debug example code for MegaForCausalLM (#23382)
* Debug example code for MegaForCausalLM

set ignore_mismatched_sizes=True in model loading code

* Fix up
2023-05-22 10:53:14 +01:00
Yih-Dar 3658488ff7
Fix `tests/repo_utils/test_get_test_info.py` (#23485)
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-20 06:53:10 +02:00
Yih-Dar 9728f1134b
Fix confusing `transformers` installation in CI (#23465)
* fix

* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-19 22:10:18 +02:00
Yih-Dar 1f2c00d671
Fix DeepSpeed stuff in the nightly CI (#23478)
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-19 20:31:55 +02:00
Younes Belkada 3cb9309024
[`Blip`] Remove redundant shift right (#23153)
* remove redundant shit right

* fix failing tests

* this time fix tests
2023-05-19 19:14:16 +02:00
Dennis Loevlie 847e5691a6
Fix: Change tensors to integers for torch.dynamo and torch.compile compatibility (#23475)
* Fix: Change tensors to integers in torch.split() for torch.dynamo and torch.compile compatibility

* Applied the suggested fix to the utils/check_copies.py test

* Applied the suggested fix by changing the original function that gets copied
2023-05-19 12:50:11 -04:00
joaoareis 389bdba618
Fix PretrainedConfig `min_length` docstring (#23471) 2023-05-19 17:48:35 +01:00
Zachary Mueller b455ad0a64
Fix parallel mode check (#23409)
* Fix sagemaker/distributed state

* Fix correctly

* Bring back -1

* Bring back local rank for distributed check

* better version

* Cleanest option
2023-05-19 12:44:24 -04:00
Yih-Dar db4d765249
Fix `transformers`' DeepSpeed CI job (#23463)
* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-19 17:50:06 +02:00
Sylvain Gugger 2aa0cc2c2a
Use config to set name and description if not present (#23473)
Use config to set name and descriptiob if not present
2023-05-19 10:36:14 -04:00
Younes Belkada 21bd3be172
[`RWKV`] Rwkv fix for 8bit inference (#23468)
* rwkv fix for 8bit inference

* add comment
2023-05-19 16:12:25 +02:00
Matt 1c460a5273
TF port of the Segment Anything Model (SAM) (#22970)
* First commit

* Add auto-translation with GPT-4

* make fixup

* Add a functional layernorm for TF

* Add all the auxiliary imports etc.

* Add the extra processor and tests

* rebase to main

* Add all the needed fixes to the GPT code

* make fixup

* Make convolutions channels-last so they run on CPU

* make fixup

* Fix final issues

* Fix other models affected by test change

* Clarify comment on the sparse_prompt_embeddings check

* Refactor functional_layernorm, use shape_list in place of .shape in some places

* Remove deprecated torch-alike code

* Update tests/models/sam/test_modeling_tf_sam.py

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

* Update tests/models/sam/test_modeling_tf_sam.py

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

* Refactor processor with common methods and separated private methods

* make fixup

* Quietly delete the file that didn't do anything (sorry Sylvain)

* Refactor the processor tests into one file

* make fixup

* Clean up some unnecessary indirection

* Fix TF mask postprocessing

* Add more processor equivalence tests

* Refactor generate_crop_boxes to use framework-neutral np code

* Make the serving output correctly conditional

* Fix error message line length

* Use dict keys rather than indices internally in both TF and PT SAM call/forward

* Return dicts internally in the call/forward methods

* Revert changes to common tests and just override check_pt_tf_outputs

* Revert changes to other model tests

* Clarify comments for functional layernorm

* Add missing transpose from PT code

* Removed unused copied from in PT code

* Remove overrides for tests that don't exist in TF

* Fix transpose and update tests for PT and TF to check pred_masks

* Add training flag

* Update tests to use TF checkpoints

* Update index.mdx

* Add missing cross-test decorator

* Remove optional extra asterisks

* Revert return_dict changes in PT code

* Update src/transformers/models/sam/modeling_tf_sam.py

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

* Remove None return annotations on init methods

* Update tests/models/sam/test_processor_sam.py

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

* Fix input_boxes shapes

* make fixup

---------

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2023-05-19 14:14:13 +01:00
Jiewen Tan 8aa8513f71
Remove .data usages in optimizations.py (#23417)
Patched the optimizers
2023-05-19 07:41:51 -04:00
Julien Chaumond 3cf01b2060
README: Fix affiliation for MEGA (#23394)
* README: Fix affiliation for MEGA

* Fix quality

---------

Co-authored-by: Lysandre <lysandre@huggingface.co>
2023-05-19 11:03:07 +02:00
Connor Henderson 2acedf4721
feat: Whisper prompting (#22496)
* initial working additions

* clean and rename, add cond stripping initial prompt to decode

* cleanup, edit create_initial_prompt_ids, add tests

* repo consistency, flip order of conditional

* fix error, move the processor fn to the tokenizer

* repo consistency, update test ids to corresponding tokenizer

* use convert_tokens_to_ids not get_vocab...

* use actual conditional in generate

* make sytle

* initial address comments

* initial working add new params to pipeline

* first draft of sequential generation for condition_on_previous_text

* add/update tests, make compatible with timestamps

* make compatible with diff. input kwargs and max length

* add None check

* add temperature check

* flip temp check operand

* refocusing to prev pr scope

* remove the params too

* make style

* edits, move max length incorporating prompt to whisper

* address comments

* remove asr pipeline prompt decoding, fix indexing

* address comments (more tests, validate prompt)

* un-comment out tests (from debug)

* remove old comment

* address comments

* fix typo

* remove timestamp token from test

* make style

* cleanup

* copy method to fast tokenizer, set max_new_tokens for test

* prompt_ids type just pt

* address Amy's comments

* make style
2023-05-19 09:33:11 +01:00
Boda Sadallah a7920065f2
fix bug in group_texts function, that was inserting short batches (#23429)
* fix bug in group_texts function, that was inserting short batches

* fully exclude short batches and return empty dict instead

* fix style
2023-05-18 14:22:30 -04:00
Sylvain Gugger b7b81d9344
Clean up CUDA kernels (#23455) 2023-05-18 14:14:43 -04:00
Sylvain Gugger 40ed18ae15
Add an option to log result from the Agent (#23454) 2023-05-18 14:06:49 -04:00
Jonas Mueller f69589d1bc
add cleanlab to awesome-transformers tools list (#23440)
* add tool to awesome-transformers list

* add keyword list

* sgugger wording suggestion

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

---------

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2023-05-18 13:14:28 -04:00
Sylvain Gugger 167aa76cfa
Properly guard PyTorch stuff (#23452)
* Properly guard PyTorch stuff

* [all-test]

* [all-test] Fix model imports as well

* Making sure StoppingCriteria is always defined

* [all-test]
2023-05-18 12:17:17 -04:00
Yih-Dar ffad4f1373
Update tiny models and pipeline tests (#23446)
* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-18 17:29:04 +02:00
Yih-Dar 2406dbdcfa
Less flaky `test_assisted_decoding_matches_greedy_search` (#23451)
* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-18 17:28:22 +02:00
Yih-Dar 21f7e81b6b
Make `RwkvModel` accept `attention_mask` but discard it internally (#23442)
* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-18 17:14:25 +02:00
Sylvain Gugger cf43200861
Add local agent (#23438)
* Add local agent

* Document LocalAgent
2023-05-18 11:09:55 -04:00
Joao Gante db13634183
TF: GPT2 with native embedding layers (#23436) 2023-05-18 14:46:40 +01:00
joaoareis c618ab4fab
Fix DecisionTransformerConfig doctring (#23450) 2023-05-18 14:07:10 +01:00
Yih-Dar 5777c3cb3f
Fix (skip) a pipeline test for `RwkvModel` (#23444)
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-18 14:54:23 +02:00
Nayeon Han 8cfae44093
🌐 [i18n-KO] Translated `tasks/zero_shot_object_detection.mdx` to Korean (#23430)
docs: ko: zero_shot_object_detection
2023-05-18 08:52:17 -04:00
Chris Hammill f2d2880bbb
remove unnecessary print in gpt neox sequence classifier (#23433) 2023-05-18 11:34:33 +01:00
Joao Gante aea7b23b57
Generate: skip left-padding tests on old models (#23437) 2023-05-18 11:04:51 +01:00
Yih-Dar a8732e09bb
Fix device issue in `SwiftFormerModelIntegrationTest::test_inference_image_classification_head` (#23435)
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-17 19:48:18 +02:00
Hugo Abonizio 0f2c738207
Remove hardcoded prints in Trainer (#23432) 2023-05-17 13:08:12 -04:00
Joao Gante a574de302f
Encoder-Decoder: add informative exception when the decoder is not compatible (#23426) 2023-05-17 17:42:54 +01:00
Yih-Dar 939a65aba7
Update Bigbird Pegasus tests (#23431)
* fix

* fix

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2023-05-17 18:14:29 +02:00
Joao Gante cf9e7cb079
TF: embeddings out of bounds check factored into function (#23427) 2023-05-17 17:04:51 +01:00
Zachary Mueller 45e3d6496a
Update error message when Accelerate isn't installed (#23373)
Update error
2023-05-17 11:16:02 -04:00
Lysandre Debut ea0eb15649
Small fixes and link in the README (#23428)
Fix + link
2023-05-17 11:07:36 -04:00
Lysandre Debut 5ba0c332b6
Top 100 (#22912)
* Awesome Transformers

* Update

* Update

* Keywords

* Keywords

* Complete document

* Add lm-evaluation-harness

* Edit txtai according to David's comments

* Update awesome-transformers.md
2023-05-17 10:46:55 -04:00