Spaces:
Running
Running
Commit ·
e9f731a
1
Parent(s): 7597057
feat: add script to automate TRL dependency updates in the GRPO Colab notebook
Browse files4 unmodified lines5678910111213141516174 unmodified lineswith open(file_path, 'r', encoding='utf-8') as f:nb = json.load(f)for cell in nb['cells']:if cell['cell_type'] == 'code':for i, line in enumerate(cell['source']):if '!pip install trl==0.8.6' in line:cell['source'][i] = line.replace('trl==0.8.6', 'trl>=0.14.0')with open(file_path, 'w', encoding='utf-8') as f:json.dump(nb, f, indent=1)print("Updated notebook to use trl>=0.14.0")4 unmodified lines56789101112131415161718192021224 unmodified lineswith open(file_path, 'r', encoding='utf-8') as f:nb = json.load(f)# Replace the first code cell's sourcefor cell in nb['cells']:if cell['cell_type'] == 'code':cell['source'] = ["!pip install trl transformers accelerate datasets unsloth requests pandas matplotlib\n","import os\n","os.makedirs('results', exist_ok=True)\n","print(\"✔ All dependencies installed\")\n"]break # Only replace the very first code cellwith open(file_path, 'w', encoding='utf-8') as f:json.dump(nb, f, indent=1)print("Updated Cell 1 successfully.")
scratch/fix_trl_version.py+9-4