natmin322 commited on
Commit
5e730b3
·
1 Parent(s): d8766fe

fix: trust_remote_code and abs paths for load_dataset

Browse files
root_gainlora/runtest_colab.ipynb CHANGED
@@ -5,14 +5,223 @@
5
  "execution_count": null,
6
  "id": "bc5f87a4",
7
  "metadata": {},
8
- "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  "source": [
10
  "# Cell for start run\n",
11
  "!git clone -b main --single-branch --depth 1 https://github.com/nnminh322/Continual.git\n",
12
  "!pip install uv\n",
13
  "%cd Continual/root_gainlora/\n",
14
  "!bash setup_kaggle_colab.sh\n",
15
- "!bash gen_script_superni_order1_t5_specroute.sh 0 google/flan-t5-large\n"
16
  ]
17
  },
18
  {
@@ -37,7 +246,117 @@
37
  "# Cell for rerun\n",
38
  "!git clone -b main --single-branch --depth 1 https://github.com/nnminh322/Continual.git\n",
39
  "%cd Continual/root_gainlora/\n",
40
- "!bash gen_script_superni_order1_t5_specroute.sh 0 google/flan-t5-large\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  ]
42
  }
43
  ],
@@ -46,6 +365,18 @@
46
  "display_name": "Python 3 (ipykernel)",
47
  "language": "python",
48
  "name": "python3"
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
  },
51
  "nbformat": 4,
 
5
  "execution_count": null,
6
  "id": "bc5f87a4",
7
  "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "name": "stdout",
