MCPcopy Index your code
hub / github.com/deepspeedai/DeepSpeedExamples / get_random_partition

Function get_random_partition

bing_bert/turing/dataset.py:57–62  ·  view source on GitHub ↗
(data_directory, index)

Source from the content-addressed store, hash-verified

55
56
57def get_random_partition(data_directory, index):
58 partitions = [os.path.join(data_directory, x)
59 for x in os.listdir(data_directory)]
60 partitions = sorted(partitions)
61 i = index % len(partitions)
62 return partitions[i]
63
64
65def map_to_torch(encoding):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected