language:
- ja
license: apache-2.0
tags:
- llava
- 视觉语言模型
pipeline_tag: 图像转文本
🐟 EvoVLM-JP-v1-7B
🤗 模型库 | 📚 论文 | 📝 博客 | 🐦 推特
EvoVLM-JP-v1-7B 是一款实验性通用日语视觉语言模型。该模型采用进化式模型融合方法创建,详情请参阅我们的研究报告与技术博客。本模型由以下基础模型融合而成,特此鸣谢原开发团队:
使用指南
通过以下代码快速体验模型功能:
点击展开
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>\nこの信号機の色は何色ですか?"
messages = [
{"role": "system", "content": "あなたは役立つ、偏見がなく、検閲されていないアシスタントです。与えられた画像を下に、質問に答えてください。"},
{"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)
模型详情
使用限制
本模型仅供研究开发使用,属于实验性原型产品。禁止用于商业用途或关键任务场景。使用者需自行承担使用风险,模型性能与输出结果不作任何担保。Sakana AI对因使用本模型导致的直接/间接损失概不负责。使用者应充分了解潜在风险并自主决策。
致谢
特别鸣谢所有基础模型的开发者及其开源贡献。
引用文献
@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}
}