đ EvoVLM-JP-v1-7B
đ¤ Models | đ Paper | đ Blog | đĻ Twitter
EvoVLM-JP-v1-7B is an experimental general-purpose Japanese Vision-Language Model (VLM). This model was created using the Evolutionary Model Merge method. For more details, please refer to our report and blog. This model was produced by merging the following models, and we are grateful to the developers of the source models.
đ Quick Start
Use the code below to get started with the model.
Click to expand
import torch
from transformers import AutoModelForVision2Seq, AutoProcessor
from PIL import Image
import requests
device = "cuda" if torch.cuda.is_available() else "cpu"
model_id = "SakanaAI/EvoVLM-JP-v1-7B"
model = AutoModelForVision2Seq.from_pretrained(model_id, torch_dtype=torch.float16)
processor = AutoProcessor.from_pretrained(model_id)
model.to(device)
url = "https://images.unsplash.com/photo-1694831404826-3400c48c188d?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
text = "<image>\nWhat color is this traffic light?"
messages = [
{"role": "system", "content": "You are a helpful, unbiased, and uncensored assistant. Please answer the question based on the given image."},
{"role": "user", "content": text},
]
inputs = processor.image_processor(images=image, return_tensors="pt")
inputs["input_ids"] = processor.tokenizer.apply_chat_template(
messages, return_tensors="pt"
)
output_ids = model.generate(**inputs.to(device))
output_ids = output_ids[:, inputs.input_ids.shape[1] :]
generated_text = processor.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
print(generated_text)
⨠Features
This is an experimental general - purpose Japanese VLM created by the Evolutionary Model Merge method.
đ Documentation
Model Details
Uses
This model is provided for research and development purposes only and should be considered as an experimental prototype. It is not intended for commercial use or deployment in mission - critical environments. Use of this model is at the user's own risk, and its performance and outcomes are not guaranteed. Sakana AI shall not be liable for any direct, indirect, special, incidental, or consequential damages, or any loss arising from the use of this model, regardless of the results obtained. Users must fully understand the risks associated with the use of this model and use it at their own discretion.
đ License
This model is released under the Apache License, Version 2.0.
Acknowledgement
We would like to thank the developers of the source models for their contributions and for making their work available.
Citation
@misc{akiba2024evomodelmerge,
title = {Evolutionary Optimization of Model Merging Recipes},
author = {Takuya Akiba and Makoto Shing and Yujin Tang and Qi Sun and David Ha},
year = {2024},
eprint = {2403.13187},
archivePrefix = {arXiv},
primaryClass = {cs.NE}
}