File size: 689 Bytes
08731ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)

for cell in nb['cells']:
    if cell.get('id') == 'ceac8c9d':
        source = cell['source']
        for i, line in enumerate(source):
            if 'tokenizer=tokenizer,' in line:
                source[i] = line.replace('tokenizer=tokenizer,', 'processing_class=tokenizer,')
                print("Updated tokenizer to processing_class in Step 6")
                break
        cell['source'] = source
        break

with open(file_path, 'w', encoding='utf-8') as f:
    json.dump(nb, f, indent=1)
    
print("Change applied.")