语言:
- ja
标签:
- heron
- 视觉
- 图像描述
- VQA
管道标签: 图像到文本
许可证:
- cc-by-nc-4.0
推理: false
Heron GIT Japanese StableLM Base 7B

模型详情
Heron GIT Japanese StableLM Base 7B 是一个能够就输入图像进行对话的视觉语言模型。
该模型使用 the heron 库 进行训练。详情请参考代码。
使用方法
按照 安装指南 进行操作。
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 和 Japanese Visual Genome 上进行了微调。
训练数据集
使用与限制
预期用途
该模型适用于聊天类应用和研究目的。
限制
模型可能会产生不准确或错误的信息,其准确性无法保证。目前仍处于研究和开发阶段。
引用方式
@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