MCPcopy
hub / github.com/appvision-ai/fast-bert / load

Method load

fast_bert/data.py:335–348  ·  view source on GitHub ↗
(data_dir, backend='nccl', filename="databunch.pkl")

Source from the content-addressed store, hash-verified

333
334 @staticmethod
335 def load(data_dir, backend='nccl', filename="databunch.pkl"):
336
337 try:
338 torch.distributed.init_process_group(backend=backend,
339 init_method="tcp://localhost:23459",
340 rank=0, world_size=1)
341 except:
342 pass
343
344 tmp_path = data_dir/'tmp'
345 with open(str(tmp_path/filename), "rb") as f:
346 databunch = pickle.load(f)
347
348 return databunch
349
350 def __init__(self, data_dir, label_dir, tokenizer, train_file='train.csv', val_file='val.csv', test_data=None,
351 label_file='labels.csv', text_col='text', label_col='label', bs=32, maxlen=512,

Callers 15

get_predictor_modelMethod · 0.80
get_predictor_modelMethod · 0.80
get_predictor_modelMethod · 0.80
get_predictor_modelMethod · 0.80
load_modelFunction · 0.80
load_modelFunction · 0.80
retrieveMethod · 0.80
from_pretrained_modelMethod · 0.80
read_examplesFunction · 0.80
__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected