/ Модель

Характеристики

Контекст
131 072 токена
Размер весов
6 ГБ
Лицензия
Apache 2.0
Архитектура
llava_next · dense
Базовая модель
granite-vision-3.2-2b
Библиотека
transformers
Опубликована
14 мар 2025

granite-vision-3.2-2b

Изображение и текст → текст15 профессий

Компактная мультимодальная модель IBM для извлечения информации и ответов на вопросы по изображениям документов и другим визуальным материалам.

216скачиваний за 30 дней5лайковвеса обновлены14 мар 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Изображение → текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

granite-vision-3.2-2b — компактная мультимодальная модель IBM, дообученная на базе ibm-granite/granite-vision-3.2-2b для понимания изображений и работы с визуальными документами. Архитектура LLaVA-NeXT объединяет визуальный энкодер SigLIP, двухслойный MLP-коннектор и языковую модель Granite 3.1 2B Instruct; модель использует разрешение AnyRes и многослойные признаки энкодера. В метаданных указаны архитектура LlavaNextForConditionalGeneration и формат safetensors.

Модель принимает изображения и инструкции на английском языке и формирует текстовые ответы. Она предназначена для извлечения сведений из таблиц, графиков, инфографики, диаграмм и других документов, OCR, ответов на вопросы по изображениям, а также общих задач визуального понимания. В базовой языковой модели заявлено контекстное окно 128 тыс. токенов. Лицензия — Apache 2.0.

Модель может ошибаться, выдавать предвзятые или небезопасные ответы; её компактный размер может повышать риск галлюцинаций. Для задач только с текстовым вводом README рекомендует использовать текстовые модели Granite.

Сценарии применения

  • извлечение данных из таблиц на изображениях
  • ответы на вопросы по графикам и диаграммам
  • распознавание и разбор текста в документах
  • анализ инфографики и визуальных отчетов
  • ответы на вопросы по содержимому изображения

Ограничения

Модель может выдавать неточные, предвзятые или небезопасные ответы; небольшой размер может усиливать галлюцинации. Она рассчитана на английские инструкции, а для задач только с текстом README рекомендует текстовые модели Granite.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

granite-vision-3.2-2b

Model Summary: granite-vision-3.2-2b is a compact and efficient vision-language model, specifically designed for visual document understanding, enabling automated content extraction from tables, charts, infographics, plots, diagrams, and more. The model was trained on a meticulously curated instruction-following dataset, comprising diverse public datasets and synthetic datasets tailored to support a wide range of document understanding and general image tasks. It was trained by fine-tuning a Granite large language model with both image and text modalities.

Evaluations:

We evaluated Granite Vision 3.2 alongside other vision-language models (VLMs) in the 1B-4B parameter range using the standard llms-eval benchmark. The evaluation spanned multiple public benchmarks, with particular emphasis on document understanding tasks while also including general visual question-answering benchmarks.

Molmo-EInternVL2Phi3vPhi3.5vGranite Vision
Document benchmarks
DocVQA0.660.870.870.880.89
ChartQA0.600.750.810.820.87
TextVQA0.620.720.690.70.78
AI2D0.630.740.790.790.76
InfoVQA0.440.580.550.610.64
OCRBench0.650.750.640.640.77
LiveXiv VQA0.470.510.61-0.61
LiveXiv TQA0.360.380.48-0.57
Other benchmarks
MMMU0.320.350.420.440.37
VQAv20.570.750.760.770.78
RealWorldQA0.550.340.600.580.63
VizWiz VQA0.490.460.570.570.63
OK VQA0.400.440.510.530.56

Supported Input Format: Currently the model supports English instructions and images (png, jpeg, etc.) as input format.

Intended Use: The model is intended to be used in enterprise applications that involve processing visual and text data. In particular, the model is well-suited for a range of visual document understanding tasks, such as analyzing tables and charts, performing optical character recognition (OCR), and answering questions based on document content. Additionally, its capabilities extend to general image understanding, enabling it to be applied to a broader range of business applications. For tasks that exclusively involve text-based input, we suggest using our Granite large language models, which are optimized for text-only processing and offer superior performance compared to this model.

Generation:

Granite Vision model is supported natively transformers>=4.49. Below is a simple example of how to use the granite-vision-3.2-2b model.

Usage with transformers

First, make sure to build the latest verions of transormers:

pip install transformers>=4.49

Then run the code:

from transformers import AutoProcessor, AutoModelForVision2Seq
from huggingface_hub import hf_hub_download
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"

