🚀 Eagle模型卡片
Eagle是一系列以視覺為中心的高分辨率多模態大語言模型,通過融合多種視覺編碼器和不同輸入分辨率,增強了多模態大語言模型的感知能力,在多模態大語言模型基準測試中表現出色。
📚 詳細文檔
模型詳情
模型類型:
Eagle是一系列以視覺為中心的高分辨率多模態大語言模型。它通過混合視覺編碼器和不同的輸入分辨率,對加強多模態大語言模型的感知能力進行了全面探索。該模型包含基於通道拼接的“CLIP + X”融合,適用於具有不同架構(ViT/卷積網絡)和知識(檢測/分割/光學字符識別/自監督學習)的視覺專家。由此產生的Eagle模型系列支持超過1K的輸入分辨率,並在多模態大語言模型基準測試中取得了優異的成績,特別是在光學字符識別和文檔理解等對分辨率敏感的任務上。

更多信息的論文或資源:
https://github.com/NVlabs/Eagle
arXiv / 演示 / Huggingface
@article{shi2024eagle,
title = {Eagle: Exploring The Design Space for Multimodal LLMs with Mixture of Encoders},
author={Min Shi and Fuxiao Liu and Shihao Wang and Shijia Liao and Subhashree Radhakrishnan and De-An Huang and Hongxu Yin and Karan Sapra and Yaser Yacoob and Humphrey Shi and Bryan Catanzaro and Andrew Tao and Jan Kautz and Zhiding Yu and Guilin Liu},
journal={arXiv:2408.15998},
year={2024}
}
模型架構
屬性 |
詳情 |
模型類型 |
以視覺為中心的高分辨率多模態大語言模型 |
架構類型 |
Transformer |
輸入類型 |
圖像、文本 |
輸入格式 |
紅、綠、藍;字符串 |
輸出類型 |
文本 |
輸出格式 |
字符串 |
預期用途
主要預期用途:
Eagle的主要用途是用於大型多模態模型和聊天機器人的研究。
主要預期用戶:
該模型的主要預期用戶是計算機視覺、自然語言處理、機器學習和人工智能領域的研究人員和愛好者。
倫理考量
英偉達認為可信人工智能是一項共同責任,我們已經制定了政策和實踐,以推動廣泛的人工智能應用的開發。當按照我們的服務條款下載或使用時,開發者應與他們的內部模型團隊合作,確保該模型符合相關行業和用例的要求,並解決不可預見的產品濫用問題。
📄 許可證
關於模型的問題或意見反饋地址:
https://github.com/NVlabs/Eagle/issues
💻 使用示例
基礎用法
import os
import torch
import numpy as np
from eagle import conversation as conversation_lib
from eagle.constants import DEFAULT_IMAGE_TOKEN
from eagle.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
from eagle.conversation import conv_templates, SeparatorStyle
from eagle.model.builder import load_pretrained_model
from eagle.utils import disable_torch_init
from eagle.mm_utils import tokenizer_image_token, get_model_name_from_path, process_images, KeywordsStoppingCriteria
from PIL import Image
import argparse
from transformers import TextIteratorStreamer
from threading import Thread
model_path = "NVEagle/Eagle-X5-13B-Chat"
conv_mode = "vicuna_v1"
image_path = "assets/georgia-tech.jpeg"
input_prompt = "Describe this image."
model_name = get_model_name_from_path(model_path)
tokenizer, model, image_processor, context_len = load_pretrained_model(model_path,None,model_name,False,False)
if model.config.mm_use_im_start_end:
input_prompt = DEFAULT_IM_START_TOKEN + DEFAULT_IMAGE_TOKEN + DEFAULT_IM_END_TOKEN + '\n' + input_prompt
else:
input_prompt = DEFAULT_IMAGE_TOKEN + '\n' + input_prompt
conv = conv_templates[conv_mode].copy()
conv.append_message(conv.roles[0], input_prompt)
conv.append_message(conv.roles[1], None)
prompt = conv.get_prompt()
image = Image.open(image_path).convert('RGB')
image_tensor = process_images([image], image_processor, model.config)[0]
input_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt')
input_ids = input_ids.to(device='cuda', non_blocking=True)
image_tensor = image_tensor.to(dtype=torch.float16, device='cuda', non_blocking=True)
with torch.inference_mode():
output_ids = model.generate(
input_ids.unsqueeze(0),
images=image_tensor.unsqueeze(0),
image_sizes=[image.size],
do_sample=True,
temperature=0.2,
top_p=0.5,
num_beams=1,
max_new_tokens=256,
use_cache=True)
outputs = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
print(f"Image:{image_path} \nPrompt:{input_prompt} \nOutput:{outputs}")
[首選/支持的]操作系統:
Linux