🚀 Heron GIT 日语 StableLM Base 7B
Heron GIT 日语 StableLM Base 7B 是一款视觉语言模型,能够针对输入的图像进行对话交流,为图像相关的交互与研究提供了有力支持。
🚀 快速开始
你可以按照安装指南进行操作。
✨ 主要特性
📦 安装指南
请参考 安装指南 完成安装。
💻 使用示例
基础用法
import requests
from PIL import Image
import torch
from transformers import AutoProcessor
from heron.models.git_llm.git_japanese_stablelm_alpha import GitJapaneseStableLMAlphaForCausalLM
device_id = 0
model = GitJapaneseStableLMAlphaForCausalLM.from_pretrained(
'turing-motors/heron-chat-git-ja-stablelm-base-7b-v0', torch_dtype=torch.float16
)
model.eval()
model.to(f"cuda:{device_id}")
processor = AutoProcessor.from_pretrained('turing-motors/heron-chat-git-ja-stablelm-base-7b-v0')
url = "https://www.barnorama.com/wp-content/uploads/2016/12/03-Confusing-Pictures.jpg"
image = Image.open(requests.get(url, stream=True).raw)
text = f"##human: これは何の写真ですか?\n##gpt: "
inputs = processor(
text,
image,
return_tensors="pt",
truncation=True,
)
inputs = {k: v.to(f"cuda:{device_id}") for k, v in inputs.items()}
eos_token_id_list = [
processor.tokenizer.pad_token_id,
processor.tokenizer.eos_token_id,
]
with torch.no_grad():
out = model.generate(**inputs, max_length=256, do_sample=False, temperature=0., eos_token_id=eos_token_id_list)
print(processor.tokenizer.batch_decode(out)[0])
📚 详细文档
模型详情
训练情况
该模型首先使用适配器结合 STAIR Captions 进行训练。在第二阶段,使用 LoRA 结合 LLaVA - Instruct - 150K - JA 和日语视觉基因组进行微调。
训练数据集
使用与限制
预期用途
该模型旨在用于类似聊天的应用程序以及研究目的。
限制
模型可能会产生不准确或错误的信息,其准确性无法保证,目前仍处于研究和开发阶段。
如何引用
@misc{GitJapaneseStableLM,
url = {[https://huggingface.co/turing-motors/heron-chat-git-ja-stablelm-base-7b-v0](https://huggingface.co/turing-motors/heron-chat-git-ja-stablelm-base-7b-v0)},
title = {Heron GIT Japanese StableLM Base 7B},
author = {Yuichi Inoue, Kotaro Tanahashi, and Yu Yamaguchi}
}
引用文献
@misc{JapaneseInstructBLIPAlpha,
url = {[https://huggingface.co/stabilityai/japanese-instructblip-alpha](https://huggingface.co/stabilityai/japanese-instructblip-alpha)},
title = {Japanese InstructBLIP Alpha},
author = {Shing, Makoto and Akiba, Takuya}
}
📄 许可证
本项目采用 cc-by-nc-4.0 许可证。