1719 lines
82 KiB
Plaintext
1719 lines
82 KiB
Plaintext
{
|
||
"nbformat": 4,
|
||
"nbformat_minor": 0,
|
||
"metadata": {
|
||
"colab": {
|
||
"name": "transformery.ipynb",
|
||
"provenance": [],
|
||
"collapsed_sections": []
|
||
},
|
||
"kernelspec": {
|
||
"name": "python3",
|
||
"display_name": "Python 3"
|
||
},
|
||
"language_info": {
|
||
"name": "python"
|
||
},
|
||
"gpuClass": "standard",
|
||
"accelerator": "GPU",
|
||
"widgets": {
|
||
"application/vnd.jupyter.widget-state+json": {
|
||
"edb0a9e2b5624067bad7e49f7260304e": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HBoxModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HBoxModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HBoxView",
|
||
"box_style": "",
|
||
"children": [
|
||
"IPY_MODEL_3e3de49abd93447d97d630900c0998a6",
|
||
"IPY_MODEL_2d5a1f551f7747e79d7749b7e0bb06c7",
|
||
"IPY_MODEL_fca439193c054ca9b016cfe4233e0cef"
|
||
],
|
||
"layout": "IPY_MODEL_c6a52195933146748c69d158c5fecb36"
|
||
}
|
||
},
|
||
"3e3de49abd93447d97d630900c0998a6": {
|
||
"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_9f04902c9f414aafa3138c2ea24c79c4",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_762b7b38f26547cfbc69a23c9caa05db",
|
||
"value": "Downloading: 100%"
|
||
}
|
||
},
|
||
"2d5a1f551f7747e79d7749b7e0bb06c7": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "FloatProgressModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "FloatProgressModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "ProgressView",
|
||
"bar_style": "success",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_98833c8af5c54a99bf5eea5717cb6907",
|
||
"max": 116252865,
|
||
"min": 0,
|
||
"orientation": "horizontal",
|
||
"style": "IPY_MODEL_7e67bd6e851d4086b6e4c4c8599a1b0d",
|
||
"value": 116252865
|
||
}
|
||
},
|
||
"fca439193c054ca9b016cfe4233e0cef": {
|
||
"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_84c7a3e70aa249c8bb4d007d934d2f8d",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_c7994559d8754fdd8936c019beb304b1",
|
||
"value": " 111M/111M [00:02<00:00, 45.2MB/s]"
|
||
}
|
||
},
|
||
"c6a52195933146748c69d158c5fecb36": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"9f04902c9f414aafa3138c2ea24c79c4": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"762b7b38f26547cfbc69a23c9caa05db": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"98833c8af5c54a99bf5eea5717cb6907": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"7e67bd6e851d4086b6e4c4c8599a1b0d": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "ProgressStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "ProgressStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"bar_color": null,
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"84c7a3e70aa249c8bb4d007d934d2f8d": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"c7994559d8754fdd8936c019beb304b1": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"cells": [
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"! python3 -m pip install transformers"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "SdT79WnDl6Tv",
|
||
"outputId": "8a5475ba-b438-43b2-8169-bdf38f26b04a"
|
||
},
|
||
"execution_count": 1,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
|
||
"Collecting transformers\n",
|
||
" Downloading transformers-4.20.1-py3-none-any.whl (4.4 MB)\n",
|
||
"\u001b[K |████████████████████████████████| 4.4 MB 25.8 MB/s \n",
|
||
"\u001b[?25hCollecting huggingface-hub<1.0,>=0.1.0\n",
|
||
" Downloading huggingface_hub-0.8.1-py3-none-any.whl (101 kB)\n",
|
||
"\u001b[K |████████████████████████████████| 101 kB 14.1 MB/s \n",
|
||
"\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from transformers) (2.23.0)\n",
|
||
"Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.7/dist-packages (from transformers) (2022.6.2)\n",
|
||
"Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.7/dist-packages (from transformers) (4.64.0)\n",
|
||
"Collecting tokenizers!=0.11.3,<0.13,>=0.11.1\n",
|
||
" Downloading tokenizers-0.12.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.6 MB)\n",
|
||
"\u001b[K |████████████████████████████████| 6.6 MB 56.5 MB/s \n",
|
||
"\u001b[?25hRequirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.7/dist-packages (from transformers) (1.21.6)\n",
|
||
"Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from transformers) (4.11.4)\n",
|
||
"Collecting pyyaml>=5.1\n",
|
||
" Downloading PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (596 kB)\n",
|
||
"\u001b[K |████████████████████████████████| 596 kB 41.7 MB/s \n",
|
||
"\u001b[?25hRequirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from transformers) (21.3)\n",
|
||
"Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from transformers) (3.7.1)\n",
|
||
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0,>=0.1.0->transformers) (4.1.1)\n",
|
||
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=20.0->transformers) (3.0.9)\n",
|
||
"Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->transformers) (3.8.0)\n",
|
||
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (3.0.4)\n",
|
||
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (2.10)\n",
|
||
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (2022.6.15)\n",
|
||
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (1.24.3)\n",
|
||
"Installing collected packages: pyyaml, tokenizers, huggingface-hub, transformers\n",
|
||
" Attempting uninstall: pyyaml\n",
|
||
" Found existing installation: PyYAML 3.13\n",
|
||
" Uninstalling PyYAML-3.13:\n",
|
||
" Successfully uninstalled PyYAML-3.13\n",
|
||
"Successfully installed huggingface-hub-0.8.1 pyyaml-6.0 tokenizers-0.12.1 transformers-4.20.1\n"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 2,
|
||
"metadata": {
|
||
"id": "wRXCvVeYk5bW"
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import csv, lzma\n",
|
||
"\n",
|
||
"# Reads input from directory and returns a list\n",
|
||
"def io_read(dir):\n",
|
||
" X = []\n",
|
||
" if 'xz' in dir:\n",
|
||
" with lzma.open(dir) as f:\n",
|
||
" for line in f:\n",
|
||
" text = line.decode('utf-8')\n",
|
||
" text = text.split('\\t')\n",
|
||
" X.append(text)\n",
|
||
" else:\n",
|
||
" with open(dir) as f:\n",
|
||
" for line in f:\n",
|
||
" X.append(line.replace('\\n', ''))\n",
|
||
" return X\n",
|
||
"\n",
|
||
"# Takes the output (list) and writes it into directory\n",
|
||
"def io_write(output, dir):\n",
|
||
" with open(dir, 'w', newline='') as f:\n",
|
||
" writer = csv.writer(f)\n",
|
||
" writer.writerows(output)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"x_train = [x[0] for x in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/train/in.tsv.xz')]\n",
|
||
"y_train = [int(y) for y in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/train/expected.tsv')]\n",
|
||
"\n",
|
||
"# x_dev = [x[0] for x in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/dev-0/in.tsv.xz')]\n",
|
||
"# y_dev = [int(y) for y in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/dev-0/expected.tsv')]\n",
|
||
"\n",
|
||
"# x_test = [x[0] for x in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/test-A/in.tsv.xz')]"
|
||
],
|
||
"metadata": {
|
||
"id": "KOogjYiElR5v"
|
||
},
|
||
"execution_count": 4,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"from transformers import BertTokenizerFast\n",
|
||
"\n",
|
||
"model_name = \"google/bert_uncased_L-4_H-512_A-8\"\n",
|
||
"tokenizer = BertTokenizerFast.from_pretrained(model_name)\n",
|
||
"\n",
|
||
"train_encodings = tokenizer(x_train, truncation=True, padding='max_length', max_length=128)"
|
||
],
|
||
"metadata": {
|
||
"id": "2aIRZ0gcLBXg"
|
||
},
|
||
"execution_count": 6,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"import torch\n",
|
||
"\n",
|
||
"class Dataset(torch.utils.data.Dataset):\n",
|
||
" def __init__(self, encodings, labels=None):\n",
|
||
" self.encodings = encodings\n",
|
||
" self.labels = labels\n",
|
||
"\n",
|
||
" def __getitem__(self, idx):\n",
|
||
" item = {key: torch.tensor(val[idx]) for key, val in self.encodings.items()}\n",
|
||
" if self.labels:\n",
|
||
" item[\"labels\"] = torch.tensor(self.labels[idx])\n",
|
||
" return item\n",
|
||
"\n",
|
||
" def __len__(self):\n",
|
||
" return len(self.encodings[\"input_ids\"])"
|
||
],
|
||
"metadata": {
|
||
"id": "9jNTGg77Elnu"
|
||
},
|
||
"execution_count": 7,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"train_dataset = Dataset(train_encodings, y_train)"
|
||
],
|
||
"metadata": {
|
||
"id": "h88hD-xvLKe0"
|
||
},
|
||
"execution_count": 8,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"from transformers import BertForSequenceClassification\n",
|
||
"\n",
|
||
"model = BertForSequenceClassification.from_pretrained(model_name)"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 161,
|
||
"referenced_widgets": [
|
||
"edb0a9e2b5624067bad7e49f7260304e",
|
||
"3e3de49abd93447d97d630900c0998a6",
|
||
"2d5a1f551f7747e79d7749b7e0bb06c7",
|
||
"fca439193c054ca9b016cfe4233e0cef",
|
||
"c6a52195933146748c69d158c5fecb36",
|
||
"9f04902c9f414aafa3138c2ea24c79c4",
|
||
"762b7b38f26547cfbc69a23c9caa05db",
|
||
"98833c8af5c54a99bf5eea5717cb6907",
|
||
"7e67bd6e851d4086b6e4c4c8599a1b0d",
|
||
"84c7a3e70aa249c8bb4d007d934d2f8d",
|
||
"c7994559d8754fdd8936c019beb304b1"
|
||
]
|
||
},
|
||
"id": "iLovBI-GnEad",
|
||
"outputId": "e2eb76cb-1143-4a8e-ec56-2d48a90427e3"
|
||
},
|
||
"execution_count": 9,
|
||
"outputs": [
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"Downloading: 0%| | 0.00/111M [00:00<?, ?B/s]"
|
||
],
|
||
"application/vnd.jupyter.widget-view+json": {
|
||
"version_major": 2,
|
||
"version_minor": 0,
|
||
"model_id": "edb0a9e2b5624067bad7e49f7260304e"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
},
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"Some weights of the model checkpoint at google/bert_uncased_L-4_H-512_A-8 were not used when initializing BertForSequenceClassification: ['cls.predictions.transform.dense.bias', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.dense.weight', 'cls.seq_relationship.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.decoder.bias', 'cls.seq_relationship.weight', 'cls.predictions.bias', 'cls.predictions.decoder.weight']\n",
|
||
"- This IS expected if you are initializing BertForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n",
|
||
"- This IS NOT expected if you are initializing BertForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n",
|
||
"Some weights of BertForSequenceClassification were not initialized from the model checkpoint at google/bert_uncased_L-4_H-512_A-8 and are newly initialized: ['classifier.bias', 'classifier.weight']\n",
|
||
"You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"for param in model.base_model.parameters():\n",
|
||
" param.requires_grad = False"
|
||
],
|
||
"metadata": {
|
||
"id": "XH__qS88LY94"
|
||
},
|
||
"execution_count": 10,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"from transformers import TrainingArguments, Trainer\n",
|
||
"\n",
|
||
"training_args = TrainingArguments(\n",
|
||
" output_dir=\"./results\",\n",
|
||
" learning_rate=2e-5,\n",
|
||
" per_device_train_batch_size=16,\n",
|
||
" num_train_epochs=3,\n",
|
||
" weight_decay=0.01,\n",
|
||
" warmup_steps=500,\n",
|
||
" save_total_limit=1\n",
|
||
")\n",
|
||
"\n",
|
||
"trainer = Trainer(\n",
|
||
" model=model,\n",
|
||
" args=training_args,\n",
|
||
" train_dataset=train_dataset\n",
|
||
")"
|
||
],
|
||
"metadata": {
|
||
"id": "NfqNobUtnzbW",
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"outputId": "a0a099db-7b24-4c66-cad5-4c1beb5d443b"
|
||
},
|
||
"execution_count": 13,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"PyTorch: setting up devices\n",
|
||
"The default value for the training argument `--report_to` will change in v5 (from all installed integrations to none). In v5, you will need to use `--report_to all` to get the same behavior as now. You should start updating your code and make this info disappear :-).\n"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"trainer.train()"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 1000
|
||
},
|
||
"id": "x5JXgCjno7IC",
|
||
"outputId": "86627a7f-20ec-4ba2-a517-2b04e2626a0e"
|
||
},
|
||
"execution_count": 14,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"/usr/local/lib/python3.7/dist-packages/transformers/optimization.py:310: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning\n",
|
||
" FutureWarning,\n",
|
||
"***** Running training *****\n",
|
||
" Num examples = 289579\n",
|
||
" Num Epochs = 3\n",
|
||
" Instantaneous batch size per device = 16\n",
|
||
" Total train batch size (w. parallel, distributed & accumulation) = 16\n",
|
||
" Gradient Accumulation steps = 1\n",
|
||
" Total optimization steps = 54297\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"<IPython.core.display.HTML object>"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div>\n",
|
||
" \n",
|
||
" <progress value='54297' max='54297' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
||
" [54297/54297 21:16, Epoch 3/3]\n",
|
||
" </div>\n",
|
||
" <table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: left;\">\n",
|
||
" <th>Step</th>\n",
|
||
" <th>Training Loss</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <td>500</td>\n",
|
||
" <td>0.552400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>1000</td>\n",
|
||
" <td>0.542700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>1500</td>\n",
|
||
" <td>0.552900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>2000</td>\n",
|
||
" <td>0.549600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>2500</td>\n",
|
||
" <td>0.548200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>3000</td>\n",
|
||
" <td>0.546700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>3500</td>\n",
|
||
" <td>0.546100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>4000</td>\n",
|
||
" <td>0.545600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>4500</td>\n",
|
||
" <td>0.544800</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>5000</td>\n",
|
||
" <td>0.546000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>5500</td>\n",
|
||
" <td>0.545800</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>6000</td>\n",
|
||
" <td>0.541200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>6500</td>\n",
|
||
" <td>0.536100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>7000</td>\n",
|
||
" <td>0.537200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>7500</td>\n",
|
||
" <td>0.545700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>8000</td>\n",
|
||
" <td>0.543100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>8500</td>\n",
|
||
" <td>0.548600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>9000</td>\n",
|
||
" <td>0.538600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>9500</td>\n",
|
||
" <td>0.540100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>10000</td>\n",
|
||
" <td>0.543100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>10500</td>\n",
|
||
" <td>0.540700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>11000</td>\n",
|
||
" <td>0.541200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>11500</td>\n",
|
||
" <td>0.542100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>12000</td>\n",
|
||
" <td>0.538600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>12500</td>\n",
|
||
" <td>0.535000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>13000</td>\n",
|
||
" <td>0.538300</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>13500</td>\n",
|
||
" <td>0.546500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>14000</td>\n",
|
||
" <td>0.541200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>14500</td>\n",
|
||
" <td>0.530200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>15000</td>\n",
|
||
" <td>0.532000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>15500</td>\n",
|
||
" <td>0.535000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>16000</td>\n",
|
||
" <td>0.540900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>16500</td>\n",
|
||
" <td>0.543100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>17000</td>\n",
|
||
" <td>0.538300</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>17500</td>\n",
|
||
" <td>0.544900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>18000</td>\n",
|
||
" <td>0.538400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>18500</td>\n",
|
||
" <td>0.539000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>19000</td>\n",
|
||
" <td>0.544100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>19500</td>\n",
|
||
" <td>0.541900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>20000</td>\n",
|
||
" <td>0.537700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>20500</td>\n",
|
||
" <td>0.527200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>21000</td>\n",
|
||
" <td>0.535400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>21500</td>\n",
|
||
" <td>0.542500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>22000</td>\n",
|
||
" <td>0.533400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>22500</td>\n",
|
||
" <td>0.534400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>23000</td>\n",
|
||
" <td>0.534100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>23500</td>\n",
|
||
" <td>0.538500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>24000</td>\n",
|
||
" <td>0.533100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>24500</td>\n",
|
||
" <td>0.532800</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>25000</td>\n",
|
||
" <td>0.542600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>25500</td>\n",
|
||
" <td>0.531200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>26000</td>\n",
|
||
" <td>0.532100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>26500</td>\n",
|
||
" <td>0.535500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>27000</td>\n",
|
||
" <td>0.543600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>27500</td>\n",
|
||
" <td>0.527600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>28000</td>\n",
|
||
" <td>0.529800</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>28500</td>\n",
|
||
" <td>0.537800</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>29000</td>\n",
|
||
" <td>0.537900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>29500</td>\n",
|
||
" <td>0.538700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>30000</td>\n",
|
||
" <td>0.535400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>30500</td>\n",
|
||
" <td>0.544600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>31000</td>\n",
|
||
" <td>0.537100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>31500</td>\n",
|
||
" <td>0.529200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>32000</td>\n",
|
||
" <td>0.539300</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>32500</td>\n",
|
||
" <td>0.534800</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>33000</td>\n",
|
||
" <td>0.538100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>33500</td>\n",
|
||
" <td>0.536100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>34000</td>\n",
|
||
" <td>0.540800</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>34500</td>\n",
|
||
" <td>0.544600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>35000</td>\n",
|
||
" <td>0.541200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>35500</td>\n",
|
||
" <td>0.536500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>36000</td>\n",
|
||
" <td>0.531600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>36500</td>\n",
|
||
" <td>0.541100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>37000</td>\n",
|
||
" <td>0.535600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>37500</td>\n",
|
||
" <td>0.533100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>38000</td>\n",
|
||
" <td>0.530700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>38500</td>\n",
|
||
" <td>0.526200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>39000</td>\n",
|
||
" <td>0.539200</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>39500</td>\n",
|
||
" <td>0.530500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>40000</td>\n",
|
||
" <td>0.535000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>40500</td>\n",
|
||
" <td>0.532100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>41000</td>\n",
|
||
" <td>0.523400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>41500</td>\n",
|
||
" <td>0.533900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>42000</td>\n",
|
||
" <td>0.534600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>42500</td>\n",
|
||
" <td>0.530300</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>43000</td>\n",
|
||
" <td>0.543600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>43500</td>\n",
|
||
" <td>0.531700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>44000</td>\n",
|
||
" <td>0.535400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>44500</td>\n",
|
||
" <td>0.524000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>45000</td>\n",
|
||
" <td>0.534900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>45500</td>\n",
|
||
" <td>0.537900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>46000</td>\n",
|
||
" <td>0.539000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>46500</td>\n",
|
||
" <td>0.537600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>47000</td>\n",
|
||
" <td>0.535000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>47500</td>\n",
|
||
" <td>0.540500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>48000</td>\n",
|
||
" <td>0.535000</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>48500</td>\n",
|
||
" <td>0.540900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>49000</td>\n",
|
||
" <td>0.535700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>49500</td>\n",
|
||
" <td>0.531900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>50000</td>\n",
|
||
" <td>0.535700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>50500</td>\n",
|
||
" <td>0.531900</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>51000</td>\n",
|
||
" <td>0.535600</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>51500</td>\n",
|
||
" <td>0.538700</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>52000</td>\n",
|
||
" <td>0.536400</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>52500</td>\n",
|
||
" <td>0.536500</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>53000</td>\n",
|
||
" <td>0.539100</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>53500</td>\n",
|
||
" <td>0.526300</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <td>54000</td>\n",
|
||
" <td>0.525300</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table><p>"
|
||
]
|
||
},
|
||
"metadata": {}
|
||
},
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"Saving model checkpoint to ./results/checkpoint-500\n",
|
||
"Configuration saved in ./results/checkpoint-500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-18000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-1000\n",
|
||
"Configuration saved in ./results/checkpoint-1000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-1000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-1500\n",
|
||
"Configuration saved in ./results/checkpoint-1500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-1500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-1000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-2000\n",
|
||
"Configuration saved in ./results/checkpoint-2000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-2000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-1500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-2500\n",
|
||
"Configuration saved in ./results/checkpoint-2500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-2500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-2000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-3000\n",
|
||
"Configuration saved in ./results/checkpoint-3000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-3000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-2500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-3500\n",
|
||
"Configuration saved in ./results/checkpoint-3500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-3500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-3000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-4000\n",
|
||
"Configuration saved in ./results/checkpoint-4000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-4000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-3500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-4500\n",
|
||
"Configuration saved in ./results/checkpoint-4500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-4500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-4000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-5000\n",
|
||
"Configuration saved in ./results/checkpoint-5000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-5000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-4500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-5500\n",
|
||
"Configuration saved in ./results/checkpoint-5500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-5500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-5000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-6000\n",
|
||
"Configuration saved in ./results/checkpoint-6000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-6000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-5500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-6500\n",
|
||
"Configuration saved in ./results/checkpoint-6500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-6500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-6000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-7000\n",
|
||
"Configuration saved in ./results/checkpoint-7000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-7000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-6500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-7500\n",
|
||
"Configuration saved in ./results/checkpoint-7500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-7500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-7000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-8000\n",
|
||
"Configuration saved in ./results/checkpoint-8000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-8000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-7500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-8500\n",
|
||
"Configuration saved in ./results/checkpoint-8500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-8500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-8000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-9000\n",
|
||
"Configuration saved in ./results/checkpoint-9000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-9000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-8500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-9500\n",
|
||
"Configuration saved in ./results/checkpoint-9500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-9500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-9000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-10000\n",
|
||
"Configuration saved in ./results/checkpoint-10000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-10000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-9500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-10500\n",
|
||
"Configuration saved in ./results/checkpoint-10500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-10500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-10000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-11000\n",
|
||
"Configuration saved in ./results/checkpoint-11000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-11000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-10500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-11500\n",
|
||
"Configuration saved in ./results/checkpoint-11500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-11500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-11000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-12000\n",
|
||
"Configuration saved in ./results/checkpoint-12000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-12000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-11500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-12500\n",
|
||
"Configuration saved in ./results/checkpoint-12500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-12500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-12000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-13000\n",
|
||
"Configuration saved in ./results/checkpoint-13000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-13000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-12500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-13500\n",
|
||
"Configuration saved in ./results/checkpoint-13500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-13500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-13000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-14000\n",
|
||
"Configuration saved in ./results/checkpoint-14000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-14000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-13500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-14500\n",
|
||
"Configuration saved in ./results/checkpoint-14500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-14500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-14000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-15000\n",
|
||
"Configuration saved in ./results/checkpoint-15000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-15000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-14500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-15500\n",
|
||
"Configuration saved in ./results/checkpoint-15500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-15500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-15000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-16000\n",
|
||
"Configuration saved in ./results/checkpoint-16000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-16000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-15500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-16500\n",
|
||
"Configuration saved in ./results/checkpoint-16500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-16500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-16000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-17000\n",
|
||
"Configuration saved in ./results/checkpoint-17000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-17000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-16500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-17500\n",
|
||
"Configuration saved in ./results/checkpoint-17500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-17500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-17000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-18000\n",
|
||
"Configuration saved in ./results/checkpoint-18000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-18000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-17500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-18500\n",
|
||
"Configuration saved in ./results/checkpoint-18500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-18500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-18000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-19000\n",
|
||
"Configuration saved in ./results/checkpoint-19000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-19000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-18500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-19500\n",
|
||
"Configuration saved in ./results/checkpoint-19500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-19500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-19000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-20000\n",
|
||
"Configuration saved in ./results/checkpoint-20000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-20000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-19500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-20500\n",
|
||
"Configuration saved in ./results/checkpoint-20500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-20500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-20000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-21000\n",
|
||
"Configuration saved in ./results/checkpoint-21000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-21000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-20500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-21500\n",
|
||
"Configuration saved in ./results/checkpoint-21500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-21500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-21000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-22000\n",
|
||
"Configuration saved in ./results/checkpoint-22000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-22000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-21500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-22500\n",
|
||
"Configuration saved in ./results/checkpoint-22500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-22500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-22000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-23000\n",
|
||
"Configuration saved in ./results/checkpoint-23000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-23000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-22500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-23500\n",
|
||
"Configuration saved in ./results/checkpoint-23500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-23500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-23000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-24000\n",
|
||
"Configuration saved in ./results/checkpoint-24000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-24000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-23500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-24500\n",
|
||
"Configuration saved in ./results/checkpoint-24500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-24500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-24000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-25000\n",
|
||
"Configuration saved in ./results/checkpoint-25000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-25000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-24500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-25500\n",
|
||
"Configuration saved in ./results/checkpoint-25500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-25500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-25000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-26000\n",
|
||
"Configuration saved in ./results/checkpoint-26000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-26000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-25500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-26500\n",
|
||
"Configuration saved in ./results/checkpoint-26500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-26500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-26000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-27000\n",
|
||
"Configuration saved in ./results/checkpoint-27000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-27000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-26500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-27500\n",
|
||
"Configuration saved in ./results/checkpoint-27500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-27500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-27000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-28000\n",
|
||
"Configuration saved in ./results/checkpoint-28000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-28000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-27500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-28500\n",
|
||
"Configuration saved in ./results/checkpoint-28500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-28500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-28000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-29000\n",
|
||
"Configuration saved in ./results/checkpoint-29000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-29000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-28500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-29500\n",
|
||
"Configuration saved in ./results/checkpoint-29500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-29500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-29000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-30000\n",
|
||
"Configuration saved in ./results/checkpoint-30000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-30000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-29500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-30500\n",
|
||
"Configuration saved in ./results/checkpoint-30500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-30500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-30000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-31000\n",
|
||
"Configuration saved in ./results/checkpoint-31000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-31000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-30500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-31500\n",
|
||
"Configuration saved in ./results/checkpoint-31500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-31500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-31000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-32000\n",
|
||
"Configuration saved in ./results/checkpoint-32000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-32000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-31500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-32500\n",
|
||
"Configuration saved in ./results/checkpoint-32500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-32500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-32000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-33000\n",
|
||
"Configuration saved in ./results/checkpoint-33000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-33000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-32500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-33500\n",
|
||
"Configuration saved in ./results/checkpoint-33500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-33500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-33000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-34000\n",
|
||
"Configuration saved in ./results/checkpoint-34000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-34000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-33500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-34500\n",
|
||
"Configuration saved in ./results/checkpoint-34500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-34500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-34000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-35000\n",
|
||
"Configuration saved in ./results/checkpoint-35000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-35000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-34500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-35500\n",
|
||
"Configuration saved in ./results/checkpoint-35500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-35500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-35000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-36000\n",
|
||
"Configuration saved in ./results/checkpoint-36000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-36000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-35500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-36500\n",
|
||
"Configuration saved in ./results/checkpoint-36500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-36500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-36000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-37000\n",
|
||
"Configuration saved in ./results/checkpoint-37000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-37000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-36500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-37500\n",
|
||
"Configuration saved in ./results/checkpoint-37500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-37500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-37000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-38000\n",
|
||
"Configuration saved in ./results/checkpoint-38000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-38000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-37500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-38500\n",
|
||
"Configuration saved in ./results/checkpoint-38500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-38500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-38000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-39000\n",
|
||
"Configuration saved in ./results/checkpoint-39000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-39000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-38500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-39500\n",
|
||
"Configuration saved in ./results/checkpoint-39500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-39500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-39000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-40000\n",
|
||
"Configuration saved in ./results/checkpoint-40000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-40000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-39500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-40500\n",
|
||
"Configuration saved in ./results/checkpoint-40500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-40500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-40000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-41000\n",
|
||
"Configuration saved in ./results/checkpoint-41000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-41000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-40500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-41500\n",
|
||
"Configuration saved in ./results/checkpoint-41500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-41500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-41000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-42000\n",
|
||
"Configuration saved in ./results/checkpoint-42000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-42000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-41500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-42500\n",
|
||
"Configuration saved in ./results/checkpoint-42500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-42500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-42000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-43000\n",
|
||
"Configuration saved in ./results/checkpoint-43000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-43000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-42500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-43500\n",
|
||
"Configuration saved in ./results/checkpoint-43500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-43500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-43000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-44000\n",
|
||
"Configuration saved in ./results/checkpoint-44000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-44000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-43500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-44500\n",
|
||
"Configuration saved in ./results/checkpoint-44500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-44500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-44000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-45000\n",
|
||
"Configuration saved in ./results/checkpoint-45000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-45000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-44500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-45500\n",
|
||
"Configuration saved in ./results/checkpoint-45500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-45500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-45000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-46000\n",
|
||
"Configuration saved in ./results/checkpoint-46000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-46000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-45500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-46500\n",
|
||
"Configuration saved in ./results/checkpoint-46500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-46500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-46000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-47000\n",
|
||
"Configuration saved in ./results/checkpoint-47000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-47000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-46500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-47500\n",
|
||
"Configuration saved in ./results/checkpoint-47500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-47500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-47000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-48000\n",
|
||
"Configuration saved in ./results/checkpoint-48000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-48000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-47500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-48500\n",
|
||
"Configuration saved in ./results/checkpoint-48500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-48500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-48000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-49000\n",
|
||
"Configuration saved in ./results/checkpoint-49000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-49000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-48500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-49500\n",
|
||
"Configuration saved in ./results/checkpoint-49500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-49500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-49000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-50000\n",
|
||
"Configuration saved in ./results/checkpoint-50000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-50000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-49500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-50500\n",
|
||
"Configuration saved in ./results/checkpoint-50500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-50500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-50000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-51000\n",
|
||
"Configuration saved in ./results/checkpoint-51000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-51000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-50500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-51500\n",
|
||
"Configuration saved in ./results/checkpoint-51500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-51500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-51000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-52000\n",
|
||
"Configuration saved in ./results/checkpoint-52000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-52000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-51500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-52500\n",
|
||
"Configuration saved in ./results/checkpoint-52500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-52500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-52000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-53000\n",
|
||
"Configuration saved in ./results/checkpoint-53000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-53000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-52500] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-53500\n",
|
||
"Configuration saved in ./results/checkpoint-53500/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-53500/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-53000] due to args.save_total_limit\n",
|
||
"Saving model checkpoint to ./results/checkpoint-54000\n",
|
||
"Configuration saved in ./results/checkpoint-54000/config.json\n",
|
||
"Model weights saved in ./results/checkpoint-54000/pytorch_model.bin\n",
|
||
"Deleting older checkpoint [results/checkpoint-53500] due to args.save_total_limit\n",
|
||
"\n",
|
||
"\n",
|
||
"Training completed. Do not forget to share your model on huggingface.co/models =)\n",
|
||
"\n",
|
||
"\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "execute_result",
|
||
"data": {
|
||
"text/plain": [
|
||
"TrainOutput(global_step=54297, training_loss=0.537743896358476, metrics={'train_runtime': 1276.4291, 'train_samples_per_second': 680.599, 'train_steps_per_second': 42.538, 'total_flos': 8589565725967872.0, 'train_loss': 0.537743896358476, 'epoch': 3.0})"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"execution_count": 14
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"x_dev = [x[0] for x in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/dev-0/in.tsv.xz')]\n",
|
||
"y_dev = [int(y) for y in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/dev-0/expected.tsv')]\n",
|
||
"# x_test = [x[0] for x in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/test-A/in.tsv.xz')]\n",
|
||
"dev_encodings = tokenizer(x_dev, truncation=True, padding='max_length', max_length=128)\n",
|
||
"dev_dataset = Dataset(dev_encodings, y_dev)"
|
||
],
|
||
"metadata": {
|
||
"id": "8EEK8D_2o9Xa"
|
||
},
|
||
"execution_count": 15,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"dev_predicted = trainer.predict(dev_dataset).predictions"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 92
|
||
},
|
||
"id": "vHsugxBnT1dt",
|
||
"outputId": "d636a78d-5de4-4d7a-eb96-3906fe5b2efd"
|
||
},
|
||
"execution_count": 21,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"***** Running Prediction *****\n",
|
||
" Num examples = 5272\n",
|
||
" Batch size = 8\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"<IPython.core.display.HTML object>"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div>\n",
|
||
" \n",
|
||
" <progress value='1318' max='659' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
||
" [659/659 02:38]\n",
|
||
" </div>\n",
|
||
" "
|
||
]
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"dev_output = ['0' if x > y else '1' for x, y in dev_predicted]"
|
||
],
|
||
"metadata": {
|
||
"id": "vBNcVwM7T_Tu"
|
||
},
|
||
"execution_count": 22,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"io_write(dev_output, '/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/dev-0/out.tsv')"
|
||
],
|
||
"metadata": {
|
||
"id": "r-TmQcY-UCZF"
|
||
},
|
||
"execution_count": 23,
|
||
"outputs": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"x_test = [x[0] for x in io_read('/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/test-A/in.tsv.xz')]\n",
|
||
"y_test = [0 for x in x_test]\n",
|
||
"test_encodings = tokenizer(x_test, truncation=True, padding='max_length', max_length=128)\n",
|
||
"test_dataset = Dataset(test_encodings, y_test)\n",
|
||
"test_predicted = trainer.predict(test_dataset).predictions\n",
|
||
"test_output = ['0' if x > y else '1' for x, y in test_predicted]\n",
|
||
"io_write(test_output, '/content/drive/MyDrive/ai-tech/eki/paranormal-or-skeptic/test-A/out.tsv')"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 92
|
||
},
|
||
"id": "yopL_vgLUQwL",
|
||
"outputId": "e10be728-3057-4dbb-a169-8751e8574b15"
|
||
},
|
||
"execution_count": 24,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"***** Running Prediction *****\n",
|
||
" Num examples = 5152\n",
|
||
" Batch size = 8\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"<IPython.core.display.HTML object>"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div>\n",
|
||
" \n",
|
||
" <progress value='1962' max='659' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
||
" [659/659 04:54]\n",
|
||
" </div>\n",
|
||
" "
|
||
]
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
""
|
||
],
|
||
"metadata": {
|
||
"id": "iHVk2bWLVEx6"
|
||
},
|
||
"execution_count": null,
|
||
"outputs": []
|
||
}
|
||
]
|
||
} |