Commit
•
9091c0d
1
Parent(s):
b5f32ab
Training in progress, epoch 0
Browse files- .gitattributes +1 -0
- .ipynb_checkpoints/Untitled-checkpoint.ipynb +6 -0
- Untitled.ipynb +1080 -0
- adapter_config.json +30 -0
- adapter_model.safetensors +3 -0
- data.csv +3 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
data.csv filter=lfs diff=lfs merge=lfs -text
|
.ipynb_checkpoints/Untitled-checkpoint.ipynb
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [],
|
3 |
+
"metadata": {},
|
4 |
+
"nbformat": 4,
|
5 |
+
"nbformat_minor": 5
|
6 |
+
}
|
Untitled.ipynb
ADDED
@@ -0,0 +1,1080 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"id": "b3b92bc7-d105-405f-970d-804d298b9976",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [
|
9 |
+
{
|
10 |
+
"name": "stdout",
|
11 |
+
"output_type": "stream",
|
12 |
+
"text": [
|
13 |
+
"Collecting accelerate\n",
|
14 |
+
" Downloading accelerate-0.26.1-py3-none-any.whl.metadata (18 kB)\n",
|
15 |
+
"Collecting transformers\n",
|
16 |
+
" Downloading transformers-4.37.2-py3-none-any.whl.metadata (129 kB)\n",
|
17 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.4/129.4 kB\u001b[0m \u001b[31m893.7 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:00\u001b[0m\n",
|
18 |
+
"\u001b[?25hCollecting einops\n",
|
19 |
+
" Downloading einops-0.7.0-py3-none-any.whl.metadata (13 kB)\n",
|
20 |
+
"Collecting datasets\n",
|
21 |
+
" Downloading datasets-2.16.1-py3-none-any.whl.metadata (20 kB)\n",
|
22 |
+
"Collecting peft\n",
|
23 |
+
" Downloading peft-0.8.2-py3-none-any.whl.metadata (25 kB)\n",
|
24 |
+
"Collecting bitsandbytes\n",
|
25 |
+
" Downloading bitsandbytes-0.42.0-py3-none-any.whl.metadata (9.9 kB)\n",
|
26 |
+
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.11/site-packages (from accelerate) (1.26.4)\n",
|
27 |
+
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/site-packages (from accelerate) (23.2)\n",
|
28 |
+
"Requirement already satisfied: psutil in /usr/local/lib/python3.11/site-packages (from accelerate) (5.9.8)\n",
|
29 |
+
"Requirement already satisfied: pyyaml in /usr/local/lib/python3.11/site-packages (from accelerate) (6.0.1)\n",
|
30 |
+
"Collecting torch>=1.10.0 (from accelerate)\n",
|
31 |
+
" Downloading torch-2.2.0-cp311-cp311-manylinux1_x86_64.whl.metadata (25 kB)\n",
|
32 |
+
"Collecting huggingface-hub (from accelerate)\n",
|
33 |
+
" Downloading huggingface_hub-0.20.3-py3-none-any.whl.metadata (12 kB)\n",
|
34 |
+
"Collecting safetensors>=0.3.1 (from accelerate)\n",
|
35 |
+
" Downloading safetensors-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.8 kB)\n",
|
36 |
+
"Collecting filelock (from transformers)\n",
|
37 |
+
" Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)\n",
|
38 |
+
"Collecting regex!=2019.12.17 (from transformers)\n",
|
39 |
+
" Downloading regex-2023.12.25-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (40 kB)\n",
|
40 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m40.9/40.9 kB\u001b[0m \u001b[31m121.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
41 |
+
"\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (from transformers) (2.31.0)\n",
|
42 |
+
"Collecting tokenizers<0.19,>=0.14 (from transformers)\n",
|
43 |
+
" Downloading tokenizers-0.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)\n",
|
44 |
+
"Collecting tqdm>=4.27 (from transformers)\n",
|
45 |
+
" Downloading tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)\n",
|
46 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m57.6/57.6 kB\u001b[0m \u001b[31m47.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
47 |
+
"\u001b[?25hCollecting pyarrow>=8.0.0 (from datasets)\n",
|
48 |
+
" Downloading pyarrow-15.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (3.0 kB)\n",
|
49 |
+
"Collecting pyarrow-hotfix (from datasets)\n",
|
50 |
+
" Downloading pyarrow_hotfix-0.6-py3-none-any.whl.metadata (3.6 kB)\n",
|
51 |
+
"Collecting dill<0.3.8,>=0.3.0 (from datasets)\n",
|
52 |
+
" Downloading dill-0.3.7-py3-none-any.whl.metadata (9.9 kB)\n",
|
53 |
+
"Collecting pandas (from datasets)\n",
|
54 |
+
" Downloading pandas-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)\n",
|
55 |
+
"Collecting xxhash (from datasets)\n",
|
56 |
+
" Downloading xxhash-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n",
|
57 |
+
"Collecting multiprocess (from datasets)\n",
|
58 |
+
" Downloading multiprocess-0.70.16-py311-none-any.whl.metadata (7.2 kB)\n",
|
59 |
+
"Collecting fsspec<=2023.10.0,>=2023.1.0 (from fsspec[http]<=2023.10.0,>=2023.1.0->datasets)\n",
|
60 |
+
" Downloading fsspec-2023.10.0-py3-none-any.whl.metadata (6.8 kB)\n",
|
61 |
+
"Requirement already satisfied: aiohttp in /usr/local/lib/python3.11/site-packages (from datasets) (3.8.3)\n",
|
62 |
+
"Collecting scipy (from bitsandbytes)\n",
|
63 |
+
" Downloading scipy-1.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)\n",
|
64 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.4/60.4 kB\u001b[0m \u001b[31m54.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
65 |
+
"\u001b[?25hRequirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (23.2.0)\n",
|
66 |
+
"Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (2.1.1)\n",
|
67 |
+
"Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (6.0.5)\n",
|
68 |
+
"Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (4.0.3)\n",
|
69 |
+
"Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.9.4)\n",
|
70 |
+
"Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.4.1)\n",
|
71 |
+
"Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.3.1)\n",
|
72 |
+
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/site-packages (from huggingface-hub->accelerate) (4.9.0)\n",
|
73 |
+
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (3.6)\n",
|
74 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (2.2.0)\n",
|
75 |
+
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (2024.2.2)\n",
|
76 |
+
"Collecting sympy (from torch>=1.10.0->accelerate)\n",
|
77 |
+
" Downloading sympy-1.12-py3-none-any.whl (5.7 MB)\n",
|
78 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.7/5.7 MB\u001b[0m \u001b[31m32.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
79 |
+
"\u001b[?25hCollecting networkx (from torch>=1.10.0->accelerate)\n",
|
80 |
+
" Downloading networkx-3.2.1-py3-none-any.whl.metadata (5.2 kB)\n",
|
81 |
+
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/site-packages (from torch>=1.10.0->accelerate) (3.1.3)\n",
|
82 |
+
"Collecting nvidia-cuda-nvrtc-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n",
|
83 |
+
" Downloading nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)\n",
|
84 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m23.7/23.7 MB\u001b[0m \u001b[31m61.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
85 |
+
"\u001b[?25hCollecting nvidia-cuda-runtime-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n",
|
86 |
+
" Downloading nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)\n",
|
87 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m823.6/823.6 kB\u001b[0m \u001b[31m93.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
88 |
+
"\u001b[?25hCollecting nvidia-cuda-cupti-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n",
|
89 |
+
" Downloading nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)\n",
|
90 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m14.1/14.1 MB\u001b[0m \u001b[31m44.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
91 |
+
"\u001b[?25hCollecting nvidia-cudnn-cu12==8.9.2.26 (from torch>=1.10.0->accelerate)\n",
|
92 |
+
" Downloading nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)\n",
|
93 |
+
"Collecting nvidia-cublas-cu12==12.1.3.1 (from torch>=1.10.0->accelerate)\n",
|
94 |
+
" Downloading nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)\n",
|
95 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m410.6/410.6 MB\u001b[0m \u001b[31m59.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
96 |
+
"\u001b[?25hCollecting nvidia-cufft-cu12==11.0.2.54 (from torch>=1.10.0->accelerate)\n",
|
97 |
+
" Downloading nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB)\n",
|
98 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.6/121.6 MB\u001b[0m \u001b[31m59.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
99 |
+
"\u001b[?25hCollecting nvidia-curand-cu12==10.3.2.106 (from torch>=1.10.0->accelerate)\n",
|
100 |
+
" Downloading nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB)\n",
|
101 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.5/56.5 MB\u001b[0m \u001b[31m60.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
102 |
+
"\u001b[?25hCollecting nvidia-cusolver-cu12==11.4.5.107 (from torch>=1.10.0->accelerate)\n",
|
103 |
+
" Downloading nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB)\n",
|
104 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m124.2/124.2 MB\u001b[0m \u001b[31m50.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
105 |
+
"\u001b[?25hCollecting nvidia-cusparse-cu12==12.1.0.106 (from torch>=1.10.0->accelerate)\n",
|
106 |
+
" Downloading nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB)\n",
|
107 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m196.0/196.0 MB\u001b[0m \u001b[31m40.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
108 |
+
"\u001b[?25hCollecting nvidia-nccl-cu12==2.19.3 (from torch>=1.10.0->accelerate)\n",
|
109 |
+
" Downloading nvidia_nccl_cu12-2.19.3-py3-none-manylinux1_x86_64.whl.metadata (1.8 kB)\n",
|
110 |
+
"Collecting nvidia-nvtx-cu12==12.1.105 (from torch>=1.10.0->accelerate)\n",
|
111 |
+
" Downloading nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB)\n",
|
112 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m99.1/99.1 kB\u001b[0m \u001b[31m60.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
113 |
+
"\u001b[?25hCollecting triton==2.2.0 (from torch>=1.10.0->accelerate)\n",
|
114 |
+
" Downloading triton-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.4 kB)\n",
|
115 |
+
"Collecting nvidia-nvjitlink-cu12 (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.10.0->accelerate)\n",
|
116 |
+
" Downloading nvidia_nvjitlink_cu12-12.3.101-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)\n",
|
117 |
+
"INFO: pip is looking at multiple versions of multiprocess to determine which version is compatible with other requirements. This could take a while.\n",
|
118 |
+
"Collecting multiprocess (from datasets)\n",
|
119 |
+
" Downloading multiprocess-0.70.15-py311-none-any.whl.metadata (7.2 kB)\n",
|
120 |
+
"Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/site-packages (from pandas->datasets) (2.8.2)\n",
|
121 |
+
"Collecting pytz>=2020.1 (from pandas->datasets)\n",
|
122 |
+
" Downloading pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)\n",
|
123 |
+
"Collecting tzdata>=2022.7 (from pandas->datasets)\n",
|
124 |
+
" Downloading tzdata-2023.4-py2.py3-none-any.whl.metadata (1.4 kB)\n",
|
125 |
+
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/site-packages (from python-dateutil>=2.8.2->pandas->datasets) (1.16.0)\n",
|
126 |
+
"Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/site-packages (from jinja2->torch>=1.10.0->accelerate) (2.1.5)\n",
|
127 |
+
"Collecting mpmath>=0.19 (from sympy->torch>=1.10.0->accelerate)\n",
|
128 |
+
" Downloading mpmath-1.3.0-py3-none-any.whl (536 kB)\n",
|
129 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m536.2/536.2 kB\u001b[0m \u001b[31m73.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
130 |
+
"\u001b[?25hDownloading accelerate-0.26.1-py3-none-any.whl (270 kB)\n",
|
131 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m270.9/270.9 kB\u001b[0m \u001b[31m105.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
132 |
+
"\u001b[?25hDownloading transformers-4.37.2-py3-none-any.whl (8.4 MB)\n",
|
133 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.4/8.4 MB\u001b[0m \u001b[31m41.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
134 |
+
"\u001b[?25hDownloading einops-0.7.0-py3-none-any.whl (44 kB)\n",
|
135 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m44.6/44.6 kB\u001b[0m \u001b[31m139.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
136 |
+
"\u001b[?25hDownloading datasets-2.16.1-py3-none-any.whl (507 kB)\n",
|
137 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m507.1/507.1 kB\u001b[0m \u001b[31m77.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
138 |
+
"\u001b[?25hDownloading peft-0.8.2-py3-none-any.whl (183 kB)\n",
|
139 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m183.4/183.4 kB\u001b[0m \u001b[31m101.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
140 |
+
"\u001b[?25hDownloading bitsandbytes-0.42.0-py3-none-any.whl (105.0 MB)\n",
|
141 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m105.0/105.0 MB\u001b[0m \u001b[31m33.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
142 |
+
"\u001b[?25hDownloading dill-0.3.7-py3-none-any.whl (115 kB)\n",
|
143 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m97.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
144 |
+
"\u001b[?25hDownloading fsspec-2023.10.0-py3-none-any.whl (166 kB)\n",
|
145 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m166.4/166.4 kB\u001b[0m \u001b[31m197.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
146 |
+
"\u001b[?25hDownloading huggingface_hub-0.20.3-py3-none-any.whl (330 kB)\n",
|
147 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m330.1/330.1 kB\u001b[0m \u001b[31m52.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
148 |
+
"\u001b[?25hDownloading pyarrow-15.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (38.3 MB)\n",
|
149 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m38.3/38.3 MB\u001b[0m \u001b[31m33.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
150 |
+
"\u001b[?25hDownloading regex-2023.12.25-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (785 kB)\n",
|
151 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m785.1/785.1 kB\u001b[0m \u001b[31m50.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
152 |
+
"\u001b[?25hDownloading safetensors-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
|
153 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m38.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
154 |
+
"\u001b[?25hDownloading tokenizers-0.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)\n",
|
155 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.6/3.6 MB\u001b[0m \u001b[31m36.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
156 |
+
"\u001b[?25hDownloading torch-2.2.0-cp311-cp311-manylinux1_x86_64.whl (755.5 MB)\n",
|
157 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m755.5/755.5 MB\u001b[0m \u001b[31m10.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m0:03\u001b[0mm\n",
|
158 |
+
"\u001b[?25hDownloading nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl (731.7 MB)\n",
|
159 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m731.7/731.7 MB\u001b[0m \u001b[31m28.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
160 |
+
"\u001b[?25hDownloading nvidia_nccl_cu12-2.19.3-py3-none-manylinux1_x86_64.whl (166.0 MB)\n",
|
161 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m166.0/166.0 MB\u001b[0m \u001b[31m33.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
162 |
+
"\u001b[?25hDownloading triton-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (167.9 MB)\n",
|
163 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m167.9/167.9 MB\u001b[0m \u001b[31m26.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
164 |
+
"\u001b[?25hDownloading tqdm-4.66.1-py3-none-any.whl (78 kB)\n",
|
165 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m78.3/78.3 kB\u001b[0m \u001b[31m77.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
166 |
+
"\u001b[?25hDownloading filelock-3.13.1-py3-none-any.whl (11 kB)\n",
|
167 |
+
"Downloading multiprocess-0.70.15-py311-none-any.whl (135 kB)\n",
|
168 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m135.4/135.4 kB\u001b[0m \u001b[31m77.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
169 |
+
"\u001b[?25hDownloading pandas-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)\n",
|
170 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.0/13.0 MB\u001b[0m \u001b[31m28.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
171 |
+
"\u001b[?25hDownloading pyarrow_hotfix-0.6-py3-none-any.whl (7.9 kB)\n",
|
172 |
+
"Downloading scipy-1.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.4 MB)\n",
|
173 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m38.4/38.4 MB\u001b[0m \u001b[31m28.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
174 |
+
"\u001b[?25hDownloading xxhash-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)\n",
|
175 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m194.8/194.8 kB\u001b[0m \u001b[31m92.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
176 |
+
"\u001b[?25hDownloading pytz-2024.1-py2.py3-none-any.whl (505 kB)\n",
|
177 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m505.5/505.5 kB\u001b[0m \u001b[31m49.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
178 |
+
"\u001b[?25hDownloading tzdata-2023.4-py2.py3-none-any.whl (346 kB)\n",
|
179 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m346.6/346.6 kB\u001b[0m \u001b[31m100.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
180 |
+
"\u001b[?25hDownloading networkx-3.2.1-py3-none-any.whl (1.6 MB)\n",
|
181 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m34.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
182 |
+
"\u001b[?25hDownloading nvidia_nvjitlink_cu12-12.3.101-py3-none-manylinux1_x86_64.whl (20.5 MB)\n",
|
183 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.5/20.5 MB\u001b[0m \u001b[31m22.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
184 |
+
"\u001b[?25hInstalling collected packages: pytz, mpmath, xxhash, tzdata, tqdm, sympy, scipy, safetensors, regex, pyarrow-hotfix, pyarrow, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, networkx, fsspec, filelock, einops, dill, triton, pandas, nvidia-cusparse-cu12, nvidia-cudnn-cu12, multiprocess, huggingface-hub, bitsandbytes, tokenizers, nvidia-cusolver-cu12, transformers, torch, datasets, accelerate, peft\n",
|
185 |
+
"Successfully installed accelerate-0.26.1 bitsandbytes-0.42.0 datasets-2.16.1 dill-0.3.7 einops-0.7.0 filelock-3.13.1 fsspec-2023.10.0 huggingface-hub-0.20.3 mpmath-1.3.0 multiprocess-0.70.15 networkx-3.2.1 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.19.3 nvidia-nvjitlink-cu12-12.3.101 nvidia-nvtx-cu12-12.1.105 pandas-2.2.0 peft-0.8.2 pyarrow-15.0.0 pyarrow-hotfix-0.6 pytz-2024.1 regex-2023.12.25 safetensors-0.4.2 scipy-1.12.0 sympy-1.12 tokenizers-0.15.1 torch-2.2.0 tqdm-4.66.1 transformers-4.37.2 triton-2.2.0 tzdata-2023.4 xxhash-3.4.1\n"
|
186 |
+
]
|
187 |
+
}
|
188 |
+
],
|
189 |
+
"source": [
|
190 |
+
"!pip install accelerate transformers einops datasets peft bitsandbytes"
|
191 |
+
]
|
192 |
+
},
|
193 |
+
{
|
194 |
+
"cell_type": "code",
|
195 |
+
"execution_count": 2,
|
196 |
+
"id": "46a53303-b585-4b02-956f-4af173410e25",
|
197 |
+
"metadata": {},
|
198 |
+
"outputs": [
|
199 |
+
{
|
200 |
+
"name": "stderr",
|
201 |
+
"output_type": "stream",
|
202 |
+
"text": [
|
203 |
+
"/usr/local/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
|
204 |
+
" from .autonotebook import tqdm as notebook_tqdm\n"
|
205 |
+
]
|
206 |
+
}
|
207 |
+
],
|
208 |
+
"source": [
|
209 |
+
"import torch\n",
|
210 |
+
"from datasets import load_dataset, Dataset\n",
|
211 |
+
"from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, Trainer, DataCollatorForLanguageModeling, BitsAndBytesConfig\n",
|
212 |
+
"from peft import LoraConfig, get_peft_model\n",
|
213 |
+
"import os"
|
214 |
+
]
|
215 |
+
},
|
216 |
+
{
|
217 |
+
"cell_type": "code",
|
218 |
+
"execution_count": 3,
|
219 |
+
"id": "ffa3ee11-3929-4032-8758-322cda3a912e",
|
220 |
+
"metadata": {},
|
221 |
+
"outputs": [
|
222 |
+
{
|
223 |
+
"name": "stderr",
|
224 |
+
"output_type": "stream",
|
225 |
+
"text": [
|
226 |
+
"tokenizer_config.json: 100%|██████████| 7.34k/7.34k [00:00<00:00, 13.7MB/s]\n",
|
227 |
+
"vocab.json: 100%|██████████| 798k/798k [00:00<00:00, 17.5MB/s]\n",
|
228 |
+
"merges.txt: 100%|██████████| 456k/456k [00:00<00:00, 43.7MB/s]\n",
|
229 |
+
"tokenizer.json: 100%|██████████| 2.11M/2.11M [00:00<00:00, 16.5MB/s]\n",
|
230 |
+
"added_tokens.json: 100%|██████████| 1.08k/1.08k [00:00<00:00, 2.35MB/s]\n",
|
231 |
+
"special_tokens_map.json: 100%|██████████| 99.0/99.0 [00:00<00:00, 269kB/s]\n",
|
232 |
+
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
|
233 |
+
]
|
234 |
+
}
|
235 |
+
],
|
236 |
+
"source": [
|
237 |
+
"tokenizer = AutoTokenizer.from_pretrained(\"microsoft/phi-2\", trust_remote_code=True)\n",
|
238 |
+
"tokenizer.pad_token = tokenizer.eos_token"
|
239 |
+
]
|
240 |
+
},
|
241 |
+
{
|
242 |
+
"cell_type": "code",
|
243 |
+
"execution_count": 4,
|
244 |
+
"id": "b17096e6-c633-4d88-8cfc-fb738c1e4ca0",
|
245 |
+
"metadata": {
|
246 |
+
"scrolled": true
|
247 |
+
},
|
248 |
+
"outputs": [
|
249 |
+
{
|
250 |
+
"name": "stderr",
|
251 |
+
"output_type": "stream",
|
252 |
+
"text": [
|
253 |
+
"config.json: 100%|██████████| 863/863 [00:00<00:00, 2.00MB/s]\n",
|
254 |
+
"configuration_phi.py: 100%|██████████| 9.26k/9.26k [00:00<00:00, 11.4MB/s]\n",
|
255 |
+
"A new version of the following files was downloaded from https://huggingface.co/microsoft/phi-2:\n",
|
256 |
+
"- configuration_phi.py\n",
|
257 |
+
". Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.\n",
|
258 |
+
"modeling_phi.py: 100%|██████████| 62.7k/62.7k [00:00<00:00, 48.8MB/s]\n",
|
259 |
+
"A new version of the following files was downloaded from https://huggingface.co/microsoft/phi-2:\n",
|
260 |
+
"- modeling_phi.py\n",
|
261 |
+
". Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.\n",
|
262 |
+
"model.safetensors.index.json: 100%|██████████| 35.7k/35.7k [00:00<00:00, 33.7MB/s]\n",
|
263 |
+
"Downloading shards: 0%| | 0/2 [00:00<?, ?it/s]\n",
|
264 |
+
"model-00001-of-00002.safetensors: 0%| | 0.00/5.00G [00:00<?, ?B/s]\u001b[A\n",
|
265 |
+
"model-00001-of-00002.safetensors: 0%| | 10.5M/5.00G [00:00<00:55, 90.4MB/s]\u001b[A\n",
|
266 |
+
"model-00001-of-00002.safetensors: 1%| | 31.5M/5.00G [00:00<00:41, 119MB/s] \u001b[A\n",
|
267 |
+
"model-00001-of-00002.safetensors: 1%| | 52.4M/5.00G [00:00<00:37, 133MB/s]\u001b[A\n",
|
268 |
+
"model-00001-of-00002.safetensors: 1%|▏ | 73.4M/5.00G [00:00<00:35, 140MB/s]\u001b[A\n",
|
269 |
+
"model-00001-of-00002.safetensors: 2%|▏ | 94.4M/5.00G [00:00<00:34, 143MB/s]\u001b[A\n",
|
270 |
+
"model-00001-of-00002.safetensors: 2%|▏ | 115M/5.00G [00:00<00:33, 146MB/s] \u001b[A\n",
|
271 |
+
"model-00001-of-00002.safetensors: 3%|▎ | 136M/5.00G [00:00<00:34, 142MB/s]\u001b[A\n",
|
272 |
+
"model-00001-of-00002.safetensors: 3%|▎ | 157M/5.00G [00:01<00:35, 135MB/s]\u001b[A\n",
|
273 |
+
"model-00001-of-00002.safetensors: 4%|▎ | 178M/5.00G [00:01<00:35, 136MB/s]\u001b[A\n",
|
274 |
+
"model-00001-of-00002.safetensors: 4%|▍ | 199M/5.00G [00:01<00:35, 135MB/s]\u001b[A\n",
|
275 |
+
"model-00001-of-00002.safetensors: 4%|▍ | 220M/5.00G [00:01<00:35, 136MB/s]\u001b[A\n",
|
276 |
+
"model-00001-of-00002.safetensors: 5%|▍ | 241M/5.00G [00:01<00:34, 136MB/s]\u001b[A\n",
|
277 |
+
"model-00001-of-00002.safetensors: 5%|▌ | 262M/5.00G [00:01<00:34, 135MB/s]\u001b[A\n",
|
278 |
+
"model-00001-of-00002.safetensors: 6%|▌ | 283M/5.00G [00:02<00:37, 124MB/s]\u001b[A\n",
|
279 |
+
"model-00001-of-00002.safetensors: 6%|▌ | 304M/5.00G [00:02<00:37, 127MB/s]\u001b[A\n",
|
280 |
+
"model-00001-of-00002.safetensors: 7%|▋ | 325M/5.00G [00:02<00:36, 129MB/s]\u001b[A\n",
|
281 |
+
"model-00001-of-00002.safetensors: 7%|▋ | 346M/5.00G [00:02<00:35, 133MB/s]\u001b[A\n",
|
282 |
+
"model-00001-of-00002.safetensors: 7%|▋ | 367M/5.00G [00:02<00:34, 135MB/s]\u001b[A\n",
|
283 |
+
"model-00001-of-00002.safetensors: 8%|▊ | 388M/5.00G [00:02<00:33, 139MB/s]\u001b[A\n",
|
284 |
+
"model-00001-of-00002.safetensors: 8%|▊ | 409M/5.00G [00:03<00:32, 141MB/s]\u001b[A\n",
|
285 |
+
"model-00001-of-00002.safetensors: 9%|▊ | 430M/5.00G [00:03<00:32, 139MB/s]\u001b[A\n",
|
286 |
+
"model-00001-of-00002.safetensors: 9%|▉ | 451M/5.00G [00:03<00:32, 138MB/s]\u001b[A\n",
|
287 |
+
"model-00001-of-00002.safetensors: 9%|▉ | 472M/5.00G [00:03<00:33, 136MB/s]\u001b[A\n",
|
288 |
+
"model-00001-of-00002.safetensors: 10%|▉ | 493M/5.00G [00:03<00:32, 138MB/s]\u001b[A\n",
|
289 |
+
"model-00001-of-00002.safetensors: 10%|█ | 514M/5.00G [00:03<00:31, 140MB/s]\u001b[A\n",
|
290 |
+
"model-00001-of-00002.safetensors: 11%|█ | 535M/5.00G [00:03<00:31, 140MB/s]\u001b[A\n",
|
291 |
+
"model-00001-of-00002.safetensors: 11%|█ | 556M/5.00G [00:04<00:31, 140MB/s]\u001b[A\n",
|
292 |
+
"model-00001-of-00002.safetensors: 12%|█▏ | 577M/5.00G [00:04<00:31, 138MB/s]\u001b[A\n",
|
293 |
+
"model-00001-of-00002.safetensors: 12%|█▏ | 598M/5.00G [00:04<00:31, 137MB/s]\u001b[A\n",
|
294 |
+
"model-00001-of-00002.safetensors: 12%|█▏ | 619M/5.00G [00:04<00:31, 139MB/s]\u001b[A\n",
|
295 |
+
"model-00001-of-00002.safetensors: 13%|█▎ | 640M/5.00G [00:04<00:32, 136MB/s]\u001b[A\n",
|
296 |
+
"model-00001-of-00002.safetensors: 13%|█▎ | 661M/5.00G [00:04<00:31, 139MB/s]\u001b[A\n",
|
297 |
+
"model-00001-of-00002.safetensors: 14%|█▎ | 682M/5.00G [00:05<00:31, 138MB/s]\u001b[A\n",
|
298 |
+
"model-00001-of-00002.safetensors: 14%|█▍ | 703M/5.00G [00:05<00:32, 131MB/s]\u001b[A\n",
|
299 |
+
"model-00001-of-00002.safetensors: 14%|█▍ | 724M/5.00G [00:05<00:32, 132MB/s]\u001b[A\n",
|
300 |
+
"model-00001-of-00002.safetensors: 15%|█▍ | 744M/5.00G [00:05<00:31, 135MB/s]\u001b[A\n",
|
301 |
+
"model-00001-of-00002.safetensors: 15%|█▌ | 765M/5.00G [00:05<00:31, 136MB/s]\u001b[A\n",
|
302 |
+
"model-00001-of-00002.safetensors: 16%|█▌ | 786M/5.00G [00:05<00:31, 133MB/s]\u001b[A\n",
|
303 |
+
"model-00001-of-00002.safetensors: 16%|█▌ | 807M/5.00G [00:05<00:31, 135MB/s]\u001b[A\n",
|
304 |
+
"model-00001-of-00002.safetensors: 17%|█▋ | 828M/5.00G [00:06<00:30, 138MB/s]\u001b[A\n",
|
305 |
+
"model-00001-of-00002.safetensors: 17%|█▋ | 849M/5.00G [00:06<00:31, 133MB/s]\u001b[A\n",
|
306 |
+
"model-00001-of-00002.safetensors: 17%|█▋ | 870M/5.00G [00:06<00:30, 136MB/s]\u001b[A\n",
|
307 |
+
"model-00001-of-00002.safetensors: 18%|█▊ | 891M/5.00G [00:06<00:29, 138MB/s]\u001b[A\n",
|
308 |
+
"model-00001-of-00002.safetensors: 18%|█▊ | 912M/5.00G [00:06<00:29, 139MB/s]\u001b[A\n",
|
309 |
+
"model-00001-of-00002.safetensors: 19%|█▊ | 933M/5.00G [00:06<00:28, 141MB/s]\u001b[A\n",
|
310 |
+
"model-00001-of-00002.safetensors: 19%|█▉ | 954M/5.00G [00:07<00:28, 140MB/s]\u001b[A\n",
|
311 |
+
"model-00001-of-00002.safetensors: 20%|█▉ | 975M/5.00G [00:07<00:29, 136MB/s]\u001b[A\n",
|
312 |
+
"model-00001-of-00002.safetensors: 20%|█▉ | 996M/5.00G [00:07<00:29, 136MB/s]\u001b[A\n",
|
313 |
+
"model-00001-of-00002.safetensors: 20%|██ | 1.02G/5.00G [00:07<00:28, 139MB/s]\u001b[A\n",
|
314 |
+
"model-00001-of-00002.safetensors: 21%|██ | 1.04G/5.00G [00:07<00:29, 134MB/s]\u001b[A\n",
|
315 |
+
"model-00001-of-00002.safetensors: 21%|██ | 1.06G/5.00G [00:07<00:29, 135MB/s]\u001b[A\n",
|
316 |
+
"model-00001-of-00002.safetensors: 22%|██▏ | 1.08G/5.00G [00:07<00:29, 135MB/s]\u001b[A\n",
|
317 |
+
"model-00001-of-00002.safetensors: 22%|██▏ | 1.10G/5.00G [00:08<00:29, 132MB/s]\u001b[A\n",
|
318 |
+
"model-00001-of-00002.safetensors: 22%|██▏ | 1.12G/5.00G [00:08<00:30, 129MB/s]\u001b[A\n",
|
319 |
+
"model-00001-of-00002.safetensors: 23%|██▎ | 1.14G/5.00G [00:08<00:29, 133MB/s]\u001b[A\n",
|
320 |
+
"model-00001-of-00002.safetensors: 23%|██▎ | 1.16G/5.00G [00:08<00:29, 131MB/s]\u001b[A\n",
|
321 |
+
"model-00001-of-00002.safetensors: 24%|██▎ | 1.18G/5.00G [00:08<00:28, 133MB/s]\u001b[A\n",
|
322 |
+
"model-00001-of-00002.safetensors: 24%|██▍ | 1.21G/5.00G [00:08<00:27, 136MB/s]\u001b[A\n",
|
323 |
+
"model-00001-of-00002.safetensors: 25%|██▍ | 1.23G/5.00G [00:09<00:27, 137MB/s]\u001b[A\n",
|
324 |
+
"model-00001-of-00002.safetensors: 25%|██▍ | 1.25G/5.00G [00:09<00:27, 136MB/s]\u001b[A\n",
|
325 |
+
"model-00001-of-00002.safetensors: 25%|██▌ | 1.27G/5.00G [00:09<00:27, 136MB/s]\u001b[A\n",
|
326 |
+
"model-00001-of-00002.safetensors: 26%|██▌ | 1.29G/5.00G [00:09<00:26, 138MB/s]\u001b[A\n",
|
327 |
+
"model-00001-of-00002.safetensors: 26%|██▌ | 1.31G/5.00G [00:09<00:27, 136MB/s]\u001b[A\n",
|
328 |
+
"model-00001-of-00002.safetensors: 27%|██▋ | 1.33G/5.00G [00:09<00:26, 137MB/s]\u001b[A\n",
|
329 |
+
"model-00001-of-00002.safetensors: 27%|██▋ | 1.35G/5.00G [00:09<00:26, 135MB/s]\u001b[A\n",
|
330 |
+
"model-00001-of-00002.safetensors: 27%|██▋ | 1.37G/5.00G [00:10<00:26, 135MB/s]\u001b[A\n",
|
331 |
+
"model-00001-of-00002.safetensors: 28%|██▊ | 1.39G/5.00G [00:10<00:29, 124MB/s]\u001b[A\n",
|
332 |
+
"model-00001-of-00002.safetensors: 28%|██▊ | 1.42G/5.00G [00:10<00:28, 124MB/s]\u001b[A\n",
|
333 |
+
"model-00001-of-00002.safetensors: 29%|██▉ | 1.44G/5.00G [00:10<00:27, 130MB/s]\u001b[A\n",
|
334 |
+
"model-00001-of-00002.safetensors: 29%|██▉ | 1.46G/5.00G [00:10<00:26, 133MB/s]\u001b[A\n",
|
335 |
+
"model-00001-of-00002.safetensors: 30%|██▉ | 1.48G/5.00G [00:10<00:26, 134MB/s]\u001b[A\n",
|
336 |
+
"model-00001-of-00002.safetensors: 30%|███ | 1.50G/5.00G [00:11<00:25, 136MB/s]\u001b[A\n",
|
337 |
+
"model-00001-of-00002.safetensors: 30%|███ | 1.52G/5.00G [00:11<00:25, 138MB/s]\u001b[A\n",
|
338 |
+
"model-00001-of-00002.safetensors: 31%|███ | 1.54G/5.00G [00:11<00:25, 135MB/s]\u001b[A\n",
|
339 |
+
"model-00001-of-00002.safetensors: 31%|███▏ | 1.56G/5.00G [00:11<00:25, 137MB/s]\u001b[A\n",
|
340 |
+
"model-00001-of-00002.safetensors: 32%|███▏ | 1.58G/5.00G [00:11<00:24, 141MB/s]\u001b[A\n",
|
341 |
+
"model-00001-of-00002.safetensors: 32%|███▏ | 1.60G/5.00G [00:11<00:23, 142MB/s]\u001b[A\n",
|
342 |
+
"model-00001-of-00002.safetensors: 33%|███▎ | 1.63G/5.00G [00:11<00:23, 142MB/s]\u001b[A\n",
|
343 |
+
"model-00001-of-00002.safetensors: 33%|███▎ | 1.65G/5.00G [00:12<00:34, 97.8MB/s]\u001b[A\n",
|
344 |
+
"model-00001-of-00002.safetensors: 33%|███▎ | 1.67G/5.00G [00:12<00:31, 107MB/s] \u001b[A\n",
|
345 |
+
"model-00001-of-00002.safetensors: 34%|███▍ | 1.69G/5.00G [00:12<00:28, 114MB/s]\u001b[A\n",
|
346 |
+
"model-00001-of-00002.safetensors: 34%|███▍ | 1.71G/5.00G [00:12<00:27, 120MB/s]\u001b[A\n",
|
347 |
+
"model-00001-of-00002.safetensors: 35%|███▍ | 1.73G/5.00G [00:12<00:26, 124MB/s]\u001b[A\n",
|
348 |
+
"model-00001-of-00002.safetensors: 35%|███▌ | 1.75G/5.00G [00:13<00:26, 125MB/s]\u001b[A\n",
|
349 |
+
"model-00001-of-00002.safetensors: 35%|███▌ | 1.77G/5.00G [00:13<00:25, 127MB/s]\u001b[A\n",
|
350 |
+
"model-00001-of-00002.safetensors: 36%|███▌ | 1.79G/5.00G [00:13<00:25, 126MB/s]\u001b[A\n",
|
351 |
+
"model-00001-of-00002.safetensors: 36%|███▋ | 1.81G/5.00G [00:13<00:25, 124MB/s]\u001b[A\n",
|
352 |
+
"model-00001-of-00002.safetensors: 37%|███▋ | 1.84G/5.00G [00:13<00:24, 128MB/s]\u001b[A\n",
|
353 |
+
"model-00001-of-00002.safetensors: 37%|███▋ | 1.86G/5.00G [00:13<00:24, 129MB/s]\u001b[A\n",
|
354 |
+
"model-00001-of-00002.safetensors: 38%|███▊ | 1.88G/5.00G [00:14<00:23, 132MB/s]\u001b[A\n",
|
355 |
+
"model-00001-of-00002.safetensors: 38%|███▊ | 1.90G/5.00G [00:14<00:22, 135MB/s]\u001b[A\n",
|
356 |
+
"model-00001-of-00002.safetensors: 38%|███▊ | 1.92G/5.00G [00:14<00:23, 134MB/s]\u001b[A\n",
|
357 |
+
"model-00001-of-00002.safetensors: 39%|███▉ | 1.94G/5.00G [00:14<00:22, 135MB/s]\u001b[A\n",
|
358 |
+
"model-00001-of-00002.safetensors: 39%|███▉ | 1.96G/5.00G [00:14<00:22, 136MB/s]\u001b[A\n",
|
359 |
+
"model-00001-of-00002.safetensors: 40%|███▉ | 1.98G/5.00G [00:14<00:22, 132MB/s]\u001b[A\n",
|
360 |
+
"model-00001-of-00002.safetensors: 40%|████ | 2.00G/5.00G [00:15<00:22, 134MB/s]\u001b[A\n",
|
361 |
+
"model-00001-of-00002.safetensors: 41%|████ | 2.02G/5.00G [00:15<00:22, 132MB/s]\u001b[A\n",
|
362 |
+
"model-00001-of-00002.safetensors: 41%|████ | 2.04G/5.00G [00:15<00:22, 133MB/s]\u001b[A\n",
|
363 |
+
"model-00001-of-00002.safetensors: 41%|████▏ | 2.07G/5.00G [00:15<00:22, 133MB/s]\u001b[A\n",
|
364 |
+
"model-00001-of-00002.safetensors: 42%|████▏ | 2.09G/5.00G [00:15<00:22, 130MB/s]\u001b[A\n",
|
365 |
+
"model-00001-of-00002.safetensors: 42%|████▏ | 2.11G/5.00G [00:15<00:21, 132MB/s]\u001b[A\n",
|
366 |
+
"model-00001-of-00002.safetensors: 43%|████▎ | 2.13G/5.00G [00:15<00:21, 135MB/s]\u001b[A\n",
|
367 |
+
"model-00001-of-00002.safetensors: 43%|████▎ | 2.15G/5.00G [00:16<00:20, 136MB/s]\u001b[A\n",
|
368 |
+
"model-00001-of-00002.safetensors: 43%|████▎ | 2.17G/5.00G [00:16<00:20, 138MB/s]\u001b[A\n",
|
369 |
+
"model-00001-of-00002.safetensors: 44%|████▍ | 2.19G/5.00G [00:16<00:20, 137MB/s]\u001b[A\n",
|
370 |
+
"model-00001-of-00002.safetensors: 44%|████▍ | 2.21G/5.00G [00:16<00:20, 134MB/s]\u001b[A\n",
|
371 |
+
"model-00001-of-00002.safetensors: 45%|████▍ | 2.23G/5.00G [00:16<00:20, 135MB/s]\u001b[A\n",
|
372 |
+
"model-00001-of-00002.safetensors: 45%|████▌ | 2.25G/5.00G [00:16<00:19, 138MB/s]\u001b[A\n",
|
373 |
+
"model-00001-of-00002.safetensors: 46%|████▌ | 2.28G/5.00G [00:17<00:19, 139MB/s]\u001b[A\n",
|
374 |
+
"model-00001-of-00002.safetensors: 46%|████▌ | 2.30G/5.00G [00:17<00:19, 139MB/s]\u001b[A\n",
|
375 |
+
"model-00001-of-00002.safetensors: 46%|████▋ | 2.32G/5.00G [00:17<00:19, 137MB/s]\u001b[A\n",
|
376 |
+
"model-00001-of-00002.safetensors: 47%|████▋ | 2.34G/5.00G [00:17<00:20, 131MB/s]\u001b[A\n",
|
377 |
+
"model-00001-of-00002.safetensors: 47%|████▋ | 2.36G/5.00G [00:17<00:19, 134MB/s]\u001b[A\n",
|
378 |
+
"model-00001-of-00002.safetensors: 48%|████▊ | 2.38G/5.00G [00:17<00:20, 130MB/s]\u001b[A\n",
|
379 |
+
"model-00001-of-00002.safetensors: 48%|████▊ | 2.40G/5.00G [00:18<00:20, 128MB/s]\u001b[A\n",
|
380 |
+
"model-00001-of-00002.safetensors: 48%|████▊ | 2.42G/5.00G [00:18<00:19, 129MB/s]\u001b[A\n",
|
381 |
+
"model-00001-of-00002.safetensors: 49%|████▉ | 2.44G/5.00G [00:18<00:19, 128MB/s]\u001b[A\n",
|
382 |
+
"model-00001-of-00002.safetensors: 49%|████▉ | 2.46G/5.00G [00:18<00:19, 131MB/s]\u001b[A\n",
|
383 |
+
"model-00001-of-00002.safetensors: 50%|████▉ | 2.49G/5.00G [00:18<00:18, 133MB/s]\u001b[A\n",
|
384 |
+
"model-00001-of-00002.safetensors: 50%|█████ | 2.51G/5.00G [00:18<00:18, 131MB/s]\u001b[A\n",
|
385 |
+
"model-00001-of-00002.safetensors: 51%|█████ | 2.53G/5.00G [00:18<00:18, 135MB/s]\u001b[A\n",
|
386 |
+
"model-00001-of-00002.safetensors: 51%|█████ | 2.55G/5.00G [00:19<00:17, 136MB/s]\u001b[A\n",
|
387 |
+
"model-00001-of-00002.safetensors: 51%|█████▏ | 2.57G/5.00G [00:19<00:18, 134MB/s]\u001b[A\n",
|
388 |
+
"model-00001-of-00002.safetensors: 52%|█████▏ | 2.59G/5.00G [00:19<00:17, 135MB/s]\u001b[A\n",
|
389 |
+
"model-00001-of-00002.safetensors: 52%|█████▏ | 2.61G/5.00G [00:19<00:20, 116MB/s]\u001b[A\n",
|
390 |
+
"model-00001-of-00002.safetensors: 53%|█████▎ | 2.63G/5.00G [00:19<00:20, 117MB/s]\u001b[A\n",
|
391 |
+
"model-00001-of-00002.safetensors: 53%|█████▎ | 2.65G/5.00G [00:19<00:19, 122MB/s]\u001b[A\n",
|
392 |
+
"model-00001-of-00002.safetensors: 54%|█████▎ | 2.67G/5.00G [00:20<00:18, 127MB/s]\u001b[A\n",
|
393 |
+
"model-00001-of-00002.safetensors: 54%|█████▍ | 2.69G/5.00G [00:20<00:18, 126MB/s]\u001b[A\n",
|
394 |
+
"model-00001-of-00002.safetensors: 54%|█████▍ | 2.72G/5.00G [00:20<00:17, 129MB/s]\u001b[A\n",
|
395 |
+
"model-00001-of-00002.safetensors: 55%|█████▍ | 2.74G/5.00G [00:20<00:20, 109MB/s]\u001b[A\n",
|
396 |
+
"model-00001-of-00002.safetensors: 55%|█████▌ | 2.76G/5.00G [00:20<00:19, 113MB/s]\u001b[A\n",
|
397 |
+
"model-00001-of-00002.safetensors: 56%|█████▌ | 2.78G/5.00G [00:21<00:18, 120MB/s]\u001b[A\n",
|
398 |
+
"model-00001-of-00002.safetensors: 56%|█████▌ | 2.80G/5.00G [00:21<00:17, 124MB/s]\u001b[A\n",
|
399 |
+
"model-00001-of-00002.safetensors: 56%|█████▋ | 2.82G/5.00G [00:21<00:17, 128MB/s]\u001b[A\n",
|
400 |
+
"model-00001-of-00002.safetensors: 57%|█████▋ | 2.84G/5.00G [00:21<00:16, 127MB/s]\u001b[A\n",
|
401 |
+
"model-00001-of-00002.safetensors: 57%|█████▋ | 2.86G/5.00G [00:21<00:21, 97.7MB/s]\u001b[A\n",
|
402 |
+
"model-00001-of-00002.safetensors: 58%|█████▊ | 2.88G/5.00G [00:22<00:19, 107MB/s] \u001b[A\n",
|
403 |
+
"model-00001-of-00002.safetensors: 58%|█████▊ | 2.90G/5.00G [00:22<00:18, 116MB/s]\u001b[A\n",
|
404 |
+
"model-00001-of-00002.safetensors: 59%|█████▊ | 2.93G/5.00G [00:22<00:16, 122MB/s]\u001b[A\n",
|
405 |
+
"model-00001-of-00002.safetensors: 59%|█████▉ | 2.95G/5.00G [00:22<00:16, 122MB/s]\u001b[A\n",
|
406 |
+
"model-00001-of-00002.safetensors: 59%|█████▉ | 2.97G/5.00G [00:22<00:16, 120MB/s]\u001b[A\n",
|
407 |
+
"model-00001-of-00002.safetensors: 60%|█████▉ | 2.99G/5.00G [00:22<00:16, 125MB/s]\u001b[A\n",
|
408 |
+
"model-00001-of-00002.safetensors: 60%|██████ | 3.01G/5.00G [00:22<00:15, 126MB/s]\u001b[A\n",
|
409 |
+
"model-00001-of-00002.safetensors: 61%|██████ | 3.03G/5.00G [00:23<00:15, 128MB/s]\u001b[A\n",
|
410 |
+
"model-00001-of-00002.safetensors: 61%|██████ | 3.05G/5.00G [00:23<00:14, 130MB/s]\u001b[A\n",
|
411 |
+
"model-00001-of-00002.safetensors: 62%|██████▏ | 3.07G/5.00G [00:23<00:14, 129MB/s]\u001b[A\n",
|
412 |
+
"model-00001-of-00002.safetensors: 62%|██████▏ | 3.09G/5.00G [00:23<00:15, 126MB/s]\u001b[A\n",
|
413 |
+
"model-00001-of-00002.safetensors: 62%|██████▏ | 3.11G/5.00G [00:23<00:14, 131MB/s]\u001b[A\n",
|
414 |
+
"model-00001-of-00002.safetensors: 63%|██████▎ | 3.14G/5.00G [00:23<00:14, 125MB/s]\u001b[A\n",
|
415 |
+
"model-00001-of-00002.safetensors: 63%|██████▎ | 3.16G/5.00G [00:24<00:14, 128MB/s]\u001b[A\n",
|
416 |
+
"model-00001-of-00002.safetensors: 64%|██████▎ | 3.18G/5.00G [00:24<00:13, 131MB/s]\u001b[A\n",
|
417 |
+
"model-00001-of-00002.safetensors: 64%|██████▍ | 3.20G/5.00G [00:24<00:13, 130MB/s]\u001b[A\n",
|
418 |
+
"model-00001-of-00002.safetensors: 64%|██████▍ | 3.22G/5.00G [00:24<00:13, 130MB/s]\u001b[A\n",
|
419 |
+
"model-00001-of-00002.safetensors: 65%|██████▍ | 3.24G/5.00G [00:24<00:13, 132MB/s]\u001b[A\n",
|
420 |
+
"model-00001-of-00002.safetensors: 65%|██████▌ | 3.26G/5.00G [00:24<00:13, 129MB/s]\u001b[A\n",
|
421 |
+
"model-00001-of-00002.safetensors: 66%|██████▌ | 3.28G/5.00G [00:25<00:12, 132MB/s]\u001b[A\n",
|
422 |
+
"model-00001-of-00002.safetensors: 66%|██████▌ | 3.30G/5.00G [00:25<00:12, 133MB/s]\u001b[A\n",
|
423 |
+
"model-00001-of-00002.safetensors: 67%|██████▋ | 3.32G/5.00G [00:25<00:12, 130MB/s]\u001b[A\n",
|
424 |
+
"model-00001-of-00002.safetensors: 67%|██████▋ | 3.34G/5.00G [00:25<00:12, 130MB/s]\u001b[A\n",
|
425 |
+
"model-00001-of-00002.safetensors: 67%|██████▋ | 3.37G/5.00G [00:25<00:12, 132MB/s]\u001b[A\n",
|
426 |
+
"model-00001-of-00002.safetensors: 68%|██████▊ | 3.39G/5.00G [00:25<00:12, 130MB/s]\u001b[A\n",
|
427 |
+
"model-00001-of-00002.safetensors: 68%|██████▊ | 3.41G/5.00G [00:26<00:12, 132MB/s]\u001b[A\n",
|
428 |
+
"model-00001-of-00002.safetensors: 69%|██████▊ | 3.43G/5.00G [00:26<00:11, 133MB/s]\u001b[A\n",
|
429 |
+
"model-00001-of-00002.safetensors: 69%|██████▉ | 3.45G/5.00G [00:26<00:11, 132MB/s]\u001b[A\n",
|
430 |
+
"model-00001-of-00002.safetensors: 69%|██████▉ | 3.47G/5.00G [00:26<00:11, 132MB/s]\u001b[A\n",
|
431 |
+
"model-00001-of-00002.safetensors: 70%|██████▉ | 3.49G/5.00G [00:26<00:11, 130MB/s]\u001b[A\n",
|
432 |
+
"model-00001-of-00002.safetensors: 70%|███████ | 3.51G/5.00G [00:26<00:11, 129MB/s]\u001b[A\n",
|
433 |
+
"model-00001-of-00002.safetensors: 71%|███████ | 3.53G/5.00G [00:26<00:11, 131MB/s]\u001b[A\n",
|
434 |
+
"model-00001-of-00002.safetensors: 71%|███████ | 3.55G/5.00G [00:27<00:10, 135MB/s]\u001b[A\n",
|
435 |
+
"model-00001-of-00002.safetensors: 72%|███████▏ | 3.58G/5.00G [00:27<00:10, 133MB/s]\u001b[A\n",
|
436 |
+
"model-00001-of-00002.safetensors: 72%|███████▏ | 3.60G/5.00G [00:27<00:10, 132MB/s]\u001b[A\n",
|
437 |
+
"model-00001-of-00002.safetensors: 72%|███████▏ | 3.62G/5.00G [00:27<00:10, 130MB/s]\u001b[A\n",
|
438 |
+
"model-00001-of-00002.safetensors: 73%|███████▎ | 3.64G/5.00G [00:27<00:10, 124MB/s]\u001b[A\n",
|
439 |
+
"model-00001-of-00002.safetensors: 73%|███████▎ | 3.66G/5.00G [00:27<00:11, 121MB/s]\u001b[A\n",
|
440 |
+
"model-00001-of-00002.safetensors: 74%|███████▎ | 3.68G/5.00G [00:28<00:10, 125MB/s]\u001b[A\n",
|
441 |
+
"model-00001-of-00002.safetensors: 74%|███████▍ | 3.70G/5.00G [00:28<00:09, 130MB/s]\u001b[A\n",
|
442 |
+
"model-00001-of-00002.safetensors: 75%|███████▍ | 3.72G/5.00G [00:28<00:09, 133MB/s]\u001b[A\n",
|
443 |
+
"model-00001-of-00002.safetensors: 75%|███████▍ | 3.74G/5.00G [00:28<00:10, 125MB/s]\u001b[A\n",
|
444 |
+
"model-00001-of-00002.safetensors: 75%|███████▌ | 3.76G/5.00G [00:28<00:09, 125MB/s]\u001b[A\n",
|
445 |
+
"model-00001-of-00002.safetensors: 76%|███████▌ | 3.79G/5.00G [00:28<00:09, 126MB/s]\u001b[A\n",
|
446 |
+
"model-00001-of-00002.safetensors: 76%|███████▌ | 3.81G/5.00G [00:29<00:09, 122MB/s]\u001b[A\n",
|
447 |
+
"model-00001-of-00002.safetensors: 77%|███████▋ | 3.83G/5.00G [00:29<00:09, 130MB/s]\u001b[A\n",
|
448 |
+
"model-00001-of-00002.safetensors: 77%|███████▋ | 3.85G/5.00G [00:29<00:08, 132MB/s]\u001b[A\n",
|
449 |
+
"model-00001-of-00002.safetensors: 77%|███████▋ | 3.87G/5.00G [00:29<00:12, 88.9MB/s]\u001b[A\n",
|
450 |
+
"model-00001-of-00002.safetensors: 78%|███████▊ | 3.89G/5.00G [00:30<00:11, 98.1MB/s]\u001b[A\n",
|
451 |
+
"model-00001-of-00002.safetensors: 78%|███████▊ | 3.91G/5.00G [00:30<00:10, 105MB/s] \u001b[A\n",
|
452 |
+
"model-00001-of-00002.safetensors: 79%|███████▊ | 3.93G/5.00G [00:30<00:09, 112MB/s]\u001b[A\n",
|
453 |
+
"model-00001-of-00002.safetensors: 79%|███████▉ | 3.95G/5.00G [00:30<00:08, 119MB/s]\u001b[A\n",
|
454 |
+
"model-00001-of-00002.safetensors: 80%|███████▉ | 3.97G/5.00G [00:30<00:08, 122MB/s]\u001b[A\n",
|
455 |
+
"model-00001-of-00002.safetensors: 80%|███████▉ | 4.00G/5.00G [00:30<00:08, 115MB/s]\u001b[A\n",
|
456 |
+
"model-00001-of-00002.safetensors: 80%|████████ | 4.02G/5.00G [00:31<00:08, 114MB/s]\u001b[A\n",
|
457 |
+
"model-00001-of-00002.safetensors: 81%|████████ | 4.04G/5.00G [00:31<00:08, 116MB/s]\u001b[A\n",
|
458 |
+
"model-00001-of-00002.safetensors: 81%|████████ | 4.06G/5.00G [00:31<00:08, 117MB/s]\u001b[A\n",
|
459 |
+
"model-00001-of-00002.safetensors: 82%|████████▏ | 4.08G/5.00G [00:31<00:07, 120MB/s]\u001b[A\n",
|
460 |
+
"model-00001-of-00002.safetensors: 82%|████████▏ | 4.10G/5.00G [00:31<00:07, 122MB/s]\u001b[A\n",
|
461 |
+
"model-00001-of-00002.safetensors: 82%|████████▏ | 4.12G/5.00G [00:31<00:07, 118MB/s]\u001b[A\n",
|
462 |
+
"model-00001-of-00002.safetensors: 83%|████████▎ | 4.14G/5.00G [00:32<00:07, 119MB/s]\u001b[A\n",
|
463 |
+
"model-00001-of-00002.safetensors: 83%|████████▎ | 4.16G/5.00G [00:32<00:06, 120MB/s]\u001b[A\n",
|
464 |
+
"model-00001-of-00002.safetensors: 84%|████████▍ | 4.18G/5.00G [00:32<00:06, 119MB/s]\u001b[A\n",
|
465 |
+
"model-00001-of-00002.safetensors: 84%|████████▍ | 4.20G/5.00G [00:32<00:06, 121MB/s]\u001b[A\n",
|
466 |
+
"model-00001-of-00002.safetensors: 85%|████████▍ | 4.23G/5.00G [00:32<00:06, 122MB/s]\u001b[A\n",
|
467 |
+
"model-00001-of-00002.safetensors: 85%|████████▌ | 4.25G/5.00G [00:32<00:06, 123MB/s]\u001b[A\n",
|
468 |
+
"model-00001-of-00002.safetensors: 85%|████████▌ | 4.27G/5.00G [00:33<00:05, 129MB/s]\u001b[A\n",
|
469 |
+
"model-00001-of-00002.safetensors: 86%|████████▌ | 4.29G/5.00G [00:33<00:05, 132MB/s]\u001b[A\n",
|
470 |
+
"model-00001-of-00002.safetensors: 86%|████████▋ | 4.31G/5.00G [00:33<00:05, 131MB/s]\u001b[A\n",
|
471 |
+
"model-00001-of-00002.safetensors: 87%|████████▋ | 4.33G/5.00G [00:33<00:04, 135MB/s]\u001b[A\n",
|
472 |
+
"model-00001-of-00002.safetensors: 87%|████████▋ | 4.35G/5.00G [00:33<00:04, 134MB/s]\u001b[A\n",
|
473 |
+
"model-00001-of-00002.safetensors: 88%|████████▊ | 4.37G/5.00G [00:33<00:05, 125MB/s]\u001b[A\n",
|
474 |
+
"model-00001-of-00002.safetensors: 88%|████████▊ | 4.39G/5.00G [00:34<00:04, 128MB/s]\u001b[A\n",
|
475 |
+
"model-00001-of-00002.safetensors: 88%|████████▊ | 4.41G/5.00G [00:34<00:04, 130MB/s]\u001b[A\n",
|
476 |
+
"model-00001-of-00002.safetensors: 89%|████████▉ | 4.44G/5.00G [00:34<00:04, 129MB/s]\u001b[A\n",
|
477 |
+
"model-00001-of-00002.safetensors: 89%|████████▉ | 4.46G/5.00G [00:34<00:04, 132MB/s]\u001b[A\n",
|
478 |
+
"model-00001-of-00002.safetensors: 90%|████████▉ | 4.48G/5.00G [00:34<00:03, 136MB/s]\u001b[A\n",
|
479 |
+
"model-00001-of-00002.safetensors: 90%|█████████ | 4.50G/5.00G [00:34<00:03, 135MB/s]\u001b[A\n",
|
480 |
+
"model-00001-of-00002.safetensors: 90%|█████████ | 4.52G/5.00G [00:34<00:03, 138MB/s]\u001b[A\n",
|
481 |
+
"model-00001-of-00002.safetensors: 91%|█████████ | 4.54G/5.00G [00:35<00:03, 140MB/s]\u001b[A\n",
|
482 |
+
"model-00001-of-00002.safetensors: 91%|█████████▏| 4.56G/5.00G [00:35<00:03, 136MB/s]\u001b[A\n",
|
483 |
+
"model-00001-of-00002.safetensors: 92%|█████████▏| 4.58G/5.00G [00:35<00:03, 137MB/s]\u001b[A\n",
|
484 |
+
"model-00001-of-00002.safetensors: 92%|█████████▏| 4.60G/5.00G [00:35<00:02, 138MB/s]\u001b[A\n",
|
485 |
+
"model-00001-of-00002.safetensors: 93%|█████████▎| 4.62G/5.00G [00:35<00:02, 135MB/s]\u001b[A\n",
|
486 |
+
"model-00001-of-00002.safetensors: 93%|█████████▎| 4.65G/5.00G [00:35<00:02, 137MB/s]\u001b[A\n",
|
487 |
+
"model-00001-of-00002.safetensors: 93%|█████████▎| 4.67G/5.00G [00:36<00:02, 137MB/s]\u001b[A\n",
|
488 |
+
"model-00001-of-00002.safetensors: 94%|█████████▍| 4.69G/5.00G [00:36<00:02, 135MB/s]\u001b[A\n",
|
489 |
+
"model-00001-of-00002.safetensors: 94%|█████████▍| 4.71G/5.00G [00:36<00:02, 136MB/s]\u001b[A\n",
|
490 |
+
"model-00001-of-00002.safetensors: 95%|█████████▍| 4.73G/5.00G [00:36<00:01, 134MB/s]\u001b[A\n",
|
491 |
+
"model-00001-of-00002.safetensors: 95%|█████████▌| 4.75G/5.00G [00:36<00:01, 130MB/s]\u001b[A\n",
|
492 |
+
"model-00001-of-00002.safetensors: 96%|█████████▌| 4.77G/5.00G [00:36<00:01, 131MB/s]\u001b[A\n",
|
493 |
+
"model-00001-of-00002.safetensors: 96%|█████████▌| 4.79G/5.00G [00:37<00:01, 132MB/s]\u001b[A\n",
|
494 |
+
"model-00001-of-00002.safetensors: 96%|█████████▋| 4.81G/5.00G [00:37<00:01, 132MB/s]\u001b[A\n",
|
495 |
+
"model-00001-of-00002.safetensors: 97%|█████████▋| 4.83G/5.00G [00:37<00:01, 136MB/s]\u001b[A\n",
|
496 |
+
"model-00001-of-00002.safetensors: 97%|█████████▋| 4.85G/5.00G [00:37<00:01, 138MB/s]\u001b[A\n",
|
497 |
+
"model-00001-of-00002.safetensors: 98%|█████████▊| 4.88G/5.00G [00:37<00:00, 135MB/s]\u001b[A\n",
|
498 |
+
"model-00001-of-00002.safetensors: 98%|█████████▊| 4.90G/5.00G [00:37<00:00, 138MB/s]\u001b[A\n",
|
499 |
+
"model-00001-of-00002.safetensors: 98%|█████████▊| 4.92G/5.00G [00:37<00:00, 139MB/s]\u001b[A\n",
|
500 |
+
"model-00001-of-00002.safetensors: 99%|█████████▉| 4.94G/5.00G [00:38<00:00, 140MB/s]\u001b[A\n",
|
501 |
+
"model-00001-of-00002.safetensors: 99%|█████████▉| 4.96G/5.00G [00:38<00:00, 142MB/s]\u001b[A\n",
|
502 |
+
"model-00001-of-00002.safetensors: 100%|█████████▉| 4.98G/5.00G [00:38<00:00, 137MB/s]\u001b[A\n",
|
503 |
+
"model-00001-of-00002.safetensors: 100%|██████████| 5.00G/5.00G [00:38<00:00, 130MB/s]\u001b[A\n",
|
504 |
+
"Downloading shards: 50%|█████ | 1/2 [00:38<00:38, 38.64s/it]\n",
|
505 |
+
"model-00002-of-00002.safetensors: 0%| | 0.00/564M [00:00<?, ?B/s]\u001b[A\n",
|
506 |
+
"model-00002-of-00002.safetensors: 4%|▎ | 21.0M/564M [00:00<00:03, 150MB/s]\u001b[A\n",
|
507 |
+
"model-00002-of-00002.safetensors: 7%|▋ | 41.9M/564M [00:00<00:03, 143MB/s]\u001b[A\n",
|
508 |
+
"model-00002-of-00002.safetensors: 11%|█ | 62.9M/564M [00:00<00:03, 126MB/s]\u001b[A\n",
|
509 |
+
"model-00002-of-00002.safetensors: 15%|█▍ | 83.9M/564M [00:00<00:03, 130MB/s]\u001b[A\n",
|
510 |
+
"model-00002-of-00002.safetensors: 19%|█▊ | 105M/564M [00:00<00:03, 129MB/s] \u001b[A\n",
|
511 |
+
"model-00002-of-00002.safetensors: 22%|██▏ | 126M/564M [00:00<00:03, 133MB/s]\u001b[A\n",
|
512 |
+
"model-00002-of-00002.safetensors: 26%|██▌ | 147M/564M [00:01<00:03, 134MB/s]\u001b[A\n",
|
513 |
+
"model-00002-of-00002.safetensors: 30%|██▉ | 168M/564M [00:01<00:02, 135MB/s]\u001b[A\n",
|
514 |
+
"model-00002-of-00002.safetensors: 33%|███▎ | 189M/564M [00:01<00:02, 128MB/s]\u001b[A\n",
|
515 |
+
"model-00002-of-00002.safetensors: 37%|███▋ | 210M/564M [00:01<00:02, 131MB/s]\u001b[A\n",
|
516 |
+
"model-00002-of-00002.safetensors: 41%|████ | 231M/564M [00:01<00:02, 131MB/s]\u001b[A\n",
|
517 |
+
"model-00002-of-00002.safetensors: 45%|████▍ | 252M/564M [00:01<00:02, 131MB/s]\u001b[A\n",
|
518 |
+
"model-00002-of-00002.safetensors: 48%|████▊ | 273M/564M [00:02<00:02, 133MB/s]\u001b[A\n",
|
519 |
+
"model-00002-of-00002.safetensors: 52%|█████▏ | 294M/564M [00:02<00:02, 133MB/s]\u001b[A\n",
|
520 |
+
"model-00002-of-00002.safetensors: 56%|█████▌ | 315M/564M [00:02<00:01, 136MB/s]\u001b[A\n",
|
521 |
+
"model-00002-of-00002.safetensors: 60%|█████▉ | 336M/564M [00:02<00:01, 135MB/s]\u001b[A\n",
|
522 |
+
"model-00002-of-00002.safetensors: 63%|██████▎ | 357M/564M [00:02<00:01, 134MB/s]\u001b[A\n",
|
523 |
+
"model-00002-of-00002.safetensors: 67%|██████▋ | 377M/564M [00:02<00:01, 134MB/s]\u001b[A\n",
|
524 |
+
"model-00002-of-00002.safetensors: 71%|███████ | 398M/564M [00:02<00:01, 137MB/s]\u001b[A\n",
|
525 |
+
"model-00002-of-00002.safetensors: 74%|███████▍ | 419M/564M [00:03<00:01, 136MB/s]\u001b[A\n",
|
526 |
+
"model-00002-of-00002.safetensors: 78%|███████▊ | 440M/564M [00:03<00:00, 136MB/s]\u001b[A\n",
|
527 |
+
"model-00002-of-00002.safetensors: 82%|████████▏ | 461M/564M [00:03<00:01, 95.4MB/s]\u001b[A\n",
|
528 |
+
"model-00002-of-00002.safetensors: 86%|████████▌ | 482M/564M [00:03<00:00, 103MB/s] \u001b[A\n",
|
529 |
+
"model-00002-of-00002.safetensors: 89%|████████▉ | 503M/564M [00:04<00:00, 109MB/s]\u001b[A\n",
|
530 |
+
"model-00002-of-00002.safetensors: 93%|█████████▎| 524M/564M [00:04<00:00, 116MB/s]\u001b[A\n",
|
531 |
+
"model-00002-of-00002.safetensors: 97%|█████████▋| 545M/564M [00:04<00:00, 120MB/s]\u001b[A\n",
|
532 |
+
"model-00002-of-00002.safetensors: 100%|██████████| 564M/564M [00:04<00:00, 126MB/s]\u001b[A\n",
|
533 |
+
"Downloading shards: 100%|██████████| 2/2 [00:43<00:00, 21.61s/it]\n",
|
534 |
+
"Loading checkpoint shards: 100%|██████████| 2/2 [00:08<00:00, 4.06s/it]\n",
|
535 |
+
"generation_config.json: 100%|██████████| 124/124 [00:00<00:00, 278kB/s]\n"
|
536 |
+
]
|
537 |
+
}
|
538 |
+
],
|
539 |
+
"source": [
|
540 |
+
"bnb_config = BitsAndBytesConfig(\n",
|
541 |
+
" load_in_4bit=True,\n",
|
542 |
+
" bnb_4bit_use_double_quant=True,\n",
|
543 |
+
" bnb_4bit_quant_type=\"nf4\",\n",
|
544 |
+
" bnb_4bit_compute_dtype=torch.float16\n",
|
545 |
+
")\n",
|
546 |
+
"\n",
|
547 |
+
"model = AutoModelForCausalLM.from_pretrained(\n",
|
548 |
+
" \"microsoft/phi-2\",\n",
|
549 |
+
" device_map={\"\":0},\n",
|
550 |
+
" trust_remote_code=True,\n",
|
551 |
+
" quantization_config=bnb_config\n",
|
552 |
+
")"
|
553 |
+
]
|
554 |
+
},
|
555 |
+
{
|
556 |
+
"cell_type": "code",
|
557 |
+
"execution_count": 5,
|
558 |
+
"id": "e15aa794-e17c-4b09-a64a-c60377259218",
|
559 |
+
"metadata": {},
|
560 |
+
"outputs": [
|
561 |
+
{
|
562 |
+
"name": "stdout",
|
563 |
+
"output_type": "stream",
|
564 |
+
"text": [
|
565 |
+
"PhiForCausalLM(\n",
|
566 |
+
" (model): PhiModel(\n",
|
567 |
+
" (embed_tokens): Embedding(51200, 2560)\n",
|
568 |
+
" (embed_dropout): Dropout(p=0.0, inplace=False)\n",
|
569 |
+
" (layers): ModuleList(\n",
|
570 |
+
" (0-31): 32 x PhiDecoderLayer(\n",
|
571 |
+
" (self_attn): PhiAttention(\n",
|
572 |
+
" (q_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
|
573 |
+
" (k_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
|
574 |
+
" (v_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
|
575 |
+
" (dense): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
|
576 |
+
" (rotary_emb): PhiRotaryEmbedding()\n",
|
577 |
+
" )\n",
|
578 |
+
" (mlp): PhiMLP(\n",
|
579 |
+
" (activation_fn): NewGELUActivation()\n",
|
580 |
+
" (fc1): Linear4bit(in_features=2560, out_features=10240, bias=True)\n",
|
581 |
+
" (fc2): Linear4bit(in_features=10240, out_features=2560, bias=True)\n",
|
582 |
+
" )\n",
|
583 |
+
" (input_layernorm): LayerNorm((2560,), eps=1e-05, elementwise_affine=True)\n",
|
584 |
+
" (resid_dropout): Dropout(p=0.1, inplace=False)\n",
|
585 |
+
" )\n",
|
586 |
+
" )\n",
|
587 |
+
" (final_layernorm): LayerNorm((2560,), eps=1e-05, elementwise_affine=True)\n",
|
588 |
+
" )\n",
|
589 |
+
" (lm_head): Linear(in_features=2560, out_features=51200, bias=True)\n",
|
590 |
+
")\n"
|
591 |
+
]
|
592 |
+
}
|
593 |
+
],
|
594 |
+
"source": [
|
595 |
+
"print(model)"
|
596 |
+
]
|
597 |
+
},
|
598 |
+
{
|
599 |
+
"cell_type": "code",
|
600 |
+
"execution_count": 6,
|
601 |
+
"id": "18d5599f-992d-4d8e-a90c-4d43774be473",
|
602 |
+
"metadata": {},
|
603 |
+
"outputs": [
|
604 |
+
{
|
605 |
+
"name": "stdout",
|
606 |
+
"output_type": "stream",
|
607 |
+
"text": [
|
608 |
+
"trainable params: 17,039,360 || all params: 2,796,723,200 || trainable%: 0.6092615815537269\n"
|
609 |
+
]
|
610 |
+
}
|
611 |
+
],
|
612 |
+
"source": [
|
613 |
+
"config = LoraConfig(\n",
|
614 |
+
" r=16,\n",
|
615 |
+
" lora_alpha=16,\n",
|
616 |
+
" target_modules=[\"dense\", \"fc2\",\"q_proj\",\"k_proj\",\"v_proj\"],\n",
|
617 |
+
" lora_dropout=0.05,\n",
|
618 |
+
" bias=\"none\",\n",
|
619 |
+
" task_type=\"CAUSAL_LM\"\n",
|
620 |
+
")\n",
|
621 |
+
"\n",
|
622 |
+
"model = get_peft_model(model, config)\n",
|
623 |
+
"model.print_trainable_parameters()"
|
624 |
+
]
|
625 |
+
},
|
626 |
+
{
|
627 |
+
"cell_type": "code",
|
628 |
+
"execution_count": 7,
|
629 |
+
"id": "baeee903-3dce-48b2-93c3-7a697d8c6daf",
|
630 |
+
"metadata": {},
|
631 |
+
"outputs": [],
|
632 |
+
"source": [
|
633 |
+
"def tokenize(sample):\n",
|
634 |
+
" model_inps = tokenizer(sample[\"text\"], padding=True, truncation=True, max_length=512)\n",
|
635 |
+
" return model_inps"
|
636 |
+
]
|
637 |
+
},
|
638 |
+
{
|
639 |
+
"cell_type": "code",
|
640 |
+
"execution_count": 8,
|
641 |
+
"id": "28a9b24a-a822-4fcb-96b3-d77b7ea30a5f",
|
642 |
+
"metadata": {},
|
643 |
+
"outputs": [
|
644 |
+
{
|
645 |
+
"name": "stdout",
|
646 |
+
"output_type": "stream",
|
647 |
+
"text": [
|
648 |
+
"Collecting scikit-learn\n",
|
649 |
+
" Downloading scikit_learn-1.4.0-1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)\n",
|
650 |
+
"Requirement already satisfied: numpy<2.0,>=1.19.5 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.26.4)\n",
|
651 |
+
"Requirement already satisfied: scipy>=1.6.0 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.12.0)\n",
|
652 |
+
"Collecting joblib>=1.2.0 (from scikit-learn)\n",
|
653 |
+
" Downloading joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)\n",
|
654 |
+
"Collecting threadpoolctl>=2.0.0 (from scikit-learn)\n",
|
655 |
+
" Downloading threadpoolctl-3.2.0-py3-none-any.whl.metadata (10.0 kB)\n",
|
656 |
+
"Downloading scikit_learn-1.4.0-1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.1 MB)\n",
|
657 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.1/12.1 MB\u001b[0m \u001b[31m62.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
658 |
+
"\u001b[?25hDownloading joblib-1.3.2-py3-none-any.whl (302 kB)\n",
|
659 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m302.2/302.2 kB\u001b[0m \u001b[31m279.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
660 |
+
"\u001b[?25hDownloading threadpoolctl-3.2.0-py3-none-any.whl (15 kB)\n",
|
661 |
+
"Installing collected packages: threadpoolctl, joblib, scikit-learn\n",
|
662 |
+
"Successfully installed joblib-1.3.2 scikit-learn-1.4.0 threadpoolctl-3.2.0\n"
|
663 |
+
]
|
664 |
+
}
|
665 |
+
],
|
666 |
+
"source": [
|
667 |
+
"!pip install scikit-learn"
|
668 |
+
]
|
669 |
+
},
|
670 |
+
{
|
671 |
+
"cell_type": "code",
|
672 |
+
"execution_count": 9,
|
673 |
+
"id": "1ee7fd2a-38e4-4f23-a978-0bdeeda64d8b",
|
674 |
+
"metadata": {},
|
675 |
+
"outputs": [],
|
676 |
+
"source": [
|
677 |
+
"import pandas as pd\n",
|
678 |
+
"\n",
|
679 |
+
"from sklearn.model_selection import train_test_split\n",
|
680 |
+
"dataset_name='data.csv'\n",
|
681 |
+
"df = pd.read_csv(dataset_name)\n",
|
682 |
+
"train, test = train_test_split(df, test_size=0.2)"
|
683 |
+
]
|
684 |
+
},
|
685 |
+
{
|
686 |
+
"cell_type": "code",
|
687 |
+
"execution_count": 10,
|
688 |
+
"id": "e84c29e2-843e-42c2-8c0f-324d392e671c",
|
689 |
+
"metadata": {},
|
690 |
+
"outputs": [
|
691 |
+
{
|
692 |
+
"name": "stderr",
|
693 |
+
"output_type": "stream",
|
694 |
+
"text": [
|
695 |
+
"Tokenizing data: 100%|██████████| 13129/13129 [00:04<00:00, 2739.65 examples/s]\n"
|
696 |
+
]
|
697 |
+
},
|
698 |
+
{
|
699 |
+
"data": {
|
700 |
+
"text/plain": [
|
701 |
+
"Dataset({\n",
|
702 |
+
" features: ['input_ids', 'attention_mask'],\n",
|
703 |
+
" num_rows: 13129\n",
|
704 |
+
"})"
|
705 |
+
]
|
706 |
+
},
|
707 |
+
"execution_count": 10,
|
708 |
+
"metadata": {},
|
709 |
+
"output_type": "execute_result"
|
710 |
+
}
|
711 |
+
],
|
712 |
+
"source": [
|
713 |
+
"data_df = train\n",
|
714 |
+
"data_df[\"text\"] = data_df[[\"user\", \"assistant\"]].apply(lambda x: \"question: \" + str(x[\"user\"]) + \" answer: \" + str(x[\"assistant\"]), axis=1)\n",
|
715 |
+
"data = Dataset.from_pandas(data_df)\n",
|
716 |
+
"tokenized_data = data.map(tokenize, batched=True, desc=\"Tokenizing data\", remove_columns=data.column_names)\n",
|
717 |
+
"tokenized_data"
|
718 |
+
]
|
719 |
+
},
|
720 |
+
{
|
721 |
+
"cell_type": "code",
|
722 |
+
"execution_count": 16,
|
723 |
+
"id": "ac968254-5338-49df-950d-222b82647407",
|
724 |
+
"metadata": {},
|
725 |
+
"outputs": [],
|
726 |
+
"source": [
|
727 |
+
"training_arguments = TrainingArguments(\n",
|
728 |
+
" output_dir=\".\",\n",
|
729 |
+
" per_device_train_batch_size=4,\n",
|
730 |
+
" gradient_accumulation_steps=1,\n",
|
731 |
+
" learning_rate=2e-4,\n",
|
732 |
+
" lr_scheduler_type=\"cosine\",\n",
|
733 |
+
" save_strategy=\"epoch\",\n",
|
734 |
+
" logging_steps=100,\n",
|
735 |
+
" max_steps=1100,\n",
|
736 |
+
" num_train_epochs=2,\n",
|
737 |
+
" push_to_hub=True\n",
|
738 |
+
" )"
|
739 |
+
]
|
740 |
+
},
|
741 |
+
{
|
742 |
+
"cell_type": "code",
|
743 |
+
"execution_count": 12,
|
744 |
+
"id": "729df2d0-0890-4ac4-adf3-c167a6e9669d",
|
745 |
+
"metadata": {},
|
746 |
+
"outputs": [
|
747 |
+
{
|
748 |
+
"name": "stderr",
|
749 |
+
"output_type": "stream",
|
750 |
+
"text": [
|
751 |
+
"huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
|
752 |
+
"To disable this warning, you can either:\n",
|
753 |
+
"\t- Avoid using `tokenizers` before the fork if possible\n",
|
754 |
+
"\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
|
755 |
+
]
|
756 |
+
},
|
757 |
+
{
|
758 |
+
"name": "stdout",
|
759 |
+
"output_type": "stream",
|
760 |
+
"text": [
|
761 |
+
"Requirement already satisfied: huggingface_hub in /usr/local/lib/python3.11/site-packages (0.20.3)\n",
|
762 |
+
"Requirement already satisfied: filelock in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (3.13.1)\n",
|
763 |
+
"Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (2023.10.0)\n",
|
764 |
+
"Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (2.31.0)\n",
|
765 |
+
"Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (4.66.1)\n",
|
766 |
+
"Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (6.0.1)\n",
|
767 |
+
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (4.9.0)\n",
|
768 |
+
"Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (23.2)\n",
|
769 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2.1.1)\n",
|
770 |
+
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (3.6)\n",
|
771 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2.2.0)\n",
|
772 |
+
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2024.2.2)\n"
|
773 |
+
]
|
774 |
+
}
|
775 |
+
],
|
776 |
+
"source": [
|
777 |
+
"!pip install huggingface_hub"
|
778 |
+
]
|
779 |
+
},
|
780 |
+
{
|
781 |
+
"cell_type": "code",
|
782 |
+
"execution_count": 13,
|
783 |
+
"id": "525f81a4-eb92-466e-bb9c-cd63122231ab",
|
784 |
+
"metadata": {},
|
785 |
+
"outputs": [
|
786 |
+
{
|
787 |
+
"name": "stderr",
|
788 |
+
"output_type": "stream",
|
789 |
+
"text": [
|
790 |
+
"huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
|
791 |
+
"To disable this warning, you can either:\n",
|
792 |
+
"\t- Avoid using `tokenizers` before the fork if possible\n",
|
793 |
+
"\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
|
794 |
+
]
|
795 |
+
},
|
796 |
+
{
|
797 |
+
"name": "stdout",
|
798 |
+
"output_type": "stream",
|
799 |
+
"text": [
|
800 |
+
"Requirement already satisfied: jupyterlab in /usr/local/lib/python3.11/site-packages (4.1.0)\n",
|
801 |
+
"Collecting jupyterlab-git\n",
|
802 |
+
" Downloading jupyterlab_git-0.50.0-py3-none-any.whl.metadata (31 kB)\n",
|
803 |
+
"Requirement already satisfied: async-lru>=1.0.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.0.4)\n",
|
804 |
+
"Requirement already satisfied: httpx>=0.25.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (0.26.0)\n",
|
805 |
+
"Requirement already satisfied: ipykernel in /usr/local/lib/python3.11/site-packages (from jupyterlab) (6.29.1)\n",
|
806 |
+
"Requirement already satisfied: jinja2>=3.0.3 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (3.1.3)\n",
|
807 |
+
"Requirement already satisfied: jupyter-core in /usr/local/lib/python3.11/site-packages (from jupyterlab) (5.7.1)\n",
|
808 |
+
"Requirement already satisfied: jupyter-lsp>=2.0.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.2.2)\n",
|
809 |
+
"Requirement already satisfied: jupyter-server<3,>=2.4.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.12.5)\n",
|
810 |
+
"Requirement already satisfied: jupyterlab-server<3,>=2.19.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.25.2)\n",
|
811 |
+
"Requirement already satisfied: notebook-shim>=0.2 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (0.2.3)\n",
|
812 |
+
"Requirement already satisfied: packaging in /usr/local/lib/python3.11/site-packages (from jupyterlab) (23.2)\n",
|
813 |
+
"Requirement already satisfied: tornado>=6.2.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (6.4)\n",
|
814 |
+
"Requirement already satisfied: traitlets in /usr/local/lib/python3.11/site-packages (from jupyterlab) (5.14.1)\n",
|
815 |
+
"Collecting nbdime~=4.0.1 (from jupyterlab-git)\n",
|
816 |
+
" Downloading nbdime-4.0.1-py3-none-any.whl.metadata (9.5 kB)\n",
|
817 |
+
"Requirement already satisfied: nbformat in /usr/local/lib/python3.11/site-packages (from jupyterlab-git) (5.9.2)\n",
|
818 |
+
"Requirement already satisfied: pexpect in /usr/local/lib/python3.11/site-packages (from jupyterlab-git) (4.9.0)\n",
|
819 |
+
"Requirement already satisfied: anyio in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (4.2.0)\n",
|
820 |
+
"Requirement already satisfied: certifi in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (2024.2.2)\n",
|
821 |
+
"Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (1.0.2)\n",
|
822 |
+
"Requirement already satisfied: idna in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (3.6)\n",
|
823 |
+
"Requirement already satisfied: sniffio in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (1.3.0)\n",
|
824 |
+
"Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/site-packages (from httpcore==1.*->httpx>=0.25.0->jupyterlab) (0.14.0)\n",
|
825 |
+
"Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/site-packages (from jinja2>=3.0.3->jupyterlab) (2.1.5)\n",
|
826 |
+
"Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (23.1.0)\n",
|
827 |
+
"Requirement already satisfied: jupyter-client>=7.4.4 in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (8.6.0)\n",
|
828 |
+
"Requirement already satisfied: jupyter-events>=0.9.0 in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (0.9.0)\n",
|
829 |
+
"Requirement already satisfied: jupyter-server-terminals in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (0.5.2)\n",
|
830 |
+
"Requirement already satisfied: nbconvert>=6.4.4 in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (7.15.0)\n",
|
831 |
+
"Requirement already satisfied: overrides in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (7.7.0)\n",
|
832 |
+
"Requirement already satisfied: prometheus-client in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (0.19.0)\n",
|
833 |
+
"Requirement already satisfied: pyzmq>=24 in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (25.1.2)\n",
|
834 |
+
"Requirement already satisfied: send2trash>=1.8.2 in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (1.8.2)\n",
|
835 |
+
"Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (0.18.0)\n",
|
836 |
+
"Requirement already satisfied: websocket-client in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (1.7.0)\n",
|
837 |
+
"Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.11/site-packages (from jupyter-core->jupyterlab) (4.2.0)\n",
|
838 |
+
"Requirement already satisfied: babel>=2.10 in /usr/local/lib/python3.11/site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab) (2.14.0)\n",
|
839 |
+
"Requirement already satisfied: json5>=0.9.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab) (0.9.14)\n",
|
840 |
+
"Requirement already satisfied: jsonschema>=4.18.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab) (4.21.1)\n",
|
841 |
+
"Requirement already satisfied: requests>=2.31 in /usr/local/lib/python3.11/site-packages (from jupyterlab-server<3,>=2.19.0->jupyterlab) (2.31.0)\n",
|
842 |
+
"Collecting colorama (from nbdime~=4.0.1->jupyterlab-git)\n",
|
843 |
+
" Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n",
|
844 |
+
"Collecting gitpython!=2.1.4,!=2.1.5,!=2.1.6 (from nbdime~=4.0.1->jupyterlab-git)\n",
|
845 |
+
" Downloading GitPython-3.1.41-py3-none-any.whl.metadata (14 kB)\n",
|
846 |
+
"Collecting jupyter-server-mathjax>=0.2.2 (from nbdime~=4.0.1->jupyterlab-git)\n",
|
847 |
+
" Downloading jupyter_server_mathjax-0.2.6-py3-none-any.whl (3.1 MB)\n",
|
848 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.1/3.1 MB\u001b[0m \u001b[31m18.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
849 |
+
"\u001b[?25hRequirement already satisfied: pygments in /usr/local/lib/python3.11/site-packages (from nbdime~=4.0.1->jupyterlab-git) (2.17.2)\n",
|
850 |
+
"Requirement already satisfied: fastjsonschema in /usr/local/lib/python3.11/site-packages (from nbformat->jupyterlab-git) (2.19.1)\n",
|
851 |
+
"Requirement already satisfied: comm>=0.1.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (0.2.1)\n",
|
852 |
+
"Requirement already satisfied: debugpy>=1.6.5 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (1.8.0)\n",
|
853 |
+
"Requirement already satisfied: ipython>=7.23.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (8.21.0)\n",
|
854 |
+
"Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (0.1.6)\n",
|
855 |
+
"Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (1.6.0)\n",
|
856 |
+
"Requirement already satisfied: psutil in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (5.9.8)\n",
|
857 |
+
"Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.11/site-packages (from pexpect->jupyterlab-git) (0.7.0)\n",
|
858 |
+
"Collecting gitdb<5,>=4.0.1 (from gitpython!=2.1.4,!=2.1.5,!=2.1.6->nbdime~=4.0.1->jupyterlab-git)\n",
|
859 |
+
" Downloading gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)\n",
|
860 |
+
"Requirement already satisfied: decorator in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (5.1.1)\n",
|
861 |
+
"Requirement already satisfied: jedi>=0.16 in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (0.19.1)\n",
|
862 |
+
"Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (3.0.43)\n",
|
863 |
+
"Requirement already satisfied: stack-data in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (0.6.3)\n",
|
864 |
+
"Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.11/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.19.0->jupyterlab) (23.2.0)\n",
|
865 |
+
"Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.11/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.19.0->jupyterlab) (2023.12.1)\n",
|
866 |
+
"Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.11/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.19.0->jupyterlab) (0.33.0)\n",
|
867 |
+
"Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.11/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.19.0->jupyterlab) (0.17.1)\n",
|
868 |
+
"Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/site-packages (from jupyter-client>=7.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (2.8.2)\n",
|
869 |
+
"Requirement already satisfied: python-json-logger>=2.0.4 in /usr/local/lib/python3.11/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (2.0.7)\n",
|
870 |
+
"Requirement already satisfied: pyyaml>=5.3 in /usr/local/lib/python3.11/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (6.0.1)\n",
|
871 |
+
"Requirement already satisfied: rfc3339-validator in /usr/local/lib/python3.11/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (0.1.4)\n",
|
872 |
+
"Requirement already satisfied: rfc3986-validator>=0.1.1 in /usr/local/lib/python3.11/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (0.1.1)\n",
|
873 |
+
"Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (4.12.3)\n",
|
874 |
+
"Requirement already satisfied: bleach!=5.0.0 in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (6.1.0)\n",
|
875 |
+
"Requirement already satisfied: defusedxml in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (0.7.1)\n",
|
876 |
+
"Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (0.3.0)\n",
|
877 |
+
"Requirement already satisfied: mistune<4,>=2.0.3 in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (3.0.2)\n",
|
878 |
+
"Requirement already satisfied: nbclient>=0.5.0 in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (0.9.0)\n",
|
879 |
+
"Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (1.5.1)\n",
|
880 |
+
"Requirement already satisfied: tinycss2 in /usr/local/lib/python3.11/site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (1.2.1)\n",
|
881 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests>=2.31->jupyterlab-server<3,>=2.19.0->jupyterlab) (2.1.1)\n",
|
882 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests>=2.31->jupyterlab-server<3,>=2.19.0->jupyterlab) (2.2.0)\n",
|
883 |
+
"Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.11/site-packages (from argon2-cffi->jupyter-server<3,>=2.4.0->jupyterlab) (21.2.0)\n",
|
884 |
+
"Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.11/site-packages (from bleach!=5.0.0->nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (1.16.0)\n",
|
885 |
+
"Requirement already satisfied: webencodings in /usr/local/lib/python3.11/site-packages (from bleach!=5.0.0->nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (0.5.1)\n",
|
886 |
+
"Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->gitpython!=2.1.4,!=2.1.5,!=2.1.6->nbdime~=4.0.1->jupyterlab-git)\n",
|
887 |
+
" Downloading smmap-5.0.1-py3-none-any.whl.metadata (4.3 kB)\n",
|
888 |
+
"Requirement already satisfied: parso<0.9.0,>=0.8.3 in /usr/local/lib/python3.11/site-packages (from jedi>=0.16->ipython>=7.23.1->ipykernel->jupyterlab) (0.8.3)\n",
|
889 |
+
"Requirement already satisfied: fqdn in /usr/local/lib/python3.11/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (1.5.1)\n",
|
890 |
+
"Requirement already satisfied: isoduration in /usr/local/lib/python3.11/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (20.11.0)\n",
|
891 |
+
"Requirement already satisfied: jsonpointer>1.13 in /usr/local/lib/python3.11/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (2.4)\n",
|
892 |
+
"Requirement already satisfied: uri-template in /usr/local/lib/python3.11/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (1.3.0)\n",
|
893 |
+
"Requirement already satisfied: webcolors>=1.11 in /usr/local/lib/python3.11/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (1.13)\n",
|
894 |
+
"Requirement already satisfied: wcwidth in /usr/local/lib/python3.11/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython>=7.23.1->ipykernel->jupyterlab) (0.2.13)\n",
|
895 |
+
"Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.11/site-packages (from argon2-cffi-bindings->argon2-cffi->jupyter-server<3,>=2.4.0->jupyterlab) (1.16.0)\n",
|
896 |
+
"Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.11/site-packages (from beautifulsoup4->nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->jupyterlab) (2.5)\n",
|
897 |
+
"Requirement already satisfied: executing>=1.2.0 in /usr/local/lib/python3.11/site-packages (from stack-data->ipython>=7.23.1->ipykernel->jupyterlab) (2.0.1)\n",
|
898 |
+
"Requirement already satisfied: asttokens>=2.1.0 in /usr/local/lib/python3.11/site-packages (from stack-data->ipython>=7.23.1->ipykernel->jupyterlab) (2.4.1)\n",
|
899 |
+
"Requirement already satisfied: pure-eval in /usr/local/lib/python3.11/site-packages (from stack-data->ipython>=7.23.1->ipykernel->jupyterlab) (0.2.2)\n",
|
900 |
+
"Requirement already satisfied: pycparser in /usr/local/lib/python3.11/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->jupyter-server<3,>=2.4.0->jupyterlab) (2.21)\n",
|
901 |
+
"Requirement already satisfied: arrow>=0.15.0 in /usr/local/lib/python3.11/site-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (1.3.0)\n",
|
902 |
+
"Requirement already satisfied: types-python-dateutil>=2.8.10 in /usr/local/lib/python3.11/site-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->jupyterlab) (2.8.19.20240106)\n",
|
903 |
+
"Downloading jupyterlab_git-0.50.0-py3-none-any.whl (1.2 MB)\n",
|
904 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m80.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
905 |
+
"\u001b[?25hDownloading nbdime-4.0.1-py3-none-any.whl (5.9 MB)\n",
|
906 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.9/5.9 MB\u001b[0m \u001b[31m43.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
907 |
+
"\u001b[?25hDownloading GitPython-3.1.41-py3-none-any.whl (196 kB)\n",
|
908 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m196.4/196.4 kB\u001b[0m \u001b[31m43.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
909 |
+
"\u001b[?25hDownloading gitdb-4.0.11-py3-none-any.whl (62 kB)\n",
|
910 |
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 kB\u001b[0m \u001b[31m132.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
911 |
+
"\u001b[?25hDownloading smmap-5.0.1-py3-none-any.whl (24 kB)\n",
|
912 |
+
"Installing collected packages: smmap, colorama, gitdb, gitpython, jupyter-server-mathjax, nbdime, jupyterlab-git\n",
|
913 |
+
"Successfully installed colorama-0.4.6 gitdb-4.0.11 gitpython-3.1.41 jupyter-server-mathjax-0.2.6 jupyterlab-git-0.50.0 nbdime-4.0.1 smmap-5.0.1\n",
|
914 |
+
"Note: you may need to restart the kernel to use updated packages.\n"
|
915 |
+
]
|
916 |
+
}
|
917 |
+
],
|
918 |
+
"source": [
|
919 |
+
"pip install --upgrade jupyterlab jupyterlab-git"
|
920 |
+
]
|
921 |
+
},
|
922 |
+
{
|
923 |
+
"cell_type": "code",
|
924 |
+
"execution_count": 17,
|
925 |
+
"id": "05d58512-a9e2-4319-88bf-9331c6a0584c",
|
926 |
+
"metadata": {},
|
927 |
+
"outputs": [
|
928 |
+
{
|
929 |
+
"name": "stdout",
|
930 |
+
"output_type": "stream",
|
931 |
+
"text": [
|
932 |
+
"\n",
|
933 |
+
" _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\n",
|
934 |
+
" _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
|
935 |
+
" _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\n",
|
936 |
+
" _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
|
937 |
+
" _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\n",
|
938 |
+
"\n",
|
939 |
+
" A token is already saved on your machine. Run `huggingface-cli whoami` to get more information or `huggingface-cli logout` if you want to log out.\n",
|
940 |
+
" Setting a new token will erase the existing one.\n",
|
941 |
+
" To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .\n"
|
942 |
+
]
|
943 |
+
},
|
944 |
+
{
|
945 |
+
"name": "stdin",
|
946 |
+
"output_type": "stream",
|
947 |
+
"text": [
|
948 |
+
"Token: ········\n",
|
949 |
+
"Add token as git credential? (Y/n) n\n"
|
950 |
+
]
|
951 |
+
},
|
952 |
+
{
|
953 |
+
"name": "stdout",
|
954 |
+
"output_type": "stream",
|
955 |
+
"text": [
|
956 |
+
"Token is valid (permission: write).\n",
|
957 |
+
"Your token has been saved to /root/.cache/huggingface/token\n",
|
958 |
+
"Login successful\n"
|
959 |
+
]
|
960 |
+
}
|
961 |
+
],
|
962 |
+
"source": [
|
963 |
+
"from huggingface_hub import interpreter_login\n",
|
964 |
+
"interpreter_login()"
|
965 |
+
]
|
966 |
+
},
|
967 |
+
{
|
968 |
+
"cell_type": "code",
|
969 |
+
"execution_count": null,
|
970 |
+
"id": "3bf553b6-b26c-49c3-9407-74c8d53a395e",
|
971 |
+
"metadata": {},
|
972 |
+
"outputs": [
|
973 |
+
{
|
974 |
+
"name": "stderr",
|
975 |
+
"output_type": "stream",
|
976 |
+
"text": [
|
977 |
+
"Detected kernel version 4.4.0, which is below the recommended minimum of 5.5.0; this can cause the process to hang. It is recommended to upgrade the kernel to the minimum version or higher.\n"
|
978 |
+
]
|
979 |
+
},
|
980 |
+
{
|
981 |
+
"data": {
|
982 |
+
"text/html": [
|
983 |
+
"\n",
|
984 |
+
" <div>\n",
|
985 |
+
" \n",
|
986 |
+
" <progress value='865' max='1100' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
987 |
+
" [ 865/1100 06:23 < 01:44, 2.25 it/s, Epoch 0.26/1]\n",
|
988 |
+
" </div>\n",
|
989 |
+
" <table border=\"1\" class=\"dataframe\">\n",
|
990 |
+
" <thead>\n",
|
991 |
+
" <tr style=\"text-align: left;\">\n",
|
992 |
+
" <th>Step</th>\n",
|
993 |
+
" <th>Training Loss</th>\n",
|
994 |
+
" </tr>\n",
|
995 |
+
" </thead>\n",
|
996 |
+
" <tbody>\n",
|
997 |
+
" <tr>\n",
|
998 |
+
" <td>100</td>\n",
|
999 |
+
" <td>1.304900</td>\n",
|
1000 |
+
" </tr>\n",
|
1001 |
+
" <tr>\n",
|
1002 |
+
" <td>200</td>\n",
|
1003 |
+
" <td>1.187200</td>\n",
|
1004 |
+
" </tr>\n",
|
1005 |
+
" <tr>\n",
|
1006 |
+
" <td>300</td>\n",
|
1007 |
+
" <td>1.169100</td>\n",
|
1008 |
+
" </tr>\n",
|
1009 |
+
" <tr>\n",
|
1010 |
+
" <td>400</td>\n",
|
1011 |
+
" <td>1.171700</td>\n",
|
1012 |
+
" </tr>\n",
|
1013 |
+
" <tr>\n",
|
1014 |
+
" <td>500</td>\n",
|
1015 |
+
" <td>1.143400</td>\n",
|
1016 |
+
" </tr>\n",
|
1017 |
+
" <tr>\n",
|
1018 |
+
" <td>600</td>\n",
|
1019 |
+
" <td>1.191400</td>\n",
|
1020 |
+
" </tr>\n",
|
1021 |
+
" <tr>\n",
|
1022 |
+
" <td>700</td>\n",
|
1023 |
+
" <td>1.144800</td>\n",
|
1024 |
+
" </tr>\n",
|
1025 |
+
" <tr>\n",
|
1026 |
+
" <td>800</td>\n",
|
1027 |
+
" <td>1.152100</td>\n",
|
1028 |
+
" </tr>\n",
|
1029 |
+
" </tbody>\n",
|
1030 |
+
"</table><p>"
|
1031 |
+
],
|
1032 |
+
"text/plain": [
|
1033 |
+
"<IPython.core.display.HTML object>"
|
1034 |
+
]
|
1035 |
+
},
|
1036 |
+
"metadata": {},
|
1037 |
+
"output_type": "display_data"
|
1038 |
+
}
|
1039 |
+
],
|
1040 |
+
"source": [
|
1041 |
+
"trainer = Trainer(\n",
|
1042 |
+
" model=model,\n",
|
1043 |
+
" train_dataset=tokenized_data,\n",
|
1044 |
+
" args=training_arguments,\n",
|
1045 |
+
" data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False)\n",
|
1046 |
+
")\n",
|
1047 |
+
"trainer.train()"
|
1048 |
+
]
|
1049 |
+
},
|
1050 |
+
{
|
1051 |
+
"cell_type": "code",
|
1052 |
+
"execution_count": null,
|
1053 |
+
"id": "263cc15e-8e9d-4bd8-9708-ec1638bc1165",
|
1054 |
+
"metadata": {},
|
1055 |
+
"outputs": [],
|
1056 |
+
"source": []
|
1057 |
+
}
|
1058 |
+
],
|
1059 |
+
"metadata": {
|
1060 |
+
"kernelspec": {
|
1061 |
+
"display_name": "Python 3 (ipykernel)",
|
1062 |
+
"language": "python",
|
1063 |
+
"name": "python3"
|
1064 |
+
},
|
1065 |
+
"language_info": {
|
1066 |
+
"codemirror_mode": {
|
1067 |
+
"name": "ipython",
|
1068 |
+
"version": 3
|
1069 |
+
},
|
1070 |
+
"file_extension": ".py",
|
1071 |
+
"mimetype": "text/x-python",
|
1072 |
+
"name": "python",
|
1073 |
+
"nbconvert_exporter": "python",
|
1074 |
+
"pygments_lexer": "ipython3",
|
1075 |
+
"version": "3.11.5"
|
1076 |
+
}
|
1077 |
+
},
|
1078 |
+
"nbformat": 4,
|
1079 |
+
"nbformat_minor": 5
|
1080 |
+
}
|
adapter_config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "microsoft/phi-2",
|
5 |
+
"bias": "none",
|
6 |
+
"fan_in_fan_out": false,
|
7 |
+
"inference_mode": true,
|
8 |
+
"init_lora_weights": true,
|
9 |
+
"layers_pattern": null,
|
10 |
+
"layers_to_transform": null,
|
11 |
+
"loftq_config": {},
|
12 |
+
"lora_alpha": 16,
|
13 |
+
"lora_dropout": 0.05,
|
14 |
+
"megatron_config": null,
|
15 |
+
"megatron_core": "megatron.core",
|
16 |
+
"modules_to_save": null,
|
17 |
+
"peft_type": "LORA",
|
18 |
+
"r": 16,
|
19 |
+
"rank_pattern": {},
|
20 |
+
"revision": null,
|
21 |
+
"target_modules": [
|
22 |
+
"v_proj",
|
23 |
+
"k_proj",
|
24 |
+
"fc2",
|
25 |
+
"dense",
|
26 |
+
"q_proj"
|
27 |
+
],
|
28 |
+
"task_type": "CAUSAL_LM",
|
29 |
+
"use_rslora": false
|
30 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e022b421528495c48133eddad0f9e9bfabc961fbb1c17e027dfba5889b9e3ec9
|
3 |
+
size 68199872
|
data.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b8009c48c3edc7e0ffaaa8c6f5c327aa69cd089184a966e6501a941bb82f2cfd
|
3 |
+
size 22246553
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:722353eab13d6007491c6de86f62d8c3e6b74e347e9eb1e04a39128a3d3a15ac
|
3 |
+
size 4664
|