/ Модель

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

Контекст
131 072 токена
Параметры
3,4 млрд
Лицензия
Apache 2.0
Архитектура
granite · dense
Базовая модель
granite-4.2-3b
Библиотека
transformers
Опубликована
29 ноя 2026

granite-4.2-3b-HTML

Генерация текстаТекст → текст
520скачиваний за 30 дней0лайковвеса обновлены29 ноя 2026

Описание модели

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

Дообученная модель Granite 4.2 3B создаёт структурированные HTML-карточки по текстовым инструкциям.

wesjos выпустил полно-параметрическую донастройку SFT модели IBM Granite 4.2 3B для генерации структурированных HTML-карточек по инструкциям. Модель имеет плотную архитектуру GraniteForCausalLM и около 3,4 млрд параметров; в обучении использовались 830 примеров в формате с полями user, think и body. При включённом режиме рассуждения она формирует блок рассуждений, а затем нормализованное тело HTML-карточки структуры ai-view.

Модель предназначена для создания HTML-представлений ответов и их отображения в комплектном веб-интерфейсе. Она принимает текстовые инструкции и выдаёт текст с HTML; заявленные в метаданных языки — английский и китайский. Контекст модели указан как 131 072 токена. Лицензия — Apache-2.0.

В README сообщается, что в 17 из 17 проб блок рассуждений корректно закрывался перед основным ответом при включённом режиме thinking. Это ограниченное наблюдение по небольшому числу проб, а обучение опиралось на небольшой специализированный набор из 830 примеров. Модель ориентирована на формат HTML-карточек, поэтому её не следует считать универсальным генератором HTML для произвольных интерфейсов.

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

  • генерация HTML-карточки из текстовой инструкции
  • форматирование ответа в структуру ai-view
  • подготовка HTML-ответа для отображения в веб-интерфейсе

Ограничения

Модель обучена на специализированном наборе из 830 примеров и ориентирована на нормализованные HTML-карточки структуры ai-view. Результат о корректном закрытии блока рассуждений основан на 17 пробах и не гарантирует такое поведение во всех сценариях.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

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

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

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

Открыть на Hugging Face

granite-4.2-3b · HTML (think)

A full-parameter SFT of ibm-granite/granite-4.2-3b (3.66B dense, Apache-2.0) for structured HTML card generation. Given any instruction, the model first emits a reasoning block (closed by </think>) and then produces the normalized HTML card body.

Model Summary

ItemValue
Base modelibm-granite/granite-4.2-3b (bf16, Apache-2.0)
Training scopeFull-parameter SFT (embeddings and lm_head frozen)
Training dataMario-HTML SFT, 830 examples (709 CoT-think + 121 direct), three-field user/think/body format
Learning rate / epochs2e-5 / 1.3 epochs (234 steps)
Sequence length / budget8192 / 16384
Seed42
Optimizer stackLiger kernel, bf16
Weight fileSingle model.safetensors (6.82 GiB), sha256 c2f0e856ecaa10bd925609f2ec64cfdf94f5afa2d7654c79bc516f959ce51f79

🖼️ Demo

Rendered by the bundled WebUI (webui/) — the collapsed Chain of Thought panel on top, the raw model output rendered as an HTML card below it, unmodified.

who is the presidency of US now?


Observed behaviour

Measured with 19 generation probes:

  • Think closure 17/17 — with thinking enabled, every reasoning block closed properly before the body started. The reasoning style is data-driven ("The user wants…"), not a base-model artefact.
  • Closure needs in-distribution reinforcement. Under the same lr/epoch/seed: no-think data × full-parameter training welded the think tag on (86% unclosed); no-think data × attention-only training kept it but closed unreliably (~80–90%). This repo is the think-data × full-parameter variant.
  • Body is a normalized HTML card (ai-view structure), renderable directly by the bundled WebUI.

Deployment

vllm serve <this-directory> --max-model-len 65536 --gpu-memory-utilization 0.9

OpenAI-compatible endpoint. The bundled chat_template.jinja implements the ChatML-style format with <think> tags:

  • enable_thinking=true → the prompt is prefixed with an open <think> and the model reasons first.
  • enable_thinking=false → the template pre-closes an empty think block (<think></think>) and the model answers directly.

Chat template

from transformers import AutoTokenizer

tok = AutoTokenizer.from_pretrained("wesjos/granite-4.2-3b-HTML")
text = tok.apply_chat_template(
    [{"role": "user", "content": "Make me a card for a coffee shop."}],
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=True,
)

🖥️ Bundled WebUI

A single-file FastAPI chat UI lives in webui/. It splits the <think> stream into a collapsible Chain of Thought panel and renders the answer body as an HTML card on a canvas.

# 1. serve the model
vllm serve . --served-model-name granite-4.2-3b-HTML \
  --max-model-len 65536 --gpu-memory-utilization 0.9

# 2. serve the UI
cd webui
pip install -r requirements.txt
./run_webui.sh          # → http://localhost:8791

It is model-agnostic: point api_url in webui/config.json at any OpenAI-compatible /v1 endpoint. See webui/README.md for the full file list and options.

A GGUF build of this model is available at wesjos/granite-4.2-3b-HTML-GGUF (Q8_0 + Q4_K_M).


Notes

  • config.json additionally carries the legacy top-level rope_theta / rope_scaling / torch_dtype keys and use_cache: true, so the repo loads cleanly on both transformers 4.x and 5.x.
  • The tokenizer files are byte-identical to the base model's tokenizer (tokenizer.json sha256 883975314d58743726347caaf2c32ac89afd5ad57222cffbc4f052f2ab27b2d7); vocab.json, merges.txt and special_tokens_map.json are included for transformers 4.x compatibility.

License and attribution

Apache-2.0. This is an unofficial fine-tune of the IBM Granite model family; it is not endorsed by or affiliated with IBM. The base model ibm-granite/granite-4.2-3b is licensed under Apache-2.0.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
GraniteForCausalLM
Ревизия весов
72059eb

0 моделей