Get startedGet started for free

8-bit Adam with Trainer

You've set up an 8-bit Adam optimizer, and you're ready to use it for training. Prepare the Trainer for 8-bit Adam!

Some data has been pre-loaded:

  • The adam_bnb_optim optimizer
  • Training objects like model, train_dataset, and training_args

This exercise is part of the course

Efficient AI Model Training with PyTorch

View Course

Exercise instructions

  • Pass the 8-bit Adam optimizer to the Trainer.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Pass 8-bit Adam to the Trainer
trainer = Trainer(model=model, 
                  args=training_args, 
                  train_dataset=train_dataset, 
                  eval_dataset=validation_dataset,
                  compute_metrics=compute_metrics,
                  ____=(____, None))
Edit and Run Code