MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / run

Method run

tests/explorer/scheduler_test.py:43–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41 self.run_id_base = run_id_base
42
43 def run(self) -> List[Experience]:
44 if "timeout" in self.error_type:
45 time.sleep(self.seconds)
46 elif self.error_type == "exception":
47 raise ValueError("Exception occurred")
48 elif self.error_type == "exit":
49 exit(1)
50 elif self.error_type == "auxiliary_models":
51 assert self.auxiliary_models is not None and len(self.auxiliary_models) == 2
52
53 exps = []
54 for i in range(self.repeat_times):
55 run_level_metrics = {"run_metrics": float(i + self.run_id_base)}
56 run_level_exps = []
57 for step in range(self.step_num):
58 run_level_exps.append(
59 Experience(
60 tokens=torch.zeros(5),
61 prompt_length=2,
62 prompt_text=self.error_type or "success",
63 eid=EID(run=i + self.run_id_base, step=step),
64 info={"repeat_times": self.repeat_times},
65 )
66 )
67 run_level_exps[-1].metrics = run_level_metrics
68 exps.extend(run_level_exps)
69 return exps
70
71
72@WORKFLOWS.register_module("dummy_nonrepeat_workflow")

Callers

nothing calls this directly

Calls 3

ExperienceClass · 0.90
EIDClass · 0.90
sleepMethod · 0.80

Tested by

no test coverage detected