11
+ "output_type": "stream",
12
+ "text": [
13
+ "Cloning into 'Continual'...\n",
14
+ "remote: Enumerating objects: 1185, done.\u001b[K\n",
15
+ "remote: Counting objects: 100% (1185/1185), done.\u001b[K\n",
16
+ "remote: Compressing objects: 100% (851/851), done.\u001b[K\n",
17
+ "remote: Total 1185 (delta 271), reused 1164 (delta 267), pack-reused 0 (from 0)\u001b[K\n",
18
+ "Receiving objects: 100% (1185/1185), 341.53 MiB | 30.39 MiB/s, done.\n",
19
+ "Resolving deltas: 100% (271/271), done.\n",
20
+ "Updating files: 100% (1684/1684), done.\n",
21
+ "Collecting uv\n",
22
+ " Downloading uv-0.10.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)\n",
23
+ "Downloading uv-0.10.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23.4 MB)\n",
24
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m23.4/23.4 MB\u001b[0m \u001b[31m85.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n",
25
+ "\u001b[?25hInstalling collected packages: uv\n",
26
+ "Successfully installed uv-0.10.9\n",
27
+ "/content/Continual/root_gainlora\n",
28
+ "==========================================\n",
29
+ "SpecRoute Setup for Kaggle/Colab\n",
30
+ "==========================================\n",
31
+ "[Env] Detected: colab\n",
32
+ "[Setup] Using current Python environment\n",
33
+ "Requirement already satisfied: pip in /usr/local/lib/python3.12/dist-packages (24.1.2)\n",
34
+ "Collecting pip\n",
35
+ " Downloading pip-26.0.1-py3-none-any.whl.metadata (4.7 kB)\n",
36
+ "Requirement already satisfied: setuptools in /usr/local/lib/python3.12/dist-packages (75.2.0)\n",
37
+ "Collecting setuptools\n",
38
+ " Downloading setuptools-82.0.1-py3-none-any.whl.metadata (6.5 kB)\n",
39
+ "Requirement already satisfied: wheel in /usr/local/lib/python3.12/dist-packages (0.46.3)\n",
40
+ "Requirement already satisfied: packaging>=24.0 in /usr/local/lib/python3.12/dist-packages (from wheel) (26.0)\n",
41
+ "Downloading pip-26.0.1-py3-none-any.whl (1.8 MB)\n",
42
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.8/1.8 MB\u001b[0m \u001b[31m31.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
43
+ "\u001b[?25hDownloading setuptools-82.0.1-py3-none-any.whl (1.0 MB)\n",
44
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m71.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
45
+ "\u001b[?25hInstalling collected packages: setuptools, pip\n",
46
+ " Attempting uninstall: setuptools\n",
47
+ " Found existing installation: setuptools 75.2.0\n",
48
+ " Uninstalling setuptools-75.2.0:\n",
49
+ " Successfully uninstalled setuptools-75.2.0\n",
50
+ " Attempting uninstall: pip\n",
51
+ " Found existing installation: pip 24.1.2\n",
52
+ " Uninstalling pip-24.1.2:\n",
53
+ " Successfully uninstalled pip-24.1.2\n",
54
+ "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
55
+ "ipython 7.34.0 requires jedi>=0.16, which is not installed.\u001b[0m\u001b[31m\n",
56
+ "\u001b[0mSuccessfully installed pip-26.0.1 setuptools-82.0.1\n",
57
+ "\n",
58
+ "[Remove] Uninstalling conflicting packages...\n",
59
+ "Found existing installation: torch 2.10.0+cu128\n",
60
+ "Uninstalling torch-2.10.0+cu128:\n",
61
+ " Successfully uninstalled torch-2.10.0+cu128\n",
62
+ "Found existing installation: torchvision 0.25.0+cu128\n",
63
+ "Uninstalling torchvision-0.25.0+cu128:\n",
64
+ " Successfully uninstalled torchvision-0.25.0+cu128\n",
65
+ "Found existing installation: torchaudio 2.10.0+cu128\n",
66
+ "Uninstalling torchaudio-2.10.0+cu128:\n",
67
+ " Successfully uninstalled torchaudio-2.10.0+cu128\n",
68
+ "Found existing installation: triton 3.6.0\n",
69
+ "Uninstalling triton-3.6.0:\n",
70
+ " Successfully uninstalled triton-3.6.0\n",
71
+ "Found existing installation: cupy-cuda12x 14.0.1\n",
72
+ "Uninstalling cupy-cuda12x-14.0.1:\n",
73
+ " Successfully uninstalled cupy-cuda12x-14.0.1\n",
74
+ "Found existing installation: transformers 5.0.0\n",
75
+ "Uninstalling transformers-5.0.0:\n",
76
+ " Successfully uninstalled transformers-5.0.0\n",
77
+ "Found existing installation: tokenizers 0.22.2\n",
78
+ "Uninstalling tokenizers-0.22.2:\n",
79
+ " Successfully uninstalled tokenizers-0.22.2\n",
80
+ "Found existing installation: datasets 4.0.0\n",
81
+ "Uninstalling datasets-4.0.0:\n",
82
+ " Successfully uninstalled datasets-4.0.0\n",
83
+ "Found existing installation: accelerate 1.12.0\n",
84
+ "Uninstalling accelerate-1.12.0:\n",
85
+ " Successfully uninstalled accelerate-1.12.0\n",
86
+ "Found existing installation: peft 0.18.1\n",
87
+ "Uninstalling peft-0.18.1:\n",
88
+ " Successfully uninstalled peft-0.18.1\n",
89
+ "Found existing installation: sentence-transformers 5.2.3\n",
90
+ "Uninstalling sentence-transformers-5.2.3:\n",
91
+ " Successfully uninstalled sentence-transformers-5.2.3\n",
92
+ "Found existing installation: torchtune 0.6.1\n",
93
+ "Uninstalling torchtune-0.6.1:\n",
94
+ " Successfully uninstalled torchtune-0.6.1\n",
95
+ "Found existing installation: cudf-cu12 26.2.1\n",
96
+ "Uninstalling cudf-cu12-26.2.1:\n",
97
+ " Successfully uninstalled cudf-cu12-26.2.1\n",
98
+ "Found existing installation: dask-cudf-cu12 26.2.1\n",
99
+ "Uninstalling dask-cudf-cu12-26.2.1:\n",
100
+ " Successfully uninstalled dask-cudf-cu12-26.2.1\n",
101
+ "Found existing installation: cuml-cu12 26.2.0\n",
102
+ "Uninstalling cuml-cu12-26.2.0:\n",
103
+ " Successfully uninstalled cuml-cu12-26.2.0\n",
104
+ "Found existing installation: cucim-cu12 26.2.0\n",
105
+ "Uninstalling cucim-cu12-26.2.0:\n",
106
+ " Successfully uninstalled cucim-cu12-26.2.0\n",
107
+ "Found existing installation: ydf 0.15.0\n",
108
+ "Uninstalling ydf-0.15.0:\n",
109
+ " Successfully uninstalled ydf-0.15.0\n",
110
+ "Found existing installation: grain 0.2.16\n",
111
+ "Uninstalling grain-0.2.16:\n",
112
+ " Successfully uninstalled grain-0.2.16\n",
113
+ "Found existing installation: umap-learn 0.5.11\n",
114
+ "Uninstalling umap-learn-0.5.11:\n",
115
+ " Successfully uninstalled umap-learn-0.5.11\n",
116
+ "Found existing installation: hdbscan 0.8.41\n",
117
+ "Uninstalling hdbscan-0.8.41:\n",
118
+ " Successfully uninstalled hdbscan-0.8.41\n",
119
+ "Found existing installation: textblob 0.19.0\n",
120
+ "Uninstalling textblob-0.19.0:\n",
121
+ " Successfully uninstalled textblob-0.19.0\n",
122
+ "Found existing installation: opentelemetry-proto 1.38.0\n",
123
+ "Uninstalling opentelemetry-proto-1.38.0:\n",
124
+ " Successfully uninstalled opentelemetry-proto-1.38.0\n",
125
+ "Found existing installation: grpcio-status 1.71.2\n",
126
+ "Uninstalling grpcio-status-1.71.2:\n",
127
+ " Successfully uninstalled grpcio-status-1.71.2\n",
128
+ "Found existing installation: protobuf 5.29.6\n",
129
+ "Uninstalling protobuf-5.29.6:\n",
130
+ " Successfully uninstalled protobuf-5.29.6\n",
131
+ "Found existing installation: jax 0.7.2\n",
132
+ "Uninstalling jax-0.7.2:\n",
133
+ " Successfully uninstalled jax-0.7.2\n",
134
+ "Found existing installation: jaxlib 0.7.2\n",
135
+ "Uninstalling jaxlib-0.7.2:\n",
136
+ " Successfully uninstalled jaxlib-0.7.2\n",
137
+ "Found existing installation: fastai 2.8.7\n",
138
+ "Uninstalling fastai-2.8.7:\n",
139
+ " Successfully uninstalled fastai-2.8.7\n",
140
+ "Found existing installation: dopamine_rl 4.1.2\n",
141
+ "Uninstalling dopamine_rl-4.1.2:\n",
142
+ " Successfully uninstalled dopamine_rl-4.1.2\n",
143
+ "Found existing installation: flax 0.11.2\n",
144
+ "Uninstalling flax-0.11.2:\n",
145
+ " Successfully uninstalled flax-0.11.2\n",
146
+ "Found existing installation: optax 0.2.7\n",
147
+ "Uninstalling optax-0.2.7:\n",
148
+ " Successfully uninstalled optax-0.2.7\n",
149
+ "Found existing installation: orbax-checkpoint 0.11.33\n",
150
+ "Uninstalling orbax-checkpoint-0.11.33:\n",
151
+ " Successfully uninstalled orbax-checkpoint-0.11.33\n",
152
+ "Found existing installation: nx-cugraph-cu12 26.2.0\n",
153
+ "Uninstalling nx-cugraph-cu12-26.2.0:\n",
154
+ " Successfully uninstalled nx-cugraph-cu12-26.2.0\n",
155
+ "Found existing installation: pylibcugraph-cu12 26.2.0\n",
156
+ "Uninstalling pylibcugraph-cu12-26.2.0:\n",
157
+ " Successfully uninstalled pylibcugraph-cu12-26.2.0\n",
158
+ "Found existing installation: opencv-contrib-python 4.13.0.92\n",
159
+ "Uninstalling opencv-contrib-python-4.13.0.92:\n",
160
+ " Successfully uninstalled opencv-contrib-python-4.13.0.92\n",
161
+ "Found existing installation: opencv-python 4.13.0.92\n",
162
+ "Uninstalling opencv-python-4.13.0.92:\n",
163
+ " Successfully uninstalled opencv-python-4.13.0.92\n",
164
+ "Found existing installation: opencv-python-headless 4.13.0.92\n",
165
+ "Uninstalling opencv-python-headless-4.13.0.92:\n",
166
+ " Successfully uninstalled opencv-python-headless-4.13.0.92\n",
167
+ "Found existing installation: shap 0.50.0\n",
168
+ "Uninstalling shap-0.50.0:\n",
169
+ " Successfully uninstalled shap-0.50.0\n",
170
+ "Found existing installation: rasterio 1.5.0\n",
171
+ "Uninstalling rasterio-1.5.0:\n",
172
+ " Successfully uninstalled rasterio-1.5.0\n",
173
+ "Found existing installation: tobler 0.13.0\n",
174
+ "Uninstalling tobler-0.13.0:\n",
175
+ " Successfully uninstalled tobler-0.13.0\n",
176
+ "Found existing installation: pytensor 2.38.0\n",
177
+ "Uninstalling pytensor-2.38.0:\n",
178
+ " Successfully uninstalled pytensor-2.38.0\n",
179
+ "Found existing installation: tensorflow_decision_forests 1.12.0\n",
180
+ "Uninstalling tensorflow_decision_forests-1.12.0:\n",
181
+ " Successfully uninstalled tensorflow_decision_forests-1.12.0\n",
182
+ "Found existing installation: bigframes 2.36.0\n",
183
+ "Uninstalling bigframes-2.36.0:\n",
184
+ " Successfully uninstalled bigframes-2.36.0\n",
185
+ "Found existing installation: google-adk 1.26.0\n",
186
+ "Uninstalling google-adk-1.26.0:\n",
187
+ " Successfully uninstalled google-adk-1.26.0\n",
188
+ "Found existing installation: gcsfs 2025.3.0\n",
189
+ "Uninstalling gcsfs-2025.3.0:\n",
190
+ " Successfully uninstalled gcsfs-2025.3.0\n",
191
+ "\n",
192
+ "[Install] Core CUDA stack (PyTorch cu121)...\n",
193
+ "[Check] torch version after install: 2.5.1+cu121\n",
194
+ "[Install] Project dependencies...\n",
195
+ "[Install] CuPy (with fallback for Python/CUDA compatibility)...\n",
196
+ "[Cache] Clearing stale HuggingFace dataset module cache...\n",
197
+ "[Cache] HF dataset module cache cleared\n",
198
+ "\n",
199
+ "[Check] Verifying installation...\n",
200
+ "✓ python 3.12.12\n",
201
+ "✓ torch 2.5.1+cu121\n",
202
+ "✓ cuda available: True\n",
203
+ "✓ gpu count: 1\n",
204
+ " - GPU 0: Tesla T4 (15.6 GB)\n",
205
+ "✓ transformers 4.40.2\n",
206
+ "✓ datasets 2.21.0\n",
207
+ "✓ cupy 13.6.0\n",
208
+ "\n",
209
+ "[Success] All packages installed correctly!\n",
210
+ "\n",
211
+ "==========================================\n",
212
+ "[Ready] Environment is ready to use\n",
213
+ "==========================================\n",
214
+ "bash: gen_script_superni_order1_t5_specroute.sh: No such file or directory\n"
215
+ ]
216
+ }
217
+ ],
218
  "source": [
219
  "# Cell for start run\n",
220
  "!git clone -b main --single-branch --depth 1 https://github.com/nnminh322/Continual.git\n",
221
  "!pip install uv\n",
222
  "%cd Continual/root_gainlora/\n",
223
  "!bash setup_kaggle_colab.sh\n",
224
+ "!bash gen_script_long_order3_t5_gainlora_inflora.sh 0 google/flan-t5-large\n"
225
  ]
226
  },
227
  {
 
246
  "# Cell for rerun\n",
247
  "!git clone -b main --single-branch --depth 1 https://github.com/nnminh322/Continual.git\n",
248
  "%cd Continual/root_gainlora/\n",
249
+ "!bash gen_script_long_order3_t5_gainlora_inflora.sh 0 google/flan-t5-large\n"
250
+ ]
251
+ },
252
+ {
253
+ "cell_type": "code",
254
+ "execution_count": 1,
255
+ "id": "2ea9f0f8",
256
+ "metadata": {},
257
+ "outputs": [
258
+ {
259
+ "name": "stdout",
260
+ "output_type": "stream",
261
+ "text": [
262
+ "Tue Mar 10 10:52:07 2026 \n",
263
+ "+-----------------------------------------------------------------------------------------+\n",
264
+ "| NVIDIA-SMI 580.82.07 Driver Version: 580.82.07 CUDA Version: 13.0 |\n",
265
+ "+-----------------------------------------+------------------------+----------------------+\n",
266
+ "| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
267
+ "| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |\n",
268
+ "| | | MIG M. |\n",
269
+ "|=========================================+========================+======================|\n",
270
+ "| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n",
271
+ "| N/A 60C P8 10W / 70W | 0MiB / 15360MiB | 0% Default |\n",
272
+ "| | | N/A |\n",
273
+ "+-----------------------------------------+------------------------+----------------------+\n",
274
+ "\n",
275
+ "+-----------------------------------------------------------------------------------------+\n",
276
+ "| Processes: |\n",
277
+ "| GPU GI CI PID Type Process name GPU Memory |\n",
278
+ "| ID ID Usage |\n",
279
+ "|=========================================================================================|\n",
280
+ "| No running processes found |\n",
281
+ "+-----------------------------------------------------------------------------------------+\n"
282
+ ]
283
+ }
284
+ ],
285
+ "source": [
286
+ "!nvidia-smi"
287
+ ]
288
+ },
289
+ {
290
+ "cell_type": "code",
291
+ "execution_count": 7,
292
+ "id": "ad592075",
293
+ "metadata": {},
294
+ "outputs": [
295
+ {
296
+ "name": "stdout",
297
+ "output_type": "stream",
298
+ "text": [
299
+ " the above exception, another exception occurred:\n",
300
+ "\n",
301
+ "Traceback (most recent call last):\n",
302
+ " File \"/content/Continual/root_gainlora/src/run_t5.py\", line 917, in <module>\n",
303
+ " main()\n",
304
+ " File \"/content/Continual/root_gainlora/src/run_t5.py\", line 426, in main\n",
305
+ " raw_datasets = load_dataset(\n",
306
+ " ^^^^^^^^^^^^^\n",
307
+ " File \"/usr/local/lib/python3.12/dist-packages/datasets/load.py\", line 2606, in load_dataset\n",
308
+ " builder_instance = load_dataset_builder(\n",
309
+ " ^^^^^^^^^^^^^^^^^^^^^\n",
310
+ " File \"/usr/local/lib/python3.12/dist-packages/datasets/load.py\", line 2277, in load_dataset_builder\n",
311
+ " dataset_module = dataset_module_factory(\n",
312
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n",
313
+ " File \"/usr/local/lib/python3.12/dist-packages/datasets/load.py\", line 1823, in dataset_module_factory\n",
314
+ " ).get_module()\n",
315
+ " ^^^^^^^^^^^^\n",
316
+ " File \"/usr/local/lib/python3.12/dist-packages/datasets/load.py\", line 968, in get_module\n",
317
+ " trust_remote_code = resolve_trust_remote_code(self.trust_remote_code, self.name)\n",
318
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
319
+ " File \"/usr/local/lib/python3.12/dist-packages/datasets/load.py\", line 134, in resolve_trust_remote_code\n",
320
+ " raise ValueError(\n",
321
+ "ValueError: The repository for cl_dataset contains custom code which must be executed to correctly load the dataset. You can inspect the repository content at https://hf.co/datasets/cl_dataset.\n",
322
+ "Please pass the argument `trust_remote_code=True` to allow custom code to be run.\n",
323
+ "\n",
324
+ "RC: 0\n"
325
+ ]
326
+ }
327
+ ],
328
+ "source": [
329
+ "# Run first task with --max_steps 5, only show last 50 lines \n",
330
+ "import subprocess\n",
331
+ "result = subprocess.run(\n",
332
+ " ['bash', '-c', '''\n",
333
+ "cd /content/Continual/root_gainlora\n",
334
+ "CUDA_VISIBLE_DEVICES=0 python src/run_t5.py \\\n",
335
+ " --do_train --predict_with_generate \\\n",
336
+ " --model_name_or_path google/flan-t5-large \\\n",
337
+ " --data_dir CL_Benchmark \\\n",
338
+ " --task_order yelp,amazon,mnli,cb,copa,qqp,rte,imdb,sst2,dbpedia,agnews,yahoo,multirc,boolq,wic \\\n",
339
+ " --task_config_dir configs/gen_script_long_order3_t5_configs/yelp \\\n",
340
+ " --output_dir /tmp/test_run \\\n",
341
+ " --per_device_train_batch_size 8 --per_device_eval_batch_size 128 \\\n",
342
+ " --gradient_accumulation_steps 4 --learning_rate 0.0003 --num_train_epochs 1 \\\n",
343
+ " --run_name test --max_source_length 512 --max_target_length 50 --generation_max_length 50 \\\n",
344
+ " --add_task_name False --add_dataset_name False --overwrite_output_dir --overwrite_cache \\\n",
345
+ " --lr_scheduler_type constant --warmup_steps 0 --logging_strategy steps --logging_steps 10 \\\n",
346
+ " --metric_for_best_model eval_exact_match --evaluation_strategy steps --save_strategy steps \\\n",
347
+ " --save_total_limit 1 --load_best_model_at_end --lora_r 8 --lora_alpha 32 --lora_dropout 0.0 \\\n",
348
+ " --add_instruction_replay --data_replay_freq -1 --replay_after_n_epoch 0 --mlp_hidden_dim 100 \\\n",
349
+ " --model_name gainlora_inflora --threshold 0.995 --transthreshold 0.995 \\\n",
350
+ " --max_steps 3 2>&1 | tail -50\n",
351
+ "'''],\n",
352
+ " capture_output=True, text=True, timeout=300\n",
353
+ ")\n",
354
+ "# Only print last 1500 chars\n",
355
+ "out = result.stdout[-1500:] if result.stdout else \"\"\n",
356
+ "err = result.stderr[-500:] if result.stderr else \"\"\n",
357
+ "print(out)\n",
358
+ "if err: print(\"ERR:\", err)\n",
359
+ "print(\"RC:\", result.returncode)"
360
  ]
361
  }
