def generate_mdl()

in tasks/add-or-mul/generate_data.py [0:0]


def generate_mdl(root, train_length, test_span, rule):
    root_raw = f'{root}/data/'
    pathlib.Path(root_raw).mkdir(parents=True)


    test_from, test_to = train_length - test_span, train_length + test_span + 1 # not inclusive

    put_test(root_raw, test_from, test_to)
    put_train_mdl(root_raw, train_length, test_from, test_to, rule)

    root_bin = f'./{root}/data-bin/'
    pathlib.Path(root_bin).mkdir(parents=True)

    command = ['fairseq-preprocess', '--source-lang', 'src', '--target-lang',
               'dst', '--destdir', root_bin, 
               '--trainpref', f'{root_raw}/train', 
               '--validpref', f'{root_raw}/valid',
               '--testpref', f'{root_raw}/test']

    subprocess.check_call(command)