derek-thomas
commited on
Commit
·
9ef5a14
1
Parent(s):
79c7f3b
Updating for faster training
Browse files- 02-autotrain.ipynb +105 -14
02-autotrain.ipynb
CHANGED
@@ -99,7 +99,7 @@
|
|
99 |
" \"base_model\": \"tiiuae/Falcon3-7B-Instruct\",\n",
|
100 |
" \"project_name\": \"\",\n",
|
101 |
" \"log\": \"tensorboard\",\n",
|
102 |
-
" \"backend\": \"spaces-
|
103 |
" \"data\": {\n",
|
104 |
" \"path\": \"derek-thomas/labeled-multiple-choice-explained-falcon-tokenized\",\n",
|
105 |
" \"train_split\": \"train\",\n",
|
@@ -113,8 +113,8 @@
|
|
113 |
" \"block_size\": 512,\n",
|
114 |
" \"model_max_length\": 1500,\n",
|
115 |
" \"epochs\": 4,\n",
|
116 |
-
" \"batch_size\":
|
117 |
-
" \"lr\":
|
118 |
" \"peft\": True,\n",
|
119 |
" \"quantization\": \"int4\",\n",
|
120 |
" \"target_modules\": \"all-linear\",\n",
|
@@ -335,11 +335,10 @@
|
|
335 |
]
|
336 |
},
|
337 |
{
|
338 |
-
"cell_type": "code",
|
339 |
-
"execution_count": null,
|
340 |
-
"id": "f86ed8ad-4e38-454a-a2c1-b1f075399c37",
|
341 |
"metadata": {},
|
|
|
342 |
"outputs": [],
|
|
|
343 |
"source": [
|
344 |
"for space in autotrain_spaces:\n",
|
345 |
" confirm = input(f\"Are you sure you want to delete the space '{space}'? (y/n): \")\n",
|
@@ -348,25 +347,25 @@
|
|
348 |
" print(f\"Deleted {space}\")\n",
|
349 |
" else:\n",
|
350 |
" print(f\"Skipped {space}\")\n"
|
351 |
-
]
|
|
|
352 |
},
|
353 |
{
|
354 |
-
"cell_type": "markdown",
|
355 |
-
"id": "2182f8fe-8504-4cb9-a0a6-4b143541158d",
|
356 |
"metadata": {},
|
|
|
357 |
"source": [
|
358 |
"<span style=\"color:red; font-size:20px; font-weight:bold;\">\n",
|
359 |
"ONLY RUN THIS IF YOU NEED TO RESTART FROM SCRATCH\n",
|
360 |
"THIS WILL DELETE YOUR MODELS\n",
|
361 |
-
"</span
|
362 |
-
]
|
|
|
363 |
},
|
364 |
{
|
365 |
-
"cell_type": "code",
|
366 |
-
"execution_count": null,
|
367 |
-
"id": "12939405-a731-4a7c-ab4a-e1a4f1850bb6",
|
368 |
"metadata": {},
|
|
|
369 |
"outputs": [],
|
|
|
370 |
"source": [
|
371 |
"# for model in autotrain_models:\n",
|
372 |
"# confirm = input(f\"Are you sure you want to delete the model '{model}'? (y/n): \")\n",
|
@@ -375,6 +374,98 @@
|
|
375 |
"# print(f\"Deleted {model}\")\n",
|
376 |
"# else:\n",
|
377 |
"# print(f\"Skipped {model}\")\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
]
|
379 |
},
|
380 |
{
|
|
|
99 |
" \"base_model\": \"tiiuae/Falcon3-7B-Instruct\",\n",
|
100 |
" \"project_name\": \"\",\n",
|
101 |
" \"log\": \"tensorboard\",\n",
|
102 |
+
" \"backend\": \"spaces-a100-large\",\n",
|
103 |
" \"data\": {\n",
|
104 |
" \"path\": \"derek-thomas/labeled-multiple-choice-explained-falcon-tokenized\",\n",
|
105 |
" \"train_split\": \"train\",\n",
|
|
|
113 |
" \"block_size\": 512,\n",
|
114 |
" \"model_max_length\": 1500,\n",
|
115 |
" \"epochs\": 4,\n",
|
116 |
+
" \"batch_size\": 8,\n",
|
117 |
+
" \"lr\": 1e-6,\n",
|
118 |
" \"peft\": True,\n",
|
119 |
" \"quantization\": \"int4\",\n",
|
120 |
" \"target_modules\": \"all-linear\",\n",
|
|
|
335 |
]
|
336 |
},
|
337 |
{
|
|
|
|
|
|
|
338 |
"metadata": {},
|
339 |
+
"cell_type": "code",
|
340 |
"outputs": [],
|
341 |
+
"execution_count": null,
|
342 |
"source": [
|
343 |
"for space in autotrain_spaces:\n",
|
344 |
" confirm = input(f\"Are you sure you want to delete the space '{space}'? (y/n): \")\n",
|
|
|
347 |
" print(f\"Deleted {space}\")\n",
|
348 |
" else:\n",
|
349 |
" print(f\"Skipped {space}\")\n"
|
350 |
+
],
|
351 |
+
"id": "de150f086f1c72fa"
|
352 |
},
|
353 |
{
|
|
|
|
|
354 |
"metadata": {},
|
355 |
+
"cell_type": "markdown",
|
356 |
"source": [
|
357 |
"<span style=\"color:red; font-size:20px; font-weight:bold;\">\n",
|
358 |
"ONLY RUN THIS IF YOU NEED TO RESTART FROM SCRATCH\n",
|
359 |
"THIS WILL DELETE YOUR MODELS\n",
|
360 |
+
"</span>\n"
|
361 |
+
],
|
362 |
+
"id": "e6aa4788fe8b0297"
|
363 |
},
|
364 |
{
|
|
|
|
|
|
|
365 |
"metadata": {},
|
366 |
+
"cell_type": "code",
|
367 |
"outputs": [],
|
368 |
+
"execution_count": null,
|
369 |
"source": [
|
370 |
"# for model in autotrain_models:\n",
|
371 |
"# confirm = input(f\"Are you sure you want to delete the model '{model}'? (y/n): \")\n",
|
|
|
374 |
"# print(f\"Deleted {model}\")\n",
|
375 |
"# else:\n",
|
376 |
"# print(f\"Skipped {model}\")\n"
|
377 |
+
],
|
378 |
+
"id": "c887e61558785e69"
|
379 |
+
},
|
380 |
+
{
|
381 |
+
"cell_type": "code",
|
382 |
+
"execution_count": 12,
|
383 |
+
"id": "a8a8d4c2-0fb5-438c-9fbf-436144d05543",
|
384 |
+
"metadata": {},
|
385 |
+
"outputs": [
|
386 |
+
{
|
387 |
+
"name": "stdin",
|
388 |
+
"output_type": "stream",
|
389 |
+
"text": [
|
390 |
+
"Are you sure you want to move the model from 'derek-thomas/falcon-v03-poe-RFA-gpt3-5' to derek-thomas/falcon-v03-poe-RFA-gpt3-5_backup? (y/n): y\n"
|
391 |
+
]
|
392 |
+
},
|
393 |
+
{
|
394 |
+
"name": "stdout",
|
395 |
+
"output_type": "stream",
|
396 |
+
"text": [
|
397 |
+
"Moved derek-thomas/falcon-v03-poe-RFA-gpt3-5 to derek-thomas/falcon-v03-poe-RFA-gpt3-5_backup\n"
|
398 |
+
]
|
399 |
+
},
|
400 |
+
{
|
401 |
+
"name": "stdin",
|
402 |
+
"output_type": "stream",
|
403 |
+
"text": [
|
404 |
+
"Are you sure you want to move the model from 'derek-thomas/falcon-v03-poe-RFA-falcon' to derek-thomas/falcon-v03-poe-RFA-falcon_backup? (y/n): y\n"
|
405 |
+
]
|
406 |
+
},
|
407 |
+
{
|
408 |
+
"name": "stdout",
|
409 |
+
"output_type": "stream",
|
410 |
+
"text": [
|
411 |
+
"Moved derek-thomas/falcon-v03-poe-RFA-falcon to derek-thomas/falcon-v03-poe-RFA-falcon_backup\n"
|
412 |
+
]
|
413 |
+
},
|
414 |
+
{
|
415 |
+
"name": "stdin",
|
416 |
+
"output_type": "stream",
|
417 |
+
"text": [
|
418 |
+
"Are you sure you want to move the model from 'derek-thomas/falcon-v03-poe-FAR-gpt3-5' to derek-thomas/falcon-v03-poe-FAR-gpt3-5_backup? (y/n): y\n"
|
419 |
+
]
|
420 |
+
},
|
421 |
+
{
|
422 |
+
"name": "stdout",
|
423 |
+
"output_type": "stream",
|
424 |
+
"text": [
|
425 |
+
"Moved derek-thomas/falcon-v03-poe-FAR-gpt3-5 to derek-thomas/falcon-v03-poe-FAR-gpt3-5_backup\n"
|
426 |
+
]
|
427 |
+
},
|
428 |
+
{
|
429 |
+
"name": "stdin",
|
430 |
+
"output_type": "stream",
|
431 |
+
"text": [
|
432 |
+
"Are you sure you want to move the model from 'derek-thomas/falcon-v03-poe-FAR-falcon' to derek-thomas/falcon-v03-poe-FAR-falcon_backup? (y/n): y\n"
|
433 |
+
]
|
434 |
+
},
|
435 |
+
{
|
436 |
+
"name": "stdout",
|
437 |
+
"output_type": "stream",
|
438 |
+
"text": [
|
439 |
+
"Moved derek-thomas/falcon-v03-poe-FAR-falcon to derek-thomas/falcon-v03-poe-FAR-falcon_backup\n"
|
440 |
+
]
|
441 |
+
},
|
442 |
+
{
|
443 |
+
"name": "stdin",
|
444 |
+
"output_type": "stream",
|
445 |
+
"text": [
|
446 |
+
"Are you sure you want to move the model from 'derek-thomas/falcon-v03-poe-FA' to derek-thomas/falcon-v03-poe-FA_backup? (y/n): y\n"
|
447 |
+
]
|
448 |
+
},
|
449 |
+
{
|
450 |
+
"name": "stdout",
|
451 |
+
"output_type": "stream",
|
452 |
+
"text": [
|
453 |
+
"Moved derek-thomas/falcon-v03-poe-FA to derek-thomas/falcon-v03-poe-FA_backup\n"
|
454 |
+
]
|
455 |
+
}
|
456 |
+
],
|
457 |
+
"source": [
|
458 |
+
"from huggingface_hub import move_repo\n",
|
459 |
+
"\n",
|
460 |
+
"for model in autotrain_models:\n",
|
461 |
+
" user, model_tag = model.split('/')\n",
|
462 |
+
" to = f\"{user}/{model_tag}_backup\"\n",
|
463 |
+
" confirm = input(f\"Are you sure you want to move the model from '{model}' to {to}? (y/n): \")\n",
|
464 |
+
" if confirm.lower() == 'y':\n",
|
465 |
+
" move_repo(from_id=model, to_id=to)\n",
|
466 |
+
" print(f\"Moved {model} to {to}\")\n",
|
467 |
+
" else:\n",
|
468 |
+
" print(f\"Skipped {model}\")"
|
469 |
]
|
470 |
},
|
471 |
{
|