/ Модель

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

Размер весов
11,3 ГБ
Архитектура
llava · dense
Базовая модель
gemma-2b-it
Библиотека
transformers
Опубликована
14 мар 2024

llava-gemma-2b

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

Компактная модель Intel на базе Gemma-2B, которая отвечает на вопросы об изображениях и поддерживает мультимодальный диалог.

783скачиваний за 30 дней50лайковвеса обновлены11 июн 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

LLaVA-Gemma-2b — компактная мультимодальная модель Intel, дообученная по фреймворку LLaVA-v1.5 на основе google/gemma-2b-it. Она сочетает языковую модель Gemma-2B с визуальным энкодером на основе CLIP и принимает текст вместе с изображениями, чтобы отвечать на вопросы и вести диалог о визуальном содержимом. Модель также может работать с текстом без изображений.

Модель предназначена для оценки мультимодальных систем и использования в качестве чат-бота. В карточке описано применение в бенчмарках, но характеристики длины контекста и результаты сравнительных оценок этой версии не приведены. Авторы не рекомендуют использовать её в ситуациях, требующих высокой фактической точности, а также в медицинских и других высокорисковых сценариях. Модель распространяется под лицензией Gemma; условия следует сверить с файлами лицензии репозитория.

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

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

Ограничения

Авторы предостерегают от использования модели там, где нужна высокая фактическая точность, а также в медицинских и других высокорисковых сценариях. Для обработки изображений требуется совместимый препроцессор; результаты зависят от версии Transformers.

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

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

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

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

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

Открыть на Hugging Face

Model Details: LLaVA-Gemma-2b

llava-gemma-2b is a large multimodal model (LMM) trained using the LLaVA-v1.5 framework with the 2-billion parameter google/gemma-2b-it model as language backbone and the CLIP-based vision encoder.

Model DetailsDescription
AuthorsIntel: Musashi Hinck*, Matthew L. Olson*, David Cobbley, Shao-Yen Tseng, Vasudev Lal
DateMarch 2024
Version1
TypeLarge multimodal model (LMM)
Paper or Other ResourcesLLaVA-Gemma: Accelerating Multimodal Foundation Models with a Compact Language Model
LicenseGemma
Questions or CommentsCommunity Tab and Intel DevHub Discord

This model card was created by Benjamin Consolvo and the authors listed above.

Intended Use

Intended UseDescription
Primary intended usesThe model has been finetuned for multimodal benchmark evaluations, but can also be used as a multimodal chatbot.
Primary intended usersAnyone using or evaluating multimodal models.
Out-of-scope usesThis model is not intended for uses that require high levels of factuality, high stakes situations, mental health or medical applications, generating misinformation or disinformation, impersonating others, facilitating or inciting harassment or violence, any use that could lead to the violation of a human right under the UN Declaration of Human Rights.

How to use

Using llava-gemma requires a modified preprocessor if your transformers version is < 4.41.1

For current usage, see usage.py or the following code block:

import requests
from PIL import Image
from transformers import (
  LlavaForConditionalGeneration,
  AutoTokenizer,
  AutoProcessor,
  CLIPImageProcessor
)
#In this repo, needed for version < 4.41.1
#from processing_llavagemma import LlavaGemmaProcessor
#processor = LlavaGemmaProcessor( tokenizer=AutoTokenizer.from_pretrained(checkpoint), image_processor=CLIPImageProcessor.from_pretrained(checkpoint))

checkpoint = "Intel/llava-gemma-2b"

# Load model
model = LlavaForConditionalGeneration.from_pretrained(checkpoint)
processor = AutoProcessor.from_pretrained(checkpoint)

# Prepare inputs
# Use gemma chat template
prompt = processor.tokenizer.apply_chat_template(
    [{'role': 'user', 'content': "<image>\nWhat's the content of the image?"}],
    tokenize=False,
    add_generation_prompt=True
)
url = "https://www.ilankelman.org/stopsigns/australia.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text=prompt, images=image, return_tensors="pt")

# Generate
generate_ids = model.generate(**inputs, max_length=30)
output = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
print(output)

For straightforward use as a chatbot (without images), you can modify the last portion of code to the following:

