aissatoubalde commited on
Commit
489dc47
1 Parent(s): 81dd58a

Training in progress, epoch 0

Browse files
.ipynb_checkpoints/data-checkpoint.csv ADDED
The diff for this file is too large to render. See raw diff
 
.ipynb_checkpoints/fine-tuned-phi2-checkpoint.ipynb ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [],
3
+ "metadata": {},
4
+ "nbformat": 4,
5
+ "nbformat_minor": 5
6
+ }
.ipynb_checkpoints/phi-2-custom-checkpoint.ipynb ADDED
@@ -0,0 +1,697 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "Requirement already satisfied: accelerate in /usr/local/lib/python3.11/site-packages (0.27.2)\n",
14
+ "Requirement already satisfied: transformers in /usr/local/lib/python3.11/site-packages (4.37.2)\n",
15
+ "Requirement already satisfied: einops in /usr/local/lib/python3.11/site-packages (0.7.0)\n",
16
+ "Requirement already satisfied: datasets in /usr/local/lib/python3.11/site-packages (2.17.0)\n",
17
+ "Requirement already satisfied: peft in /usr/local/lib/python3.11/site-packages (0.8.2)\n",
18
+ "Requirement already satisfied: bitsandbytes in /usr/local/lib/python3.11/site-packages (0.42.0)\n",
19
+ "Requirement already satisfied: torch in /usr/local/lib/python3.11/site-packages (2.2.0)\n",
20
+ "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.11/site-packages (from accelerate) (1.26.4)\n",
21
+ "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/site-packages (from accelerate) (23.2)\n",
22
+ "Requirement already satisfied: psutil in /usr/local/lib/python3.11/site-packages (from accelerate) (5.9.8)\n",
23
+ "Requirement already satisfied: pyyaml in /usr/local/lib/python3.11/site-packages (from accelerate) (6.0.1)\n",
24
+ "Requirement already satisfied: huggingface-hub in /usr/local/lib/python3.11/site-packages (from accelerate) (0.20.3)\n",
25
+ "Requirement already satisfied: safetensors>=0.3.1 in /usr/local/lib/python3.11/site-packages (from accelerate) (0.4.2)\n",
26
+ "Requirement already satisfied: filelock in /usr/local/lib/python3.11/site-packages (from transformers) (3.13.1)\n",
27
+ "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.11/site-packages (from transformers) (2023.12.25)\n",
28
+ "Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (from transformers) (2.31.0)\n",
29
+ "Requirement already satisfied: tokenizers<0.19,>=0.14 in /usr/local/lib/python3.11/site-packages (from transformers) (0.15.2)\n",
30
+ "Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.11/site-packages (from transformers) (4.66.2)\n",
31
+ "Requirement already satisfied: pyarrow>=12.0.0 in /usr/local/lib/python3.11/site-packages (from datasets) (15.0.0)\n",
32
+ "Requirement already satisfied: pyarrow-hotfix in /usr/local/lib/python3.11/site-packages (from datasets) (0.6)\n",
33
+ "Requirement already satisfied: dill<0.3.9,>=0.3.0 in /usr/local/lib/python3.11/site-packages (from datasets) (0.3.8)\n",
34
+ "Requirement already satisfied: pandas in /usr/local/lib/python3.11/site-packages (from datasets) (2.2.0)\n",
35
+ "Requirement already satisfied: xxhash in /usr/local/lib/python3.11/site-packages (from datasets) (3.4.1)\n",
36
+ "Requirement already satisfied: multiprocess in /usr/local/lib/python3.11/site-packages (from datasets) (0.70.16)\n",
37
+ "Requirement already satisfied: fsspec<=2023.10.0,>=2023.1.0 in /usr/local/lib/python3.11/site-packages (from fsspec[http]<=2023.10.0,>=2023.1.0->datasets) (2023.10.0)\n",
38
+ "Requirement already satisfied: aiohttp in /usr/local/lib/python3.11/site-packages (from datasets) (3.8.3)\n",
39
+ "Requirement already satisfied: scipy in /usr/local/lib/python3.11/site-packages (from bitsandbytes) (1.12.0)\n",
40
+ "Requirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.11/site-packages (from torch) (4.9.0)\n",
41
+ "Requirement already satisfied: sympy in /usr/local/lib/python3.11/site-packages (from torch) (1.12)\n",
42
+ "Requirement already satisfied: networkx in /usr/local/lib/python3.11/site-packages (from torch) (3.2.1)\n",
43
+ "Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/site-packages (from torch) (3.1.3)\n",
44
+ "Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /usr/local/lib/python3.11/site-packages (from torch) (12.1.105)\n",
45
+ "Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /usr/local/lib/python3.11/site-packages (from torch) (12.1.105)\n",
46
+ "Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /usr/local/lib/python3.11/site-packages (from torch) (12.1.105)\n",
47
+ "Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /usr/local/lib/python3.11/site-packages (from torch) (8.9.2.26)\n",
48
+ "Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /usr/local/lib/python3.11/site-packages (from torch) (12.1.3.1)\n",
49
+ "Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /usr/local/lib/python3.11/site-packages (from torch) (11.0.2.54)\n",
50
+ "Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /usr/local/lib/python3.11/site-packages (from torch) (10.3.2.106)\n",
51
+ "Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /usr/local/lib/python3.11/site-packages (from torch) (11.4.5.107)\n",
52
+ "Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /usr/local/lib/python3.11/site-packages (from torch) (12.1.0.106)\n",
53
+ "Requirement already satisfied: nvidia-nccl-cu12==2.19.3 in /usr/local/lib/python3.11/site-packages (from torch) (2.19.3)\n",
54
+ "Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /usr/local/lib/python3.11/site-packages (from torch) (12.1.105)\n",
55
+ "Requirement already satisfied: triton==2.2.0 in /usr/local/lib/python3.11/site-packages (from torch) (2.2.0)\n",
56
+ "Requirement already satisfied: nvidia-nvjitlink-cu12 in /usr/local/lib/python3.11/site-packages (from nvidia-cusolver-cu12==11.4.5.107->torch) (12.3.101)\n",
57
+ "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (23.2.0)\n",
58
+ "Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (2.1.1)\n",
59
+ "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (6.0.5)\n",
60
+ "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",
61
+ "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.9.4)\n",
62
+ "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.4.1)\n",
63
+ "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.3.1)\n",
64
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (3.6)\n",
65
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (2.2.0)\n",
66
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (2024.2.2)\n",
67
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/site-packages (from jinja2->torch) (2.1.5)\n",
68
+ "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/site-packages (from pandas->datasets) (2.8.2)\n",
69
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.11/site-packages (from pandas->datasets) (2024.1)\n",
70
+ "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.11/site-packages (from pandas->datasets) (2024.1)\n",
71
+ "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.11/site-packages (from sympy->torch) (1.3.0)\n",
72
+ "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"
73
+ ]
74
+ }
75
+ ],
76
+ "source": [
77
+ "!pip install accelerate transformers einops datasets peft bitsandbytes torch"
78
+ ]
79
+ },
80
+ {
81
+ "cell_type": "code",
82
+ "execution_count": 2,
83
+ "id": "46a53303-b585-4b02-956f-4af173410e25",
84
+ "metadata": {},
85
+ "outputs": [
86
+ {
87
+ "name": "stderr",
88
+ "output_type": "stream",
89
+ "text": [
90
+ "/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",
91
+ " from .autonotebook import tqdm as notebook_tqdm\n"
92
+ ]
93
+ }
94
+ ],
95
+ "source": [
96
+ "import torch\n",
97
+ "from datasets import load_dataset, Dataset\n",
98
+ "from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, Trainer, DataCollatorForLanguageModeling, BitsAndBytesConfig\n",
99
+ "from peft import LoraConfig, get_peft_model\n",
100
+ "import os"
101
+ ]
102
+ },
103
+ {
104
+ "cell_type": "code",
105
+ "execution_count": 3,
106
+ "id": "ffa3ee11-3929-4032-8758-322cda3a912e",
107
+ "metadata": {},
108
+ "outputs": [
109
+ {
110
+ "name": "stderr",
111
+ "output_type": "stream",
112
+ "text": [
113
+ "Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
114
+ ]
115
+ }
116
+ ],
117
+ "source": [
118
+ "tokenizer = AutoTokenizer.from_pretrained(\"microsoft/phi-2\", trust_remote_code=True)\n",
119
+ "tokenizer.pad_token = tokenizer.eos_token"
120
+ ]
121
+ },
122
+ {
123
+ "cell_type": "code",
124
+ "execution_count": 4,
125
+ "id": "b17096e6-c633-4d88-8cfc-fb738c1e4ca0",
126
+ "metadata": {
127
+ "scrolled": true
128
+ },
129
+ "outputs": [
130
+ {
131
+ "name": "stderr",
132
+ "output_type": "stream",
133
+ "text": [
134
+ "Loading checkpoint shards: 100%|██████████| 2/2 [00:06<00:00, 3.08s/it]\n"
135
+ ]
136
+ }
137
+ ],
138
+ "source": [
139
+ "bnb_config = BitsAndBytesConfig(\n",
140
+ " load_in_4bit=True,\n",
141
+ " bnb_4bit_use_double_quant=True,\n",
142
+ " bnb_4bit_quant_type=\"nf4\",\n",
143
+ " bnb_4bit_compute_dtype=torch.float16\n",
144
+ ")\n",
145
+ "\n",
146
+ "model = AutoModelForCausalLM.from_pretrained(\n",
147
+ " \"microsoft/phi-2\",\n",
148
+ " device_map={\"\":0},\n",
149
+ " trust_remote_code=True,\n",
150
+ " quantization_config=bnb_config\n",
151
+ ")"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type": "code",
156
+ "execution_count": 5,
157
+ "id": "e15aa794-e17c-4b09-a64a-c60377259218",
158
+ "metadata": {},
159
+ "outputs": [
160
+ {
161
+ "name": "stdout",
162
+ "output_type": "stream",
163
+ "text": [
164
+ "PhiForCausalLM(\n",
165
+ " (model): PhiModel(\n",
166
+ " (embed_tokens): Embedding(51200, 2560)\n",
167
+ " (embed_dropout): Dropout(p=0.0, inplace=False)\n",
168
+ " (layers): ModuleList(\n",
169
+ " (0-31): 32 x PhiDecoderLayer(\n",
170
+ " (self_attn): PhiAttention(\n",
171
+ " (q_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
172
+ " (k_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
173
+ " (v_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
174
+ " (dense): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
175
+ " (rotary_emb): PhiRotaryEmbedding()\n",
176
+ " )\n",
177
+ " (mlp): PhiMLP(\n",
178
+ " (activation_fn): NewGELUActivation()\n",
179
+ " (fc1): Linear4bit(in_features=2560, out_features=10240, bias=True)\n",
180
+ " (fc2): Linear4bit(in_features=10240, out_features=2560, bias=True)\n",
181
+ " )\n",
182
+ " (input_layernorm): LayerNorm((2560,), eps=1e-05, elementwise_affine=True)\n",
183
+ " (resid_dropout): Dropout(p=0.1, inplace=False)\n",
184
+ " )\n",
185
+ " )\n",
186
+ " (final_layernorm): LayerNorm((2560,), eps=1e-05, elementwise_affine=True)\n",
187
+ " )\n",
188
+ " (lm_head): Linear(in_features=2560, out_features=51200, bias=True)\n",
189
+ ")\n"
190
+ ]
191
+ }
192
+ ],
193
+ "source": [
194
+ "print(model)"
195
+ ]
196
+ },
197
+ {
198
+ "cell_type": "code",
199
+ "execution_count": 6,
200
+ "id": "18d5599f-992d-4d8e-a90c-4d43774be473",
201
+ "metadata": {},
202
+ "outputs": [
203
+ {
204
+ "name": "stdout",
205
+ "output_type": "stream",
206
+ "text": [
207
+ "trainable params: 17,039,360 || all params: 2,796,723,200 || trainable%: 0.6092615815537269\n"
208
+ ]
209
+ }
210
+ ],
211
+ "source": [
212
+ "config = LoraConfig(\n",
213
+ " r=16,\n",
214
+ " lora_alpha=16,\n",
215
+ " target_modules=[\"q_proj\",\"k_proj\",\"v_proj\"],\n",
216
+ " lora_dropout=0.05,\n",
217
+ " bias=\"none\",\n",
218
+ " task_type=\"CAUSAL_LM\"\n",
219
+ ")\n",
220
+ "\n",
221
+ "model = get_peft_model(model, config)\n",
222
+ "model.print_trainable_parameters()"
223
+ ]
224
+ },
225
+ {
226
+ "cell_type": "code",
227
+ "execution_count": 7,
228
+ "id": "baeee903-3dce-48b2-93c3-7a697d8c6daf",
229
+ "metadata": {},
230
+ "outputs": [],
231
+ "source": [
232
+ "def tokenize(sample):\n",
233
+ " model_inps = tokenizer(sample[\"text\"], padding=True, truncation=True, max_length=512)\n",
234
+ " return model_inps"
235
+ ]
236
+ },
237
+ {
238
+ "cell_type": "code",
239
+ "execution_count": 8,
240
+ "id": "28a9b24a-a822-4fcb-96b3-d77b7ea30a5f",
241
+ "metadata": {},
242
+ "outputs": [
243
+ {
244
+ "name": "stdout",
245
+ "output_type": "stream",
246
+ "text": [
247
+ "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.11/site-packages (1.4.0)\n",
248
+ "Requirement already satisfied: numpy<2.0,>=1.19.5 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.26.4)\n",
249
+ "Requirement already satisfied: scipy>=1.6.0 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.12.0)\n",
250
+ "Requirement already satisfied: joblib>=1.2.0 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.3.2)\n",
251
+ "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (3.3.0)\n"
252
+ ]
253
+ }
254
+ ],
255
+ "source": [
256
+ "!pip install scikit-learn"
257
+ ]
258
+ },
259
+ {
260
+ "cell_type": "code",
261
+ "execution_count": 9,
262
+ "id": "1ee7fd2a-38e4-4f23-a978-0bdeeda64d8b",
263
+ "metadata": {},
264
+ "outputs": [],
265
+ "source": [
266
+ "import pandas as pd\n",
267
+ "\n",
268
+ "from sklearn.model_selection import train_test_split\n",
269
+ "dataset_name='data.csv'\n",
270
+ "df = pd.read_csv(dataset_name)\n",
271
+ "#train, test = train_test_split(df, test_size=0.2)"
272
+ ]
273
+ },
274
+ {
275
+ "cell_type": "code",
276
+ "execution_count": 10,
277
+ "id": "e84c29e2-843e-42c2-8c0f-324d392e671c",
278
+ "metadata": {},
279
+ "outputs": [
280
+ {
281
+ "name": "stderr",
282
+ "output_type": "stream",
283
+ "text": [
284
+ "Tokenizing data: 100%|██████████| 16412/16412 [00:05<00:00, 2902.91 examples/s]\n"
285
+ ]
286
+ },
287
+ {
288
+ "data": {
289
+ "text/plain": [
290
+ "Dataset({\n",
291
+ " features: ['input_ids', 'attention_mask'],\n",
292
+ " num_rows: 16412\n",
293
+ "})"
294
+ ]
295
+ },
296
+ "execution_count": 10,
297
+ "metadata": {},
298
+ "output_type": "execute_result"
299
+ }
300
+ ],
301
+ "source": [
302
+ "data_df = df\n",
303
+ "data_df[\"text\"] = data_df[[\"user\", \"assistant\"]].apply(lambda x: \"question: \" + str(x[\"user\"]) + \" answer: \" + str(x[\"assistant\"]), axis=1)\n",
304
+ "data = Dataset.from_pandas(data_df)\n",
305
+ "tokenized_data = data.map(tokenize, batched=True, desc=\"Tokenizing data\", remove_columns=data.column_names)\n",
306
+ "tokenized_data"
307
+ ]
308
+ },
309
+ {
310
+ "cell_type": "code",
311
+ "execution_count": 11,
312
+ "id": "ac968254-5338-49df-950d-222b82647407",
313
+ "metadata": {},
314
+ "outputs": [],
315
+ "source": [
316
+ "training_arguments = TrainingArguments(\n",
317
+ " output_dir=\".\",\n",
318
+ " per_device_train_batch_size=4,\n",
319
+ " gradient_accumulation_steps=1,\n",
320
+ " learning_rate=2e-4,\n",
321
+ " lr_scheduler_type=\"cosine\",\n",
322
+ " save_strategy=\"epoch\",\n",
323
+ " logging_steps=100,\n",
324
+ " max_steps=1100,\n",
325
+ " num_train_epochs=3,\n",
326
+ " push_to_hub=True\n",
327
+ " )"
328
+ ]
329
+ },
330
+ {
331
+ "cell_type": "code",
332
+ "execution_count": 12,
333
+ "id": "729df2d0-0890-4ac4-adf3-c167a6e9669d",
334
+ "metadata": {},
335
+ "outputs": [
336
+ {
337
+ "name": "stderr",
338
+ "output_type": "stream",
339
+ "text": [
340
+ "huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
341
+ "To disable this warning, you can either:\n",
342
+ "\t- Avoid using `tokenizers` before the fork if possible\n",
343
+ "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
344
+ ]
345
+ },
346
+ {
347
+ "name": "stdout",
348
+ "output_type": "stream",
349
+ "text": [
350
+ "Requirement already satisfied: huggingface_hub in /usr/local/lib/python3.11/site-packages (0.20.3)\n",
351
+ "Requirement already satisfied: filelock in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (3.13.1)\n",
352
+ "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (2023.10.0)\n",
353
+ "Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (2.31.0)\n",
354
+ "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (4.66.2)\n",
355
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (6.0.1)\n",
356
+ "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (4.9.0)\n",
357
+ "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (23.2)\n",
358
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2.1.1)\n",
359
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (3.6)\n",
360
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2.2.0)\n",
361
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2024.2.2)\n"
362
+ ]
363
+ }
364
+ ],
365
+ "source": [
366
+ "!pip install huggingface_hub"
367
+ ]
368
+ },
369
+ {
370
+ "cell_type": "code",
371
+ "execution_count": 13,
372
+ "id": "525f81a4-eb92-466e-bb9c-cd63122231ab",
373
+ "metadata": {},
374
+ "outputs": [
375
+ {
376
+ "name": "stderr",
377
+ "output_type": "stream",
378
+ "text": [
379
+ "huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
380
+ "To disable this warning, you can either:\n",
381
+ "\t- Avoid using `tokenizers` before the fork if possible\n",
382
+ "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
383
+ ]
384
+ },
385
+ {
386
+ "name": "stdout",
387
+ "output_type": "stream",
388
+ "text": [
389
+ "Requirement already satisfied: jupyterlab in /usr/local/lib/python3.11/site-packages (4.1.0)\n",
390
+ "Collecting jupyterlab\n",
391
+ " Downloading jupyterlab-4.1.1-py3-none-any.whl.metadata (15 kB)\n",
392
+ "Collecting jupyterlab-git\n",
393
+ " Downloading jupyterlab_git-0.50.0-py3-none-any.whl.metadata (31 kB)\n",
394
+ "Requirement already satisfied: async-lru>=1.0.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.0.4)\n",
395
+ "Requirement already satisfied: httpx>=0.25.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (0.26.0)\n",
396
+ "Requirement already satisfied: ipykernel in /usr/local/lib/python3.11/site-packages (from jupyterlab) (6.29.1)\n",
397
+ "Requirement already satisfied: jinja2>=3.0.3 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (3.1.3)\n",
398
+ "Requirement already satisfied: jupyter-core in /usr/local/lib/python3.11/site-packages (from jupyterlab) (5.7.1)\n",
399
+ "Requirement already satisfied: jupyter-lsp>=2.0.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.2.2)\n",
400
+ "Requirement already satisfied: jupyter-server<3,>=2.4.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.12.5)\n",
401
+ "Requirement already satisfied: jupyterlab-server<3,>=2.19.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.25.2)\n",
402
+ "Requirement already satisfied: notebook-shim>=0.2 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (0.2.3)\n",
403
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.11/site-packages (from jupyterlab) (23.2)\n",
404
+ "Requirement already satisfied: tornado>=6.2.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (6.4)\n",
405
+ "Requirement already satisfied: traitlets in /usr/local/lib/python3.11/site-packages (from jupyterlab) (5.14.1)\n",
406
+ "Collecting nbdime~=4.0.1 (from jupyterlab-git)\n",
407
+ " Downloading nbdime-4.0.1-py3-none-any.whl.metadata (9.5 kB)\n",
408
+ "Requirement already satisfied: nbformat in /usr/local/lib/python3.11/site-packages (from jupyterlab-git) (5.9.2)\n",
409
+ "Requirement already satisfied: pexpect in /usr/local/lib/python3.11/site-packages (from jupyterlab-git) (4.9.0)\n",
410
+ "Requirement already satisfied: anyio in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (4.2.0)\n",
411
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (2024.2.2)\n",
412
+ "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (1.0.2)\n",
413
+ "Requirement already satisfied: idna in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (3.6)\n",
414
+ "Requirement already satisfied: sniffio in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (1.3.0)\n",
415
+ "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",
416
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/site-packages (from jinja2>=3.0.3->jupyterlab) (2.1.5)\n",
417
+ "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",
418
+ "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",
419
+ "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",
420
+ "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",
421
+ "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",
422
+ "Requirement already satisfied: overrides in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (7.7.0)\n",
423
+ "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",
424
+ "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",
425
+ "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",
426
+ "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",
427
+ "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",
428
+ "Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.11/site-packages (from jupyter-core->jupyterlab) (4.2.0)\n",
429
+ "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",
430
+ "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",
431
+ "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",
432
+ "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",
433
+ "Collecting colorama (from nbdime~=4.0.1->jupyterlab-git)\n",
434
+ " Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n",
435
+ "Collecting gitpython!=2.1.4,!=2.1.5,!=2.1.6 (from nbdime~=4.0.1->jupyterlab-git)\n",
436
+ " Downloading GitPython-3.1.41-py3-none-any.whl.metadata (14 kB)\n",
437
+ "Collecting jupyter-server-mathjax>=0.2.2 (from nbdime~=4.0.1->jupyterlab-git)\n",
438
+ " Downloading jupyter_server_mathjax-0.2.6-py3-none-any.whl (3.1 MB)\n",
439
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.1/3.1 MB\u001b[0m \u001b[31m97.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
440
+ "\u001b[?25hRequirement already satisfied: pygments in /usr/local/lib/python3.11/site-packages (from nbdime~=4.0.1->jupyterlab-git) (2.17.2)\n",
441
+ "Requirement already satisfied: fastjsonschema in /usr/local/lib/python3.11/site-packages (from nbformat->jupyterlab-git) (2.19.1)\n",
442
+ "Requirement already satisfied: comm>=0.1.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (0.2.1)\n",
443
+ "Requirement already satisfied: debugpy>=1.6.5 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (1.8.0)\n",
444
+ "Requirement already satisfied: ipython>=7.23.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (8.21.0)\n",
445
+ "Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (0.1.6)\n",
446
+ "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (1.6.0)\n",
447
+ "Requirement already satisfied: psutil in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (5.9.8)\n",
448
+ "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.11/site-packages (from pexpect->jupyterlab-git) (0.7.0)\n",
449
+ "Collecting gitdb<5,>=4.0.1 (from gitpython!=2.1.4,!=2.1.5,!=2.1.6->nbdime~=4.0.1->jupyterlab-git)\n",
450
+ " Downloading gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)\n",
451
+ "Requirement already satisfied: decorator in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (5.1.1)\n",
452
+ "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",
453
+ "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",
454
+ "Requirement already satisfied: stack-data in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (0.6.3)\n",
455
+ "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",
456
+ "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",
457
+ "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",
458
+ "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",
459
+ "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",
460
+ "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",
461
+ "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",
462
+ "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",
463
+ "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",
464
+ "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",
465
+ "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",
466
+ "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",
467
+ "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",
468
+ "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",
469
+ "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",
470
+ "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",
471
+ "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",
472
+ "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",
473
+ "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",
474
+ "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",
475
+ "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",
476
+ "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",
477
+ "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",
478
+ " Downloading smmap-5.0.1-py3-none-any.whl.metadata (4.3 kB)\n",
479
+ "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",
480
+ "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",
481
+ "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",
482
+ "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",
483
+ "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",
484
+ "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",
485
+ "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",
486
+ "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",
487
+ "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",
488
+ "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",
489
+ "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",
490
+ "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",
491
+ "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",
492
+ "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",
493
+ "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",
494
+ "Downloading jupyterlab-4.1.1-py3-none-any.whl (11.4 MB)\n",
495
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.4/11.4 MB\u001b[0m \u001b[31m150.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
496
+ "\u001b[?25hDownloading jupyterlab_git-0.50.0-py3-none-any.whl (1.2 MB)\n",
497
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m165.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
498
+ "\u001b[?25hDownloading nbdime-4.0.1-py3-none-any.whl (5.9 MB)\n",
499
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━��━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.9/5.9 MB\u001b[0m \u001b[31m140.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
500
+ "\u001b[?25hDownloading GitPython-3.1.41-py3-none-any.whl (196 kB)\n",
501
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m196.4/196.4 kB\u001b[0m \u001b[31m94.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
502
+ "\u001b[?25hDownloading gitdb-4.0.11-py3-none-any.whl (62 kB)\n",
503
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 kB\u001b[0m \u001b[31m156.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
504
+ "\u001b[?25hDownloading smmap-5.0.1-py3-none-any.whl (24 kB)\n",
505
+ "Installing collected packages: smmap, colorama, gitdb, gitpython, jupyter-server-mathjax, nbdime, jupyterlab, jupyterlab-git\n",
506
+ " Attempting uninstall: jupyterlab\n",
507
+ " Found existing installation: jupyterlab 4.1.0\n",
508
+ " Uninstalling jupyterlab-4.1.0:\n",
509
+ " Successfully uninstalled jupyterlab-4.1.0\n",
510
+ "Successfully installed colorama-0.4.6 gitdb-4.0.11 gitpython-3.1.41 jupyter-server-mathjax-0.2.6 jupyterlab-4.1.1 jupyterlab-git-0.50.0 nbdime-4.0.1 smmap-5.0.1\n",
511
+ "Note: you may need to restart the kernel to use updated packages.\n"
512
+ ]
513
+ }
514
+ ],
515
+ "source": [
516
+ "pip install --upgrade jupyterlab jupyterlab-git"
517
+ ]
518
+ },
519
+ {
520
+ "cell_type": "code",
521
+ "execution_count": 14,
522
+ "id": "05d58512-a9e2-4319-88bf-9331c6a0584c",
523
+ "metadata": {},
524
+ "outputs": [
525
+ {
526
+ "name": "stdout",
527
+ "output_type": "stream",
528
+ "text": [
529
+ "\n",
530
+ " _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\n",
531
+ " _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
532
+ " _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\n",
533
+ " _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
534
+ " _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\n",
535
+ "\n",
536
+ " To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .\n"
537
+ ]
538
+ },
539
+ {
540
+ "name": "stdin",
541
+ "output_type": "stream",
542
+ "text": [
543
+ "Token: ········\n",
544
+ "Add token as git credential? (Y/n) n\n"
545
+ ]
546
+ },
547
+ {
548
+ "name": "stdout",
549
+ "output_type": "stream",
550
+ "text": [
551
+ "Token is valid (permission: write).\n",
552
+ "Your token has been saved to /root/.cache/huggingface/token\n",
553
+ "Login successful\n"
554
+ ]
555
+ }
556
+ ],
557
+ "source": [
558
+ "from huggingface_hub import interpreter_login\n",
559
+ "interpreter_login()"
560
+ ]
561
+ },
562
+ {
563
+ "cell_type": "code",
564
+ "execution_count": 15,
565
+ "id": "3bf553b6-b26c-49c3-9407-74c8d53a395e",
566
+ "metadata": {},
567
+ "outputs": [
568
+ {
569
+ "name": "stderr",
570
+ "output_type": "stream",
571
+ "text": [
572
+ "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"
573
+ ]
574
+ },
575
+ {
576
+ "data": {
577
+ "text/html": [
578
+ "\n",
579
+ " <div>\n",
580
+ " \n",
581
+ " <progress value='1100' max='1100' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
582
+ " [1100/1100 07:32, Epoch 0/1]\n",
583
+ " </div>\n",
584
+ " <table border=\"1\" class=\"dataframe\">\n",
585
+ " <thead>\n",
586
+ " <tr style=\"text-align: left;\">\n",
587
+ " <th>Step</th>\n",
588
+ " <th>Training Loss</th>\n",
589
+ " </tr>\n",
590
+ " </thead>\n",
591
+ " <tbody>\n",
592
+ " <tr>\n",
593
+ " <td>100</td>\n",
594
+ " <td>1.414100</td>\n",
595
+ " </tr>\n",
596
+ " <tr>\n",
597
+ " <td>200</td>\n",
598
+ " <td>1.213500</td>\n",
599
+ " </tr>\n",
600
+ " <tr>\n",
601
+ " <td>300</td>\n",
602
+ " <td>1.205500</td>\n",
603
+ " </tr>\n",
604
+ " <tr>\n",
605
+ " <td>400</td>\n",
606
+ " <td>1.142100</td>\n",
607
+ " </tr>\n",
608
+ " <tr>\n",
609
+ " <td>500</td>\n",
610
+ " <td>1.158900</td>\n",
611
+ " </tr>\n",
612
+ " <tr>\n",
613
+ " <td>600</td>\n",
614
+ " <td>1.131100</td>\n",
615
+ " </tr>\n",
616
+ " <tr>\n",
617
+ " <td>700</td>\n",
618
+ " <td>1.160300</td>\n",
619
+ " </tr>\n",
620
+ " <tr>\n",
621
+ " <td>800</td>\n",
622
+ " <td>1.148900</td>\n",
623
+ " </tr>\n",
624
+ " <tr>\n",
625
+ " <td>900</td>\n",
626
+ " <td>1.115100</td>\n",
627
+ " </tr>\n",
628
+ " <tr>\n",
629
+ " <td>1000</td>\n",
630
+ " <td>1.123700</td>\n",
631
+ " </tr>\n",
632
+ " <tr>\n",
633
+ " <td>1100</td>\n",
634
+ " <td>1.143100</td>\n",
635
+ " </tr>\n",
636
+ " </tbody>\n",
637
+ "</table><p>"
638
+ ],
639
+ "text/plain": [
640
+ "<IPython.core.display.HTML object>"
641
+ ]
642
+ },
643
+ "metadata": {},
644
+ "output_type": "display_data"
645
+ },
646
+ {
647
+ "data": {
648
+ "text/plain": [
649
+ "TrainOutput(global_step=1100, training_loss=1.177838169444691, metrics={'train_runtime': 454.4095, 'train_samples_per_second': 9.683, 'train_steps_per_second': 2.421, 'total_flos': 3.603107414016e+16, 'train_loss': 1.177838169444691, 'epoch': 0.27})"
650
+ ]
651
+ },
652
+ "execution_count": 15,
653
+ "metadata": {},
654
+ "output_type": "execute_result"
655
+ }
656
+ ],
657
+ "source": [
658
+ "trainer = Trainer(\n",
659
+ " model=model,\n",
660
+ " train_dataset=tokenized_data,\n",
661
+ " args=training_arguments,\n",
662
+ " data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False)\n",
663
+ ")\n",
664
+ "trainer.train()"
665
+ ]
666
+ },
667
+ {
668
+ "cell_type": "code",
669
+ "execution_count": null,
670
+ "id": "263cc15e-8e9d-4bd8-9708-ec1638bc1165",
671
+ "metadata": {},
672
+ "outputs": [],
673
+ "source": []
674
+ }
675
+ ],
676
+ "metadata": {
677
+ "kernelspec": {
678
+ "display_name": "Python 3 (ipykernel)",
679
+ "language": "python",
680
+ "name": "python3"
681
+ },
682
+ "language_info": {
683
+ "codemirror_mode": {
684
+ "name": "ipython",
685
+ "version": 3
686
+ },
687
+ "file_extension": ".py",
688
+ "mimetype": "text/x-python",
689
+ "name": "python",
690
+ "nbconvert_exporter": "python",
691
+ "pygments_lexer": "ipython3",
692
+ "version": "3.11.5"
693
+ }
694
+ },
695
+ "nbformat": 4,
696
+ "nbformat_minor": 5
697
+ }
adapter_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": null,
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
+ "q_proj"
25
+ ],
26
+ "task_type": "CAUSAL_LM",
27
+ "use_rslora": false
28
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9791595178e2c022ea24fe5360aa7af0060a60c77d5b2f35583ba9045871ca6
3
+ size 31486304
fine-tuned-phi2.ipynb ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "6cb144df-3103-4fbe-96cf-5bc7e7e119c6",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": []
10
+ }
11
+ ],
12
+ "metadata": {
13
+ "kernelspec": {
14
+ "display_name": "Python 3 (ipykernel)",
15
+ "language": "python",
16
+ "name": "python3"
17
+ },
18
+ "language_info": {
19
+ "codemirror_mode": {
20
+ "name": "ipython",
21
+ "version": 3
22
+ },
23
+ "file_extension": ".py",
24
+ "mimetype": "text/x-python",
25
+ "name": "python",
26
+ "nbconvert_exporter": "python",
27
+ "pygments_lexer": "ipython3",
28
+ "version": "3.11.5"
29
+ }
30
+ },
31
+ "nbformat": 4,
32
+ "nbformat_minor": 5
33
+ }
phi-2-custom.ipynb ADDED
@@ -0,0 +1,1045 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "b3b92bc7-d105-405f-970d-804d298b9976",
7
+ "metadata": {
8
+ "scrolled": true
9
+ },
10
+ "outputs": [
11
+ {
12
+ "name": "stdout",
13
+ "output_type": "stream",
14
+ "text": [
15
+ "Collecting accelerate\n",
16
+ " Downloading accelerate-0.27.2-py3-none-any.whl.metadata (18 kB)\n",
17
+ "Collecting transformers\n",
18
+ " Downloading transformers-4.37.2-py3-none-any.whl.metadata (129 kB)\n",
19
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.4/129.4 kB\u001b[0m \u001b[31m80.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
20
+ "\u001b[?25hCollecting einops\n",
21
+ " Downloading einops-0.7.0-py3-none-any.whl.metadata (13 kB)\n",
22
+ "Collecting datasets\n",
23
+ " Downloading datasets-2.17.0-py3-none-any.whl.metadata (20 kB)\n",
24
+ "Collecting peft\n",
25
+ " Downloading peft-0.8.2-py3-none-any.whl.metadata (25 kB)\n",
26
+ "Collecting bitsandbytes\n",
27
+ " Downloading bitsandbytes-0.42.0-py3-none-any.whl.metadata (9.9 kB)\n",
28
+ "Collecting torch\n",
29
+ " Downloading torch-2.2.0-cp311-cp311-manylinux1_x86_64.whl.metadata (25 kB)\n",
30
+ "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.11/site-packages (from accelerate) (1.26.4)\n",
31
+ "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/site-packages (from accelerate) (23.2)\n",
32
+ "Requirement already satisfied: psutil in /usr/local/lib/python3.11/site-packages (from accelerate) (5.9.8)\n",
33
+ "Requirement already satisfied: pyyaml in /usr/local/lib/python3.11/site-packages (from accelerate) (6.0.1)\n",
34
+ "Collecting huggingface-hub (from accelerate)\n",
35
+ " Downloading huggingface_hub-0.20.3-py3-none-any.whl.metadata (12 kB)\n",
36
+ "Collecting safetensors>=0.3.1 (from accelerate)\n",
37
+ " Downloading safetensors-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.8 kB)\n",
38
+ "Collecting filelock (from transformers)\n",
39
+ " Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)\n",
40
+ "Collecting regex!=2019.12.17 (from transformers)\n",
41
+ " Downloading regex-2023.12.25-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (40 kB)\n",
42
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m40.9/40.9 kB\u001b[0m \u001b[31m416.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
43
+ "\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (from transformers) (2.31.0)\n",
44
+ "Collecting tokenizers<0.19,>=0.14 (from transformers)\n",
45
+ " Downloading tokenizers-0.15.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)\n",
46
+ "Collecting tqdm>=4.27 (from transformers)\n",
47
+ " Downloading tqdm-4.66.2-py3-none-any.whl.metadata (57 kB)\n",
48
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m57.6/57.6 kB\u001b[0m \u001b[31m156.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
49
+ "\u001b[?25hCollecting pyarrow>=12.0.0 (from datasets)\n",
50
+ " Downloading pyarrow-15.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (3.0 kB)\n",
51
+ "Collecting pyarrow-hotfix (from datasets)\n",
52
+ " Downloading pyarrow_hotfix-0.6-py3-none-any.whl.metadata (3.6 kB)\n",
53
+ "Collecting dill<0.3.9,>=0.3.0 (from datasets)\n",
54
+ " Downloading dill-0.3.8-py3-none-any.whl.metadata (10 kB)\n",
55
+ "Collecting pandas (from datasets)\n",
56
+ " Downloading pandas-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)\n",
57
+ "Collecting xxhash (from datasets)\n",
58
+ " Downloading xxhash-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n",
59
+ "Collecting multiprocess (from datasets)\n",
60
+ " Downloading multiprocess-0.70.16-py311-none-any.whl.metadata (7.2 kB)\n",
61
+ "Collecting fsspec<=2023.10.0,>=2023.1.0 (from fsspec[http]<=2023.10.0,>=2023.1.0->datasets)\n",
62
+ " Downloading fsspec-2023.10.0-py3-none-any.whl.metadata (6.8 kB)\n",
63
+ "Requirement already satisfied: aiohttp in /usr/local/lib/python3.11/site-packages (from datasets) (3.8.3)\n",
64
+ "Collecting scipy (from bitsandbytes)\n",
65
+ " Downloading scipy-1.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)\n",
66
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.4/60.4 kB\u001b[0m \u001b[31m432.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
67
+ "\u001b[?25hRequirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.11/site-packages (from torch) (4.9.0)\n",
68
+ "Collecting sympy (from torch)\n",
69
+ " Downloading sympy-1.12-py3-none-any.whl.metadata (12 kB)\n",
70
+ "Collecting networkx (from torch)\n",
71
+ " Downloading networkx-3.2.1-py3-none-any.whl.metadata (5.2 kB)\n",
72
+ "Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/site-packages (from torch) (3.1.3)\n",
73
+ "Collecting nvidia-cuda-nvrtc-cu12==12.1.105 (from torch)\n",
74
+ " Downloading nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)\n",
75
+ "Collecting nvidia-cuda-runtime-cu12==12.1.105 (from torch)\n",
76
+ " Downloading nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)\n",
77
+ "Collecting nvidia-cuda-cupti-cu12==12.1.105 (from torch)\n",
78
+ " Downloading nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)\n",
79
+ "Collecting nvidia-cudnn-cu12==8.9.2.26 (from torch)\n",
80
+ " Downloading nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)\n",
81
+ "Collecting nvidia-cublas-cu12==12.1.3.1 (from torch)\n",
82
+ " Downloading nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)\n",
83
+ "Collecting nvidia-cufft-cu12==11.0.2.54 (from torch)\n",
84
+ " Downloading nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)\n",
85
+ "Collecting nvidia-curand-cu12==10.3.2.106 (from torch)\n",
86
+ " Downloading nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)\n",
87
+ "Collecting nvidia-cusolver-cu12==11.4.5.107 (from torch)\n",
88
+ " Downloading nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)\n",
89
+ "Collecting nvidia-cusparse-cu12==12.1.0.106 (from torch)\n",
90
+ " Downloading nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl.metadata (1.6 kB)\n",
91
+ "Collecting nvidia-nccl-cu12==2.19.3 (from torch)\n",
92
+ " Downloading nvidia_nccl_cu12-2.19.3-py3-none-manylinux1_x86_64.whl.metadata (1.8 kB)\n",
93
+ "Collecting nvidia-nvtx-cu12==12.1.105 (from torch)\n",
94
+ " Downloading nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl.metadata (1.7 kB)\n",
95
+ "Collecting triton==2.2.0 (from torch)\n",
96
+ " Downloading triton-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.4 kB)\n",
97
+ "Collecting nvidia-nvjitlink-cu12 (from nvidia-cusolver-cu12==11.4.5.107->torch)\n",
98
+ " Downloading nvidia_nvjitlink_cu12-12.3.101-py3-none-manylinux1_x86_64.whl.metadata (1.5 kB)\n",
99
+ "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (23.2.0)\n",
100
+ "Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (2.1.1)\n",
101
+ "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (6.0.5)\n",
102
+ "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",
103
+ "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.9.4)\n",
104
+ "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.4.1)\n",
105
+ "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.11/site-packages (from aiohttp->datasets) (1.3.1)\n",
106
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (3.6)\n",
107
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (2.2.0)\n",
108
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->transformers) (2024.2.2)\n",
109
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/site-packages (from jinja2->torch) (2.1.5)\n",
110
+ "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/site-packages (from pandas->datasets) (2.8.2)\n",
111
+ "Collecting pytz>=2020.1 (from pandas->datasets)\n",
112
+ " Downloading pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)\n",
113
+ "Collecting tzdata>=2022.7 (from pandas->datasets)\n",
114
+ " Downloading tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)\n",
115
+ "Collecting mpmath>=0.19 (from sympy->torch)\n",
116
+ " Downloading mpmath-1.3.0-py3-none-any.whl (536 kB)\n",
117
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m536.2/536.2 kB\u001b[0m \u001b[31m344.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
118
+ "\u001b[?25hRequirement 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",
119
+ "Downloading accelerate-0.27.2-py3-none-any.whl (279 kB)\n",
120
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m280.0/280.0 kB\u001b[0m \u001b[31m352.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
121
+ "\u001b[?25hDownloading transformers-4.37.2-py3-none-any.whl (8.4 MB)\n",
122
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.4/8.4 MB\u001b[0m \u001b[31m235.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
123
+ "\u001b[?25hDownloading einops-0.7.0-py3-none-any.whl (44 kB)\n",
124
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m44.6/44.6 kB\u001b[0m \u001b[31m358.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
125
+ "\u001b[?25hDownloading datasets-2.17.0-py3-none-any.whl (536 kB)\n",
126
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m536.6/536.6 kB\u001b[0m \u001b[31m461.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
127
+ "\u001b[?25hDownloading peft-0.8.2-py3-none-any.whl (183 kB)\n",
128
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m183.4/183.4 kB\u001b[0m \u001b[31m386.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
129
+ "\u001b[?25hDownloading bitsandbytes-0.42.0-py3-none-any.whl (105.0 MB)\n",
130
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m105.0/105.0 MB\u001b[0m \u001b[31m164.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
131
+ "\u001b[?25hDownloading torch-2.2.0-cp311-cp311-manylinux1_x86_64.whl (755.5 MB)\n",
132
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m755.5/755.5 MB\u001b[0m \u001b[31m257.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
133
+ "\u001b[?25hDownloading nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)\n",
134
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m410.6/410.6 MB\u001b[0m \u001b[31m272.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
135
+ "\u001b[?25hDownloading nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)\n",
136
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m14.1/14.1 MB\u001b[0m \u001b[31m191.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m\n",
137
+ "\u001b[?25hDownloading nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)\n",
138
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m23.7/23.7 MB\u001b[0m \u001b[31m262.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
139
+ "\u001b[?25hDownloading nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)\n",
140
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m823.6/823.6 kB\u001b[0m \u001b[31m553.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
141
+ "\u001b[?25hDownloading nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl (731.7 MB)\n",
142
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m731.7/731.7 MB\u001b[0m \u001b[31m319.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
143
+ "\u001b[?25hDownloading nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB)\n",
144
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.6/121.6 MB\u001b[0m \u001b[31m244.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
145
+ "\u001b[?25hDownloading nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB)\n",
146
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.5/56.5 MB\u001b[0m \u001b[31m294.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
147
+ "\u001b[?25hDownloading nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB)\n",
148
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m124.2/124.2 MB\u001b[0m \u001b[31m276.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
149
+ "\u001b[?25hDownloading nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB)\n",
150
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m196.0/196.0 MB\u001b[0m \u001b[31m163.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
151
+ "\u001b[?25hDownloading nvidia_nccl_cu12-2.19.3-py3-none-manylinux1_x86_64.whl (166.0 MB)\n",
152
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m166.0/166.0 MB\u001b[0m \u001b[31m207.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
153
+ "\u001b[?25hDownloading nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB)\n",
154
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m99.1/99.1 kB\u001b[0m \u001b[31m338.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
155
+ "\u001b[?25hDownloading triton-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (167.9 MB)\n",
156
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m167.9/167.9 MB\u001b[0m \u001b[31m217.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
157
+ "\u001b[?25hDownloading dill-0.3.8-py3-none-any.whl (116 kB)\n",
158
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m116.3/116.3 kB\u001b[0m \u001b[31m340.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
159
+ "\u001b[?25hDownloading fsspec-2023.10.0-py3-none-any.whl (166 kB)\n",
160
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m166.4/166.4 kB\u001b[0m \u001b[31m579.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
161
+ "\u001b[?25hDownloading huggingface_hub-0.20.3-py3-none-any.whl (330 kB)\n",
162
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m330.1/330.1 kB\u001b[0m \u001b[31m454.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
163
+ "\u001b[?25hDownloading pyarrow-15.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (38.3 MB)\n",
164
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m38.3/38.3 MB\u001b[0m \u001b[31m283.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
165
+ "\u001b[?25hDownloading regex-2023.12.25-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (785 kB)\n",
166
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m785.1/785.1 kB\u001b[0m \u001b[31m547.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
167
+ "\u001b[?25hDownloading safetensors-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
168
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m538.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
169
+ "\u001b[?25hDownloading tokenizers-0.15.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)\n",
170
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.6/3.6 MB\u001b[0m \u001b[31m80.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mta \u001b[36m0:00:01\u001b[0m\n",
171
+ "\u001b[?25hDownloading tqdm-4.66.2-py3-none-any.whl (78 kB)\n",
172
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m78.3/78.3 kB\u001b[0m \u001b[31m97.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
173
+ "\u001b[?25hDownloading filelock-3.13.1-py3-none-any.whl (11 kB)\n",
174
+ "Downloading multiprocess-0.70.16-py311-none-any.whl (143 kB)\n",
175
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m143.5/143.5 kB\u001b[0m \u001b[31m396.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
176
+ "\u001b[?25hDownloading networkx-3.2.1-py3-none-any.whl (1.6 MB)\n",
177
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m464.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
178
+ "\u001b[?25hDownloading pandas-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)\n",
179
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.0/13.0 MB\u001b[0m \u001b[31m256.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m\n",
180
+ "\u001b[?25hDownloading pyarrow_hotfix-0.6-py3-none-any.whl (7.9 kB)\n",
181
+ "Downloading scipy-1.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.4 MB)\n",
182
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m38.4/38.4 MB\u001b[0m \u001b[31m282.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
183
+ "\u001b[?25hDownloading sympy-1.12-py3-none-any.whl (5.7 MB)\n",
184
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.7/5.7 MB\u001b[0m \u001b[31m180.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
185
+ "\u001b[?25hDownloading xxhash-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)\n",
186
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m194.8/194.8 kB\u001b[0m \u001b[31m540.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
187
+ "\u001b[?25hDownloading pytz-2024.1-py2.py3-none-any.whl (505 kB)\n",
188
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m505.5/505.5 kB\u001b[0m \u001b[31m586.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
189
+ "\u001b[?25hDownloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n",
190
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m345.4/345.4 kB\u001b[0m \u001b[31m585.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
191
+ "\u001b[?25hDownloading nvidia_nvjitlink_cu12-12.3.101-py3-none-manylinux1_x86_64.whl (20.5 MB)\n",
192
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.5/20.5 MB\u001b[0m \u001b[31m199.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
193
+ "\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",
194
+ "Successfully installed accelerate-0.27.2 bitsandbytes-0.42.0 datasets-2.17.0 dill-0.3.8 einops-0.7.0 filelock-3.13.1 fsspec-2023.10.0 huggingface-hub-0.20.3 mpmath-1.3.0 multiprocess-0.70.16 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.2 torch-2.2.0 tqdm-4.66.2 transformers-4.37.2 triton-2.2.0 tzdata-2024.1 xxhash-3.4.1\n"
195
+ ]
196
+ }
197
+ ],
198
+ "source": [
199
+ "!pip install accelerate transformers einops datasets peft bitsandbytes torch"
200
+ ]
201
+ },
202
+ {
203
+ "cell_type": "code",
204
+ "execution_count": 2,
205
+ "id": "46a53303-b585-4b02-956f-4af173410e25",
206
+ "metadata": {},
207
+ "outputs": [
208
+ {
209
+ "name": "stderr",
210
+ "output_type": "stream",
211
+ "text": [
212
+ "/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",
213
+ " from .autonotebook import tqdm as notebook_tqdm\n"
214
+ ]
215
+ }
216
+ ],
217
+ "source": [
218
+ "import torch\n",
219
+ "from datasets import load_dataset, Dataset\n",
220
+ "from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, Trainer, DataCollatorForLanguageModeling, BitsAndBytesConfig\n",
221
+ "from peft import LoraConfig, get_peft_model\n",
222
+ "import os"
223
+ ]
224
+ },
225
+ {
226
+ "cell_type": "code",
227
+ "execution_count": 3,
228
+ "id": "ffa3ee11-3929-4032-8758-322cda3a912e",
229
+ "metadata": {},
230
+ "outputs": [
231
+ {
232
+ "name": "stderr",
233
+ "output_type": "stream",
234
+ "text": [
235
+ "tokenizer_config.json: 100%|██████████| 7.34k/7.34k [00:00<00:00, 22.1MB/s]\n",
236
+ "vocab.json: 100%|██████████| 798k/798k [00:00<00:00, 3.38MB/s]\n",
237
+ "merges.txt: 100%|██████████| 456k/456k [00:00<00:00, 50.2MB/s]\n",
238
+ "tokenizer.json: 100%|██████████| 2.11M/2.11M [00:00<00:00, 45.9MB/s]\n",
239
+ "added_tokens.json: 100%|██████████| 1.08k/1.08k [00:00<00:00, 8.97MB/s]\n",
240
+ "special_tokens_map.json: 100%|██████████| 99.0/99.0 [00:00<00:00, 779kB/s]\n",
241
+ "Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
242
+ ]
243
+ }
244
+ ],
245
+ "source": [
246
+ "tokenizer = AutoTokenizer.from_pretrained(\"microsoft/phi-2\", trust_remote_code=True)\n",
247
+ "tokenizer.pad_token = tokenizer.eos_token"
248
+ ]
249
+ },
250
+ {
251
+ "cell_type": "code",
252
+ "execution_count": 4,
253
+ "id": "b17096e6-c633-4d88-8cfc-fb738c1e4ca0",
254
+ "metadata": {
255
+ "scrolled": true
256
+ },
257
+ "outputs": [
258
+ {
259
+ "name": "stderr",
260
+ "output_type": "stream",
261
+ "text": [
262
+ "config.json: 100%|██████████| 863/863 [00:00<00:00, 6.70MB/s]\n",
263
+ "configuration_phi.py: 100%|██████████| 9.26k/9.26k [00:00<00:00, 46.0MB/s]\n",
264
+ "A new version of the following files was downloaded from https://huggingface.co/microsoft/phi-2:\n",
265
+ "- configuration_phi.py\n",
266
+ ". 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",
267
+ "modeling_phi.py: 100%|██████████| 62.7k/62.7k [00:00<00:00, 18.8MB/s]\n",
268
+ "A new version of the following files was downloaded from https://huggingface.co/microsoft/phi-2:\n",
269
+ "- modeling_phi.py\n",
270
+ ". 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",
271
+ "model.safetensors.index.json: 100%|██████████| 35.7k/35.7k [00:00<00:00, 126MB/s]\n",
272
+ "Downloading shards: 0%| | 0/2 [00:00<?, ?it/s]\n",
273
+ "model-00001-of-00002.safetensors: 0%| | 0.00/5.00G [00:00<?, ?B/s]\u001b[A\n",
274
+ "model-00001-of-00002.safetensors: 1%| | 31.5M/5.00G [00:00<00:19, 254MB/s]\u001b[A\n",
275
+ "model-00001-of-00002.safetensors: 1%|▏ | 62.9M/5.00G [00:00<00:21, 233MB/s]\u001b[A\n",
276
+ "model-00001-of-00002.safetensors: 2%|▏ | 94.4M/5.00G [00:00<00:21, 227MB/s]\u001b[A\n",
277
+ "model-00001-of-00002.safetensors: 3%|▎ | 126M/5.00G [00:00<00:19, 247MB/s] \u001b[A\n",
278
+ "model-00001-of-00002.safetensors: 3%|▎ | 157M/5.00G [00:00<00:18, 263MB/s]\u001b[A\n",
279
+ "model-00001-of-00002.safetensors: 4%|▍ | 189M/5.00G [00:00<00:18, 262MB/s]\u001b[A\n",
280
+ "model-00001-of-00002.safetensors: 4%|▍ | 220M/5.00G [00:00<00:20, 232MB/s]\u001b[A\n",
281
+ "model-00001-of-00002.safetensors: 5%|▌ | 252M/5.00G [00:01<00:21, 223MB/s]\u001b[A\n",
282
+ "model-00001-of-00002.safetensors: 6%|▌ | 283M/5.00G [00:01<00:22, 207MB/s]\u001b[A\n",
283
+ "model-00001-of-00002.safetensors: 6%|▋ | 315M/5.00G [00:01<00:21, 221MB/s]\u001b[A\n",
284
+ "model-00001-of-00002.safetensors: 7%|▋ | 346M/5.00G [00:01<00:21, 217MB/s]\u001b[A\n",
285
+ "model-00001-of-00002.safetensors: 8%|▊ | 377M/5.00G [00:01<00:22, 205MB/s]\u001b[A\n",
286
+ "model-00001-of-00002.safetensors: 8%|▊ | 409M/5.00G [00:02<00:57, 79.3MB/s]\u001b[A\n",
287
+ "model-00001-of-00002.safetensors: 9%|▊ | 430M/5.00G [00:02<00:49, 91.5MB/s]\u001b[A\n",
288
+ "model-00001-of-00002.safetensors: 9%|▉ | 451M/5.00G [00:02<00:45, 101MB/s] \u001b[A\n",
289
+ "model-00001-of-00002.safetensors: 9%|▉ | 472M/5.00G [00:02<00:39, 115MB/s]\u001b[A\n",
290
+ "model-00001-of-00002.safetensors: 10%|█ | 514M/5.00G [00:03<00:28, 155MB/s]\u001b[A\n",
291
+ "model-00001-of-00002.safetensors: 11%|█ | 545M/5.00G [00:03<00:25, 176MB/s]\u001b[A\n",
292
+ "model-00001-of-00002.safetensors: 12%|█▏ | 577M/5.00G [00:03<00:25, 174MB/s]\u001b[A\n",
293
+ "model-00001-of-00002.safetensors: 12%|█▏ | 598M/5.00G [00:03<00:28, 153MB/s]\u001b[A\n",
294
+ "model-00001-of-00002.safetensors: 13%|█▎ | 629M/5.00G [00:03<00:24, 177MB/s]\u001b[A\n",
295
+ "model-00001-of-00002.safetensors: 13%|█▎ | 661M/5.00G [00:03<00:22, 192MB/s]\u001b[A\n",
296
+ "model-00001-of-00002.safetensors: 14%|█▍ | 692M/5.00G [00:04<00:20, 206MB/s]\u001b[A\n",
297
+ "model-00001-of-00002.safetensors: 14%|█▍ | 724M/5.00G [00:04<00:21, 201MB/s]\u001b[A\n",
298
+ "model-00001-of-00002.safetensors: 15%|█▌ | 755M/5.00G [00:04<00:19, 214MB/s]\u001b[A\n",
299
+ "model-00001-of-00002.safetensors: 16%|█▌ | 786M/5.00G [00:04<00:20, 203MB/s]\u001b[A\n",
300
+ "model-00001-of-00002.safetensors: 16%|█▋ | 818M/5.00G [00:04<00:21, 198MB/s]\u001b[A\n",
301
+ "model-00001-of-00002.safetensors: 17%|█▋ | 839M/5.00G [00:04<00:21, 198MB/s]\u001b[A\n",
302
+ "model-00001-of-00002.safetensors: 17%|█▋ | 870M/5.00G [00:04<00:18, 221MB/s]\u001b[A\n",
303
+ "model-00001-of-00002.safetensors: 18%|█▊ | 902M/5.00G [00:04<00:17, 237MB/s]\u001b[A\n",
304
+ "model-00001-of-00002.safetensors: 19%|█▊ | 933M/5.00G [00:05<00:47, 86.2MB/s]\u001b[A\n",
305
+ "model-00001-of-00002.safetensors: 19%|█▉ | 954M/5.00G [00:05<00:40, 99.0MB/s]\u001b[A\n",
306
+ "model-00001-of-00002.safetensors: 20%|█▉ | 986M/5.00G [00:07<01:16, 52.4MB/s]\u001b[A\n",
307
+ "model-00001-of-00002.safetensors: 20%|██ | 1.01G/5.00G [00:07<01:03, 62.8MB/s]\u001b[A\n",
308
+ "model-00001-of-00002.safetensors: 21%|██ | 1.03G/5.00G [00:07<00:52, 75.3MB/s]\u001b[A\n",
309
+ "model-00001-of-00002.safetensors: 21%|██ | 1.05G/5.00G [00:07<00:44, 89.7MB/s]\u001b[A\n",
310
+ "model-00001-of-00002.safetensors: 22%|██▏ | 1.08G/5.00G [00:07<00:33, 118MB/s] \u001b[A\n",
311
+ "model-00001-of-00002.safetensors: 22%|██▏ | 1.10G/5.00G [00:07<00:29, 130MB/s]\u001b[A\n",
312
+ "model-00001-of-00002.safetensors: 22%|██▏ | 1.12G/5.00G [00:07<00:27, 140MB/s]\u001b[A\n",
313
+ "model-00001-of-00002.safetensors: 23%|██▎ | 1.14G/5.00G [00:08<01:16, 50.1MB/s]\u001b[A\n",
314
+ "model-00001-of-00002.safetensors: 24%|██▎ | 1.17G/5.00G [00:09<00:54, 70.6MB/s]\u001b[A\n",
315
+ "model-00001-of-00002.safetensors: 24%|██▍ | 1.20G/5.00G [00:09<00:44, 84.8MB/s]\u001b[A\n",
316
+ "model-00001-of-00002.safetensors: 24%|██▍ | 1.22G/5.00G [00:09<00:37, 99.8MB/s]\u001b[A\n",
317
+ "model-00001-of-00002.safetensors: 25%|██▍ | 1.24G/5.00G [00:09<00:33, 113MB/s] \u001b[A\n",
318
+ "model-00001-of-00002.safetensors: 25%|██▌ | 1.26G/5.00G [00:09<00:30, 124MB/s]\u001b[A\n",
319
+ "model-00001-of-00002.safetensors: 26%|██▌ | 1.28G/5.00G [00:09<00:29, 126MB/s]\u001b[A\n",
320
+ "model-00001-of-00002.safetensors: 26%|██▌ | 1.31G/5.00G [00:09<00:24, 148MB/s]\u001b[A\n",
321
+ "model-00001-of-00002.safetensors: 27%|██▋ | 1.33G/5.00G [00:10<00:25, 142MB/s]\u001b[A\n",
322
+ "model-00001-of-00002.safetensors: 27%|██▋ | 1.35G/5.00G [00:10<00:26, 136MB/s]\u001b[A\n",
323
+ "model-00001-of-00002.safetensors: 27%|██▋ | 1.37G/5.00G [00:11<01:13, 49.0MB/s]\u001b[A\n",
324
+ "model-00001-of-00002.safetensors: 28%|██▊ | 1.39G/5.00G [00:11<00:59, 60.7MB/s]\u001b[A\n",
325
+ "model-00001-of-00002.safetensors: 28%|██▊ | 1.42G/5.00G [00:11<00:52, 68.8MB/s]\u001b[A\n",
326
+ "model-00001-of-00002.safetensors: 29%|██▉ | 1.45G/5.00G [00:11<00:38, 91.4MB/s]\u001b[A\n",
327
+ "model-00001-of-00002.safetensors: 29%|██▉ | 1.47G/5.00G [00:11<00:34, 103MB/s] \u001b[A\n",
328
+ "model-00001-of-00002.safetensors: 30%|██▉ | 1.49G/5.00G [00:12<00:40, 86.3MB/s]\u001b[A\n",
329
+ "model-00001-of-00002.safetensors: 30%|███ | 1.51G/5.00G [00:12<00:33, 103MB/s] \u001b[A\n",
330
+ "model-00001-of-00002.safetensors: 31%|███ | 1.53G/5.00G [00:13<01:17, 44.5MB/s]\u001b[A\n",
331
+ "model-00001-of-00002.safetensors: 31%|███▏ | 1.56G/5.00G [00:13<00:54, 63.6MB/s]\u001b[A\n",
332
+ "model-00001-of-00002.safetensors: 32%|███▏ | 1.58G/5.00G [00:13<00:47, 71.3MB/s]\u001b[A\n",
333
+ "model-00001-of-00002.safetensors: 32%|███▏ | 1.60G/5.00G [00:14<00:45, 75.2MB/s]\u001b[A\n",
334
+ "model-00001-of-00002.safetensors: 33%|███▎ | 1.63G/5.00G [00:14<00:38, 87.8MB/s]\u001b[A\n",
335
+ "model-00001-of-00002.safetensors: 33%|███▎ | 1.65G/5.00G [00:14<00:32, 102MB/s] \u001b[A\n",
336
+ "model-00001-of-00002.safetensors: 34%|███▎ | 1.68G/5.00G [00:14<00:30, 110MB/s]\u001b[A\n",
337
+ "model-00001-of-00002.safetensors: 34%|███▍ | 1.72G/5.00G [00:14<00:22, 148MB/s]\u001b[A\n",
338
+ "model-00001-of-00002.safetensors: 35%|███▌ | 1.75G/5.00G [00:14<00:19, 171MB/s]\u001b[A\n",
339
+ "model-00001-of-00002.safetensors: 35%|███▌ | 1.77G/5.00G [00:15<00:18, 176MB/s]\u001b[A\n",
340
+ "model-00001-of-00002.safetensors: 36%|███▌ | 1.79G/5.00G [00:15<00:18, 170MB/s]\u001b[A\n",
341
+ "model-00001-of-00002.safetensors: 36%|███▋ | 1.81G/5.00G [00:15<00:19, 165MB/s]\u001b[A\n",
342
+ "model-00001-of-00002.safetensors: 37%|███▋ | 1.85G/5.00G [00:15<00:17, 184MB/s]\u001b[A\n",
343
+ "model-00001-of-00002.safetensors: 38%|███▊ | 1.88G/5.00G [00:15<00:14, 212MB/s]\u001b[A\n",
344
+ "model-00001-of-00002.safetensors: 38%|███▊ | 1.91G/5.00G [00:15<00:14, 216MB/s]\u001b[A\n",
345
+ "model-00001-of-00002.safetensors: 39%|███▉ | 1.94G/5.00G [00:15<00:14, 206MB/s]\u001b[A\n",
346
+ "model-00001-of-00002.safetensors: 39%|███▉ | 1.97G/5.00G [00:16<00:14, 215MB/s]\u001b[A\n",
347
+ "model-00001-of-00002.safetensors: 40%|████ | 2.00G/5.00G [00:16<00:14, 207MB/s]\u001b[A\n",
348
+ "model-00001-of-00002.safetensors: 41%|████ | 2.03G/5.00G [00:16<00:13, 220MB/s]\u001b[A\n",
349
+ "model-00001-of-00002.safetensors: 41%|████▏ | 2.07G/5.00G [00:16<00:13, 222MB/s]\u001b[A\n",
350
+ "model-00001-of-00002.safetensors: 42%|████▏ | 2.10G/5.00G [00:16<00:12, 239MB/s]\u001b[A\n",
351
+ "model-00001-of-00002.safetensors: 43%|████▎ | 2.13G/5.00G [00:16<00:12, 223MB/s]\u001b[A\n",
352
+ "model-00001-of-00002.safetensors: 43%|████▎ | 2.16G/5.00G [00:16<00:13, 207MB/s]\u001b[A\n",
353
+ "model-00001-of-00002.safetensors: 44%|████▍ | 2.19G/5.00G [00:17<00:16, 167MB/s]\u001b[A\n",
354
+ "model-00001-of-00002.safetensors: 44%|████▍ | 2.21G/5.00G [00:17<00:17, 163MB/s]\u001b[A\n",
355
+ "model-00001-of-00002.safetensors: 45%|████▍ | 2.23G/5.00G [00:17<00:16, 165MB/s]\u001b[A\n",
356
+ "model-00001-of-00002.safetensors: 45%|████▌ | 2.25G/5.00G [00:17<00:18, 147MB/s]\u001b[A\n",
357
+ "model-00001-of-00002.safetensors: 46%|████▌ | 2.28G/5.00G [00:17<00:17, 154MB/s]\u001b[A\n",
358
+ "model-00001-of-00002.safetensors: 46%|████▌ | 2.30G/5.00G [00:17<00:16, 159MB/s]\u001b[A\n",
359
+ "model-00001-of-00002.safetensors: 46%|████▋ | 2.32G/5.00G [00:17<00:16, 161MB/s]\u001b[A\n",
360
+ "model-00001-of-00002.safetensors: 47%|████▋ | 2.34G/5.00G [00:18<00:16, 160MB/s]\u001b[A\n",
361
+ "model-00001-of-00002.safetensors: 47%|████▋ | 2.36G/5.00G [00:18<00:16, 163MB/s]\u001b[A\n",
362
+ "model-00001-of-00002.safetensors: 48%|████▊ | 2.38G/5.00G [00:18<00:15, 167MB/s]\u001b[A\n",
363
+ "model-00001-of-00002.safetensors: 48%|████▊ | 2.41G/5.00G [00:18<00:13, 186MB/s]\u001b[A\n",
364
+ "model-00001-of-00002.safetensors: 49%|████▊ | 2.43G/5.00G [00:18<00:14, 182MB/s]\u001b[A\n",
365
+ "model-00001-of-00002.safetensors: 49%|████▉ | 2.45G/5.00G [00:18<00:14, 178MB/s]\u001b[A\n",
366
+ "model-00001-of-00002.safetensors: 50%|████▉ | 2.47G/5.00G [00:18<00:13, 184MB/s]\u001b[A\n",
367
+ "model-00001-of-00002.safetensors: 50%|████▉ | 2.50G/5.00G [00:18<00:15, 166MB/s]\u001b[A\n",
368
+ "model-00001-of-00002.safetensors: 50%|█████ | 2.52G/5.00G [00:19<00:15, 164MB/s]\u001b[A\n",
369
+ "model-00001-of-00002.safetensors: 51%|█████ | 2.54G/5.00G [00:19<00:15, 164MB/s]\u001b[A\n",
370
+ "model-00001-of-00002.safetensors: 51%|█████ | 2.56G/5.00G [00:19<00:14, 166MB/s]\u001b[A\n",
371
+ "model-00001-of-00002.safetensors: 52%|█████▏ | 2.59G/5.00G [00:19<00:12, 192MB/s]\u001b[A\n",
372
+ "model-00001-of-00002.safetensors: 52%|█████▏ | 2.61G/5.00G [00:19<00:13, 180MB/s]\u001b[A\n",
373
+ "model-00001-of-00002.safetensors: 53%|█████▎ | 2.63G/5.00G [00:19<00:14, 167MB/s]\u001b[A\n",
374
+ "model-00001-of-00002.safetensors: 53%|█████▎ | 2.66G/5.00G [00:19<00:12, 194MB/s]\u001b[A\n",
375
+ "model-00001-of-00002.safetensors: 54%|█████▍ | 2.69G/5.00G [00:20<00:10, 212MB/s]\u001b[A\n",
376
+ "model-00001-of-00002.safetensors: 55%|█████▍ | 2.73G/5.00G [00:20<00:11, 200MB/s]\u001b[A\n",
377
+ "model-00001-of-00002.safetensors: 55%|█████▌ | 2.76G/5.00G [00:20<00:10, 211MB/s]\u001b[A\n",
378
+ "model-00001-of-00002.safetensors: 56%|█████▌ | 2.79G/5.00G [00:20<00:10, 205MB/s]\u001b[A\n",
379
+ "model-00001-of-00002.safetensors: 56%|█████▋ | 2.81G/5.00G [00:20<00:11, 192MB/s]\u001b[A\n",
380
+ "model-00001-of-00002.safetensors: 57%|█████▋ | 2.83G/5.00G [00:20<00:12, 178MB/s]\u001b[A\n",
381
+ "model-00001-of-00002.safetensors: 57%|█████▋ | 2.85G/5.00G [00:20<00:11, 180MB/s]\u001b[A\n",
382
+ "model-00001-of-00002.safetensors: 58%|█████▊ | 2.88G/5.00G [00:20<00:10, 201MB/s]\u001b[A\n",
383
+ "model-00001-of-00002.safetensors: 58%|█████▊ | 2.92G/5.00G [00:21<00:09, 214MB/s]\u001b[A\n",
384
+ "model-00001-of-00002.safetensors: 59%|█████▉ | 2.95G/5.00G [00:21<00:11, 174MB/s]\u001b[A\n",
385
+ "model-00001-of-00002.safetensors: 59%|█████▉ | 2.97G/5.00G [00:21<00:13, 154MB/s]\u001b[A\n",
386
+ "model-00001-of-00002.safetensors: 60%|█████▉ | 2.99G/5.00G [00:21<00:13, 154MB/s]\u001b[A\n",
387
+ "model-00001-of-00002.safetensors: 60%|██████ | 3.01G/5.00G [00:21<00:13, 152MB/s]\u001b[A\n",
388
+ "model-00001-of-00002.safetensors: 61%|██████ | 3.03G/5.00G [00:21<00:12, 160MB/s]\u001b[A\n",
389
+ "model-00001-of-00002.safetensors: 61%|██████▏ | 3.06G/5.00G [00:22<00:10, 188MB/s]\u001b[A\n",
390
+ "model-00001-of-00002.safetensors: 62%|██████▏ | 3.08G/5.00G [00:22<00:09, 192MB/s]\u001b[A\n",
391
+ "model-00001-of-00002.safetensors: 62%|██████▏ | 3.10G/5.00G [00:22<00:10, 182MB/s]\u001b[A\n",
392
+ "model-00001-of-00002.safetensors: 63%|██████▎ | 3.14G/5.00G [00:22<00:09, 196MB/s]\u001b[A\n",
393
+ "model-00001-of-00002.safetensors: 63%|██████▎ | 3.17G/5.00G [00:22<00:08, 216MB/s]\u001b[A\n",
394
+ "model-00001-of-00002.safetensors: 64%|██████▍ | 3.21G/5.00G [00:22<00:07, 239MB/s]\u001b[A\n",
395
+ "model-00001-of-00002.safetensors: 65%|██████▍ | 3.24G/5.00G [00:22<00:08, 218MB/s]\u001b[A\n",
396
+ "model-00001-of-00002.safetensors: 65%|██████▌ | 3.27G/5.00G [00:23<00:08, 194MB/s]\u001b[A\n",
397
+ "model-00001-of-00002.safetensors: 66%|██████▌ | 3.30G/5.00G [00:23<00:08, 206MB/s]\u001b[A\n",
398
+ "model-00001-of-00002.safetensors: 67%|██████▋ | 3.33G/5.00G [00:23<00:09, 184MB/s]\u001b[A\n",
399
+ "model-00001-of-00002.safetensors: 67%|██████▋ | 3.36G/5.00G [00:23<00:09, 164MB/s]\u001b[A\n",
400
+ "model-00001-of-00002.safetensors: 68%|██████▊ | 3.38G/5.00G [00:23<00:12, 132MB/s]\u001b[A\n",
401
+ "model-00001-of-00002.safetensors: 68%|██████▊ | 3.40G/5.00G [00:24<00:13, 122MB/s]\u001b[A\n",
402
+ "model-00001-of-00002.safetensors: 68%|██████▊ | 3.42G/5.00G [00:24<00:13, 120MB/s]\u001b[A\n",
403
+ "model-00001-of-00002.safetensors: 69%|██████▉ | 3.44G/5.00G [00:24<00:14, 110MB/s]\u001b[A\n",
404
+ "model-00001-of-00002.safetensors: 69%|██████▉ | 3.46G/5.00G [00:24<00:14, 104MB/s]\u001b[A\n",
405
+ "model-00001-of-00002.safetensors: 70%|██████▉ | 3.48G/5.00G [00:24<00:15, 95.3MB/s]\u001b[A\n",
406
+ "model-00001-of-00002.safetensors: 70%|██████▉ | 3.49G/5.00G [00:25<00:16, 93.6MB/s]\u001b[A\n",
407
+ "model-00001-of-00002.safetensors: 70%|███████ | 3.51G/5.00G [00:25<00:15, 96.6MB/s]\u001b[A\n",
408
+ "model-00001-of-00002.safetensors: 71%|███████ | 3.53G/5.00G [00:25<00:14, 97.9MB/s]\u001b[A\n",
409
+ "model-00001-of-00002.safetensors: 71%|███████ | 3.54G/5.00G [00:25<00:14, 99.1MB/s]\u001b[A\n",
410
+ "model-00001-of-00002.safetensors: 71%|███████ | 3.55G/5.00G [00:25<00:14, 99.1MB/s]\u001b[A\n",
411
+ "model-00001-of-00002.safetensors: 72%|███████▏ | 3.58G/5.00G [00:25<00:11, 122MB/s] \u001b[A\n",
412
+ "model-00001-of-00002.safetensors: 72%|███████▏ | 3.60G/5.00G [00:26<00:11, 119MB/s]\u001b[A\n",
413
+ "model-00001-of-00002.safetensors: 73%|███████▎ | 3.63G/5.00G [00:26<00:08, 154MB/s]\u001b[A\n",
414
+ "model-00001-of-00002.safetensors: 73%|███████▎ | 3.65G/5.00G [00:26<00:10, 128MB/s]\u001b[A\n",
415
+ "model-00001-of-00002.safetensors: 73%|███████▎ | 3.67G/5.00G [00:26<00:11, 115MB/s]\u001b[A\n",
416
+ "model-00001-of-00002.safetensors: 74%|███████▍ | 3.69G/5.00G [00:26<00:12, 101MB/s]\u001b[A\n",
417
+ "model-00001-of-00002.safetensors: 74%|███████▍ | 3.71G/5.00G [00:27<00:11, 110MB/s]\u001b[A\n",
418
+ "model-00001-of-00002.safetensors: 75%|███████▍ | 3.74G/5.00G [00:27<00:09, 127MB/s]\u001b[A\n",
419
+ "model-00001-of-00002.safetensors: 75%|███████▌ | 3.76G/5.00G [00:27<00:09, 128MB/s]\u001b[A\n",
420
+ "model-00001-of-00002.safetensors: 76%|███████▌ | 3.79G/5.00G [00:27<00:08, 142MB/s]\u001b[A\n",
421
+ "model-00001-of-00002.safetensors: 76%|███████▌ | 3.81G/5.00G [00:27<00:10, 112MB/s]\u001b[A\n",
422
+ "model-00001-of-00002.safetensors: 77%|███████▋ | 3.83G/5.00G [00:27<00:11, 105MB/s]\u001b[A\n",
423
+ "model-00001-of-00002.safetensors: 77%|███████▋ | 3.85G/5.00G [00:28<00:11, 98.9MB/s]\u001b[A\n",
424
+ "model-00001-of-00002.safetensors: 77%|███████▋ | 3.87G/5.00G [00:28<00:10, 106MB/s] \u001b[A\n",
425
+ "model-00001-of-00002.safetensors: 78%|███████▊ | 3.89G/5.00G [00:28<00:10, 106MB/s]\u001b[A\n",
426
+ "model-00001-of-00002.safetensors: 78%|███████▊ | 3.91G/5.00G [00:28<00:09, 119MB/s]\u001b[A\n",
427
+ "model-00001-of-00002.safetensors: 79%|███████▊ | 3.93G/5.00G [00:28<00:08, 129MB/s]\u001b[A\n",
428
+ "model-00001-of-00002.safetensors: 79%|███████▉ | 3.96G/5.00G [00:28<00:06, 163MB/s]\u001b[A\n",
429
+ "model-00001-of-00002.safetensors: 80%|███████▉ | 4.00G/5.00G [00:29<00:05, 182MB/s]\u001b[A\n",
430
+ "model-00001-of-00002.safetensors: 80%|████████ | 4.02G/5.00G [00:29<00:05, 183MB/s]\u001b[A\n",
431
+ "model-00001-of-00002.safetensors: 81%|████████ | 4.05G/5.00G [00:29<00:04, 210MB/s]\u001b[A\n",
432
+ "model-00001-of-00002.safetensors: 82%|████████▏ | 4.08G/5.00G [00:29<00:04, 204MB/s]\u001b[A\n",
433
+ "model-00001-of-00002.safetensors: 82%|████████▏ | 4.11G/5.00G [00:29<00:04, 205MB/s]\u001b[A\n",
434
+ "model-00001-of-00002.safetensors: 83%|████████▎ | 4.14G/5.00G [00:29<00:03, 220MB/s]\u001b[A\n",
435
+ "model-00001-of-00002.safetensors: 84%|████████▍ | 4.18G/5.00G [00:29<00:03, 250MB/s]\u001b[A\n",
436
+ "model-00001-of-00002.safetensors: 84%|████████▍ | 4.22G/5.00G [00:30<00:03, 247MB/s]\u001b[A\n",
437
+ "model-00001-of-00002.safetensors: 85%|████████▌ | 4.25G/5.00G [00:30<00:03, 223MB/s]\u001b[A\n",
438
+ "model-00001-of-00002.safetensors: 86%|████████▌ | 4.28G/5.00G [00:30<00:04, 165MB/s]\u001b[A\n",
439
+ "model-00001-of-00002.safetensors: 86%|████████▌ | 4.30G/5.00G [00:30<00:04, 148MB/s]\u001b[A\n",
440
+ "model-00001-of-00002.safetensors: 87%|████████▋ | 4.33G/5.00G [00:30<00:04, 164MB/s]\u001b[A\n",
441
+ "model-00001-of-00002.safetensors: 87%|████████▋ | 4.36G/5.00G [00:31<00:03, 168MB/s]\u001b[A\n",
442
+ "model-00001-of-00002.safetensors: 88%|████████▊ | 4.38G/5.00G [00:31<00:03, 157MB/s]\u001b[A\n",
443
+ "model-00001-of-00002.safetensors: 88%|████████▊ | 4.40G/5.00G [00:31<00:05, 116MB/s]\u001b[A\n",
444
+ "model-00001-of-00002.safetensors: 89%|████████▊ | 4.42G/5.00G [00:31<00:04, 130MB/s]\u001b[A\n",
445
+ "model-00001-of-00002.safetensors: 89%|████████▉ | 4.45G/5.00G [00:31<00:03, 142MB/s]\u001b[A\n",
446
+ "model-00001-of-00002.safetensors: 90%|████████▉ | 4.49G/5.00G [00:31<00:02, 189MB/s]\u001b[A\n",
447
+ "model-00001-of-00002.safetensors: 90%|█████████ | 4.52G/5.00G [00:31<00:02, 205MB/s]\u001b[A\n",
448
+ "model-00001-of-00002.safetensors: 91%|█████████ | 4.55G/5.00G [00:32<00:02, 174MB/s]\u001b[A\n",
449
+ "model-00001-of-00002.safetensors: 92%|█████████▏| 4.57G/5.00G [00:32<00:02, 166MB/s]\u001b[A\n",
450
+ "model-00001-of-00002.safetensors: 92%|█████████▏| 4.60G/5.00G [00:32<00:02, 187MB/s]\u001b[A\n",
451
+ "model-00001-of-00002.safetensors: 93%|█████████▎| 4.63G/5.00G [00:32<00:01, 188MB/s]\u001b[A\n",
452
+ "model-00001-of-00002.safetensors: 93%|█████████▎| 4.67G/5.00G [00:32<00:01, 201MB/s]\u001b[A\n",
453
+ "model-00001-of-00002.safetensors: 94%|█████████▍| 4.70G/5.00G [00:32<00:01, 218MB/s]\u001b[A\n",
454
+ "model-00001-of-00002.safetensors: 95%|█████████▍| 4.73G/5.00G [00:33<00:01, 232MB/s]\u001b[A\n",
455
+ "model-00001-of-00002.safetensors: 95%|█████████▌| 4.76G/5.00G [00:33<00:00, 250MB/s]\u001b[A\n",
456
+ "model-00001-of-00002.safetensors: 96%|█████████▌| 4.79G/5.00G [00:33<00:00, 244MB/s]\u001b[A\n",
457
+ "model-00001-of-00002.safetensors: 97%|█████████▋| 4.82G/5.00G [00:33<00:00, 202MB/s]\u001b[A\n",
458
+ "model-00001-of-00002.safetensors: 97%|█████████▋| 4.85G/5.00G [00:33<00:00, 200MB/s]\u001b[A\n",
459
+ "model-00001-of-00002.safetensors: 98%|█████████▊| 4.89G/5.00G [00:33<00:00, 222MB/s]\u001b[A\n",
460
+ "model-00001-of-00002.safetensors: 98%|█████████▊| 4.92G/5.00G [00:33<00:00, 208MB/s]\u001b[A\n",
461
+ "model-00001-of-00002.safetensors: 99%|█████████▉| 4.95G/5.00G [00:34<00:00, 209MB/s]\u001b[A\n",
462
+ "model-00001-of-00002.safetensors: 100%|██████████| 5.00G/5.00G [00:34<00:00, 146MB/s]\u001b[A\n",
463
+ "Downloading shards: 50%|█████ | 1/2 [00:34<00:34, 34.54s/it]\n",
464
+ "model-00002-of-00002.safetensors: 0%| | 0.00/564M [00:00<?, ?B/s]\u001b[A\n",
465
+ "model-00002-of-00002.safetensors: 6%|▌ | 31.5M/564M [00:00<00:02, 235MB/s]\u001b[A\n",
466
+ "model-00002-of-00002.safetensors: 11%|█ | 62.9M/564M [00:00<00:01, 256MB/s]\u001b[A\n",
467
+ "model-00002-of-00002.safetensors: 17%|█▋ | 94.4M/564M [00:00<00:02, 234MB/s]\u001b[A\n",
468
+ "model-00002-of-00002.safetensors: 24%|██▍ | 136M/564M [00:00<00:01, 273MB/s] \u001b[A\n",
469
+ "model-00002-of-00002.safetensors: 30%|██▉ | 168M/564M [00:00<00:01, 222MB/s]\u001b[A\n",
470
+ "model-00002-of-00002.safetensors: 35%|███▌ | 199M/564M [00:01<00:02, 167MB/s]\u001b[A\n",
471
+ "model-00002-of-00002.safetensors: 39%|███▉ | 220M/564M [00:01<00:01, 175MB/s]\u001b[A\n",
472
+ "model-00002-of-00002.safetensors: 45%|████▍ | 252M/564M [00:01<00:01, 196MB/s]\u001b[A\n",
473
+ "model-00002-of-00002.safetensors: 50%|█████ | 283M/564M [00:01<00:01, 183MB/s]\u001b[A\n",
474
+ "model-00002-of-00002.safetensors: 54%|█████▍ | 304M/564M [00:01<00:01, 187MB/s]\u001b[A\n",
475
+ "model-00002-of-00002.safetensors: 60%|█████▉ | 336M/564M [00:01<00:01, 204MB/s]\u001b[A\n",
476
+ "model-00002-of-00002.safetensors: 67%|██████▋ | 377M/564M [00:01<00:00, 239MB/s]\u001b[A\n",
477
+ "model-00002-of-00002.safetensors: 73%|███████▎ | 409M/564M [00:01<00:00, 245MB/s]\u001b[A\n",
478
+ "model-00002-of-00002.safetensors: 78%|███████▊ | 440M/564M [00:02<00:00, 242MB/s]\u001b[A\n",
479
+ "model-00002-of-00002.safetensors: 84%|████████▎ | 472M/564M [00:02<00:00, 234MB/s]\u001b[A\n",
480
+ "model-00002-of-00002.safetensors: 89%|████████▉ | 503M/564M [00:02<00:00, 192MB/s]\u001b[A\n",
481
+ "model-00002-of-00002.safetensors: 93%|█████████▎| 524M/564M [00:02<00:00, 193MB/s]\u001b[A\n",
482
+ "model-00002-of-00002.safetensors: 100%|██████████| 564M/564M [00:02<00:00, 213MB/s]\u001b[A\n",
483
+ "Downloading shards: 100%|██████████| 2/2 [00:37<00:00, 18.66s/it]\n",
484
+ "Loading checkpoint shards: 100%|██████████| 2/2 [00:02<00:00, 1.40s/it]\n",
485
+ "generation_config.json: 100%|██████████| 124/124 [00:00<00:00, 861kB/s]\n"
486
+ ]
487
+ }
488
+ ],
489
+ "source": [
490
+ "bnb_config = BitsAndBytesConfig(\n",
491
+ " load_in_4bit=True,\n",
492
+ " bnb_4bit_use_double_quant=True,\n",
493
+ " bnb_4bit_quant_type=\"nf4\",\n",
494
+ " bnb_4bit_compute_dtype=torch.float16\n",
495
+ ")\n",
496
+ "\n",
497
+ "model = AutoModelForCausalLM.from_pretrained(\n",
498
+ " \"microsoft/phi-2\",\n",
499
+ " device_map={\"\":0},\n",
500
+ " trust_remote_code=True,\n",
501
+ " quantization_config=bnb_config\n",
502
+ ")"
503
+ ]
504
+ },
505
+ {
506
+ "cell_type": "code",
507
+ "execution_count": 5,
508
+ "id": "e15aa794-e17c-4b09-a64a-c60377259218",
509
+ "metadata": {},
510
+ "outputs": [
511
+ {
512
+ "name": "stdout",
513
+ "output_type": "stream",
514
+ "text": [
515
+ "PhiForCausalLM(\n",
516
+ " (model): PhiModel(\n",
517
+ " (embed_tokens): Embedding(51200, 2560)\n",
518
+ " (embed_dropout): Dropout(p=0.0, inplace=False)\n",
519
+ " (layers): ModuleList(\n",
520
+ " (0-31): 32 x PhiDecoderLayer(\n",
521
+ " (self_attn): PhiAttention(\n",
522
+ " (q_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
523
+ " (k_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
524
+ " (v_proj): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
525
+ " (dense): Linear4bit(in_features=2560, out_features=2560, bias=True)\n",
526
+ " (rotary_emb): PhiRotaryEmbedding()\n",
527
+ " )\n",
528
+ " (mlp): PhiMLP(\n",
529
+ " (activation_fn): NewGELUActivation()\n",
530
+ " (fc1): Linear4bit(in_features=2560, out_features=10240, bias=True)\n",
531
+ " (fc2): Linear4bit(in_features=10240, out_features=2560, bias=True)\n",
532
+ " )\n",
533
+ " (input_layernorm): LayerNorm((2560,), eps=1e-05, elementwise_affine=True)\n",
534
+ " (resid_dropout): Dropout(p=0.1, inplace=False)\n",
535
+ " )\n",
536
+ " )\n",
537
+ " (final_layernorm): LayerNorm((2560,), eps=1e-05, elementwise_affine=True)\n",
538
+ " )\n",
539
+ " (lm_head): Linear(in_features=2560, out_features=51200, bias=True)\n",
540
+ ")\n"
541
+ ]
542
+ }
543
+ ],
544
+ "source": [
545
+ "print(model)"
546
+ ]
547
+ },
548
+ {
549
+ "cell_type": "code",
550
+ "execution_count": 13,
551
+ "id": "18d5599f-992d-4d8e-a90c-4d43774be473",
552
+ "metadata": {},
553
+ "outputs": [
554
+ {
555
+ "name": "stdout",
556
+ "output_type": "stream",
557
+ "text": [
558
+ "trainable params: 7,864,320 || all params: 2,787,548,160 || trainable%: 0.2821231974697076\n"
559
+ ]
560
+ }
561
+ ],
562
+ "source": [
563
+ "config = LoraConfig(\n",
564
+ " r=16,\n",
565
+ " lora_alpha=16,\n",
566
+ " target_modules=[\"q_proj\",\"k_proj\",\"v_proj\"],\n",
567
+ " lora_dropout=0.05,\n",
568
+ " bias=\"none\",\n",
569
+ " task_type=\"CAUSAL_LM\"\n",
570
+ ")\n",
571
+ "\n",
572
+ "model = get_peft_model(model, config)\n",
573
+ "model.print_trainable_parameters()"
574
+ ]
575
+ },
576
+ {
577
+ "cell_type": "code",
578
+ "execution_count": 14,
579
+ "id": "baeee903-3dce-48b2-93c3-7a697d8c6daf",
580
+ "metadata": {},
581
+ "outputs": [],
582
+ "source": [
583
+ "def tokenize(sample):\n",
584
+ " model_inps = tokenizer(sample[\"text\"], padding=True, truncation=True, max_length=512)\n",
585
+ " return model_inps"
586
+ ]
587
+ },
588
+ {
589
+ "cell_type": "code",
590
+ "execution_count": 15,
591
+ "id": "28a9b24a-a822-4fcb-96b3-d77b7ea30a5f",
592
+ "metadata": {},
593
+ "outputs": [
594
+ {
595
+ "name": "stdout",
596
+ "output_type": "stream",
597
+ "text": [
598
+ "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.11/site-packages (1.4.0)\n",
599
+ "Requirement already satisfied: numpy<2.0,>=1.19.5 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.26.4)\n",
600
+ "Requirement already satisfied: scipy>=1.6.0 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.12.0)\n",
601
+ "Requirement already satisfied: joblib>=1.2.0 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (1.3.2)\n",
602
+ "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.11/site-packages (from scikit-learn) (3.3.0)\n"
603
+ ]
604
+ }
605
+ ],
606
+ "source": [
607
+ "!pip install scikit-learn"
608
+ ]
609
+ },
610
+ {
611
+ "cell_type": "code",
612
+ "execution_count": 16,
613
+ "id": "1ee7fd2a-38e4-4f23-a978-0bdeeda64d8b",
614
+ "metadata": {},
615
+ "outputs": [],
616
+ "source": [
617
+ "import pandas as pd\n",
618
+ "\n",
619
+ "from sklearn.model_selection import train_test_split\n",
620
+ "dataset_name='data.csv'\n",
621
+ "df = pd.read_csv(dataset_name)\n",
622
+ "#train, test = train_test_split(df, test_size=0.2)"
623
+ ]
624
+ },
625
+ {
626
+ "cell_type": "code",
627
+ "execution_count": 17,
628
+ "id": "e84c29e2-843e-42c2-8c0f-324d392e671c",
629
+ "metadata": {},
630
+ "outputs": [
631
+ {
632
+ "name": "stderr",
633
+ "output_type": "stream",
634
+ "text": [
635
+ "Tokenizing data: 100%|██████████| 16412/16412 [00:02<00:00, 6502.58 examples/s]\n"
636
+ ]
637
+ },
638
+ {
639
+ "data": {
640
+ "text/plain": [
641
+ "Dataset({\n",
642
+ " features: ['input_ids', 'attention_mask'],\n",
643
+ " num_rows: 16412\n",
644
+ "})"
645
+ ]
646
+ },
647
+ "execution_count": 17,
648
+ "metadata": {},
649
+ "output_type": "execute_result"
650
+ }
651
+ ],
652
+ "source": [
653
+ "data_df = df\n",
654
+ "data_df[\"text\"] = data_df[[\"user\", \"assistant\"]].apply(lambda x: \"question: \" + str(x[\"user\"]) + \" answer: \" + str(x[\"assistant\"]), axis=1)\n",
655
+ "data = Dataset.from_pandas(data_df)\n",
656
+ "tokenized_data = data.map(tokenize, batched=True, desc=\"Tokenizing data\", remove_columns=data.column_names)\n",
657
+ "tokenized_data"
658
+ ]
659
+ },
660
+ {
661
+ "cell_type": "code",
662
+ "execution_count": 18,
663
+ "id": "ac968254-5338-49df-950d-222b82647407",
664
+ "metadata": {},
665
+ "outputs": [],
666
+ "source": [
667
+ "training_arguments = TrainingArguments(\n",
668
+ " output_dir=\".\",\n",
669
+ " per_device_train_batch_size=4,\n",
670
+ " gradient_accumulation_steps=1,\n",
671
+ " learning_rate=2e-4,\n",
672
+ " lr_scheduler_type=\"cosine\",\n",
673
+ " save_strategy=\"epoch\",\n",
674
+ " logging_steps=100,\n",
675
+ " max_steps=1100,\n",
676
+ " num_train_epochs=3,\n",
677
+ " push_to_hub=True\n",
678
+ " )"
679
+ ]
680
+ },
681
+ {
682
+ "cell_type": "code",
683
+ "execution_count": 19,
684
+ "id": "729df2d0-0890-4ac4-adf3-c167a6e9669d",
685
+ "metadata": {},
686
+ "outputs": [
687
+ {
688
+ "name": "stderr",
689
+ "output_type": "stream",
690
+ "text": [
691
+ "huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
692
+ "To disable this warning, you can either:\n",
693
+ "\t- Avoid using `tokenizers` before the fork if possible\n",
694
+ "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
695
+ ]
696
+ },
697
+ {
698
+ "name": "stdout",
699
+ "output_type": "stream",
700
+ "text": [
701
+ "Requirement already satisfied: huggingface_hub in /usr/local/lib/python3.11/site-packages (0.20.3)\n",
702
+ "Requirement already satisfied: filelock in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (3.13.1)\n",
703
+ "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (2023.10.0)\n",
704
+ "Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (2.31.0)\n",
705
+ "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (4.66.2)\n",
706
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (6.0.1)\n",
707
+ "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (4.9.0)\n",
708
+ "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/site-packages (from huggingface_hub) (23.2)\n",
709
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2.1.1)\n",
710
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (3.6)\n",
711
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2.2.0)\n",
712
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->huggingface_hub) (2024.2.2)\n"
713
+ ]
714
+ }
715
+ ],
716
+ "source": [
717
+ "!pip install huggingface_hub"
718
+ ]
719
+ },
720
+ {
721
+ "cell_type": "code",
722
+ "execution_count": 20,
723
+ "id": "525f81a4-eb92-466e-bb9c-cd63122231ab",
724
+ "metadata": {},
725
+ "outputs": [
726
+ {
727
+ "name": "stderr",
728
+ "output_type": "stream",
729
+ "text": [
730
+ "huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
731
+ "To disable this warning, you can either:\n",
732
+ "\t- Avoid using `tokenizers` before the fork if possible\n",
733
+ "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
734
+ ]
735
+ },
736
+ {
737
+ "name": "stdout",
738
+ "output_type": "stream",
739
+ "text": [
740
+ "Requirement already satisfied: jupyterlab in /usr/local/lib/python3.11/site-packages (4.1.0)\n",
741
+ "Collecting jupyterlab\n",
742
+ " Downloading jupyterlab-4.1.1-py3-none-any.whl.metadata (15 kB)\n",
743
+ "Collecting jupyterlab-git\n",
744
+ " Downloading jupyterlab_git-0.50.0-py3-none-any.whl.metadata (31 kB)\n",
745
+ "Requirement already satisfied: async-lru>=1.0.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.0.4)\n",
746
+ "Requirement already satisfied: httpx>=0.25.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (0.26.0)\n",
747
+ "Requirement already satisfied: ipykernel in /usr/local/lib/python3.11/site-packages (from jupyterlab) (6.29.1)\n",
748
+ "Requirement already satisfied: jinja2>=3.0.3 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (3.1.3)\n",
749
+ "Requirement already satisfied: jupyter-core in /usr/local/lib/python3.11/site-packages (from jupyterlab) (5.7.1)\n",
750
+ "Requirement already satisfied: jupyter-lsp>=2.0.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.2.2)\n",
751
+ "Requirement already satisfied: jupyter-server<3,>=2.4.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.12.5)\n",
752
+ "Requirement already satisfied: jupyterlab-server<3,>=2.19.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (2.25.2)\n",
753
+ "Requirement already satisfied: notebook-shim>=0.2 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (0.2.3)\n",
754
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.11/site-packages (from jupyterlab) (23.2)\n",
755
+ "Requirement already satisfied: tornado>=6.2.0 in /usr/local/lib/python3.11/site-packages (from jupyterlab) (6.4)\n",
756
+ "Requirement already satisfied: traitlets in /usr/local/lib/python3.11/site-packages (from jupyterlab) (5.14.1)\n",
757
+ "Collecting nbdime~=4.0.1 (from jupyterlab-git)\n",
758
+ " Downloading nbdime-4.0.1-py3-none-any.whl.metadata (9.5 kB)\n",
759
+ "Requirement already satisfied: nbformat in /usr/local/lib/python3.11/site-packages (from jupyterlab-git) (5.9.2)\n",
760
+ "Requirement already satisfied: pexpect in /usr/local/lib/python3.11/site-packages (from jupyterlab-git) (4.9.0)\n",
761
+ "Requirement already satisfied: anyio in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (4.2.0)\n",
762
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (2024.2.2)\n",
763
+ "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (1.0.2)\n",
764
+ "Requirement already satisfied: idna in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (3.6)\n",
765
+ "Requirement already satisfied: sniffio in /usr/local/lib/python3.11/site-packages (from httpx>=0.25.0->jupyterlab) (1.3.0)\n",
766
+ "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",
767
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/site-packages (from jinja2>=3.0.3->jupyterlab) (2.1.5)\n",
768
+ "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",
769
+ "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",
770
+ "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",
771
+ "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",
772
+ "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",
773
+ "Requirement already satisfied: overrides in /usr/local/lib/python3.11/site-packages (from jupyter-server<3,>=2.4.0->jupyterlab) (7.7.0)\n",
774
+ "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",
775
+ "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",
776
+ "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",
777
+ "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",
778
+ "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",
779
+ "Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.11/site-packages (from jupyter-core->jupyterlab) (4.2.0)\n",
780
+ "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",
781
+ "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",
782
+ "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",
783
+ "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",
784
+ "Collecting colorama (from nbdime~=4.0.1->jupyterlab-git)\n",
785
+ " Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n",
786
+ "Collecting gitpython!=2.1.4,!=2.1.5,!=2.1.6 (from nbdime~=4.0.1->jupyterlab-git)\n",
787
+ " Downloading GitPython-3.1.41-py3-none-any.whl.metadata (14 kB)\n",
788
+ "Collecting jupyter-server-mathjax>=0.2.2 (from nbdime~=4.0.1->jupyterlab-git)\n",
789
+ " Downloading jupyter_server_mathjax-0.2.6-py3-none-any.whl (3.1 MB)\n",
790
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.1/3.1 MB\u001b[0m \u001b[31m265.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
791
+ "\u001b[?25hRequirement already satisfied: pygments in /usr/local/lib/python3.11/site-packages (from nbdime~=4.0.1->jupyterlab-git) (2.17.2)\n",
792
+ "Requirement already satisfied: fastjsonschema in /usr/local/lib/python3.11/site-packages (from nbformat->jupyterlab-git) (2.19.1)\n",
793
+ "Requirement already satisfied: comm>=0.1.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (0.2.1)\n",
794
+ "Requirement already satisfied: debugpy>=1.6.5 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (1.8.0)\n",
795
+ "Requirement already satisfied: ipython>=7.23.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (8.21.0)\n",
796
+ "Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (0.1.6)\n",
797
+ "Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (1.6.0)\n",
798
+ "Requirement already satisfied: psutil in /usr/local/lib/python3.11/site-packages (from ipykernel->jupyterlab) (5.9.8)\n",
799
+ "Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.11/site-packages (from pexpect->jupyterlab-git) (0.7.0)\n",
800
+ "Collecting gitdb<5,>=4.0.1 (from gitpython!=2.1.4,!=2.1.5,!=2.1.6->nbdime~=4.0.1->jupyterlab-git)\n",
801
+ " Downloading gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)\n",
802
+ "Requirement already satisfied: decorator in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (5.1.1)\n",
803
+ "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",
804
+ "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",
805
+ "Requirement already satisfied: stack-data in /usr/local/lib/python3.11/site-packages (from ipython>=7.23.1->ipykernel->jupyterlab) (0.6.3)\n",
806
+ "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",
807
+ "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",
808
+ "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",
809
+ "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",
810
+ "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",
811
+ "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",
812
+ "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",
813
+ "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",
814
+ "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",
815
+ "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",
816
+ "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",
817
+ "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",
818
+ "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",
819
+ "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",
820
+ "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",
821
+ "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",
822
+ "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",
823
+ "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",
824
+ "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",
825
+ "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",
826
+ "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",
827
+ "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",
828
+ "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",
829
+ " Downloading smmap-5.0.1-py3-none-any.whl.metadata (4.3 kB)\n",
830
+ "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",
831
+ "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",
832
+ "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",
833
+ "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",
834
+ "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",
835
+ "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",
836
+ "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",
837
+ "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",
838
+ "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",
839
+ "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",
840
+ "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",
841
+ "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",
842
+ "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",
843
+ "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",
844
+ "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",
845
+ "Downloading jupyterlab-4.1.1-py3-none-any.whl (11.4 MB)\n",
846
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.4/11.4 MB\u001b[0m \u001b[31m434.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
847
+ "\u001b[?25hDownloading jupyterlab_git-0.50.0-py3-none-any.whl (1.2 MB)\n",
848
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m546.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
849
+ "\u001b[?25hDownloading nbdime-4.0.1-py3-none-any.whl (5.9 MB)\n",
850
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.9/5.9 MB\u001b[0m \u001b[31m279.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
851
+ "\u001b[?25hDownloading GitPython-3.1.41-py3-none-any.whl (196 kB)\n",
852
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m196.4/196.4 kB\u001b[0m \u001b[31m474.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
853
+ "\u001b[?25hDownloading gitdb-4.0.11-py3-none-any.whl (62 kB)\n",
854
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 kB\u001b[0m \u001b[31m406.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
855
+ "\u001b[?25hDownloading smmap-5.0.1-py3-none-any.whl (24 kB)\n",
856
+ "Installing collected packages: smmap, colorama, gitdb, gitpython, jupyter-server-mathjax, nbdime, jupyterlab, jupyterlab-git\n",
857
+ " Attempting uninstall: jupyterlab\n",
858
+ " Found existing installation: jupyterlab 4.1.0\n",
859
+ " Uninstalling jupyterlab-4.1.0:\n",
860
+ " Successfully uninstalled jupyterlab-4.1.0\n",
861
+ "Successfully installed colorama-0.4.6 gitdb-4.0.11 gitpython-3.1.41 jupyter-server-mathjax-0.2.6 jupyterlab-4.1.1 jupyterlab-git-0.50.0 nbdime-4.0.1 smmap-5.0.1\n",
862
+ "Note: you may need to restart the kernel to use updated packages.\n"
863
+ ]
864
+ }
865
+ ],
866
+ "source": [
867
+ "pip install --upgrade jupyterlab jupyterlab-git"
868
+ ]
869
+ },
870
+ {
871
+ "cell_type": "code",
872
+ "execution_count": 22,
873
+ "id": "05d58512-a9e2-4319-88bf-9331c6a0584c",
874
+ "metadata": {},
875
+ "outputs": [
876
+ {
877
+ "name": "stdout",
878
+ "output_type": "stream",
879
+ "text": [
880
+ "\n",
881
+ " _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\n",
882
+ " _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
883
+ " _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\n",
884
+ " _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
885
+ " _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\n",
886
+ "\n",
887
+ " To login, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .\n"
888
+ ]
889
+ },
890
+ {
891
+ "name": "stdin",
892
+ "output_type": "stream",
893
+ "text": [
894
+ "Token: ········\n",
895
+ "Add token as git credential? (Y/n) n\n"
896
+ ]
897
+ },
898
+ {
899
+ "name": "stdout",
900
+ "output_type": "stream",
901
+ "text": [
902
+ "Token is valid (permission: write).\n",
903
+ "Your token has been saved to /root/.cache/huggingface/token\n",
904
+ "Login successful\n"
905
+ ]
906
+ }
907
+ ],
908
+ "source": [
909
+ "from huggingface_hub import interpreter_login\n",
910
+ "interpreter_login()"
911
+ ]
912
+ },
913
+ {
914
+ "cell_type": "code",
915
+ "execution_count": null,
916
+ "id": "3bf553b6-b26c-49c3-9407-74c8d53a395e",
917
+ "metadata": {},
918
+ "outputs": [
919
+ {
920
+ "data": {
921
+ "text/html": [
922
+ "\n",
923
+ " <div>\n",
924
+ " \n",
925
+ " <progress value='1044' max='1100' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
926
+ " [1044/1100 03:16 < 00:10, 5.31 it/s, Epoch 0.25/1]\n",
927
+ " </div>\n",
928
+ " <table border=\"1\" class=\"dataframe\">\n",
929
+ " <thead>\n",
930
+ " <tr style=\"text-align: left;\">\n",
931
+ " <th>Step</th>\n",
932
+ " <th>Training Loss</th>\n",
933
+ " </tr>\n",
934
+ " </thead>\n",
935
+ " <tbody>\n",
936
+ " <tr>\n",
937
+ " <td>100</td>\n",
938
+ " <td>1.473100</td>\n",
939
+ " </tr>\n",
940
+ " <tr>\n",
941
+ " <td>200</td>\n",
942
+ " <td>1.236100</td>\n",
943
+ " </tr>\n",
944
+ " <tr>\n",
945
+ " <td>300</td>\n",
946
+ " <td>1.224800</td>\n",
947
+ " </tr>\n",
948
+ " <tr>\n",
949
+ " <td>400</td>\n",
950
+ " <td>1.157900</td>\n",
951
+ " </tr>\n",
952
+ " <tr>\n",
953
+ " <td>500</td>\n",
954
+ " <td>1.177800</td>\n",
955
+ " </tr>\n",
956
+ " <tr>\n",
957
+ " <td>600</td>\n",
958
+ " <td>1.150500</td>\n",
959
+ " </tr>\n",
960
+ " <tr>\n",
961
+ " <td>700</td>\n",
962
+ " <td>1.178100</td>\n",
963
+ " </tr>\n",
964
+ " <tr>\n",
965
+ " <td>800</td>\n",
966
+ " <td>1.166400</td>\n",
967
+ " </tr>\n",
968
+ " <tr>\n",
969
+ " <td>900</td>\n",
970
+ " <td>1.138400</td>\n",
971
+ " </tr>\n",
972
+ " <tr>\n",
973
+ " <td>1000</td>\n",
974
+ " <td>1.144000</td>\n",
975
+ " </tr>\n",
976
+ " </tbody>\n",
977
+ "</table><p>"
978
+ ],
979
+ "text/plain": [
980
+ "<IPython.core.display.HTML object>"
981
+ ]
982
+ },
983
+ "metadata": {},
984
+ "output_type": "display_data"
985
+ }
986
+ ],
987
+ "source": [
988
+ "trainer = Trainer(\n",
989
+ " model=model,\n",
990
+ " train_dataset=tokenized_data,\n",
991
+ " args=training_arguments,\n",
992
+ " data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False)\n",
993
+ ")\n",
994
+ "trainer.train()"
995
+ ]
996
+ },
997
+ {
998
+ "cell_type": "code",
999
+ "execution_count": null,
1000
+ "id": "263cc15e-8e9d-4bd8-9708-ec1638bc1165",
1001
+ "metadata": {},
1002
+ "outputs": [],
1003
+ "source": [
1004
+ "from peft import PeftModel\n",
1005
+ "from transformers import AutoModelForCausalLM\n",
1006
+ "import torch\n",
1007
+ "model = AutoModelForCausalLM.from_pretrained(\"microsoft/phi-2\", trust_remote_code=True, torch_dtype=torch.float32)\n",
1008
+ "peft_model = PeftModel.from_pretrained(model, \"aissatoubalde/lab\", from_transformers=True)\n",
1009
+ "model = peft_model.merge_and_unload()\n",
1010
+ "model"
1011
+ ]
1012
+ },
1013
+ {
1014
+ "cell_type": "code",
1015
+ "execution_count": null,
1016
+ "id": "8eef4f4f-52da-4ba9-8a22-2b7874420562",
1017
+ "metadata": {},
1018
+ "outputs": [],
1019
+ "source": [
1020
+ "model.push_to_hub('aissatoubalde/lab')"
1021
+ ]
1022
+ }
1023
+ ],
1024
+ "metadata": {
1025
+ "kernelspec": {
1026
+ "display_name": "Python 3 (ipykernel)",
1027
+ "language": "python",
1028
+ "name": "python3"
1029
+ },
1030
+ "language_info": {
1031
+ "codemirror_mode": {
1032
+ "name": "ipython",
1033
+ "version": 3
1034
+ },
1035
+ "file_extension": ".py",
1036
+ "mimetype": "text/x-python",
1037
+ "name": "python",
1038
+ "nbconvert_exporter": "python",
1039
+ "pygments_lexer": "ipython3",
1040
+ "version": "3.11.5"
1041
+ }
1042
+ },
1043
+ "nbformat": 4,
1044
+ "nbformat_minor": 5
1045
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6018ee5dd9088c029dec6b7490a081b122e08b3ae81ee63f1cb6fda91dcb9fd4
3
+ size 4664