Auroraventures commited on
Commit
81098fd
·
verified ·
1 Parent(s): 30c9bde

Upload cipher-simpo-train.ipynb with huggingface_hub

Browse files
Files changed (1) hide show
  1. cipher-simpo-train.ipynb +1 -1
cipher-simpo-train.ipynb CHANGED
@@ -19,7 +19,7 @@
19
  "metadata": {},
20
  "execution_count": null,
21
  "outputs": [],
22
- "source": "# Cell 1 — Install\n!pip install -U unsloth trl datasets huggingface_hub -q\n!pip install --no-deps git+https://github.com/unslothai/unsloth.git@nightly -q\nimport os\nfrom google.colab import userdata\ntry:\n os.environ['HF_TOKEN'] = userdata.get('HF_TOKEN')\nexcept Exception:\n raise RuntimeError('Add HF_TOKEN to Colab Secrets (left sidebar key icon).')\nos.environ['WANDB_DISABLED'] = 'true'\nfrom huggingface_hub import login\nlogin(token=os.environ['HF_TOKEN'])\nprint('Setup done')"
23
  },
24
  {
25
  "cell_type": "code",
 
19
  "metadata": {},
20
  "execution_count": null,
21
  "outputs": [],
22
+ "source": "# Cell 1 — Install\n!pip install -U unsloth trl datasets huggingface_hub -q\n!pip install --no-deps git+https://github.com/unslothai/unsloth.git@nightly -q\nimport os\nfrom google.colab import userdata\n\n# Try multiple secret names (case-insensitive fallback)\nhf_token = None\nfor name in ['HF_TOKEN', 'hf_token', 'HF_TOKE2', 'HF_TOKE', 'huggingface_token']:\n try:\n v = userdata.get(name)\n if v:\n hf_token = v\n print(f'Using token from secret: {name}')\n break\n except Exception:\n continue\n\nif not hf_token:\n raise RuntimeError(\n 'No HF token found. Add a Colab Secret named HF_TOKEN '\n '(left sidebar 🔑 icon) with toggle ON for this notebook.'\n )\n\nos.environ['HF_TOKEN'] = hf_token\nos.environ['WANDB_DISABLED'] = 'true'\nfrom huggingface_hub import login\nlogin(token=os.environ['HF_TOKEN'])\nprint('Setup done')"
23
  },
24
  {
25
  "cell_type": "code",