You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am the author of MachinaScript for Robots - a framework for building LLM-powered robots in your garage!
The LLM basically outputs a JSON-like set of instructions for actions, movements and skill usages that are then parsed by a raspberry pi and serialized to an arduino to be executed. I am using unsloth for training a model that outputs this synthax so we can have smaller system prompts and faster execution for the robot.
However these are for receiving text instructions - there's no vision related so it makes it difficult to make a fully self operating robot out of it.
The project was initially based on GPT-4-V however with the great multimodal open models out there like Obsidian, Llava, and BakLLaVA the world of llm-powered robots is ready to take a great leap forward. I would love to plan a dataset and finetune a vision model to output machinascript synthax code using the awesome capabilities of unsloth. Is it possible or will it be in the future to finetune multimodal llms?
@babycommando Hey thanks for the cool request! Super cool repo as well! And super interesting you're finetuning to output instructions then actually executing them!! That's super cool!!!
Hmm currently vision models can get more complex. Technically in the Llava paper, a LLM is first used, then the final layer is projected into a new feature space then a Vision Encoder is used:
So in theory the LLM part can be optimized with Unsloth, and the rest can be optimized at a later date. I just haven't gotten time to work on vision + LLM type models, but we will do so at a later date :)
Hey Daniel, sorry for the delay!
I went on a deep research on the finetuning of multimodal models, and turns out LLaVA repo already provides most of the things we need to get started.
Would be so cool if we could borrow Unsloth awesome capabilities to execute it.
About Obsidian 3B, after some talk with one of the core engineers it is clear that is a version of LLaVA using a strain of Zephyr3B underneath. It is by the same people who made Hermes (Nous).
So, I hope this brings up some light for the integration of multimodal training. They both seems to be using deepspeed, I myself haven't tried it yet. Would love to use Unsloth for this!
And again, thank you so much for the interest in MachinaScript, free the robots!!!!
@babycommando Thanks for the writeup! Super useful and wonderful insights! :) I will check these all out in the following days! :)) Hopefully Unsloth will have support for LlaVa type models in the near future :))
Huggingface now has supported LLaVA, LLaVA-NeXT and LLaVA-NeXT-Video (LLaVA-Next is the better version of LLaVA) and has multiple tutorials with Pytorch Lightning (which can be converted to HFTrainer) and also with HFTrainer (for the video version).
Activity
[-]Finetuning multimodal vision models?[/-][+]Finetuning multimodal vision models? (Llava, and BakLLaVA)[/+]danielhanchen commentedon Feb 7, 2024
@babycommando Hey thanks for the cool request! Super cool repo as well! And super interesting you're finetuning to output instructions then actually executing them!! That's super cool!!!
Hmm currently vision models can get more complex. Technically in the Llava paper, a LLM is first used, then the final layer is projected into a new feature space then a Vision Encoder is used:

