MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / __init__

Method __init__

utils/indexed_datasets.py:8–15  ·  view source on GitHub ↗
(self, path, num_cache=1)

Source from the content-addressed store, hash-verified

6
7class IndexedDataset:
8 def __init__(self, path, num_cache=1):
9 super().__init__()
10 self.path = path
11 self.data_file = None
12 self.data_offsets = np.load(f"{path}.idx", allow_pickle=True).item()['offsets']
13 self.data_file = open(f"{path}.data", 'rb', buffering=-1)
14 self.cache = []
15 self.num_cache = num_cache
16
17 def check_index(self, i):
18 if i < 0 or i >= len(self.data_offsets) - 1:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected