🚀 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 許可證。