So in theory the LLM part can be optimized with Unsloth, and the rest can be optimized at a later date. I just haven't gotten time to work on vision + LLM type models, but we will do so at a later date :)
Again super cool project!
babycommando commentedon Feb 11, 2024
Hey Daniel, sorry for the delay!
I went on a deep research on the finetuning of multimodal models, and turns out LLaVA repo already provides most of the things we need to get started.
Would be so cool if we could borrow Unsloth awesome capabilities to execute it.
This is an official doc for finetuning LLaVA:
https://github.com/haotian-liu/LLaVA/blob/main/docs/Finetune_Custom_Data.md
it mentions that:
if you have a lot of data use this script (12 hours on 8xA100's):
https://github.com/haotian-liu/LLaVA/blob/main/scripts/v1_5/finetune_task_lora.sh
if you don't have a lot of data use this script (a few hours and a single A100):
https://github.com/haotian-liu/LLaVA/blob/main/scripts/v1_5/finetune_task.sh
(try to also take a look at the whole /scripts directory)
Also the dataset format is the "share gpt" as mentioned in the doc. This is the dataset they used to make llava, for anyone else wondering how the finetuning dataset should be formatted:
https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K
About Obsidian 3B, after some talk with one of the core engineers it is clear that is a version of LLaVA using a strain of Zephyr3B underneath. It is by the same people who made Hermes (Nous).
They recommend using this script for finetuning with a big dataset:
https://github.com/NousResearch/Obsidian/blob/main/scripts/finetune.sh
And this one for smaller datasets:
https://github.com/NousResearch/Obsidian/blob/main/scripts/finetune_qlora.sh
So, I hope this brings up some light for the integration of multimodal training. They both seems to be using deepspeed, I myself haven't tried it yet. Would love to use Unsloth for this!
And again, thank you so much for the interest in MachinaScript, free the robots!!!!
danielhanchen commentedon Feb 11, 2024
@babycommando Thanks for the writeup! Super useful and wonderful insights! :) I will check these all out in the following days! :)) Hopefully Unsloth will have support for LlaVa type models in the near future :))
oliverbob commentedon Feb 21, 2024
Can't wait to see it implemented. Thanks.
linshi1111 commentedon Apr 22, 2024
I am currently exploring the
qnguyen3/nanoLLaVAmodel, which it is built on top of Quyen-SE-v0.1 (Qwen1.5-0.5B) and incorporates Google SigLIP-400M.Would there be support for Colab or Kaggle version fine-tuning for
qnguyen3/nanoLLaVA?Thank you for making
unslothproject open-source. I am eagerly looking forward to seeing its implementation.Here are the links to
nanoLLaVAproject:https://huggingface.co/qnguyen3/nanoLLaVA
https://github.com/qnguyen3/nanoLLaVA
danielhanchen commentedon Apr 23, 2024
Hmm Llava probs for a future release
kinchahoy commentedon Jul 4, 2024
Big +1 for any fairly recent vision LLM models. Ideally one of the smaller ones like nanoLLaVA etc.
Namzakku commentedon Aug 26, 2024
Huggingface now has supported LLaVA, LLaVA-NeXT and LLaVA-NeXT-Video (LLaVA-Next is the better version of LLaVA) and has multiple tutorials with Pytorch Lightning (which can be converted to HFTrainer) and also with HFTrainer (for the video version).
LLaVa
LLaVa-NeXT
LLaVA-NeXT-Video
Hope this helps!
kinchahoy commentedon Aug 26, 2024
Namzakku commentedon Aug 27, 2024
Looking at the tutorials and their transformers library doc, at the multimodal model section, I don't think they have support for Phi-3.5 yet.
danielhanchen commentedon Oct 9, 2024
Working on vision LMs!
[-]Finetuning multimodal vision models? (Llava, and BakLLaVA)[/-][+][Feature Request] Vision LMs[/+]kinchahoy commentedon Oct 9, 2024
Standing by with datasets :-). Thank you.
shimmyshimmer commentedon Nov 22, 2024
@kinchahoy @oliverbob @Namzakku @babycommando @asmith26 @KIC @aeltorio @jonflynng @Reichenbachian, @R3xpook @sarvghotra @erwe324 @mimbres @taesiri @LawrenceLinn @Yueeeeeeee
Hey guys apologies for the delays. Vision models are now supported in Unsloth! Please update Unsloth :)
Read our blogpost: https://unsloth.ai/blog/vision
Tweet: https://x.com/UnslothAI/status/1859667930075758793
GitHub post: https://github.com/unslothai/unsloth/releases/tag/November-2024
Model uploads: https://huggingface.co/collections/unsloth/vision-multimodal-models-673eb9908fc2cb3deebd2fa3
fix save merge to work with new transformers vlm layer naming system (u…
fix save merge to work with new transformers vlm layer naming system (u…
fix save merge to work with new transformers vlm layer naming system (u…