{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "gpuType": "T4" }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" }, "accelerator": "GPU", "widgets": { "application/vnd.jupyter.widget-state+json": { "8c1c7e4a6b8f47149ddca02e551f48a4": { "model_module": "@jupyter-widgets/controls", "model_name": "VBoxModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "VBoxView", "box_style": "", "children": [ "IPY_MODEL_c2463a94b1fb44fa8196e7b61636c3b7", "IPY_MODEL_3040b325f55949fdbdc4caf75e9cd618", "IPY_MODEL_d9de6537b056464baa3dde45e81bbd72", "IPY_MODEL_dc8c33db5e814578a4aa9355132e132a" ], "layout": "IPY_MODEL_022ab2bdb55944858b48891baa414d3c" } }, "cdbbba5c25e64371a6678a34e1120dc5": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_5b364ad09e3d4158a728284f583616b3", "placeholder": "", "style": "IPY_MODEL_3e894d7c8a3545c3886c340328d289a2", "value": "
Step | \n", "Training Loss | \n", "
---|---|
500 | \n", "1.365200 | \n", "
1000 | \n", "1.226200 | \n", "
1500 | \n", "1.156000 | \n", "
2000 | \n", "1.108600 | \n", "
2500 | \n", "1.084900 | \n", "
3000 | \n", "1.033100 | \n", "
3500 | \n", "1.020700 | \n", "
4000 | \n", "1.009600 | \n", "
4500 | \n", "0.994900 | \n", "
5000 | \n", "0.972800 | \n", "
5500 | \n", "0.921200 | \n", "
6000 | \n", "0.869000 | \n", "
6500 | \n", "0.847500 | \n", "
7000 | \n", "0.862500 | \n", "
7500 | \n", "0.847000 | \n", "
8000 | \n", "0.845800 | \n", "
8500 | \n", "0.854900 | \n", "
9000 | \n", "0.845700 | \n", "
9500 | \n", "0.847800 | \n", "
10000 | \n", "0.848000 | \n", "
10500 | \n", "0.834000 | \n", "
11000 | \n", "0.762500 | \n", "
11500 | \n", "0.764200 | \n", "
12000 | \n", "0.767400 | \n", "
12500 | \n", "0.765000 | \n", "
13000 | \n", "0.770000 | \n", "
13500 | \n", "0.757100 | \n", "
14000 | \n", "0.756700 | \n", "
14500 | \n", "0.762700 | \n", "
15000 | \n", "0.766800 | \n", "
15500 | \n", "0.751000 | \n", "
"
]
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"TrainOutput(global_step=15765, training_loss=0.9012604572793396, metrics={'train_runtime': 2950.8187, 'train_samples_per_second': 170.94, 'train_steps_per_second': 5.343, 'total_flos': 1.008207288336384e+16, 'train_loss': 0.9012604572793396, 'epoch': 3.0})"
]
},
"metadata": {},
"execution_count": 19
}
]
},
{
"cell_type": "code",
"source": [
"trainer.push_to_hub(tags=\"translation\", commit_message=\"Training complete\") #To save the latest model onto the repository"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 52
},
"id": "TnYcoiFLzU_f",
"outputId": "b4080bed-d2f9-4e91-be88-0ae88d4a325e"
},
"execution_count": 20,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"CommitInfo(commit_url='https://huggingface.co/rajbhirud/eng-to-fra-model/commit/7dc6032cdedafc309f004b8d65493fbfe40fd5b7', commit_message='Training complete', commit_description='', oid='7dc6032cdedafc309f004b8d65493fbfe40fd5b7', pr_url=None, pr_revision=None, pr_num=None)"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 20
}
]
},
{
"cell_type": "code",
"source": [
"# we can check the score of our model through the following code\n",
"trainer.evaluate(max_length=128)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 141
},
"id": "mhf4dB0pzlA_",
"outputId": "f92c5300-8f61-4f04-8a36-62d31028c467"
},
"execution_count": 21,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"