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

Function get_experiences

tests/buffer/experience_pipeline_test.py:21–34  ·  view source on GitHub ↗

Generate a list of experiences for testing.

(task_num: int, repeat_times: int = 1, step_num: int = 1)

Source from the content-addressed store, hash-verified

19
20
21def get_experiences(task_num: int, repeat_times: int = 1, step_num: int = 1) -> List[Experience]:
22 """Generate a list of experiences for testing."""
23 return [
24 Experience(
25 eid=EID(task=i, run=j, step=k),
26 tokens=torch.zeros((5,)),
27 prompt_length=4,
28 reward=j,
29 logprobs=torch.tensor([0.1]),
30 )
31 for i in range(task_num)
32 for j in range(repeat_times)
33 for k in range(step_num)
34 ]
35
36
37class TestExperiencePipeline(RayUnittestBaseAsync):

Callers 2

Calls 2

ExperienceClass · 0.90
EIDClass · 0.90

Tested by

no test coverage detected