\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m trainer \u001b[38;5;241m=\u001b[39m Trainer(model\u001b[38;5;241m=\u001b[39mmodel, tokenizer\u001b[38;5;241m=\u001b[39mtokenizer,\n\u001b[1;32m 2\u001b[0m data_collator\u001b[38;5;241m=\u001b[39mdata_collator,\n\u001b[1;32m 3\u001b[0m args\u001b[38;5;241m=\u001b[39mtraining_args,\n\u001b[0;32m----> 4\u001b[0m train_dataset\u001b[38;5;241m=\u001b[39m\u001b[43mtokenized_ds\u001b[49m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtrain\u001b[39m\u001b[38;5;124m\"\u001b[39m],\n\u001b[1;32m 5\u001b[0m eval_dataset\u001b[38;5;241m=\u001b[39mtokenized_ds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtest\u001b[39m\u001b[38;5;124m\"\u001b[39m], \n\u001b[1;32m 6\u001b[0m compute_metrics\u001b[38;5;241m=\u001b[39mcompute_metrics)\n",
"\u001b[0;31mNameError\u001b[0m: name 'tokenized_ds' is not defined"
]
}
],
"source": [
"trainer = Trainer(model=model, tokenizer=tokenizer,\n",
" data_collator=data_collator,\n",
" args=training_args,\n",
" train_dataset=tokenized_ds[\"train\"],\n",
" eval_dataset=tokenized_ds[\"test\"], \n",
" compute_metrics=compute_metrics)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "c4829ba0",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" \n",
" \n",
" [ 3/1563 00:17 < 7:33:36, 0.06 it/s, Epoch 0.00/1]\n",
" \n",
" \n",
" \n",
" \n",
" Epoch | \n",
" Training Loss | \n",
" Validation Loss | \n",
" \n",
" \n",
" \n",
" \n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"KeyboardInterrupt\n",
"\n"
]
}
],
"source": [
"trainer.train()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2f919628",
"metadata": {},
"outputs": [],
"source": [
"trainer.push_to_hub()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6448feed",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|