Commit Graph

11371 Commits

Author SHA1 Message Date
Ayrton San Joaquin
35bd089a24
add return_tensor parameter for feature extraction (#19257)
* add return_tensors parameter for feature_extraction  w/ test

add return_tensor parameter for feature extraction

Revert "Merge branch 'feature-extraction-return-tensor' of https://github.com/ajsanjoaquin/transformers into feature-extraction-return-tensor"

This reverts commit d559da743b87914e111a84a98ba6dbb70d08ad88, reversing
changes made to bbef89278650c04c090beb65637a8e9572dba222.

* call parameter directly

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

* Fixup.

* Update src/transformers/pipelines/feature_extraction.py

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

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-17 11:17:26 -04:00
Spacefish
59e29be363
object-detection instead of object_detection (#19677) 2022-10-17 10:57:29 -04:00
Christopher Akiki
aa629e7a7c
Update perf_train_gpu_one.mdx (#19676) 2022-10-17 16:54:35 +02:00
Thomas
0027edf905
[Doctest] Add configuration_transfo_xl.py (#19651)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-17 16:47:54 +02:00
Shreem Asati
f4e31a9aa1
word replacement line #231 (#19662)
install->installation
2022-10-17 10:40:35 -04:00
Sander Land
b6204c9e9b
fix warnings in deberta (#19458)
* fix warnings in deberta

* fix copies

* Revert "fix copies"

This reverts commit 324cb3fed1.

* fix copies

* fix copies again

* revert changes to whitespace that make style did since it results in an infinite chain of fix-copies

* argh

Co-authored-by: Sander Land <sander@chatdesk.com>
2022-10-17 10:15:02 -04:00
Mukesh K
de64d671dc
Removed Bert interdependency from Funnel transformer (#19655)
* Removed Bert interdependency from Funnel transformer

* passed consistency check

* Revert "passed consistency check"

This reverts commit ba55a08135.

* Fixed docstrings

Co-authored-by: mukesh663 <mukesh13034@gmail.com>
2022-10-17 10:04:11 -04:00
Ankur Goyal
cbc1abc4af
A few CI fixes for DocumentQuestionAnsweringPipeline (#19584)
* Fixes

* update expected values

* style

* fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-17 15:35:27 +02:00
ANURAG BHANDARI
0b7b07ef03
added type hints for Yolos Pytorch model (#19545)
* added type hints for Yolos Pytorch model

* make fixup

* Update src/transformers/models/yolos/convert_yolos_to_pytorch.py

* Update src/transformers/models/yolos/convert_yolos_to_pytorch.py

* Update src/transformers/models/yolos/convert_yolos_to_pytorch.py

Co-authored-by: Matt <rocketknight1@gmail.com>
Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
2022-10-17 14:34:22 +01:00
Matt
3b3024da70
TF port of ESM (#19587)
* Partial TF port for ESM model

* Add ESM-TF tests

* Add the various imports for TF-ESM

* TF weight conversion almost ready

* Stop ignoring the decoder weights in PT

* Add tests and lots of fixes

* fix-copies

* Fix imports, add model docs

* Add get_vocab() to tokenizer

* Fix vocab links for pretrained files

* Allow multiple inputs with a sep

* Use EOS as SEP token because ESM vocab lacks SEP

* Correctly return special tokens mask from ESM tokenizer

* make fixup

* Stop testing unsupported embedding resizing

* Handle TF bias correctly

* Skip all models with slow tokenizers in the token classification test

* Fixing the batch/unbatcher of pipelines to accomodate the `None` being

passed around.

* Fixing pipeline bug caused by slow tokenizer  being different.

* Update src/transformers/models/esm/modeling_tf_esm.py

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>

* Update src/transformers/models/esm/modeling_tf_esm.py

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>

* Update src/transformers/models/esm/modeling_tf_esm.py

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>

* Update set_input_embeddings and the copyright notices

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
2022-10-17 14:16:16 +01:00
Ryan Chan
d7754c43d0
Type hints MCTCT (#19618)
* add type hints to mctct

* run auto style corrections

* change torch.bool to bool#

* Update src/transformers/models/mctct/modeling_mctct.py

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>

* Remove optional tags for attention_mask and head_mask'

* fix optional tags'

* Update src/transformers/models/mctct/modeling_mctct.py

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
2022-10-17 14:15:21 +01:00
Sivaudha
8aad4363d8
Fix pipeline predict transform methods (#19657)
* Remove key word argument X from pipeline predict and transform methods

As __call__ of pipeline clasees require one positional argument, passing
the input as a keyword argument inside predict, transform methods, causing
__call__ to fail. Hence in this commit the keyword argument is modified
into positional argument.

* Implement basic tests for scikitcompat pipeline interface

* Seperate tests instead of running with parameterized based on framework as both frameworks will not be active at the same time
2022-10-17 09:06:20 -04:00
Ethan Joseph
e4d56e818a
add return types for tf gptj, xlm, and xlnet (#19638) 2022-10-17 13:47:21 +01:00
Spacefish
2af36f957f
Add pillow to layoutlmv3 example requirements.txt (#19663) 2022-10-17 08:41:57 -04:00
Arthur
d2e5b19b82
Add doctest info in testingmdx (#19623) 2022-10-17 11:23:20 +02:00
Thomas
9bb26f2505
[Doctest] Add configuration_trocr.py (#19658)
* trocr Config for doctest

* ran make style
2022-10-17 10:53:36 +02:00
AymenBer99
c06a5a3101
[Doctest] XLNet config for doctest (#19649) 2022-10-17 10:45:37 +02:00
AymenBer99
57505b1def
[Doctest] Conditional DETR config for doctest (#19641) 2022-10-17 10:42:55 +02:00
Partho
339c5a5d9a
[Doctest] Add configuration_data2vec_text.py (#19636)
* Data2Vec Text Config for doctest

* typo fix

* made suggested changes
2022-10-17 10:34:33 +02:00
AymenBer99
dd464e22a7
[Doctest] CodeGen config for doctest (#19633) 2022-10-15 12:35:35 +02:00
Sylvain Gugger
3e4900208a
Tokenizer from_pretrained should not use local files named like tokenizer files (#19626) 2022-10-14 14:06:56 -04:00
Sujay
8fcf562603
[Doctest] Add configuration_time_series_transformer.py (#19582)
* initial changes

* update the suggested order of import
2022-10-14 19:39:56 +02:00
Sujay
31cfe9c429
[Doctest] Add configuration_vision_encoder_decoder.py (#19583)
* adds vision_encoder_decoder to Doc tests

* keep the initial order
2022-10-14 19:30:14 +02:00
Sujay
7972f995b3
[Doctest] Add configuration_vision_text_dual_encoder.py (#19580)
* initial commit

* few suggested changes
2022-10-14 18:45:15 +02:00
Arthur
2bd2de62c9
Sharding fails in TF when absolute scope was modified if . in layer name (#19124)
* simplify loop

* fix layer map split

* update

* update for special variables

* add rag test

* fixup

* revert change : for next PR
2022-10-14 18:34:33 +02:00
Arthur
614f7d28a8
Fix whisper doc (#19608)
* update feature extractor params

* update attention mask handling

* fix doc and pipeline test

* add warning when skipping test

* add whisper translation and transcription test

* fix build doc test

* Correct whisper processor

* make fix copies

* remove sample docstring as it does not fit whisper model

* Update src/transformers/models/whisper/modeling_whisper.py

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

* fix, doctests are passing

* Nit

* last nit

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-14 18:12:32 +02:00
Partho
66dd80213c
[Doctest] Add configuration_resnet.py (#19620)
* ResNet Config for doctest

* added empty lines as suggested

* ran make style
2022-10-14 18:10:17 +02:00
Sanchit Gandhi
4e196df8c4
[Whisper] Fix gradient checkpointing (again!) (#19548)
* [Whisper] Fix gradient checkpointing (again!)

* [Whisper] Fix checkpointing (again!)
2022-10-14 17:08:36 +01:00
Partho
585f9c6d9e
[Doctest] DistilBERT Config for doctest (#19621) 2022-10-14 17:22:29 +02:00
Partho
96f243c399
[Doctest] LeViT Config for doctest (#19622) 2022-10-14 17:21:24 +02:00
Nicolas Patry
463226e2ee
Improve error messaging for ASR pipeline. (#19570)
* Improve error messaging for ASR pipeline.

- Raise error early (in `_sanitize`) so users don't waste time trying to
  run queries with invalid params.

- Fix the error was after using `config.inputs_to_logits_ratio` so our
  check was masked by the failing property does not exist.

- Added some manual check on s2t for the error message.
  No non ctc model seems to be used by the default runner (they are all
  skipped).

* Removing pdb.

* Stop the early error it doesn't really work :(.
2022-10-14 17:12:21 +02:00
0xflotus
5ef2186692
fix: small error (#19612)
* fix: small error

* fix: another typo error
2022-10-14 11:10:33 -04:00
Jing Hua
78c1e7d253
xlm roberta xl config for doctest (#19610)
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-14 11:04:10 -04:00
Jing Hua
10ea45b902
Ernie config for doctest (#19611) 2022-10-14 10:57:51 -04:00
Jing Hua
637af90d7f
xlm roberta config for doctest (#19609) 2022-10-14 10:48:38 -04:00
RamitPahwa
2d4572b5c9
GPTTokenizer dependency removed from deberta class (#19551)
* GPTTOkenizer dependency removed from deberta class

Fixup

made the Deberta Tokenizer fast independent of GPT-2 tokenizer

Copied annotation added

Done the dependency removal

* Added some missing copied statement

* Added some copied statements
2022-10-14 10:46:38 -04:00
Jing Hua
f8244014a5
Visual Bert config for doctest (#19605) 2022-10-14 10:45:37 -04:00
Yih-Dar
db94b746db
Fix FlaubertTokenizer (#19552)
* fix flaubert tokenizer

* update

* update

* Final cleanup

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-14 16:31:01 +02:00
Yih-Dar
62f28bc152
Fix ImageToTextPipelineTests.test_small_model_tf (#19565)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-14 16:29:54 +02:00
Wang, Yi
e82c1cb78e
add gloo backend support for CPU DDP (#19555)
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
2022-10-14 10:18:16 -04:00
Pi Esposito
0e0b7cb72a
Allow usage of TF Text BertTokenizer on TFBertTokenizer to make it servable on TF Serving (#19590)
* add suport for non fast tf bert tokenizer

* add tests for non fast tf bert tokenizer

* fix fast bert tf tokenizer flag

* double tokenizers list on tf tokenizers test to aovid breaking zip on test output equivalence

* reformat code with black to comply with code quality checks

* trigger ci
2022-10-14 15:18:02 +01:00
Yih-Dar
59b7334c87
Fix test_tf_encode_plus_sent_to_model for TAPAS (#19559)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-10-14 16:10:36 +02:00
Nouamane Tazi
1967be98fa
fix BLOOM ONNX config (#19573)
* fix BLOOM ONNX config
- `value` params have `seq_len` as their 2nd axe as opposed to other models which have it as 3rd

Co-authored-by: lewtun <lewis.c.tunstall@gmail.com>
2022-10-14 16:04:48 +02:00
NielsRogge
4f0337a08f
[Time Series Transformer] Add doc tests (#19607)
* Add doc tests

* Make it more consistent

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-10-14 15:57:03 +02:00
Sanchit Gandhi
c937f0b954
[Whisper] Don't return attention mask in feat extractor (#19521)
* [Whisper] Don't return attention mask in feat extractor

* remove attention mask from test

* fix failing tests

* quality
2022-10-14 14:36:03 +01:00
amyeroberts
83a2e694f1
Cast masks to np.unit8 before converting to PIL.Image.Image (#19616)
* Cast masks to np.unit8 before converting to PIL.Image.Image

* Update tests

* Fixup
2022-10-14 09:30:45 -04:00
Xabier Lahuerta Vazquez
909f07092a
[Doctest] Add configuration_bigbird_pegasus.py and configuration_big_bird.py (#19606)
* [Doctest] Add `configuration_bigbird_pegasus.py` and `configuration_big_bird`

[Doctest] Re-style `configuration_big_bird.py`

* [Doctest] One python instruction per line

* [Doctest] Fix styling

* [Doctest] More styling fixes
2022-10-14 15:17:36 +02:00
Thomas
6deac5c824
Adding type hints for TFXLnet (#19344)
* Added type hints for TF: XLNet

* Added type hints for TF: XLNet

* Added type hints for TF: XLNet

* Added type hints for TF: XLNet

* Added type hints for TF: XLNet

* Added type hints for TF: XLNet

* Add type hints for XLnet (TF)
* Added type hints for XLnet (TF)

* Update src/transformers/models/xlnet/modeling_tf_xlnet.py
2022-10-14 12:28:08 +01:00
RamitPahwa
7036c956fe
[Doctest] fix doc test for megatron bert (#19600) 2022-10-14 12:08:55 +02:00
Partho
c7d1fb6964
[Doctest] SEW-D Config for doctest (#19598) 2022-10-14 12:07:32 +02:00