Skip to content

基于 llama3 8B 构建的 SOTA 视觉模型。

Notifications You must be signed in to change notification settings

yuanzhongqiao/llama3v

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

骆驼3v

llama3v 是一个 SOTA 视觉模型,由Llama3 8Bsiglip-so400m提供支持。

[ GitHub ] [模型权重] [博客文章]

特征

  • SOTA开源VLLM
  • 模型可在 Huggingface 上找到
  • 快速局部推理
  • 发布推理代码(训练代码即将发布,只是清理一下)

检查huggingface了解模型权重。

指标

用法

您可以将llama3v与 Transformers 库一起使用。

from transformers import AutoTokenizer, AutoModel
from PIL import Image

model = AutoModel.from_pretrained("mustafaaljadery/llama3v").cuda() tokenizer = AutoTokenizer.from_pretrained("mustafaaljadery/llama3v")

image = Image.open("test_image.png")

answer = model.generate(image=image, message="What is this image?", temperature=0.1, tokenizer=tokenizer)

print(answer)

<clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 tooltipped-no-delay d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w" value="from transformers import AutoTokenizer, AutoModel from PIL import Image

model = AutoModel.from_pretrained("mustafaaljadery/llama3v").cuda() tokenizer = AutoTokenizer.from_pretrained("mustafaaljadery/llama3v")

image = Image.open("test_image.png")

answer = model.generate(image=image, message="What is this image?", temperature=0.1, tokenizer=tokenizer)

print(answer)" tabindex="0" role="button">

该模型首先通过视觉模型对图像进行处理以提取特征,然后通过语言模型生成答案。以下是示例推理流程:

建筑学

训练过程

在我们的训练过程中,我们将用于视觉的 siglip-so400m 模型与用于多模态图像文本输入和文本生成的 Llama3 8B 模型相结合。

我们在siglip-so400m模型中添加一个投影层,将图像特征投影到LLaMA嵌入空间,以便模型更好地理解图像。

在预训练过程中,我们冻结除投影层之外的所有权重。我们在大约 600K 张图像上进行训练。

在微调过程中,我们更新 Llama3 8B 模型的权重,同时冻结 siglip-so400m 模型和投影层的权重。我们训练了大约 100 万张图像。此外,我们还从 YI 的模型系列中生成合成多模态数据,用于多模态文本生成。我们根据这些合成数据微调我们的模型。

请在此处阅读有关我们的培训流程的更多信息。

致谢

引用

这是在以下资源的帮助下构建的:

About

基于 llama3 8B 构建的 SOTA 视觉模型。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%