Matt
4c35c8d89c
Experimenting with adding proper get_config() and from_config() methods ( #14361 )
...
* Experimenting with adding proper get_config() and from_config() methods
* Adding a test for get/from config
* Fix test for get/from config
2021-11-11 14:21:50 +00:00
Suraj Patil
b1dbdf22ef
pass params to encode ( #14370 )
2021-11-11 17:16:24 +05:30
Suraj Patil
e92190c0f8
Fix Flax params dtype ( #13098 )
...
* fix inits
* fix embed dtype
* fix embed dtype
* add test to check default dtype
* quality
* add type conversion methods for flax models
* more robust casting
* cast sinusoidal positions
* update pegasus
* update albert
* update test
* make sure dtype is passed to every module
* style
* fix electra dense
* fix t5
* quality
* add more tests
* better name
* use the dtype for lm head computation
* fix albert
* style
* fix albert embed dtype
* more tests
* fix vision enc-dec
* cleanup
* fix embed dtype pegasus
* fix default param test
* doc
* update template
* fix final_logits_bias dtype
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* fix doc
* fix doc
* add detailed docstring for dtype parameter
* remove un-necessary import
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2021-11-11 14:45:20 +05:30
Stas Bekman
1c76a51615
solve the port conflict ( #14362 )
2021-11-10 19:11:45 -08:00
Li-Huai (Allan) Lin
9e37c5cdf8
Fix list index out of range when padding nested empty lists ( #13876 )
...
* Fix index out of range when padding
* Apply suggestions from code review
* Style
2021-11-10 21:34:52 +01:00
Chang Wang
bec02ff209
enhance rewrite state_dict missing _metadata ( #14348 )
2021-11-10 07:25:41 -05:00
Ella Charlaix
2b0d9389f8
Add notebook INC quantization for text classification tasks ( #14293 )
...
* Add notebook applying Intel Neural Compressor quantization for text classification tasks
* Add Optimum notebooks section
2021-11-10 12:49:43 +01:00
Li-Huai (Allan) Lin
ea163d0948
Fix fast tokenization problems ( #13930 )
...
* Fix albert mask token tokenization.
* Ensure special tokans sanitized.
* Style
* Fix
* Apply suggestions from code review
2021-11-10 11:16:45 +01:00
Nicolas Patry
5c153079e2
Adding some quality of life for pipeline
function. ( #14322 )
...
* Adding some quality of life for `pipeline` function.
* Update docs/source/main_classes/pipelines.rst
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Update src/transformers/pipelines/__init__.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Improve the tests.
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-11-10 10:18:35 +01:00
Elad Segal
321eb56222
BatchFeature
: Convert List[np.ndarray]
to np.ndarray
before converting to pytorch tensors (#14306 )
...
* update
* style fix
* retrigger checks
* check first element
* fix syntax error
* Update src/transformers/feature_extraction_utils.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* remove import
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-11-09 22:23:08 -05:00
Sylvain Gugger
46d0cdae40
Support for TF >= 2.7 ( #14345 )
2021-11-09 18:49:29 -05:00
Patrick von Platen
e81d8d7fa9
[Bert2Bert] allow bert2bert + relative embeddings ( #14324 )
...
* [Bert2Bert] allow bert2bert + relative embeddings
* up
* Update README_ko.md
* up
* up
2021-11-09 14:26:58 -05:00
Steven Liu
e4d8f517b9
Rewrite guides for fine-tuning with Datasets ( #13923 )
...
* rewrite guides for fine-tuning with datasets
* simple qa code example
* use anonymous rST links
* style
2021-11-09 14:12:50 -05:00
Suraj Patil
85a4bda4f4
bump flax version ( #14343 )
2021-11-09 22:15:22 +05:30
Yih-Dar
babd0b9a5e
remove test_model_various_embeddings ( #14341 )
...
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2021-11-09 11:30:17 -05:00
karthikrangasai
4f24058c58
Update Seq2Seq QA example script to use SQuAD metric. ( #14335 )
...
* Update postporcessing accordingly to use SQuAD metric.
* Update assets accordingly based on SQuAD metrics.
* Fix function naming error.
2021-11-09 08:04:23 -05:00
Yih-Dar
be4a6c64dc
Add TFViTModel ( #13778 )
...
* Start the work for TFViTModel
* Convert to TF code - need to check in the follow up commits
* Clean up model code
* Expose TFViTModel
* make style
* make quality
* Add test
* make style & quality
* Fix some imports
* fix wrong usage - *kwargs => ** kwargs
* Fix Conv2D weight loading (PT->TF) issue
* Add tests for images with different sizes + fix model
* Fix some common tests for TFViTModel
* Use inputs instead of input_ids in test_compile_tf_model
* Add a comment about transpose and Conv2D in convert_tf_weight_name_to_pt_weight_name
* Avoid transpose in TFViT call
* Fix Conv2D issue in load_tf2_weights_in_pytorch_model
* Use tf.keras.layers.Conv2D instead of tf.nn.conv2d
* Using simpler heuristic to detect Conv2D layer
* Change convert_tf_weight_name_to_pt_weight_name to return TransposeType
* Check tf_weight_shape is not None before using it
* Apply suggestions from code review
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* fix missing comma
* fix input dtype
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-11-09 07:54:37 -05:00
Apoorv Garg
6326aa4bf0
Correct order of overflowing tokens for LayoutLmV2 tokenizer ( #13495 )
...
* correct order of overflowing tokens for LayoutLmV2 tokenizer
* test to check order of overflowing_tokens for a seq of input_ids
* fix up quality
* added suggested changes
* check that tests the bbox sequence
* pair_input test added
* pass quality test
* check bbox sequence added
* unittest method
* comments added
* add overflowing bbox test
* improved "seq_1"
Co-authored-by: SaulLu <55560583+SaulLu@users.noreply.github.com>
* improve code quality
Co-authored-by: SaulLu <lucilesaul.com@gmail.com>
Co-authored-by: SaulLu <55560583+SaulLu@users.noreply.github.com>
2021-11-09 07:49:53 -05:00
Yih-Dar
95b3ec3bc9
Add FlaxVisionEncoderDecoderModel ( #13359 )
...
* Start the work on FlaxVisionEncoderDecoderModel
* Add FlaxVisionEncoderDecoderModel
* Add VisionEncoderDecoderConfig
* Make FlaxVisionEncoderDecoderModel visible to transformers
* Add test
* Fix wrong getattr usage
* Fix tests
* Add FlaxAutoModelForVision2Seq
* Expose FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING
* clean-up
* add integration test
* update expected logits
* update expected scores
* Add ViT2GPT2ModelIntegrationTest + some cleaning
* Add projection layer + PT/Flax equivalence tests
* Fix import
* minor changes
* make test slow again
* Apply suggestions
* Add modeling_flax_vision_encoder_decoder to _ignore_modules in get_model_modules()
* fix copies
* Apply suggestions from code review
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* split long strings in multiple lines
* decoder_input_ids can't be None
* Add back test_configuration_tie
* Remove attention_mask parameter
* fix test - encoder_last_hidden_state should be encoder_outputs.last_hidden_state instead of the projected vector
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* Remove more encoder_attention_mask
* remove encoder_attention_mask when calling self.decode (in FlaxVisionEncoderDecoderModule)
* Fix style + pass 1s instead of None as encoder_attention_mask
* fix init_weights
* pass None for encoder_attention_mask
* pass 1s instead of None as encoder_attention_mask
* Fix doc style
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Suraj Patil <surajp815@gmail.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2021-11-09 15:14:28 +05:30
Reza Yazdani
a503012275
Small change to Wav2Vec2 model to support Tensor-Parallelism with DeepSpeed ( #14298 )
...
* minor modification to the wav2vec2 modeling file to support tensor-parallelism with DeepSpeed on this HuggingFace model
* refine the comments
* synch changes
* fix comments
* refine comments
* fix format
2021-11-08 21:00:05 -05:00
Jeff Rasley
d0e96c6de6
[deepspeed] Enable multiple test runs on single box, defer to DS_TEST_PORT if set ( #14331 )
...
* defer to DS_TEST_PORT if set
* style
Co-authored-by: Stas Bekman <stas@stason.org>
2021-11-08 12:40:29 -08:00
Sylvain Gugger
dfb00bf644
Expand dynamic supported objects to configs and tokenizers ( #14296 )
...
* Dynamic configs
* Add config test
* Better tests
* Add tokenizer and test
* Add to from_config
* With save
2021-11-08 15:28:25 -05:00
nbertagnolli
de635af3f1
Changed relative imports to absolute to allow convert_graph_to_onnx.py to run as a script. ( #14325 )
...
* Changed relative imports to absolute to allow convert_graph_to_onnx.py to be run as a script
* isorted code
2021-11-08 10:56:44 -05:00
Nicolas Patry
a3ded170e2
Fixing mutable default argument in pipeline
. ( #14316 )
...
* Fixing mutable default argument.
* XX.
* Revert "XX."
This reverts commit 61d4bb333f
.
2021-11-08 16:22:28 +01:00
Nicolas Patry
9b78b070ef
Fixing tests on master. ( #14317 )
...
* Fixing tests on master.
* Better fix.
* Lxmert doesn't have feature extractor but is bimodal.
2021-11-08 08:28:26 -05:00
Anton Lozhkov
df1f94eb4a
[TFWav2Vec2Model] Fix input shapes in TFWav2Vec2WeightNormConv1D ( #14319 )
...
* Add paddings to input shapes
* Add padding comment
2021-11-08 15:58:28 +03:00
Anton Lozhkov
e30078b544
[Tests] Update audio classification tests to support torch 1.10 ( #14318 )
2021-11-08 14:15:56 +03:00
Patrick von Platen
b48faae364
[Marian Conversion] Fix eos_token_id conversion in conversion script ( #14320 )
2021-11-08 11:42:34 +01:00
Junbum Lee
c016dbdbda
Fix execution PATH for PPLM Example ( #14287 )
2021-11-06 10:33:47 -04:00
NielsRogge
34307bb358
Fix tests ( #14289 )
2021-11-06 10:08:58 -04:00
Nicolas Patry
24b30d4d2f
Handle long answer needs to be updated. ( #14279 )
...
`start_` and `end_` tensors now contain a batch_size at this point.
2021-11-06 10:04:30 -04:00
Xing Han Lu
843c326ee1
Update dpr.rst ( #14300 )
2021-11-06 09:41:02 -04:00
Sylvain Gugger
08a5f57567
Add new LFS prune API ( #14294 )
2021-11-05 18:58:51 -04:00
Patrick von Platen
4be78c22c9
[Hubert Docs] Make sure example uses a fine-tuned model ( #14291 )
2021-11-05 14:09:57 +01:00
Sylvain Gugger
a14d62b0b1
Pin TF until tests are fixed ( #14283 )
...
* Pin TF until tests are fixed
* Also pin TF CPU
2021-11-04 21:15:42 -04:00
Matt
b90a48f654
Removing Keras version pinning ( #14280 )
...
* Removing Keras version pinning
* make fixup
2021-11-04 17:58:28 +00:00
Chang Wang
fd8136fa75
improve rewrite state_dict missing _metadata ( #14276 )
2021-11-04 10:13:23 -04:00
Nicolas Patry
d29baf69bb
Fixing mishandling of ignore_labels
. ( #14274 )
...
Fixes #14272
2021-11-04 09:47:52 -04:00
Nicolas Patry
68427c9beb
Fixing slow pipeline tests ( #14260 )
...
* Fiixng slow pipeline tests
* Remove the image-segmentaiton override.
* Fixing clamping only in training.
* Wav2vec2.
* Remove last mention of `no_grad`.
* Fixing copies.
* Rename.
2021-11-04 09:49:55 +01:00
Sylvain Gugger
1a674ce679
Add more instructions to the release guide ( #14263 )
...
* Add more instructions to the release guide
* Apply suggestions from code review
Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
* Address review comment
Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
2021-11-03 17:45:41 -04:00
Sylvain Gugger
f0d6e952c0
Quality explain ( #14264 )
...
* Start PR doc
* Cleanup the quality checks and document them
* Add reference in the contributing guide
* Apply suggestions from code review
Co-authored-by: Stas Bekman <stas00@users.noreply.github.com>
* Rename file as per review suggestion
Co-authored-by: Stas Bekman <stas00@users.noreply.github.com>
2021-11-03 17:43:19 -04:00
Sylvain Gugger
a1c15ea855
Pin Keras cause they messed their release ( #14262 )
...
* Pin Keras cause they messed their release
* Put != instead of <
* Try this way
* Back to the beginning but more agressive
2021-11-03 15:03:09 -04:00
Nicolas Patry
1149243184
Fixing typo in error message. ( #14226 )
2021-11-03 19:28:57 +01:00
Dan Shirron
2c8957feea
Fix of issue #13327 : Wrong weight initialization for TF t5 model ( #14241 )
...
* Fix of issue #13327 : Wrong weight initialization for TF t5 model
* run black formatter
* fix typo
* remove my name tag from comments
Co-authored-by: Shirron <dan.shirron@intel.com>
2021-11-03 16:20:48 +00:00
Nicolas Patry
dec759e7e8
Adding support for truncation
parameter on feature-extraction
pipeline. ( #14193 )
...
* Adding support for `truncation` parameter on `feature-extraction`
pipeline.
Fixes #14183
* Fixing tests on ibert, longformer, and roberta.
* Rebase fix.
2021-11-03 15:48:00 +01:00
Dean Wyatte
27b1516d32
minimal fixes to run DataCollatorForWholeWordMask with return_tensors="np" and return_tensors="tf" ( #13891 )
...
* minimal fixes to run DataCollatorForWholeWordMask with return_tensors="np" and return_tensors="tf"
* more consinstent implementation for numpy_mask_tokens
2021-11-03 10:36:41 -04:00
Mishig Davaadorj
671569ddf7
Put load_image
function in image_utils.py
& fix image rotation issue ( #14062 )
...
* Fix img load rotation
* Add `load_image` to `image_utils.py`
* Implement LoadImageTester
* Use hf-internal-testing dataset
* Add img utils comments
* Refactor LoadImageTester
* Import load_image under is_vision_available
2021-11-03 14:53:05 +01:00
Patrick von Platen
89766b3d44
up ( #14258 )
2021-11-03 11:31:40 +01:00
Yih-Dar
bd21ed4099
Add cross attentions to TFGPT2Model ( #14038 )
...
* Add cross attentions to TFGPT2Model
* change to is_pt_tf_cross_test
* A minor correction to a comment
* Remove n_ctx when creating self.crossattention
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2021-11-03 09:54:34 +01:00
NielsRogge
5f789a687a
Add LayoutXLMProcessor (and LayoutXLMTokenizer, LayoutXLMTokenizerFast) ( #14115 )
...
* Add LayoutXLMTokenizer and LayoutXLMTokenizerFast
* Fix styling issues
* Fix more styling issues
* Fix more styling issues
* Fix docstring
* Fix unit tests
* Fix docs
* Fix unit tests
* Fix typos and styling issues
* Fix styling issues
* Fix docstring
* Make all tests of test_tokenization_layoutxlm pass
* Add LayoutXLMProcessor
* Make fixup
* Make all LayoutXLMProcessor tests pass
* Minor fixes
* Leave LayoutLMv2Processor tests unchanged
* Fix code quality
* Move LayoutXLM tokenizers and processor to separate folder
* Fix code quality
* Apply suggestions from code review
* Replace assertions by value errors
* Remove methods from fast tokenizer
Co-authored-by: King Yiu Suen <kingyiusuen@gmail.com>
2021-11-03 08:59:44 +01:00