|
|
| import re |
|
|
| EVAL = "/workspace/rl4phyx/RL4Phyx/SFT/sft_eval_footprint" |
| ORIG = f"{EVAL}/eval_openended_inference.py" |
|
|
| |
| with open(ORIG) as f: |
| content = f.read() |
|
|
| |
| phyx = content |
| phyx = phyx.replace("sft_qwen25vl_3b_fullft/final", "sft_qwen25vl_3b_fullft_phyx/final") |
| phyx = phyx.replace("inference_results_sft.jsonl", "inference_results_phyx_v2.jsonl") |
| phyx = re.sub(r"BASE_GPUS\s*=\s*\[.*?\]", "BASE_GPUS = []", phyx) |
| phyx = re.sub(r"SFT_GPUS\s*=\s*\[.*?\]", "SFT_GPUS = [0, 1, 2, 3]", phyx) |
| with open(f"{EVAL}/eval_phyx_v2.py", "w") as f: |
| f.write(phyx) |
| print("phyx_v2 created") |
|
|
| |
| for line in phyx.split("\n"): |
| if any(k in line for k in ["BASE_GPUS", "SFT_GPUS", "SFT_MODEL", "OUTPUT_FILE"]): |
| print(f" {line.strip()}") |
|
|
| |
| p50k = content |
| p50k = p50k.replace("sft_qwen25vl_3b_fullft/final", "sft_qwen25vl_3b_fullft_phyx_50000/final") |
| p50k = p50k.replace("inference_results_sft.jsonl", "inference_results_phyx_50000_v2.jsonl") |
| p50k = re.sub(r"BASE_GPUS\s*=\s*\[.*?\]", "BASE_GPUS = []", p50k) |
| |
| with open(f"{EVAL}/eval_phyx_50000_v2.py", "w") as f: |
| f.write(p50k) |
| print("phyx_50000_v2 created") |
|
|
| for line in p50k.split("\n"): |
| if any(k in line for k in ["BASE_GPUS", "SFT_GPUS", "SFT_MODEL", "OUTPUT_FILE"]): |
| print(f" {line.strip()}") |
|
|
|
|