# Prepare inputs
# Use gemma chat template
prompt = processor.tokenizer.apply_chat_template(
    [{'role': 'user', 'content': "Summarize the following paragraph? In this paper, we introduced LLaVA-Gemma, a compact vision-language model leveraging the Gemma Large Language Model in two variants, Gemma-2B and Gemma-7B. Our work provides a unique opportunity for researchers to explore the trade-offs between computational efficiency and multimodal understanding in small-scale models. The availability of both variants allows for a comparative analysis that sheds light on how model size impacts performance in various tasks. Our evaluations demonstrate the versatility and effectiveness of LLaVA-Gemma across a range of datasets, highlighting its potential as a benchmark for future research in small-scale vision-language models. With these models, future practitioners can optimize the performance of small-scale multimodal models more directly."}],
    tokenize=False,
    add_generation_prompt=True
)
# url = "https://www.ilankelman.org/stopsigns/australia.jpg"
# image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text=prompt, images=None, return_tensors="pt")

# Generate
generate_ids = model.generate(**inputs, max_length=300)
output = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
print(output)

Factors

FactorsDescription
Groups-
Instrumentation-
EnvironmentTrained for 4 hours on 8 Intel Gaudi 2 AI accelerators.
Card PromptsModel training and deployment on alternate hardware and software will change model performance

Metrics

MetricsDescription
Model performance measuresWe evaluate the LlaVA-Gemma models on a similar collection of benchmarks to other LMM works: GQA; MME; MM-Vet; POPE (accuracy and F1); VQAv2; MMVP; the image subset of ScienceQA. Our experiments provide insights into the efficacy of various design choices within the LLaVA framework.
Decision thresholds-
Approaches to uncertainty and variability-

Training Data

The model was trained using the LLaVA-v1.5 data mixture. This is listed as follows:

  • 558K filtered image-text pairs from LAION/CC/SBU, captioned by BLIP.
  • 158K GPT-generated multimodal instruction-following data.
  • 450K academic-task-oriented VQA data mixture.
  • 40K ShareGPT data.

Quantitative Analyses

Performance of LLaVA-Gemma models across seven benchmarks. Highlighted box indicates strongest performance amongst LLaVA-Gemma models. Bottom two rows show self-reported performance of Llava Phi-2 and LLaVA-v1.5 respectively. The bolded gemma-2b-it is the current model used here in this model card.

LM BackboneVision ModelPretrained ConnectorGQAMME cognitionMME perceptionMM-VetPOPE accuracyPOPE F1VQAv2ScienceQA ImageMMVP
gemma-2b-itCLIPYes0.531236113017.70.8500.83970.650.5640.287
gemma-2b-itCLIPNo0.48124893513.10.7840.76261.740.5490.180
gemma-2b-itDinoV2Yes0.587307113319.10.8530.83871.370.5550.227
gemma-2b-itDinoV2No0.50130995914.50.7930.77261.650.5680.180
gemma-7b-itCLIPYes0.47225389518.20.8480.82968.70.6250.327
gemma-7b-itCLIPNo0.47227885719.10.7820.73465.10.6360.240
gemma-7b-itDinoV2Yes0.519257102114.30.7940.76265.20.6280.327
gemma-7b-itDinoV2No0.45922677112.20.6930.56757.40.5980.267
Phi-2bCLIPYes--133528.9-0.85071.40.684-
Llama-2-7bCLIPYes0.620348151130.60.8500.85978.50.70446.1

Ethical Considerations

Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See Intel’s Global Human Rights Principles. Intel’s products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights.

Ethical ConsiderationsDescription
DataThe model was trained using the LLaVA-v1.5 data mixture as described above.
Human lifeThe model is not intended to inform decisions central to human life or flourishing.
MitigationsNo additional risk mitigation strategies were considered during model development.
Risks and harmsThis model has not been assessed for harm or biases, and should not be used for sensitive applications where it may cause harm.
Use cases-

Caveats and Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

Citation details

@misc{hinck2024llavagemma,
      title={LLaVA-Gemma: Accelerating Multimodal Foundation Models with a Compact Language Model}, 
      author={Musashi Hinck and Matthew L. Olson and David Cobbley and Shao-Yen Tseng and Vasudev Lal},
      year={2024},
      eprint={2404.01331},
      url={https://arxiv.org/abs/2404.01331},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlavaForConditionalGeneration
Ревизия весов
d127740

0 моделей