// If there are no captions then make the captions list the same size
// as the images list.
if captions == [None] or captions is None:
captions = [None] * len(images)
assert type(
After Change
captions = [caption]
// You can pass in a 1-D Numpy array as captions.
elif type(caption) == np.ndarray and len(caption.shape) == 1:
captions = caption.tolist()
// If there are no captions then make the captions list the same size
// as the images list.
elif caption is None:
captions = [None] * len(images)