File size: 716 Bytes
af8efb9
 
 
 
 
 
 
e9f731a
af8efb9
 
e9f731a
 
 
 
 
 
 
af8efb9
 
 
 
e9f731a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.")