mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-05-03 17:53:26 +00:00
use native types List->list, Dict->dict, Set->set, Tuple->tuple
This commit is contained in:
parent
5d02064b5a
commit
3e7ff3b084
95 changed files with 754 additions and 760 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# This example is an adapted version of Bytedance's code:
|
||||
# https://github.com/volcengine/verl/blob/a65c9157bc0b85b64cd753de19f94e80a11bd871/verl/trainer/main_ppo.py
|
||||
import os
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Optional
|
||||
|
||||
import hydra
|
||||
import ray
|
||||
|
|
@ -64,12 +64,12 @@ class ReasoningGymDataset(Dataset):
|
|||
self.client.create_experiment(dataset_name, config)
|
||||
|
||||
# Cache for batches
|
||||
self._batch_cache: dict[int, List[BatchEntry]] = {}
|
||||
self._batch_cache: dict[int, list[BatchEntry]] = {}
|
||||
|
||||
def __len__(self) -> int:
|
||||
return self.size
|
||||
|
||||
def _get_batch(self, batch_idx: int) -> List[BatchEntry]:
|
||||
def _get_batch(self, batch_idx: int) -> list[BatchEntry]:
|
||||
"""Fetch or retrieve cached batch"""
|
||||
if batch_idx not in self._batch_cache:
|
||||
base_index = batch_idx * self.batch_size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue