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

Method read

trinity/buffer/reader/sql_reader.py:38–51  ·  view source on GitHub ↗
(self, batch_size: Optional[int] = None, **kwargs)

Source from the content-addressed store, hash-verified

36 return self._async_storage
37
38 async def read(self, batch_size: Optional[int] = None, **kwargs) -> List:
39 batch_size = self.read_batch_size if batch_size is None else batch_size
40 if self.wrap_in_ray:
41 try:
42 return await self.storage.read.remote(batch_size, **kwargs)
43 except (StopIteration, StopAsyncIteration):
44 raise StopAsyncIteration()
45 except Exception as e:
46 if "StopAsyncIteration" in traceback.format_exc():
47 raise StopAsyncIteration() from e
48 raise
49 else:
50 storage = await self._get_async_storage()
51 return await storage.read(batch_size, **kwargs)
52
53 def state_dict(self) -> Dict:
54 return {"current_index": 0}

Calls 2

_get_async_storageMethod · 0.95
remoteMethod · 0.80