Gridmind / scratch /fix_trl_version.py
Prajwal782007's picture
feat: add script to automate TRL dependency updates in the GRPO Colab notebook
e9f731a
raw
history blame contribute delete
716 Bytes
import json
file_path = r"c:\Projects\gridmind\scripts\gridmind_grpo_colab.ipynb"
with open(file_path, 'r', encoding='utf-8') as f:
nb = json.load(f)
# Replace the first code cell's source
for 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 cell
with open(file_path, 'w', encoding='utf-8') as f:
json.dump(nb, f, indent=1)
print("Updated Cell 1 successfully.")