Accelerator.__init__() got an unexpected keyword argument 'use_seedable_sampler'
I am trying to define the training by the following code snippet:model = T5ForConditionalGeneration.from_pretrained('t5-small')

# ! pip install -U 'accelerate==0.21.0'
# ! pip install transformers[pytorch]

training_args = TrainingArguments(
    output_dir='/content/drive/MyDrive/Results',          # output directory
    num_train_epochs=3,              # number of training epochs
    per_device_train_batch_size=4,   # batch size for training
    per_device_eval_batch_size=4,    # batch size for evaluation
    warmup_steps=500,                # number of warmup steps for learning rate scheduler
    weight_decay=0.01,               # strength of weight decay
    logging_dir='./logs',            # directory for storing logs
    logging_steps=10,
    evaluation_strategy="epoch",     # evaluate at the end of each epoch
)

trainer = Trainer(
    model=model,                         
    args=training_args,                  # training arguments, defined above
    train_dataset=train_dataset,         # training dataset
    eval_dataset=val_dataset,            # evaluation dataset
)But I am getting this error:---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-10-98d5893e43cf> in <cell line: 13>()
     11 )
     12 
---> 13 trainer = Trainer(
     14     model=model,                         # the instantiated Transformers model to be trained
     15     args=training_args,                  # training arguments, defined above

1 frames
/usr/local/lib/python3.10/dist-packages/transformers/trainer.py in create_accelerator_and_postprocess(self)
   4533 
   4534         # create accelerator object
-> 4535         self.accelerator = Accelerator(**args)
   4536         # some Trainer classes need to use `gather` instead of `gather_for_metrics`, thus we store a flag
   4537         self.gather_function = self.accelerator.gather_for_metrics

TypeError: Accelerator.__init__() got an unexpected keyword argument 'use_seedable_sampler'
2024-06-19T20:00:52Z
This works for me, it seems to be coming from accelerate:github.com/huggingface/transformersBug in latest version of `trainer.py` leads to training not starting for making Reward Modelopened03:28PM - 22 Feb 24 UTCclosed09:33AM - 23 Feb 24 UTCarmsp### System Info

- `transformers` version: 4.39.0.dev0
- Platform: Linux-3.10….0-1160.108.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.9
- Huggingface_hub version: 0.20.3
- Safetensors version: 0.4.2
- Accelerate version: 0.25.0.dev0
- Accelerate config:    not found
- PyTorch version (GPU?): 2.0.1+cu118 (False)
- Tensorflow version (GPU?): 2.14.0 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: Yes

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

Just instantiate the RewardTrainer object - 
```
trainer = RewardTrainer(
    model = model,
    args = training_args,
    tokenizer= tokenizer,
    train_dataset= train_data,
    eval_dataset= val_data,
    peft_config= peft_config
)
```
And I get the error -
```
/python3.9/site-packages/trl/trainer/reward_trainer.py:189: UserWarning: When using RewardDataCollatorWithPadding, you should set `remove_unused_columns=False` in your RewardConfig we have set it for you, but you should do it yourself in the future.
  warnings.warn(
Traceback (most recent call last):
  File "/cluster/TRAINREWARDMODEL.py", line 189, in <module>
    trainer = RewardTrainer(
  File "/python3.9/site-packages/trl/trainer/reward_trainer.py", line 198, in __init__
    super().__init__(
  File "/python3.9/site-packages/transformers/trainer.py", line 367, in __init__
    self.create_accelerator_and_postprocess()
  File "/python3.9/site-packages/transformers/trainer.py", line 4127, in create_accelerator_and_postprocess
    self.accelerator = Accelerator(
TypeError: __init__() got an unexpected keyword argument 'use_seedable_sampler'
```
Unfortunately I opened this issue in trl but its not a issue from there and I cannot close it https://github.com/huggingface/trl/issues/1354 it is clearly an issue in the transformers library.

**Note**: my code was working just fine until I updated the libraries. I am NOT using Accelerate...not even importing it.

### Expected behavior

The `RewardTrainer` should initialize and just work.
2024-06-26T17:07:25Z
I tried with another code. Also faced the almost same issue. Then I downgrade some dependecy and worked well.