messages listlengths 2 2 | images images listlengths 1 1 |
|---|---|
[
{
"content": [
{
"index": null,
"text": "Give a short and clear explanation of the subsequent image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"inde... | |
[
{
"content": [
{
"index": null,
"text": "What is in the photo?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a series of... | |
[
{
"content": [
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Present a compact description of the photo's key features.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "What is in the photo?",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a gold and ... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Give a brief description of the image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"te... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Present a compact description of the photo's key features.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "What is in the photo?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a shiny bla... | |
[
{
"content": [
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "the rolling stones ... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Present a compact description of the photo's key features.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index... | |
[
{
"content": [
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "the front of the bu... | |
[
{
"content": [
{
"index": null,
"text": "Give a brief description of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"te... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "the moonwalk is lit... | |
[
{
"content": [
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Present a compact description of the photo's key features.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "orange butterfly on... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "5 f... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Give a brief description of the image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"te... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "an ... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Give a short and clear explanation of the subsequent image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"inde... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Give a brief description of the image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"te... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a s... | |
[
{
"content": [
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "an ... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Present a compact description of the photo's key features.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Give a short and clear explanation of the subsequent image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"inde... | |
[
{
"content": [
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a s... | |
[
{
"content": [
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a woman in pink dre... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Present a compact description of the photo's key features.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index... | |
[
{
"content": [
{
"index": null,
"text": "Give a short and clear explanation of the subsequent image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"inde... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "two template busine... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "What is in the photo?",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a big group... | |
[
{
"content": [
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "the... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a pattern with gold... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "What is in the photo?",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "two chinese... | |
[
{
"content": [
{
"index": null,
"text": "What is in the photo?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a dog on a ... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Summarize the visual content of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "What is in the photo?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "illustratio... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Present a compact description of the photo's key features.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index... | |
[
{
"content": [
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a p... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Give a brief description of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"te... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "stu... | |
[
{
"content": [
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "What is this?",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "the grim knight fig... | |
[
{
"content": [
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a t... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "What is this?",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "an image of a plast... | |
[
{
"content": [
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "What is in the photo?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "two hands h... | |
[
{
"content": [
{
"index": null,
"text": "Share a concise interpretation of the image provided.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": null,
"text": "What is this?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "the paper front pag... | |
[
{
"content": [
{
"index": null,
"text": "What is in the photo?",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a blue buil... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a w... | |
[
{
"content": [
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Render a clear and concise summary of the photo.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Write a terse but informative summary of the picture.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": nu... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Describe the image concisely.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"text": "a y... | |
[
{
"content": [
{
"index": 0,
"text": null,
"type": "image"
},
{
"index": null,
"text": "Give a short and clear explanation of the subsequent image.",
"type": "text"
}
],
"role": "user"
},
{
"content": [
{
"inde... | |
[
{
"content": [
{
"index": null,
"text": "Provide a brief description of the given image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
... | |
[
{
"content": [
{
"index": null,
"text": "Give a brief description of the image.",
"type": "text"
},
{
"index": 0,
"text": null,
"type": "image"
}
],
"role": "user"
},
{
"content": [
{
"index": null,
"te... |
End of preview. Expand
in Data Studio
theblackcat102/llava-pretrain reformated for VSFT with TRL's SFT Trainer.
Referenced the format of HuggingFaceH4/llava-instruct-mix-vsft
I used this code for format changes.
Warning: I'm not completely sure if I used this code. Please use it only as a reference.
import json
from datasets import load_dataset
from huggingface_hub import login
login(token="YOUR TOKEN")
def transform_format(example):
conversations = json.loads(example['conversations'])
messages = []
for conv in conversations:
if conv['from'] == 'human':
value = conv['value']
# ์ด๋ฏธ์ง ํ๊ทธ๊ฐ ์ค๊ฐ์ ์๋์ง ํ์ธ
if '<image>' in value and not (value.startswith('<image>') or value.endswith('<image>')):
raise ValueError(f"Image tag found in the middle of text: {value}")
text = value.replace('<image>\n', '').replace('\n<image>', '') # doing value.replace('<image>', '').strip() is better
content = []
# ์ด๋ฏธ์ง๊ฐ ํ
์คํธ ์์ ์๋ ๊ฒฝ์ฐ
if value.startswith('<image>'):
content = [
{"index": 0, "text": None, "type": "image"},
{"index": None, "text": text, "type": "text"}
]
# ์ด๋ฏธ์ง๊ฐ ํ
์คํธ ๋ค์ ์๋ ๊ฒฝ์ฐ
elif value.endswith('<image>'):
content = [
{"index": None, "text": text, "type": "text"},
{"index": 0, "text": None, "type": "image"}
]
else:
# ์ด๋ฏธ์ง ํ๊ทธ๊ฐ ์๋ ๊ฒฝ์ฐ
content = [
{"index": None, "text": text, "type": "text"}
]
messages.append({
"content": content,
"role": "user"
})
else: # 'gpt' case
messages.append({
"content": [
{"index": None, "text": conv['value'], "type": "text"}
],
"role": "assistant"
})
return {
'messages': messages,
'images': example['image']
}
dataset = load_dataset("theblackcat102/llava-pretrain")
try:
transformed_dataset = dataset.map(
transform_format,
num_proc=64,
batch_size=128,
remove_columns=dataset['train'].column_names,
desc="Transforming dataset"
)
except ValueError as e:
print(f"Error during transformation: {e}")
transformed_dataset.push_to_hub(
"Ryoo72/llava-pretrain-vsft",
private=False
)
- Downloads last month
- 24