from PIL import Image import datasets data = { 'image': [], 'text': [] } for png_path, text in zip(png_list, text_list): image = Image.open(png_path) data['image'].append(image) data['text'].append(text) dataset = datasets.Dataset.from_dict(data) dataset.push_to_hub("[user_name]/[dataset_name]") # dataset.push_to_hub("[user_name]/[dataset_name]", private=True) # if private dataset
How to create a Hugging Face dataset
Tags
Python
Dataset
Published
February 13, 2024
Author