transformers/tests
gautham a1cf9f3390
Fixed datatype related issues in DataCollatorForLanguageModeling (#36457)
Fixed 2 issues regarding `tests/trainer/test_data_collator.py::TFDataCollatorIntegrationTest::test_all_mask_replacement`:
1. I got the error `RuntimeError: "bernoulli_tensor_cpu_p_" not implemented for 'Long'`. This is because the `mask_replacement_prob=1` and `torch.bernoulli` doesn't accept this type (which would be a `torch.long` dtype instead. I fixed this by manually casting the probability arguments in the `__post_init__` function of `DataCollatorForLanguageModeling`.
2. I also got the error `tensorflow.python.framework.errors_impl.InvalidArgumentError: cannot compute Equal as input #1(zero-based) was expected to be a int64 tensor but is a int32 tensor [Op:Equal]` due to the line `tf.reduce_all((batch["input_ids"] == inputs) | (batch["input_ids"] == tokenizer.mask_token_id))` in `test_data_collator.py`. This occurs because the type of the `inputs` variable is `tf.int32`. Solved this by manually casting it to `tf.int64` in the test, as the expected return type of `batch["input_ids"]` is `tf.int64`.
2025-03-07 14:09:27 +00:00
..
agents use torch.testing.assertclose instead to get more details about error in cis (#35659) 2025-01-24 16:55:28 +01:00
bettertransformer Fix typos in tests (#36547) 2025-03-05 15:04:06 -08:00
deepspeed Fix loading zero3 weights (#36455) 2025-03-03 15:05:58 +01:00
extended [tests] skip tests for xpu (#33553) 2024-09-19 19:28:04 +01:00
fixtures Implementation of SuperPoint and AutoModelForKeypointDetection (#28966) 2024-03-19 14:43:02 +00:00
fsdp [tests] make cuda-only tests device-agnostic (#35607) 2025-01-13 14:48:39 +01:00
generation Add aya (#36521) 2025-03-04 12:24:33 +01:00
models [XGLM] tag tests as slow (#36592) 2025-03-06 17:54:41 +00:00
optimization Support constant lr with cooldown (#35453) 2025-02-10 13:21:55 +01:00
peft_integration Fix pipeline+peft interaction (#36480) 2025-03-03 18:01:43 +00:00
pipelines Fix typos in tests (#36547) 2025-03-05 15:04:06 -08:00
quantization Fix Expected output for compressed-tensors tests (#36425) 2025-02-26 21:17:24 +01:00
repo_utils [Modular] skip modular checks based on diff (#36130) 2025-02-13 12:53:21 +00:00
sagemaker Trainer - deprecate tokenizer for processing_class (#32385) 2024-10-02 14:08:46 +01:00
tokenization Fix PretrainedTokenizerFast check => Fix PretrainedTokenizerFast Save (#35835) 2025-02-13 12:00:33 +01:00
tp TP initialization module-by-module (#35996) 2025-02-19 14:04:57 +01:00
trainer Fixed datatype related issues in DataCollatorForLanguageModeling (#36457) 2025-03-07 14:09:27 +00:00
utils [generate] torch.distributed-compatible DynamicCache (#36373) 2025-02-27 11:48:57 +00:00
__init__.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_backbone_common.py Align backbone stage selection with out_indices & out_features (#27606) 2023-12-20 18:33:17 +00:00
test_configuration_common.py Fix typos in tests (#36547) 2025-03-05 15:04:06 -08:00
test_feature_extraction_common.py Split common test from core tests (#24284) 2023-06-15 07:30:24 -04:00
test_image_processing_common.py Fix typos in tests (#36547) 2025-03-05 15:04:06 -08:00
test_image_transforms.py Uses Collection in transformers.image_transforms.normalize (#36301) 2025-02-21 18:38:41 +01:00
test_modeling_common.py Fix typos in tests (#36547) 2025-03-05 15:04:06 -08:00
test_modeling_flax_common.py Fix typos in tests (#36547) 2025-03-05 15:04:06 -08:00
test_modeling_tf_common.py [tests] remove flax-pt equivalence and cross tests (#36283) 2025-02-19 15:13:27 +00:00
test_pipeline_mixin.py Add image text to text pipeline (#34170) 2024-10-31 15:48:11 -04:00
test_processing_common.py Uniformize LlavaNextVideoProcessor kwargs (#35613) 2025-02-18 14:13:51 -05:00
test_sequence_feature_extraction_common.py Fix typo (#25966) 2023-09-05 10:12:25 +02:00
test_tokenization_common.py Fix typos in tests (#36547) 2025-03-05 15:04:06 -08:00
test_training_args.py CI: fix test-save-trainer (#36191) 2025-02-14 10:20:56 +01:00