MCPcopy Create free account
hub / github.com/SooLab/CGFormer / _init_db

Method _init_db

utils/dataset_open.py:114–123  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

112 self.length = info[dataset][split]
113 self.env = None
114 def _init_db(self):
115 self.env = lmdb.open(self.lmdb_dir,
116 subdir=os.path.isdir(self.lmdb_dir),
117 readonly=True,
118 lock=False,
119 readahead=False,
120 meminit=False)
121 with self.env.begin(write=False) as txn:
122 self.length = loads_pyarrow(txn.get(b'__len__'))
123 self.keys = loads_pyarrow(txn.get(b'__keys__'))
124
125 def __len__(self):
126 return self.length

Callers 1

__getitem__Method · 0.95

Calls 1

loads_pyarrowFunction · 0.70

Tested by

no test coverage detected