MCPcopy Index your code
hub / github.com/NVIDIA/Megatron-LM / __init__

Method __init__

tools/bert_embedding/utils.py:176–184  ·  view source on GitHub ↗
(self, block_paths, block_size)

Source from the content-addressed store, hash-verified

174 return cls(sorted(glob.glob(_dir + f"/*.{ext}")), block_size)
175
176 def __init__(self, block_paths, block_size):
177 self.max_idx = 0
178 self.block_path_map = {}
179 for block_path in block_paths:
180 name = os.path.splitext(os.path.basename(block_path))[0]
181 start_idx, end_idx = [ int(i) for i in name.split("-") ]
182 self.block_path_map[start_idx] = block_path
183 self.max_idx = max(self.max_idx, end_idx)
184 self.block_size = block_size
185
186 def __str__(self):
187 return "%d paths" % len(self.block_path_map)

Callers

nothing calls this directly

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected