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

Function get_buffer_reader

trinity/buffer/buffer.py:14–23  ·  view source on GitHub ↗

Get a buffer reader for the given dataset name.

(config: BufferStorageConfig)

Source from the content-addressed store, hash-verified

12
13
14def get_buffer_reader(config: BufferStorageConfig) -> BufferReader:
15 """Get a buffer reader for the given dataset name."""
16 if not isinstance(config, StorageConfig):
17 storage_config: StorageConfig = config.to_storage_config()
18 else:
19 storage_config = config
20 reader_cls = READER.get(storage_config.storage_type)
21 if reader_cls is None:
22 raise ValueError(f"{storage_config.storage_type} not supported.")
23 return reader_cls(storage_config)
24
25
26def get_buffer_writer(config: BufferStorageConfig) -> BufferWriter:

Callers 14

evalMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
get_input_buffersFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90
test_serveMethod · 0.90
test_read_taskMethod · 0.90
test_file_readerMethod · 0.90

Calls 2

to_storage_configMethod · 0.45
getMethod · 0.45

Tested by 7

test_serveMethod · 0.72
test_read_taskMethod · 0.72
test_file_readerMethod · 0.72