transformers.Trainer
Before instantiating your Trainer, create a TrainingArguments to access all the points of customization during training.
初期化の引数を見ていく
model (PreTrainedModel or torch.nn.Module, optional) — The model to train, evaluate or use for predictions.
Trainer is optimized to work with the PreTrainedModel provided by the library.
args (TrainingArguments, optional) — The arguments to tweak for training.
data_collator (DataCollator, optional) — The function to use to form a batch from a list of elements of train_dataset or eval_dataset.
「train_datasetまたはeval_datasetの要素のリストからバッチを作るのに使う関数」
train_dataset (torch.utils.data.Dataset or torch.utils.data.IterableDataset, optional) — The dataset to use for training.
callbacks (List of TrainerCallback, optional) — A list of callbacks to customize the training loop. Will add those to the list of default callbacks detailed in here.
trainメソッド
resume_from_checkpoint を指定して再開できそう
_inner_training_loop
save_modelメソッド
push_to_hub
Upload self.model and self.tokenizer to the 🤗 model hub on the repo self.args.hub_model_id.
TrainingArgumentsを見てHugging Faceにモデルをpushする
Additional keyword arguments passed along to create_model_card().
model_name
finetuned_from
dataset