/ Модель

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

Контекст
2 048 токенов
Размер весов
13,8 ГБ
Лицензия
MIT
Архитектура
llava_crystal · dense
Библиотека
transformers
Опубликована
26 июн 2024

CrystalChat-7B-Web2Code

Генерация текстаТекст → текст3 профессии

Мультимодальная модель на основе CrystalChat-7B, которая генерирует HTML-код по изображениям и наброскам веб-страниц.

54скачиваний за 30 дней5лайковвеса обновлены22 окт 2024

Бенчмарки

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

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

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

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

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

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

CrystalChat-7B-Web2Code — мультимодальная модель на 7 млрд параметров, разработанная авторами проекта Web2Code на основе CrystalChat-7B. Она предназначена прежде всего для генерации HTML по изображениям веб-страниц, включая наброски от руки и снимки существующих сайтов. Модель использует визуальный энкодер CLIP ViT-L/14 с разрешением 336 пикселей и обучалась в два этапа по рецепту, сходному с LLaVA-v1.5 на базе Vicuna-7B. Также модель может отвечать на вопросы о содержимом веб-страниц.

Модель принимает изображения и текстовые инструкции, а выдаёт текст, в том числе HTML-код. Основной язык карточки — английский; контекст составляет 2048 токенов. Репозиторий содержит веса PyTorch и распространяется по лицензии MIT. Модель специализирована на веб-страницах, поэтому качество генерации для произвольных изображений и иных задач не следует считать подтверждённым.

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

  • создание HTML-страницы по её скриншоту
  • преобразование нарисованного от руки макета сайта в HTML
  • воссоздание веб-страницы по изображению
  • ответы на вопросы о содержимом скриншота веб-страницы

Ограничения

Модель специализирована на изображениях веб-страниц; качество за пределами этой области не подтверждено. Контекст ограничен 2048 токенами.

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

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

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

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

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

Открыть на Hugging Face

CrystalChat-7B-Web2Code: a fully-reproducible vision large language model based on CrystalChat-7B LLM for webpage code generation

Model Description

CrystalChat-7B based multi-modal large language model (MLLM) mimics the training recipe used for Vicuna-7B based LLaVa-v1.5. CrystalChat-7B based MLLMs models are entirely transparent, having open-sourced all materials, including code, data, model checkpoint, intermediate results, and more at Web2Code: A Large-scale Webpage-to-Code Dataset and Evaluation Framework for Multimodal LLMs. CrystalChat-7B-Web2Code MLLM is specialized in webpage images-to-html code generation.

CrystalChat-Web2Code Features

Covert hand-drawn images to a website

Image 1Image 2
Hand Drawn WebpageCrystalChat-Web2Code Rendering

Recreate a new webpage from an existing webpage

Image 1: Original Webpage

Image 2: CrystalChat-Web2Code Rendering

Web2Code Dataset

Our Web2Code instruction tuning dataset construction and instruction generation process involves four key components:

  1. Creation of new webpage image-code pair data (DWCG): We generated high-quality HTML webpage-code pairs following the CodeAlpaca prompt using GPT-3.5 and convert them into instruction-following data.
  2. Refinement of existing webpage code generation data (DWCGR): We transform existing datasets including WebSight and Pix2Code into an instruction- following data format similar to LLaVA data, so they can be used as instruction-following data to train MLLMs.
  3. Creation of a new text question-answer pair data (DWU): We generated a new question-answer pair dataset utilizing our new GPT-3.5 generated data for webpage understanding.
  4. Refinement of existing webpage understanding data (DWUR) : We refine the WebSRC question-answer data to improve its quality using the GPT-4.

The Web2Code instruction tuning dataset was released in Web2Code: A Large-scale Webpage-to-Code Dataset and Evaluation Framework for Multimodal LLMs.

Evaluations

Webpage Understanding Benchmark (WUB)

Results

LLM BackboneDWCGDWUDWCGRDWURAccuracy (%)
CrystalChat-7B73.94
✓✓73.48
✓✓✓✓74.14
Vicuna-7B71.12
✓68.11
✓70.82
✓✓✓✓71.23
Llama3-8B✓✓✓✓74.84

Table 1: The accuracy of webpage understanding under various data configurations and LLM backbones. All models are instruction-tuned and evaluated on our WUB benchmark. We note that the general domain data (i.e., LLaVA) is included in all data configuration as default.

Webpage Code Generation Benchmark (WCGB)

Utilizing the same images as the WUB, this benchmark evaluates a multimodal model tasked with generating HTML code from webpage images based on specific instructions. Unlike traditionalcode-level evaluations, this benchmark assesses the generated webpage’s fidelity at the image level. We convert the predicted HTML codes back into images using Selenium WebDriver to allow a direct visual comparison with the ground truth images. The evaluation, depicted on the left side of Figure 6, considers 10 different aspects, which are further categorized into four evaluation matrices using the GPT-4 Vision API.

Results

LLM BackboneDWCGDWUDWCGRDWURVSA ↑CAD ↑TCC ↑UII ↑Overall ↑
CrystalChat-7B4.7144.5724.8655.1474.825
✓7.9008.0018.2048.2158.080
✓✓7.9008.0018.2048.2158.080
✓✓✓✓8.3848.2878.4178.4888.394
Vicuna-7B3.0423.2503.3333.1673.198
✓6.8716.6606.5896.8976.754
✓3.8983.4893.3403.6513.595
✓✓✓✓7.8767.6877.2677.5637.598
Llama3-8B✓✓✓✓8.5228.5648.4218.6118.530