362
  ],
 
365
  "display_name": "Python 3 (ipykernel)",
366
  "language": "python",
367
  "name": "python3"
368
+ },
369
+ "language_info": {
370
+ "codemirror_mode": {
371
+ "name": "ipython",
372
+ "version": 3
373
+ },
374
+ "file_extension": ".py",
375
+ "mimetype": "text/x-python",
376
+ "name": "python",
377
+ "nbconvert_exporter": "python",
378
+ "pygments_lexer": "ipython3",
379
+ "version": "3.12.12"
380
  }
381
  },
382
  "nbformat": 4,
root_gainlora/src/run_t5.py CHANGED
@@ -423,11 +423,15 @@ def main():
423
  download_config = DownloadConfig
424
  download_config.local_files_only = True
425
  # Get the CL dataset
 
 
 
426
  raw_datasets = load_dataset(
427
- os.path.join(CURRENT_DIR, "cl_dataset.py"),
428
- data_dir=data_args.data_dir,
429
  download_config=download_config,
430
- task_config_dir=data_args.task_config_dir,
 
431
  # cache_dir=data_cache_dir, # for debug, change dataset size, otherwise open it
432
  max_num_instances_per_task=data_args.max_num_instances_per_task,
433
  max_num_instances_per_eval_task=data_args.max_num_instances_per_eval_task,
@@ -652,12 +656,14 @@ def main():
652
  replay_dataset_dict, replay_label_dict = None, None
653
  if model_args.load_checkpoint_from:
654
  replay_dataset_dict = {}
 
655
  for idx in range(cur_task_id):
656
  raw_datasets_gen = load_dataset(
657
- os.path.join(CURRENT_DIR, "cl_dataset.py"),
658
- data_dir=data_dir,
659
  download_config=download_config,
660
- task_config_dir=task_config[task_order[idx]],
 
661
  cache_dir=data_cache_dir, # for debug, change dataset size, otherwise open it
662
  max_num_instances_per_task=data_args.max_num_instances_per_task,
663
  max_num_instances_per_eval_task=data_args.max_num_instances_per_eval_task,
 
423
  download_config = DownloadConfig
424
  download_config.local_files_only = True
425
  # Get the CL dataset
426
+ dataset_script_path = os.path.join(CURRENT_DIR, "cl_dataset.py")
427
+ abs_data_dir = os.path.abspath(data_args.data_dir) if data_args.data_dir else None
428
+ abs_task_config_dir = os.path.abspath(data_args.task_config_dir) if data_args.task_config_dir else None
429
  raw_datasets = load_dataset(
430
+ dataset_script_path,
431
+ data_dir=abs_data_dir,
432
  download_config=download_config,
433
+ task_config_dir=abs_task_config_dir,
434
+ trust_remote_code=True,
435
  # cache_dir=data_cache_dir, # for debug, change dataset size, otherwise open it
436
  max_num_instances_per_task=data_args.max_num_instances_per_task,
437
  max_num_instances_per_eval_task=data_args.max_num_instances_per_eval_task,
 
656
  replay_dataset_dict, replay_label_dict = None, None
657
  if model_args.load_checkpoint_from:
658
  replay_dataset_dict = {}
659
+ abs_data_dir_replay = os.path.abspath(data_dir) if data_dir else None
660
  for idx in range(cur_task_id):
661
  raw_datasets_gen = load_dataset(
662
+ dataset_script_path,
663
+ data_dir=abs_data_dir_replay,
664
  download_config=download_config,
665
+ task_config_dir=os.path.abspath(task_config[task_order[idx]]) if task_config[task_order[idx]] else None,
666
+ trust_remote_code=True,
667
  cache_dir=data_cache_dir, # for debug, change dataset size, otherwise open it
668
  max_num_instances_per_task=data_args.max_num_instances_per_task,
669
  max_num_instances_per_eval_task=data_args.max_num_instances_per_eval_task,