transformers
transformers copied to clipboard
adalomo is not a valid OptimizerNames
System Info
torch==2.3.0+cu121 transformers==4.41.2 trl==0.9.4
Who can help?
@ArthurZucker @muellerzr @SunMarc
Information
- [X] The official example scripts
- [ ] My own modified scripts
Tasks
- [X] An officially supported task in the
examples
folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below)
Reproduction
import torch import datasets from transformers import TrainingArguments, AutoTokenizer, AutoModelForCausalLM import trl
train_dataset = datasets.load_dataset('imdb', split='train')
args = TrainingArguments( output_dir="./test-lomo", max_steps=1000, per_device_train_batch_size=2, optim="adalomo", gradient_checkpointing=False, logging_strategy="steps", logging_steps=1, learning_rate=5e-4, save_strategy="no", run_name="lomo-imdb", )
model_id = "mistralai/Mistral-7B-v0.1"
tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id, low_cpu_mem_usage=True).to(0)
trainer = trl.SFTTrainer( model=model, args=args, train_dataset=train_dataset, dataset_text_field='text', max_seq_length=512, )
trainer.train()
and after run this code ,i meet this error .the error belows :
Traceback (most recent call last):
File "/root/full_parameter_ft_use_lomo.py", line 9, in
Expected behavior
i think this code would be run normaly ,thank you .