Table 2: The performance of different LLM backbones under various data configurations on our Webpage Code Generation Benchmark (WCGB). "VSA" denotes Visual Structure and Alignment, "CAD" represents Color and Aesthetic Design, "TCC" represents Textual and Content Consistency, and "UII" denotes User Interface and Interactivity.

About CrystalChat-7B-Web2Code:

  • 7 billion parameter LLM
  • CLIP ViT-L/14-336px vision encoder
  • Languages: English
  • Models Released: CrystalChat-7B-Web2Code
  • Trained in 2 stages
  • License: MIT

General Evaluations

General Evaluation Metrics for MLLMs. MME serves as an extensive evaluative benchmark, aiming to assess perceptual and cognitive capability of MLLMs within 14 sub-tasks. Additionally, we also evaluate the performance of our models on text-oriented visual question answering tasks employing a diverse set of benchmark datasets including ScienceQA and TextVQA. Furthermore, we assess our models’ ability toward anti-hallucination through POPE.

LLM BackboneMME-PMME-CPOPESciQATextVQA
CrystalCoder-7B1359.83238.9286.18264.1550.39
CrystalChat-7B1456.53308.2186.9667.7757.84
Vicuna-7B1481.12302.8587.17467.9756.49

Table 3: Comparison of different LLM backbones on visual language understanding benchmarks. All models are instruction-tuned on the general domain data (i.e. LLaVA)*

Data and Training Details

Pretrain Data

LLaVA Visual Instruct Pretrain LCS-558K is a filtered subset of the LAION, CC, and SBU datasets, featuring a more balanced distribution of concept coverage. The file includes multimodal synthesized conversations generated from image-caption pairs by incorporating randomly selected instructions such as "Describe this image." It is used for pretraining in LLaVA, with the raw CC-3M caption serving as the default answer.

Finetune Data

The finetuning data contains the following:

LLaVa Finetuning Data

The dataset chosen was created by LLaVA with academic-task-oriented VQA data mixture and data from ShareGPT. LLaVA Visual Instruct 150K is a dataset of GPT-generated multimodal instruction-following data. It is designed for visual instruction tuning and aims to develop large multimodal models with capabilities akin to GPT-4 in both vision and language.

DataSizeResponse formatting prompts
LLaVA [36]158K–
ShareGPT [46]40K–
VQAv2 [19]83KAnswer the question using a single word or phrase.
GQA [21]72KAnswer the question using a single word or phrase.
OKVQA [41]9KAnswer the question using a single word or phrase.
OCRVQA [42]80KAnswer the question using a single word or phrase.
A-OKVQA [45]66KAnswer with the option’s letter from the given choices directly.
TextCaps [47]22KProvide a one-sentence caption for the provided image.
RefCOCO [24, 40]48KNote: randomly choose between the two formats. Provide a short description for this region.
VG [25]86KProvide the bounding box coordinate of the region this sentence describes.
Total665K

Table 4: Instruction-following Data Mixture of LLaVA-1.5.*

Code Datasets

DatasetDWCG (ours)DWCGR (ours)
Instruction✓✓
SourceSyntheticSynthetic
Size60K824.7K
Avg Length (tokens)471.8±162.3652.85±157.0
Avg Tag Count28.1±10.635.3±9.0
Avg DOM Depth5.3±1.06.5±1.0
Avg Unique Tags13.6±2.713.5±2.5

Table 5: DWCG is a newly generated GPT-3.5-based dataset, while DWCGR is the refined dataset that utilizes WebSight and Pix2Code datasets*

Webpage Understanding Datasets

DatasetDWUDWUR
Instruction✓✓
Size243.5K51.5K

Table 6: Distribution of DWU and DWUR datasets. Both datasets include high-quality question-answer pairs for webpage understanding.*

Loading Crystal

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(
                    "LLM360/CrystalChat-7B-MLLM",
                    padding_side="right",
                    trust_remote_code=True)

model = AutoModelForCausalLM.from_pretrained(
    "LLM360/CrystalChat-7B-MLLM",
    trust_remote_code=True,
    torch_dtype=torch.float16,
    device_map='auto',
    low_cpu_mem_usage=True
)

LLM360

LLM-360 is an open research lab enabling community-owned AGI through open-source large model research and development.

Crystal-based Models enables community-owned AGI by creating standards and tools to advance the bleeding edge of LLM capability and empower knowledge transfer, research, and development.

We believe in a future where artificial general intelligence (AGI) is created by the community, for the community. Through an open ecosystem of equitable computational resources, high-quality data, and flowing technical knowledge, we can ensure ethical AGI development and universal access for all innovators.

Visit us

Citation

BibTeX:

@article{yun2024web2code,
  title={Web2Code: A Large-scale Webpage-to-Code Dataset and Evaluation Framework for Multimodal LLMs},
  author={Yun, Sukmin and Lin, Haokun and Thushara, Rusiru and Bhat, Mohammad Qazim and Wang, Yongxin and Jiang, Zutao and Deng, Mingkai and Wang, Jinhong and Tao, Tianhua and Li, Junbo and others},
  journal={arXiv preprint arXiv:2406.20098},
  year={2024}
}

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

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

GPU в ailist

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

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
LlavaCrystalForCausalLM
Ревизия весов
048a295

0 моделей