Blip blop
7418a48e34
Removed Bert
interdependency in tokenization_electra.py
( #19356 )
...
* Copied from BertTokenizer() in tokenization_bert
* Added BasicTokenizer and WordPieceTokenizer Class
* Update src/transformers/models/electra/tokenization_electra.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Added copied from comments for basicTokenizer and WordPieceTokenizer
* Updated the comments for the tokenizerClasses
* Update src/transformers/models/electra/tokenization_electra.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/models/electra/tokenization_electra.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Formatted tokenization_electra with `make style`
* Fix repo inconsistencies
* Update src/transformers/models/electra/tokenization_electra.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Set the logger
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-07 12:24:04 -04:00
Infrared1029
6ef16f2b67
Remove Dependency between Bart and LED (slow/fast) ( #19408 )
...
* removed dependency from bart(slow)
* removed dependency from bart(slow)
* adding copying comments (copied from bart to led)
* updated led docstring
* updated led docstring
* removed dependency from Bart (fast)
* replaced bart with LED in docstrings
* complying flake8
* added more copy comments
* fixing copying comments
* added comments back
* fix copy comments
* fixing copied from comments
* fixing copied from comments
2022-10-07 12:19:50 -04:00
Patrick von Platen
06514b3e1a
Clip device map ( #19409 )
...
* add first generation tutorial
* uP
* [Clip] Add text model to device map
2022-10-07 18:19:15 +02:00
harry7337
c2b83d540e
Removed Bert and XML Dependency from Herbert ( #19410 )
...
Co-authored-by: harry7337 <hari.8jan@gmail.com>
2022-10-07 11:49:09 -04:00
Ryan Chan
e6fc2016ad
Remove dependency of Bert from Squeezebert tokenizer ( #19403 )
...
* Remove dependency of Bert from Squeezebert tokenizer
* run style corrections
* update copies from BertTokenizers
* Update changes and style to Squeezebert files
* update copies for bert-fast
2022-10-07 11:32:55 -04:00
Arthur
994b7a4eea
update attention mask handling ( #19385 )
...
* update feature extractor params
* update attention mask handling
2022-10-07 16:54:08 +02:00
Dean Wyatte
a26d71d6ae
Export TensorFlow models to ONNX with dynamic input shapes ( #19255 )
...
* validate onnx models with a different input geometry than saved with
* only test working features for now
* simpler test skipping
* rm TODO
* expose batch_size/seq_length on vit
* skip certain name, feature, framework parameterizations known to fail validation
* Trigger CI
* Trigger CI
2022-10-07 10:53:03 -04:00
David Yang
5fef17f490
Copy BertTokenizer dependency into retribert tokenizer ( #19371 )
2022-10-07 10:14:00 -04:00
ddobokki
fa4bcd5274
edit: cast attention_mask to long in DataCollatorCTCWithPadding ( #19369 )
...
* edit: casting attention_mask to long in DataCollatorCTCWithPadding
* edit: casting attention_mask to long in DataCollatorCTCWithPadding
2022-10-07 10:05:48 -04:00
Amrit Sahu
e9a49babee
[WIP] Add ZeroShotObjectDetectionPipeline ( #18445 ) ( #18930 )
...
* Add ZeroShotObjectDetectionPipeline (#18445 )
* Add AutoModelForZeroShotObjectDetection task
This commit also adds the following
- Add explicit _processor method for ZeroShotObjectDetectionPipeline.
This is necessary as pipelines don't auto infer processors yet and
`OwlVitProcessor` wraps tokenizer and feature_extractor together, to
process multiple images at once
- Add auto tests and other tests for ZeroShotObjectDetectionPipeline
* Add AutoModelForZeroShotObjectDetection task
This commit also adds the following
- Add explicit _processor method for ZeroShotObjectDetectionPipeline.
This is necessary as pipelines don't auto infer processors yet and
`OwlVitProcessor` wraps tokenizer and feature_extractor together, to
process multiple images at once
- Add auto tests and other tests for ZeroShotObjectDetectionPipeline
* Add batching for ZeroShotObjectDetectionPipeline
* Fix doc-string ZeroShotObjectDetectionPipeline
* Fix output format: ZeroShotObjectDetectionPipeline
2022-10-07 10:00:19 -04:00
Omar Sanseviero
331ea019d7
Remove unneded words from audio-related feature extractors ( #19405 )
2022-10-07 15:52:52 +02:00
Sourab Mangrulkar
56af8df359
HF <-> megatron checkpoint reshaping and conversion for GPT ( #19317 )
...
* HF <-> megatron checkpoint conversion handling reshaping from different tensor and parallel sizes
* Apply suggestions from code review
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* addressing comments
* add doc strings and 🐛 fixes
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-07 19:16:55 +05:30
Thomas
41ec5d0ced
Added type hints for TF: TransfoXL ( #19380 )
...
* Added type hints for TF: TransfoXL
* Added type hints for TF: TransfoXL
* Change type hints for training
* Change type hints for training
2022-10-07 14:44:58 +01:00
h
b29ebdf4d8
removes prophet config dependencies from xlm-prophet ( #19400 )
2022-10-07 09:26:23 -04:00
Bibhabasu Mohapatra
e162cebfa3
add ONNX support for swin transformer ( #19390 )
...
* swin transformer onnx support
* Updated image dimensions as dynamic
Co-authored-by: lewtun <lewis.c.tunstall@gmail.com>
Co-authored-by: lewtun <lewis.c.tunstall@gmail.com>
2022-10-07 09:23:24 -04:00
IMvision12
969534af4b
Added Type hints for XLM TF ( #19333 )
...
* Update modeling_tf_xlm.py
* Updates
* Update src/transformers/models/xlm/modeling_tf_xlm.py
* Update src/transformers/models/xlm/modeling_tf_xlm.py
* Update src/transformers/models/xlm/modeling_tf_xlm.py
* Update src/transformers/models/xlm/modeling_tf_xlm.py
* Update src/transformers/models/xlm/modeling_tf_xlm.py
Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
2022-10-07 13:44:50 +01:00
Zachary Mueller
46fd04b481
Fix gather for metrics ( #19389 )
2022-10-07 08:36:05 -04:00
IMvision12
7e348aac96
Making ConvBert Tokenizer
independent from bert Tokenizer
( #19347 )
...
* ConvBert
* added comment
* Updated
* Final_updates
* Update tokenization_convbert.py
* Update tokenization_convbert_fast.py
* Update tokenization_convbert.py
* Update tokenization_convbert.py
* Update tokenization_convbert_fast.py
* Update tokenization_convbert.py
* Update tokenization_convbert_fast.py
* Updates
* Updates
* Updated
* Final Updates
2022-10-07 07:59:02 -04:00
Alara Dirik
ae3e3bc60a
fix docs example, add object_detection to DETR docs ( #19377 )
2022-10-07 00:02:26 +02:00
Ilaygoldman
ce2620194b
Change link of repojacking vulnerable link ( #19393 )
...
The link to https://github.com/vasudevgupta7/bigbird is vulnerable to repojacking (it redirects to the orignial project that changed name), you should change the link to the current name of the project. if you won't change the link, an attacker can open the linked repository and attacks users that trust your links
2022-10-06 23:06:39 +02:00
Alara Dirik
f0b490151e
🚨 🚨 🚨 Fix ViT parameter initialization ( #19341 )
...
This PR aims to rectify the discrepancy between the training performances of HF and Timm ViT implementations.
- Initializes torch and flax ViT dense layer weights with trunc_normal instead of normal (consistent with the TF implementation.
- Initializes cls_token and positional_embeddings with trunc_normal
- Updates DeiT copy to reflect the changes
2022-10-06 12:04:01 +03:00
Sylvain Gugger
7e7f62bfa7
Fix pipeline tests for Roberta-like tokenizers ( #19365 )
...
* Fix pipeline tests for Roberta-like tokenizers
* Fix fix
2022-10-05 17:48:14 -04:00
Alara Dirik
bad353cebf
Fix DETR segmentation postprocessing output ( #19363 )
...
Ensures post_process_instance_segmentation and post_process_panoptic_segmentation methods return a tensor of shape (target_height, target_width) filled with -1 values if no segment with score > threshold is found.
2022-10-06 00:16:36 +03:00
Arthur
45e14038f2
Add WhisperModel to transformers ( #19166 )
...
* simplify loop
* add featur extractor
* add model
* start conversion
* add dropout
* initial commit of test files
* copnversion for all models
* update processor for correct padding
* update feature extraction
* update integration test logits match
* fmnt: off for the logits
* on the fly mel bank
* small nit
* update test
* update tokenizer
* nit feature extraction
* update
* update tokenizer test
* adds logit processor and update tokenizer to get supress tokens
* style
* clean convert
* revert to original modeling tf utils
* Update
* update
* nit
* clean convert file
* update tests and nits
* quality
* slow generation test
* ffn_dim to allow customization
* update readme
* add to toctreee
* start fixing integration tests
* update tests and code
* fix feature extractor
* fix config tests common
* update code to fix tests
* fix feature exctractor
* nit feature extraction
* update test for new feature extractor
* style
* add absrtact
* large logits wioth custom decoder input ids
* wraap around is otrch available
* fix feature extractor
* correct logits for whisper small.en
* nit
* fix encoder_attentino_mask
* some fixes
* remove unnecessary inputs
* nits
* add normalizer file
* update etst tokenization
* fix attention mask not defined
* Add model to README
* Fix doc tests
* fix generate
* remove uncoder attention mask useless
* update test modeling whisper
* update condfig to add second non supress tokens
* nits on feature exrtactor
* nit for test tokenizers
* update etsts
* update tests
* update tokenization test
* fixup
* invalidated hf token. Clean convert openai to whisper
* fix logit tests
* fixup
* clean merge
* revert toc_tree changes
* remove useless LogitProcessor
* Update whisper .mdx
* update config file doc
* update configuration docstring
* update test tokenization
* update test tokenization
* update tokenization whisper
Added copied from where needed
* update feature extraction
* nit test name
* style
* quality
* remove get suppress tokens and update non_speech tokens global variables
* Update src/transformers/models/whisper/feature_extraction_whisper.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* clean modeling whisper and test
Removed the attention mask arguments that are deprecated
* fix large test
* Add multilingual audio test, and translate test
* style
* fix larg multilingual test
* nits
* Update docs/source/en/model_doc/whisper.mdx
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* add copied from for attention layer
* remove attention masks in doc
* add english normalizer
* update tokenization test
* remove copied from in whisper attention : no bias in k_proj only
* wrap around dependencies in english normalizer
* style
* correct import generation logits
* for now, wrap feature extractor with torch
* Update src/transformers/models/whisper/convert_openai_whisper_to_tfms.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update docs/source/en/model_doc/whisper.mdx
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* remove torch depencies for feature extraction and style
* fixup
* nit
* update logitds
* style
* nit
* nits and fix final tests
* add `is_more_itertools_available` to utils
* quality
* add begin supress tokens, supress tokens to generate args and config
* clean supressTokensLogitProcessor in generation logits
* Nit naming
* add supressTokensAtBegin
* udpate tests, supress tokens to None or correct values
* nit and style
* update RAG to fit test and generate_logit
* add copy pasted statment on english normalizer
* add arguments to config_common_kwargs
* Update src/transformers/generation_utils.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/generation_logits_process.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* revert changes based on reviews
* update doc and nits
* more nits
* last nits
* update test configuration common
* add BART name in decoder attention mask documentation
* Update src/transformers/models/whisper/modeling_whisper.py
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
* style
* nit
* nit
* add english.json file to git
* nits on documentation
* nit
* nits
* last styling
* add main toctree file
* remove sentence piece dependency
* clean init file
* fix tokenizer that has no dependencies on sentencepiece
* update whisper init file, nit
* remove english.json file
* add get decoder prompt id
* revert changes and add forced logit processor
* nit
* clean normalizer
* remove protected
* update
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* update based on review
* Update src/transformers/models/whisper/configuration_whisper.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* add batched tests
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: NielsRogge <niels.rogge1@gmail.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-05 22:28:31 +02:00
Alara Dirik
7598791c09
Fix MaskFormer failing postprocess tests ( #19354 )
...
Ensures post_process_instance_segmentation and post_process_panoptic_segmentation methods return a tensor of shape (target_height, target_width) filled with -1 values if no segment with score > threshold is found.
2022-10-05 23:25:58 +03:00
Zachary Mueller
ad98642a82
Fix gather for metrics ( #19360 )
2022-10-05 14:52:01 -04:00
Harsha
d9101b71bc
Removes Roberta and Bert config dependencies from Longformer ( #19343 )
...
* removes roberta and bert config dependencies from longformer
* adds copied from statements
* fixes style
* removes excessive comments and replace bert with longformer in a couple places
* fixes style
2022-10-05 13:50:15 -04:00
Paula Isabel
226b8ef063
correct typos in README ( #19304 )
2022-10-05 10:40:38 -07:00
Matt
071df6eb13
Call _set_save_spec() when creating TF models ( #19321 )
...
* Add a build_from_serving_sig_and_dummies method and replace all calls like model(model.dummy_inputs) with it.
* make fixup
* Remove the overridden save() as this is no longer necessary
* Also call _set_save_spec(), the last missing piece
* Ensure we set the save spec when loading from config too
* Turn this whole thing into a one-line PR
* Turn this whole thing into a one-line PR
* Turn this whole thing into a one-line PR
Co-authored-by: Your Name <you@example.com>
2022-10-05 18:03:49 +01:00
Sylvain Gugger
c875a96eb1
Test failing test while we resolve the issue. ( #19355 )
2022-10-05 12:23:48 -04:00
Younes Belkada
4cbc797b27
Change BloomConfig
docstring ( #19336 )
...
* change `BloomConfig` docstring
- slightly change the docstring of the `BloomConfig`
- Use correct default vocab size
- Use correct default `hidden_dim`, `n_head`
* Update src/transformers/models/bloom/configuration_bloom.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/models/bloom/configuration_bloom.py
Co-authored-by: SaulLu <55560583+SaulLu@users.noreply.github.com>
* make style
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: SaulLu <55560583+SaulLu@users.noreply.github.com>
2022-10-05 18:12:13 +02:00
Harsha
e794ca5b16
Frees LongformerTokenizer of the Roberta dependency ( #19346 )
...
* copies over roberta tokenizer to longformertokenizer since they are both identical
* adds Copied from patterns to pass copy check
2022-10-05 11:49:14 -04:00
r-terada
2f53ab5745
Add sudachi and jumanpp tokenizers for bert_japanese ( #19043 )
...
* add sudachipy and jumanpp tokenizers for bert_japanese
* use ImportError instead of ModuleNotFoundError in SudachiTokenizer and JumanppTokenizer
* put test cases of test_tokenization_bert_japanese in one line
* add require_sudachi and require_jumanpp decorator for testing
* add sudachi and pyknp(jumanpp) to dependencies
* remove sudachi_dict_small and sudachi_dict_full from dependencies
* empty commit for ci
2022-10-05 11:41:37 -04:00
mustapha ajeghrir
60db81ff60
Making camembert independent from roberta, clean ( #19337 )
...
Co-authored-by: Mustapha AJEGHRIR <mustapha.ajeghrir@kleegroup.com>
2022-10-05 09:31:33 -04:00
Druhin Abrol
c54bb1ad79
[WIP]remove XLMTokenizer inheritance from FlaubertTokenizer ( #19330 )
...
* remove XLMTokenizer inheritance from FlaubertTokenizer
* remove XLMTokenizer inheritance from FlaubertTokenizer
* remove XLMTokenizer inheritance from FlaubertTokenizer
* remove XLMTokenizer inheritance from FlaubertTokenizer: fixed styling
* removed repo-consistensy issue
2022-10-05 09:19:04 -04:00
Shyam Sudhakaran
e12bbe3b4d
Remove bert interdependency from clip tokenizer ( #19332 )
2022-10-05 09:15:14 -04:00
Divyanshu Kumar
512fa41c53
Removed interdependency of BERT's Tokenizer in tokenization of prophetnet ( #19331 )
...
* removed interdependency of BERTTokenizer in tokenization of prophetnet
* fix: style
2022-10-05 09:12:47 -04:00
Alara Dirik
07e94bf159
Maskformer post-processing fixes and improvements ( #19172 )
...
- Improves MaskFormer docs, corrects minor typos
- Restructures MaskFormerFeatureExtractor.post_process_panoptic_segmentation for better readability, adds target_sizes argument for optional resizing
- Adds post_process_semantic_segmentation and post_process_instance_segmentation methods.
- Adds a deprecation warning to post_process_segmentation method in favour of post_process_instance_segmentation
2022-10-05 15:27:15 +03:00
Druhin Abrol
6268694e27
removing XLMConfig inheritance from FlaubertConfig ( #19326 )
...
* removing XLMConfig inheritance from FlaubertConfig
* removing XLMConfig inheritance from FlaubertConfig
* Fixed styling issue
* Update configuration_flaubert.py
Co-authored-by: Druhin Abrol <druhinabrol@192.168.1.6>
2022-10-04 19:39:47 -04:00
Erin
bf7eb0c9b3
Remove interdependency from OpenAI tokenizer ( #19327 )
...
* Remove interdependency from OpenAI tokenizer
* Adjust import order for linter
2022-10-04 17:51:55 -04:00
Samuel Arcadinho
971da2e6ec
Clamping hidden state values to allow FP16 ( #19229 )
...
* Clamping hidden state values to allow FP16
* Reformating
* Adding missing if condition
* Update src/transformers/models/longt5/modeling_longt5.py
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
* Update src/transformers/models/longt5/modeling_longt5.py
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
* Update src/transformers/models/longt5/modeling_longt5.py
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
* Formating file
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
2022-10-04 20:28:28 +02:00
Younes Belkada
587d84b178
Add BloomForQuestionAnswering
( #19310 )
...
* add bloom for question answering
- attempt to add Bloom for question answering
- adapted from `GPTJForQuestionAnswering`
- Fixed `num_labels` to `2` for common tests
- Added a bit of docstring
- All common tests pass
* Update src/transformers/models/bloom/modeling_bloom.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* revert changes related to `num_labels`
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-10-04 17:52:13 +02:00
Sushrut1101
6dce9e0cdd
docker-build: Update actions/checkout to v3 ( #19288 )
2022-10-04 16:26:52 +02:00
Arnaud Stiegler
6fd254a37d
Removing BertConfig inheritance from LayoutLMConfig ( #19307 )
...
* removing BertConfig inheritance
* fix missing arguments
2022-10-04 10:24:07 -04:00
Partho
a9782881a4
wrap forward passes with torch.no_grad() ( #19273 )
2022-10-04 16:13:22 +02:00
Partho
d6e920449e
wrap forward passes with torch.no_grad() ( #19274 )
2022-10-04 16:12:03 +02:00
Partho
2403dbd607
wrap forward passes with torch.no_grad() ( #19278 )
2022-10-04 16:09:23 +02:00
Partho
f134d38553
wrap forward passes with torch.no_grad() ( #19279 )
2022-10-04 16:08:29 +02:00
Oscar Dominguez
cd024da6f8
ci(workflows): update actions/checkout to v3 ( #19280 )
...
in stale.yml
2022-10-04 16:07:53 +02:00
Oscar Dominguez
ca3ebc44e0
ci(stale.yml): upgrade actions/setup-python to v4 ( #19281 )
2022-10-04 16:07:33 +02:00