Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions examples/experimental/swe-agent-v2/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ class ScriptArgs(U.ExecuteTrainConfig):
hf_checkpoint: str = "zai-org/GLM-4.7-Flash"
ref_load: str = "/root/GLM-4.7-Flash_torch_dist"
save_dir: str = "/root/GLM-4.7-Flash_agent_v2/"
max_seq_len: int = 16384
prompt_data: str = "/root/swe_train.jsonl"

# Training settings
max_seq_len: int = 16384
rollout_batch_size: int = 2
n_samples_per_prompt: int = 4
global_batch_size: int = 8
Comment on lines +45 to +47

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency and improved configurability, consider also moving other hardcoded training parameters from the "execute" function to this "ScriptArgs" class. Specifically, "num_rollout", "rollout_temperature", and "rollout_max_response_len" are currently hardcoded in the "rollout_args" string. Moving them here would centralize all related training settings.

References
  1. Model parameters should be retrieved from the model configuration rather than being hardcoded.


# Agent settings
agent_server_url: str = os.environ.get(
"AGENT_SERVER_URL", os.environ.get("SWE_AGENT_URL", "http://agent_env:11000")
Expand Down Expand Up @@ -104,12 +109,12 @@ def execute(args: ScriptArgs):
"--metadata-key metadata "
"--rollout-shuffle "
"--num-rollout 3000 "
"--rollout-batch-size 2 "
"--n-samples-per-prompt 4 "
f"--rollout-batch-size {args.rollout_batch_size} "
f"--n-samples-per-prompt {args.n_samples_per_prompt} "
"--rollout-temperature 0.8 "
"--rollout-max-response-len 8192 "
f"--max-seq-len {args.max_seq_len} "
"--global-batch-size 8 "
f"--global-batch-size {args.global_batch_size} "
"--balance-data "
)

Expand Down
Loading