File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,26 @@ if [ -f 'PaddleFleet/.venv/bin/activate' ]; then
1818 source PaddleFleet/.venv/bin/activate
1919fi
2020
21+ export root_dir=$( pwd)
22+ python -c "
23+ infile = '$root_dir /PaddleFormers/paddleformers/transformers/glm4_moe/modeling.py'
24+ print(infile)
25+ outfile = infile + '.new'
26+ with open(infile) as fin:
27+ lines = fin.readlines()
28+ with open(outfile, 'w') as fout:
29+ i = 0
30+ while i < len(lines):
31+ line = lines[i]
32+ pad = line[:len(line)-len(line.lstrip())]
33+ if line.lstrip().startswith('config.fuse_rms_norm = False'):
34+ fout.write(pad + 'config.fuse_rms_norm = True\n')
35+ else:
36+ fout.write(line)
37+ i += 1
38+ "
39+ mv $root_dir /PaddleFormers/paddleformers/transformers/glm4_moe/modeling.py.new $root_dir /PaddleFormers/paddleformers/transformers/glm4_moe/modeling.py
40+
2141export root_dir=$( pwd)
2242
2343export config_yaml=$root_dir /PaddleFormers/tests/config/ci/glm45_pt_fp8.yaml
You can’t perform that action at this time.
0 commit comments