model_path = "ibm-granite/granite-vision-3.2-2b"
processor = AutoProcessor.from_pretrained(model_path)
model = AutoModelForVision2Seq.from_pretrained(model_path).to(device)

# prepare image and text prompt, using the appropriate prompt template

img_path = hf_hub_download(repo_id=model_path, filename='example.png')

conversation = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": img_path},
            {"type": "text", "text": "What is the highest scoring model on ChartQA and what is its score?"},
        ],
    },
]
inputs = processor.apply_chat_template(
    conversation,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt"
).to(device)


# autoregressively complete prompt
output = model.generate(**inputs, max_new_tokens=100)
print(processor.decode(output[0], skip_special_tokens=True))

Usage with vLLM

The model can also be loaded with vLLM. First make sure to install the following libraries:

pip install torch torchvision torchaudio
pip install vllm==0.6.6

Then, copy the snippet from the section that is relevant for your use case.

from vllm import LLM, SamplingParams
from vllm.assets.image import ImageAsset
from huggingface_hub import hf_hub_download
from PIL import Image

model_path = "ibm-granite/granite-vision-3.2-2b"

model = LLM(
    model=model_path,
    limit_mm_per_prompt={"image": 1},
)

sampling_params = SamplingParams(
    temperature=0.2,
    max_tokens=64,
)

# Define the question we want to answer and format the prompt
image_token = "<image>"
system_prompt = "<|system|>\nA chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n"

question = "What is the highest scoring model on ChartQA and what is its score?"
prompt = f"{system_prompt}<|user|>\n{image_token}\n{question}\n<|assistant|>\n"
img_path = hf_hub_download(repo_id=model_path, filename='example.png')
image = Image.open(img_path).convert("RGB")
print(image)

# Build the inputs to vLLM; the image is passed as `multi_modal_data`.
inputs = {
    "prompt": prompt,
    "multi_modal_data": {
        "image": image,
    }
}

outputs = model.generate(inputs, sampling_params=sampling_params)
print(f"Generated text: {outputs[0].outputs[0].text}")

Fine-tuning

For an example of fine-tuning Granite Vision for new tasks refer to this notebook.

Use Granite Vision for MM RAG

For an example of MM RAG using granite vision refer to this notebook.

Model Architecture:

The architecture of granite-vision-3.2-2b consists of the following components:

(1) Vision encoder: SigLIP (https://huggingface.co/docs/transformers/en/model_doc/siglip).

(2) Vision-language connector: two-layer MLP with gelu activation function.

(3) Large language model: granite-3.1-2b-instruct with 128k context length (https://huggingface.co/ibm-granite/granite-3.1-2b-instruct).

We built upon LLaVA (https://llava-vl.github.io) to train our model. We use multi-layer encoder features and a denser grid resolution in AnyRes to enhance the model's ability to understand nuanced visual content, which is essential for accurately interpreting document images.

Training Data:

Overall, our training data is largely comprised of two key sources: (1) publicly available datasets (2) internally created synthetic data targeting specific capabilities including document understanding tasks. A detailed attribution of datasets can be found in the technical report.

Infrastructure: We train Granite Vision using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs.

Ethical Considerations and Limitations: The use of Large Vision and Language Models involves risks and ethical considerations people must be aware of, including but not limited to: bias and fairness, misinformation, and autonomous decision-making. granite-vision-3.2-2b is not the exception in this regard. Although our alignment processes include safety considerations, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. Additionally, it remains uncertain whether smaller models might exhibit increased susceptibility to hallucination in generation scenarios due to their reduced sizes, which could limit their ability to generate coherent and contextually accurate responses. This aspect is currently an active area of research, and we anticipate more rigorous exploration, comprehension, and mitigations in this domain. Regarding ethics, a latent risk associated with all Large Language Models is their malicious utilization. We urge the community to use granite-vision-3.2-2b with ethical intentions and in a responsible way. We recommend using this model for document understanding tasks, and note that more general vision tasks may pose higher inherent risks of triggering biased or harmful output. To enhance safety, we recommend using granite-vision-3.2-2b alongside Granite Guardian. Granite Guardian is a fine-tuned instruct model designed to detect and flag risks in prompts and responses across key dimensions outlined in the IBM AI Risk Atlas. Its training, which includes both human-annotated and synthetic data informed by internal red-teaming, enables it to outperform similar open-source models on standard benchmarks, providing an additional layer of safety.

Resources

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
LlavaNextForConditionalGeneration
Ревизия весов
9d74770

0 моделей