Esempio n. 1
0
def load_examples(args, tokenizer, evaluate="train"):
    data_path = os.path.join(args.data_dir, evaluate + ".json")
    transforms = get_image_transforms()
    labels = get_mmimdb_labels()
    dataset = JsonlDataset(data_path, tokenizer, transforms, labels,
                           args.max_seq_length - args.num_image_embeds - 2)
    return dataset
Esempio n. 2
0
def load_examples(args, tokenizer, evaluate=False):
    path = os.path.join(args.data_dir,
                        "dev.jsonl" if evaluate else "train.jsonl")
    transforms = get_image_transforms()
    labels = get_mmimdb_labels()
    dataset = JsonlDataset(path, tokenizer, transforms, labels,
                           args.max_seq_length - args.num_image_embeds - 2)
    return dataset