🚀 360VL
360VL 基於 LLama3 語言模型開發,也是行業內首個基於 LLama3 - 70B [🤗Meta - Llama - 3 - 70B - Instruct] 的開源大型多模態模型。除應用 Llama3 語言模型外,360VL 模型還設計了全局感知多分支投影器架構,使模型具備更充足的圖像理解能力。
🚀 快速開始
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
from PIL import Image
checkpoint = "qihoo360/360VL-8B"
model = AutoModelForCausalLM.from_pretrained(checkpoint, torch_dtype=torch.float16, device_map='auto', trust_remote_code=True).eval()
tokenizer = AutoTokenizer.from_pretrained(checkpoint, trust_remote_code=True)
vision_tower = model.get_vision_tower()
vision_tower.load_model()
vision_tower.to(device="cuda", dtype=torch.float16)
image_processor = vision_tower.image_processor
tokenizer.pad_token = tokenizer.eos_token
image = Image.open("docs/008.jpg").convert('RGB')
query = "Who is this cartoon character?"
terminators = [
tokenizer.convert_tokens_to_ids("<|eot_id|>",)
]
inputs = model.build_conversation_input_ids(tokenizer, query=query, image=image, image_processor=image_processor)
input_ids = inputs["input_ids"].to(device='cuda', non_blocking=True)
images = inputs["image"].to(dtype=torch.float16, device='cuda', non_blocking=True)
output_ids = model.generate(
input_ids,
images=images,
do_sample=False,
eos_token_id=terminators,
num_beams=1,
max_new_tokens=512,
use_cache=True)
input_token_len = input_ids.shape[1]
outputs = tokenizer.batch_decode(output_ids[:, input_token_len:], skip_special_tokens=True)[0]
outputs = outputs.strip()
print(outputs)
✨ 主要特性
- 多輪文本 - 圖像對話:360VL 可以同時接受文本和圖像作為輸入,並輸出文本。目前,它支持單張圖像的多輪視覺問答。
- 雙語文本支持:360VL 支持中英文對話,包括圖像中的文本識別。
- 強大的圖像理解能力:360VL 擅長分析視覺信息,是從圖像中提取、組織和總結信息等任務的高效工具。
- 高分辨率圖像理解:360VL 支持 672×672 更高分辨率的圖像理解。
📦 模型庫
360VL 已發佈以下版本:
📊 性能表現
模型 |
檢查點鏈接 |
MMBT |
MMBD |
MMB - CNT |
MMB - CND |
MMMUV |
MMMUT |
MME |
QWen - VL - Chat |
🤗LINK |
61.8 |
60.6 |
56.3 |
56.7 |
37 |
32.9 |
1860 |
mPLUG - Owl2 |
🤖LINK |
66.0 |
66.5 |
60.3 |
59.5 |
34.7 |
32.1 |
1786.4 |
CogVLM |
🤗LINK |
65.8 |
63.7 |
55.9 |
53.8 |
37.3 |
30.1 |
1736.6 |
Monkey - Chat |
🤗LINK |
72.4 |
71 |
67.5 |
65.8 |
40.7 |
- |
1887.4 |
MM1 - 7B - Chat |
LINK |
- |
72.3 |
- |
- |
37.0 |
35.6 |
1858.2 |
IDEFICS2 - 8B |
🤗LINK |
75.7 |
75.3 |
68.6 |
67.3 |
43.0 |
37.7 |
1847.6 |
SVIT - v1.5 - 13B |
🤗LINK |
69.1 |
- |
63.1 |
- |
38.0 |
33.3 |
1889 |
LLaVA - v1.5 - 13B |
🤗LINK |
69.2 |
69.2 |
65 |
63.6 |
36.4 |
33.6 |
1826.7 |
LLaVA - v1.6 - 13B |
🤗LINK |
70 |
70.7 |
68.5 |
64.3 |
36.2 |
- |
1901 |
Honeybee |
LINK |
73.6 |
74.3 |
- |
- |
36.2 |
- |
1976.5 |
YI - VL - 34B |
🤗LINK |
72.4 |
71.1 |
70.7 |
71.4 |
45.1 |
41.6 |
2050.2 |
360VL - 8B |
🤗LINK |
75.3 |
73.7 |
71.1 |
68.6 |
39.7 |
37.1 |
1944.6 |
360VL - 70B |
🤗LINK |
78.1 |
80.4 |
76.9 |
77.7 |
50.8 |
44.3 |
2012.3 |
📚 詳細文檔
模型類型
360VL - 8B 是一個在多模態指令跟隨數據上微調大語言模型(LLM)得到的開源聊天機器人。它是一個基於 Transformer 架構的自迴歸語言模型。
基礎大語言模型:meta - llama/Meta - Llama - 3 - 8B - Instruct
模型訓練時間
360VL - 8B 於 2024 年 4 月完成訓練。
📄 許可證
本項目使用了某些數據集和檢查點,這些數據集和檢查點受其各自原始許可證的約束。用戶必須遵守這些原始許可證的所有條款和條件。
本項目內容本身遵循 Apache 許可證 2.0。
關於模型的問題或建議反饋地址:
https://github.com/360CVGroup/360VL
🌟 相關項目
本工作離不開以下優秀開源項目的支持,在此表示衷心感謝!