MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / __init__

Method __init__

DeepSpeedExample/megatron/data/realm_index.py:19–33  ·  view source on GitHub ↗
(self, block_data_path=None, load_from_path=True, rank=None)

Source from the content-addressed store, hash-verified

17class BlockData(object):
18 """Serializable data structure for holding data for blocks -- embeddings and necessary metadata for REALM"""
19 def __init__(self, block_data_path=None, load_from_path=True, rank=None):
20 self.embed_data = dict()
21 self.meta_data = dict()
22 if block_data_path is None:
23 args = get_args()
24 block_data_path = args.block_data_path
25 rank = args.rank
26 self.block_data_path = block_data_path
27 self.rank = rank
28
29 if load_from_path:
30 self.load_from_file()
31
32 block_data_name = os.path.splitext(self.block_data_path)[0]
33 self.temp_dir_name = block_data_name + '_tmp'
34
35 def state(self):
36 return {

Callers

nothing calls this directly

Calls 2

load_from_fileMethod · 0.95
get_argsFunction · 0.90

Tested by

no test coverage detected