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

Method setUp

tests/buffer/file_test.py:102–120  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

100 self.assertEqual(len(f.readlines()), 4)
101
102 def setUp(self):
103 self.config = get_template_config()
104 self.config.mode = "explore"
105 self.config.checkpoint_root_dir = get_checkpoint_path()
106 dataset_config = get_unittest_dataset_config("countdown", "train")
107 self.config.buffer.explorer_input.taskset = dataset_config
108 self.config.buffer.trainer_input.experience_buffer = ExperienceBufferConfig(
109 name="test_buffer", storage_type=StorageType.FILE.value
110 )
111 self.config.check_and_update()
112 ray.init(
113 ignore_reinit_error=True,
114 runtime_env={"env_vars": self.config.get_envs()},
115 namespace="trinity_unittest",
116 )
117 os.makedirs(self.config.buffer.cache_dir, exist_ok=True)
118 file_path = self.config.buffer.trainer_input.experience_buffer.path
119 if os.path.exists(file_path):
120 os.remove(file_path)
121
122 def tearDown(self):
123 ray.shutdown()

Callers

nothing calls this directly

Calls 6

get_template_configFunction · 0.90
get_checkpoint_pathFunction · 0.90
check_and_updateMethod · 0.80
get_envsMethod · 0.80

Tested by

no test coverage detected