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

Class StorageConfig

trinity/common/config.py:166–226  ·  view source on GitHub ↗

Storage config for both taskset and experience buffer. Not visible to users directly. Please use ExperienceBufferConfig or TasksetConfig instead.

Source from the content-addressed store, hash-verified

164
165@dataclass
166class StorageConfig:
167 """Storage config for both taskset and experience buffer.
168 Not visible to users directly. Please use ExperienceBufferConfig or TasksetConfig instead.
169 """
170
171 name: str = ""
172 storage_type: str = StorageType.FILE.value
173 path: Optional[str] = None
174 repeat_times: Optional[int] = None
175
176 # For continuing training
177 index: int = 0
178
179 # used for StorageType.FILE
180 split: str = "train"
181 subset_name: Optional[str] = None
182 format: FormatConfig = field(default_factory=FormatConfig)
183
184 # used for StorageType.QUEUE
185 capacity: int = 10000
186 max_read_timeout: float = 1800
187 replay_buffer: Optional[ReplayBufferConfig] = field(default_factory=ReplayBufferConfig)
188
189 # used for StorageType.SQL
190 max_retry_times: int = 3
191 max_retry_interval: int = 1
192
193 # used for rollout tasks
194 default_workflow_type: Optional[str] = None
195 default_reward_fn_type: Optional[str] = None
196 rollout_args: GenerationConfig = field(default_factory=GenerationConfig)
197 workflow_args: dict = field(default_factory=dict)
198 reward_fn_args: dict = field(default_factory=dict)
199 data_selector: DataSelectorConfig = field(default_factory=DataSelectorConfig)
200
201 # enable progress bar (tqdm) for _HFBatchReader
202 enable_progress_bar: Optional[bool] = False
203
204 # get storage from existing experiment
205 ray_namespace: Optional[str] = None
206
207 # ! DO NOT SET except you know what you are doing
208 wrap_in_ray: bool = True
209
210 # ! DO NOT SET, automatically set
211 schema_type: Optional[str] = None
212
213 # ! DO NOT SET, automatically set from buffer.total_epochs
214 total_epochs: int = 1 # automatically set
215
216 # ! DO NOT SET, automatically set from buffer.total_steps
217 total_steps: Optional[int] = None # automatically set
218
219 # ! DO NOT SET, automatically set from buffer.batch_size / train_batch_size
220 batch_size: int = 0
221
222 # ! DO NOT SET, automatically set from model.model_path
223 tokenizer_path: Optional[str] = None

Callers 9

__init__Method · 0.90
get_viewerFunction · 0.90
_init_input_storageMethod · 0.90
_make_configMethod · 0.90
_make_configMethod · 0.90
_make_configMethod · 0.90
test_task_formatterMethod · 0.90
to_storage_configMethod · 0.85
to_storage_configMethod · 0.85

Calls

no outgoing calls

Tested by 4

_make_configMethod · 0.72
_make_configMethod · 0.72
_make_configMethod · 0.72
test_task_formatterMethod · 0.72