Spaces:
Sleeping
Sleeping
Jerry commited on
Commit ·
2aa6cd5
1
Parent(s): bd633bd
fix: remove surrogate pairs from print statements to prevent Colab UnicodeEncodeError
Browse files- train_colab.ipynb +5 -5
train_colab.ipynb
CHANGED
|
@@ -8780,7 +8780,7 @@
|
|
| 8780 |
" logging_steps=5, report_to='none', warmup_steps=3,\n",
|
| 8781 |
" ),\n",
|
| 8782 |
")\n",
|
| 8783 |
-
"print('
|
| 8784 |
"trainer_finetune.train()\n",
|
| 8785 |
"print('\\u2705 Phase 4 complete!\\n')\n",
|
| 8786 |
"\n",
|
|
@@ -8788,7 +8788,7 @@
|
|
| 8788 |
"FastLanguageModel.for_inference(model)\n",
|
| 8789 |
"model.save_pretrained(SAVE_FINETUNED)\n",
|
| 8790 |
"tok.save_pretrained(SAVE_FINETUNED)\n",
|
| 8791 |
-
"print(f'
|
| 8792 |
]
|
| 8793 |
},
|
| 8794 |
{
|
|
@@ -8815,14 +8815,14 @@
|
|
| 8815 |
" actions = extract_all_actions(txt)\n",
|
| 8816 |
"\n",
|
| 8817 |
" if verbose:\n",
|
| 8818 |
-
" print(f'
|
| 8819 |
" print(f' Raw completion preview: {txt[:150]}...')\n",
|
| 8820 |
"\n",
|
| 8821 |
" total = run_sequence(actions, task)\n",
|
| 8822 |
" if verbose: print(f' \\u2192 Live Env Reward: {total:.4f}\\n')\n",
|
| 8823 |
" return total\n",
|
| 8824 |
"\n",
|
| 8825 |
-
"print('
|
| 8826 |
"cot_rewards = []\n",
|
| 8827 |
"for i in range(3):\n",
|
| 8828 |
" print(f'\\n--- CoT Episode {i+1} ---')\n",
|
|
@@ -8831,7 +8831,7 @@
|
|
| 8831 |
" time.sleep(1)\n",
|
| 8832 |
"\n",
|
| 8833 |
"cot_avg = float(np.mean(cot_rewards))\n",
|
| 8834 |
-
"print(f'\\n
|
| 8835 |
]
|
| 8836 |
}
|
| 8837 |
]
|
|
|
|
| 8780 |
" logging_steps=5, report_to='none', warmup_steps=3,\n",
|
| 8781 |
" ),\n",
|
| 8782 |
")\n",
|
| 8783 |
+
"print('[HOT] PHASE 4: Starting Advanced CoT Fine-Tuning...')\n",
|
| 8784 |
"trainer_finetune.train()\n",
|
| 8785 |
"print('\\u2705 Phase 4 complete!\\n')\n",
|
| 8786 |
"\n",
|
|
|
|
| 8788 |
"FastLanguageModel.for_inference(model)\n",
|
| 8789 |
"model.save_pretrained(SAVE_FINETUNED)\n",
|
| 8790 |
"tok.save_pretrained(SAVE_FINETUNED)\n",
|
| 8791 |
+
"print(f'[SAVE] Advanced CoT LoRA saved to {SAVE_FINETUNED}')"
|
| 8792 |
]
|
| 8793 |
},
|
| 8794 |
{
|
|
|
|
| 8815 |
" actions = extract_all_actions(txt)\n",
|
| 8816 |
"\n",
|
| 8817 |
" if verbose:\n",
|
| 8818 |
+
" print(f' [LOG] Generated output includes {len(actions)} actions.')\n",
|
| 8819 |
" print(f' Raw completion preview: {txt[:150]}...')\n",
|
| 8820 |
"\n",
|
| 8821 |
" total = run_sequence(actions, task)\n",
|
| 8822 |
" if verbose: print(f' \\u2192 Live Env Reward: {total:.4f}\\n')\n",
|
| 8823 |
" return total\n",
|
| 8824 |
"\n",
|
| 8825 |
+
"print('[RUN] Running Final CoT Model on TASK-MEDIUM...')\n",
|
| 8826 |
"cot_rewards = []\n",
|
| 8827 |
"for i in range(3):\n",
|
| 8828 |
" print(f'\\n--- CoT Episode {i+1} ---')\n",
|
|
|
|
| 8831 |
" time.sleep(1)\n",
|
| 8832 |
"\n",
|
| 8833 |
"cot_avg = float(np.mean(cot_rewards))\n",
|
| 8834 |
+
"print(f'\\n[WIN] Final CoT Average: {cot_avg:.4f}')"
|
| 8835 |
]
|
| 8836 |
}
|
| 8837 |
]
|