Repository: huggingface/transformers
Pull request: [Fix] Fix test file error

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Fixed a minor error in the test file. Otherwise, an error will be reported:
```
cls = <enum 'OptimizerNames'>
value = TrainingArguments(
_n_gpu=1,
accelerator_config={'split_batches': False, 'dispatch_batches': None, 'even_batches': Tru...diction_loop=False,
use_liger_kernel=False,
use_mps_device=False,
warmup_ratio=0.0,
warmup_steps=0,
weight_decay=0.0,
)

    @classmethod
    def _missing_(cls, value):
>       raise ValueError(
            f"{value} is not a valid {cls.__name__}, please select one of {list(cls._value2member_map_.keys())}"
        )
E       ValueError: TrainingArguments(
E       _n_gpu=1,
E       accelerator_config={'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None, 'use_configured_state': False},
E       adafactor=False,
E       adam_beta1=0.9,
E       adam_beta2=0.999,
E       adam_epsilon=1e-08,
E       auto_find_batch_size=False,
E       average_tokens_across_devices=False,
E       batch_eval_metrics=False,
E       bf16=False,
E       bf16_full_eval=False,
E       data_seed=None,
E       dataloader_drop_last=False,
E       dataloader_num_workers=0,
E       dataloader_persistent_workers=False,
E       dataloader_pin_memory=True,
E       dataloader_prefetch_factor=None,
E       ddp_backend=None,
E       ddp_broadcast_buffers=None,
E       ddp_bucket_cap_mb=None,
E       ddp_find_unused_parameters=None,
E       ddp_timeout=1800,
E       debug=[],
E       deepspeed=None,
E       disable_tqdm=False,
E       do_eval=False,
E       do_predict=False,
E       do_train=False,
E       eval_accumulation_steps=None,
E       eval_delay=0,
E       eval_do_concat_batches=True,
E       eval_on_start=False,
E       eval_steps=None,
E       eval_strategy=IntervalStrategy.NO,
E       eval_use_gather_object=False,
E       fp16=False,
E       fp16_backend=auto,
E       fp16_full_eval=False,
E       fp16_opt_level=O1,
E       fsdp=[],
E       fsdp_config={'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False},
E       fsdp_min_num_params=0,
E       fsdp_transformer_layer_cls_to_wrap=None,
E       full_determinism=False,
E       gradient_accumulation_steps=1,
E       gradient_checkpointing=False,
E       gradient_checkpointing_kwargs=None,
E       greater_is_better=None,
E       group_by_length=False,
E       half_precision_backend=auto,
E       hub_always_push=False,
E       hub_model_id=None,
E       hub_private_repo=None,
E       hub_revision=None,
E       hub_strategy=HubStrategy.EVERY_SAVE,
E       hub_token=<HUB_TOKEN>,
E       ignore_data_skip=False,
E       include_for_metrics=[],
E       include_inputs_for_metrics=False,
E       include_num_input_tokens_seen=no,
E       include_tokens_per_second=False,
E       jit_mode_eval=False,
E       label_names=None,
E       label_smoothing_factor=0.0,
E       learning_rate=5e-05,
E       length_column_name=length,
E       liger_kernel_config=None,
E       load_best_model_at_end=False,
E       local_rank=0,
E       log_level=passive,
E       log_level_replica=warning,
E       log_on_each_node=True,
E       logging_dir=None/runs/Sep18_12-37-01_173afc988c7f,
E       logging_first_step=False,
E       logging_nan_inf_filter=True,
E       logging_steps=500,
E       logging_strategy=IntervalStrategy.STEPS,
E       lr_scheduler_kwargs={},
E       lr_scheduler_type=SchedulerType.LINEAR,
E       max_grad_norm=1.0,
E       max_steps=-1,
E       metric_for_best_model=None,
E       mp_parameters=,
E       neftune_noise_alpha=None,
E       no_cuda=False,
E       num_train_epochs=3.0,
E       optim=OptimizerNames.ADAMW_TORCH_8BIT,
E       optim_args=None,
E       optim_target_modules=None,
E       output_dir=None,
E       overwrite_output_dir=False,
E       parallelism_config=None,
E       past_index=-1,
E       per_device_eval_batch_size=8,
E       per_device_train_batch_size=8,
E       prediction_loss_only=False,
E       push_to_hub=False,
E       push_to_hub_model_id=None,
E       push_to_hub_organization=None,
E       push_to_hub_token=<PUSH_TO_HUB_TOKEN>,
E       ray_scope=last,
E       remove_unused_columns=True,
E       report_to=['tensorboard'],
E       restore_callback_states_from_checkpoint=False,
E       resume_from_checkpoint=None,
E       run_name=None,
E       save_on_each_node=False,
E       save_only_model=False,
E       save_safetensors=True,
E       save_steps=500,
E       save_strategy=SaveStrategy.STEPS,
E       save_total_limit=None,
E       seed=42,
E       skip_memory_metrics=True,
E       tf32=None,
E       torch_compile=False,
E       torch_compile_backend=None,
E       torch_compile_mode=None,
E       torch_empty_cache_steps=None,
E       torchdynamo=None,
E       tpu_metrics_debug=False,
E       tpu_num_cores=None,
E       use_cpu=False,
E       use_legacy_prediction_loop=False,
E       use_liger_kernel=False,
E       use_mps_device=False,
E       warmup_ratio=0.0,
E       warmup_steps=0,
E       weight_decay=0.0,
E       ) is not a valid OptimizerNames, please select one of ['adamw_torch', 'adamw_torch_fused', 'adamw_torch_xla', 'adamw_torch_npu_fused', 'adamw_apex_fused', 'adafactor', 'adamw_anyprecision', 'adamw_torch_4bit', 'adamw_torch_8bit', 'ademamix', 'sgd', 'adagrad', 'adamw_bnb_8bit', 'adamw_8bit', 'ademamix_8bit', 'lion_8bit', 'lion_32bit', 'paged_adamw_32bit', 'paged_adamw_8bit', 'paged_ademamix_32bit', 'paged_ademamix_8bit', 'paged_lion_32bit', 'paged_lion_8bit', 'rmsprop', 'rmsprop_bnb', 'rmsprop_bnb_8bit', 'rmsprop_bnb_32bit', 'galore_adamw', 'galore_adamw_8bit', 'galore_adafactor', 'galore_adamw_layerwise', 'galore_adamw_8bit_layerwise', 'galore_adafactor_layerwise', 'lomo', 'adalomo', 'grokadamw', 'schedule_free_radam', 'schedule_free_adamw', 'schedule_free_sgd', 'apollo_adamw', 'apollo_adamw_layerwise', 'stable_adamw']

/usr/local/lib/python3.11/dist-packages/transformers/utils/generic.py:478: ValueError
```

## Before submitting
- [×] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [√] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [×] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [√] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [×] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier

Library:

- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber

Documentation: @stevhliu

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Changed files:
filename: tests/trainer/test_trainer.py
patch: @@ -5907,7 +5907,7 @@ def hp_name(trial):
         )
         optim_test_params.append(
             (
-                TrainingArguments(optim=OptimizerNames.ADAMW_TORCH_8BIT, output_dir="None"),
+                OptimizerNames.ADAMW_TORCH_8BIT,
                 AdamW8bit,
                 default_adam_kwargs,
             )