Finetune LLaVA on Custom Datasets

Dataset Format

Convert your data to a JSON file of a List of all samples. Sample metadata should contain id (a unique identifier), image (the path to the image), and conversations (the conversation data between human and AI).

A sample JSON for finetuning LLaVA for generating tag-style captions for Stable Diffusion:

json 复制代码
[
  {
    "id": "997bb945-628d-4724-b370-b84de974a19f",
    "image": "part-000001/997bb945-628d-4724-b370-b84de974a19f.jpg",
    "conversations": [
      {
        "from": "human",
        "value": "<image>\nWrite a prompt for Stable Diffusion to generate this image."
      },
      {
        "from": "gpt",
        "value": "a beautiful painting of chernobyl by nekro, pascal blanche, john harris, greg rutkowski, sin jong hun, moebius, simon stalenhag. in style of cg art. ray tracing. cel shading. hyper detailed. realistic. ue 5. maya. octane render. "
      },
    ]
  },
  ...
]

Command

If you have a limited task-specific data, we recommend finetuning from LLaVA checkpoints with LoRA following this script.

If the amount of the task-specific data is sufficient, you can also finetune from LLaVA checkpoints with full-model finetuning following this script.

You may need to adjust the hyperparameters to fit each specific dataset and your hardware constraint.

相关推荐
JoannaJuanCV6 天前
VLM学习-SFT(监督微调)
深度学习·学习·机器学习·大模型·视觉大模型·vlm·视觉编码器
JoannaJuanCV11 天前
VLM学习-DINOv2三大损失DINO / iBOT / KoLeo 解析
大模型·vlm·视觉编码器
还不秃顶的计科生20 天前
具身智能论文学习10:π0: A Vision-Language-Action Flow Model for General Robot Control
人工智能·深度学习·算法·机器学习·语言模型·vla·vlm
还不秃顶的计科生20 天前
具身智能论文学习8:Octo: An Open-Source Generalist Robot Policy
人工智能·深度学习·学习·机器学习·语言模型·vla·vlm
怦怦蓝24 天前
给AI装上“眼睛”:一文讲透视觉语言模型(VLM)
人工智能·语言模型·自然语言处理·vlm
山顶夕景1 个月前
【全模态】音视频理解模型Audio-Visual Flamingo
音视频·video·vlm·多模态理解
liferecords1 个月前
HPD-Parsing: Hierarchical Parallel Document Parsing
人工智能·算法·ocr·idp·vlm
-cywen-1 个月前
QWen-VL
vlm
山顶夕景2 个月前
【AAAI 2026】VQAThinker:通过RL进行可解释VQA训练
rl·vqa·vlm·grpo·视频质量评估
山顶夕景2 个月前
【VLM】视频理解LLaVA-OneVision-2(Codec-stream)
vlm·rope·视频理解·多模态理解·长视频·token压缩