MCPcopy
hub / github.com/zai-org/CogView / detect_new_datasets

Function detect_new_datasets

data_utils/configure_data.py:293–310  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

291 return self.wrapped_data[index]
292
293def detect_new_datasets(args):
294 if args.new_dataset_path is None:
295 return None
296 if not os.path.exists(args.new_dataset_path):
297 print('Warning: new_dataset_path not exists... skip detection.')
298 return None
299 current_datasets = [str(os.path.abspath(path)) for path in args.train_data]
300
301 found = []
302 for _p in os.listdir(args.new_dataset_path):
303 p = os.path.join(args.new_dataset_path, _p)
304 if (str(p).endswith('lmdb') or str(p).endswith('bin')) and not str(os.path.abspath(p)) in current_datasets:
305 found.append(p)
306 if len(found) == 0:
307 return None
308 else:
309 args.train_data = args.train_data + found
310 return make_loaders(args)

Callers 1

trainFunction · 0.90

Calls 1

make_loadersFunction · 0.85

Tested by

no test coverage detected