Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
html-generation
web-design
visual-ui
visual-question-answering
reasoning
vllm
80k-context
zero-system-prompt
conversational
Instructions to use wesjos/mario-html-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wesjos/mario-html-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="wesjos/mario-html-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("wesjos/mario-html-4B") model = AutoModelForMultimodalLM.from_pretrained("wesjos/mario-html-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wesjos/mario-html-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wesjos/mario-html-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wesjos/mario-html-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/wesjos/mario-html-4B
- SGLang
How to use wesjos/mario-html-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "wesjos/mario-html-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wesjos/mario-html-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "wesjos/mario-html-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wesjos/mario-html-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use wesjos/mario-html-4B with Docker Model Runner:
docker model run hf.co/wesjos/mario-html-4B
Download webui/static/theme.css from wesjos/mario-html-4B: direct link, hf CLI and curl.
- Browser
- Download file 13.8 kB
-
https://huggingface.co/wesjos/mario-html-4B/resolve/main/webui/static/theme.css
- Command line
-
hf download hf://wesjos/mario-html-4B/webui/static/theme.css
-
curl -L -o theme.css https://huggingface.co/wesjos/mario-html-4B/resolve/main/webui/static/theme.css
13.8 kB
| :root { | |
| --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; | |
| --font-mono: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, monospace; | |
| --bg-app: #f8fafc; | |
| --bg-card: #ffffff; | |
| --bg-subtle: #f1f5f9; | |
| --border-subtle: rgba(226, 232, 240, 0.8); | |
| --border-card: #e2e8f0; | |
| --text-main: #0f172a; | |
| --text-body: #334155; | |
| --text-muted: #64748b; | |
| --accent-color: #2563eb; | |
| --accent-bg: #eff6ff; | |
| --success-color: #059669; | |
| --success-bg: #ecfdf5; | |
| --success-border: #a7f3d0; | |
| --warning-color: #d97706; | |
| --warning-bg: #fffbeb; | |
| --warning-border: #fde68a; | |
| --danger-color: #dc2626; | |
| --danger-bg: #fef2f2; | |
| --danger-border: #fecaca; | |
| --info-color: #0284c7; | |
| --info-bg: #f0f9ff; | |
| --info-border: #bae6fd; | |
| --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); | |
| --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.05); | |
| --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04); | |
| --radius-sm: 6px; | |
| --radius-md: 10px; | |
| --radius-lg: 14px; | |
| } | |
| body { | |
| margin: 0; | |
| padding: 24px; | |
| background-color: var(--bg-app); | |
| font-family: var(--font-sans); | |
| color: var(--text-body); | |
| line-height: 1.6; | |
| -webkit-font-smoothing: antialiased; | |
| } | |
| .ai-view { | |
| max-width: 880px; | |
| margin: 0 auto; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 20px; | |
| } | |
| /* Card Foundation */ | |
| .card { | |
| background: var(--bg-card); | |
| border: 1px solid var(--border-card); | |
| border-radius: var(--radius-lg); | |
| padding: 20px 24px; | |
| box-shadow: var(--shadow-sm); | |
| transition: box-shadow 0.2s ease, border-color 0.2s ease; | |
| } | |
| /* Hero / TL;DR Summary Card */ | |
| .summary-card { | |
| background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); | |
| border: 1px solid var(--border-card); | |
| border-left: 5px solid var(--accent-color); | |
| border-radius: var(--radius-lg); | |
| padding: 20px 24px; | |
| box-shadow: var(--shadow-md); | |
| } | |
| .summary-card .lead { | |
| font-size: 1.05rem; | |
| font-weight: 500; | |
| color: var(--text-main); | |
| margin: 10px 0 0 0; | |
| line-height: 1.6; | |
| } | |
| /* Badges & Pills */ | |
| .badge { | |
| display: inline-flex; | |
| align-items: center; | |
| gap: 5px; | |
| font-size: 0.75rem; | |
| font-weight: 700; | |
| text-transform: uppercase; | |
| letter-spacing: 0.05em; | |
| padding: 3px 9px; | |
| border-radius: 9999px; | |
| } | |
| .badge-accent { background: var(--accent-bg); color: var(--accent-color); } | |
| .badge-success { background: var(--success-bg); color: var(--success-color); } | |
| .badge-warning { background: var(--warning-bg); color: var(--warning-color); } | |
| .badge-danger { background: var(--danger-bg); color: var(--danger-color); } | |
| .badge-info { background: var(--info-bg); color: var(--info-color); } | |
| /* Typography */ | |
| h1, h2, h3, h4 { | |
| color: var(--text-main); | |
| margin-top: 0; | |
| font-weight: 700; | |
| letter-spacing: -0.02em; | |
| } | |
| h2 { font-size: 1.3rem; margin-bottom: 12px; } | |
| h3 { font-size: 1.1rem; margin-bottom: 8px; } | |
| p { margin: 0 0 10px 0; } | |
| p:last-child { margin-bottom: 0; } | |
| /* Grid Layouts (Bento) */ | |
| .grid { | |
| display: grid; | |
| gap: 16px; | |
| } | |
| .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } | |
| .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } | |
| @media (max-width: 680px) { | |
| .grid-2, .grid-3 { grid-template-columns: 1fr; } | |
| } | |
| /* Callout Blocks */ | |
| .callout { | |
| border-radius: var(--radius-md); | |
| padding: 16px 20px; | |
| border-left: 4px solid; | |
| margin: 4px 0; | |
| font-size: 0.95rem; | |
| } | |
| .callout-header { | |
| font-weight: 700; | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| margin-bottom: 6px; | |
| } | |
| .callout-info { | |
| background-color: var(--info-bg); | |
| border-color: var(--info-color); | |
| color: #0369a1; | |
| } | |
| .callout-warning { | |
| background-color: var(--warning-bg); | |
| border-color: var(--warning-color); | |
| color: #92400e; | |
| } | |
| .callout-danger { | |
| background-color: var(--danger-bg); | |
| border-color: var(--danger-color); | |
| color: #991b1b; | |
| } | |
| .callout-success { | |
| background-color: var(--success-bg); | |
| border-color: var(--success-color); | |
| color: #065f46; | |
| } | |
| /* Stepper / Timeline */ | |
| .stepper { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 16px; | |
| position: relative; | |
| margin: 6px 0; | |
| } | |
| .step-item { | |
| display: flex; | |
| gap: 16px; | |
| align-items: flex-start; | |
| } | |
| .step-num { | |
| flex-shrink: 0; | |
| width: 32px; | |
| height: 32px; | |
| border-radius: 50%; | |
| background: var(--accent-bg); | |
| color: var(--accent-color); | |
| border: 2px solid var(--accent-color); | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-weight: 700; | |
| font-size: 0.85rem; | |
| } | |
| .step-content { | |
| flex-grow: 1; | |
| } | |
| .step-content h4 { | |
| margin: 4px 0 6px 0; | |
| font-size: 1rem; | |
| } | |
| /* Code Container (macOS style window) */ | |
| .code-box { | |
| background: #0f172a; | |
| border-radius: var(--radius-md); | |
| overflow: hidden; | |
| box-shadow: var(--shadow-sm); | |
| margin: 8px 0; | |
| } | |
| .code-header { | |
| background: #1e293b; | |
| padding: 8px 14px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| border-bottom: 1px solid rgba(255, 255, 255, 0.05); | |
| } | |
| .code-dots { | |
| display: flex; | |
| gap: 6px; | |
| } | |
| .code-dots i { | |
| width: 10px; | |
| height: 10px; | |
| border-radius: 50%; | |
| display: inline-block; | |
| } | |
| .code-dots i:nth-child(1) { background: #ef4444; } | |
| .code-dots i:nth-child(2) { background: #f59e0b; } | |
| .code-dots i:nth-child(3) { background: #10b981; } | |
| .code-title { | |
| color: #94a3b8; | |
| font-family: var(--font-mono); | |
| font-size: 0.75rem; | |
| font-weight: 600; | |
| text-transform: uppercase; | |
| } | |
| .code-box pre { | |
| margin: 0; | |
| padding: 14px 16px; | |
| overflow-x: auto; | |
| font-family: var(--font-mono); | |
| font-size: 0.88rem; | |
| line-height: 1.5; | |
| color: #f1f5f9; | |
| } | |
| code { | |
| font-family: var(--font-mono); | |
| font-size: 0.88em; | |
| background: #e2e8f0; | |
| color: #0f172a; | |
| padding: 2px 6px; | |
| border-radius: 4px; | |
| } | |
| .code-box code { | |
| background: transparent; | |
| padding: 0; | |
| color: inherit; | |
| } | |
| /* Metric / KPI Cards */ | |
| .metric-group { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); | |
| gap: 12px; | |
| } | |
| .metric-card { | |
| background: var(--bg-card); | |
| border: 1px solid var(--border-card); | |
| border-radius: var(--radius-md); | |
| padding: 14px 18px; | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .metric-label { | |
| font-size: 0.8rem; | |
| color: var(--text-muted); | |
| font-weight: 600; | |
| text-transform: uppercase; | |
| letter-spacing: 0.04em; | |
| } | |
| .metric-value { | |
| font-size: 1.6rem; | |
| font-weight: 800; | |
| color: var(--text-main); | |
| letter-spacing: -0.03em; | |
| margin: 4px 0; | |
| } | |
| .metric-sub { | |
| font-size: 0.78rem; | |
| color: var(--text-muted); | |
| } | |
| /* Modern Minimalist Table */ | |
| .table-container { | |
| overflow-x: auto; | |
| border: 1px solid var(--border-card); | |
| border-radius: var(--radius-md); | |
| margin: 8px 0; | |
| background: var(--bg-card); | |
| } | |
| .modern-table { | |
| width: 100%; | |
| border-collapse: collapse; | |
| text-align: left; | |
| font-size: 0.92rem; | |
| } | |
| .modern-table th { | |
| background: var(--bg-subtle); | |
| color: var(--text-muted); | |
| font-weight: 700; | |
| font-size: 0.78rem; | |
| text-transform: uppercase; | |
| letter-spacing: 0.05em; | |
| padding: 10px 14px; | |
| border-bottom: 1px solid var(--border-card); | |
| } | |
| .modern-table td { | |
| padding: 12px 14px; | |
| border-bottom: 1px solid var(--border-subtle); | |
| color: var(--text-body); | |
| } | |
| .modern-table tr:last-child td { | |
| border-bottom: none; | |
| } | |
| .modern-table tr:hover td { | |
| background: #f8fafc; | |
| } | |
| /* Append Thinking Card component to theme.css */ | |
| .thinking-card { | |
| background: var(--bg-subtle); | |
| border: 1px dashed var(--border-card); | |
| border-radius: var(--radius-lg); | |
| padding: 12px 18px; | |
| margin-bottom: 8px; | |
| transition: all 0.2s ease; | |
| } | |
| .thinking-card[open] { | |
| background: var(--bg-card); | |
| border-style: solid; | |
| border-color: #cbd5e1; | |
| box-shadow: var(--shadow-sm); | |
| } | |
| body.dark-mode .thinking-card { | |
| border-color: #374151; | |
| background: #11182788; | |
| } | |
| body.dark-mode .thinking-card[open] { | |
| background: #1f2937; | |
| border-color: #4b5563; | |
| } | |
| .thinking-header { | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| cursor: pointer; | |
| user-select: none; | |
| font-size: 0.88rem; | |
| font-weight: 700; | |
| color: var(--text-muted); | |
| list-style: none; /* Hide default triangle */ | |
| } | |
| .thinking-header::-webkit-details-marker { | |
| display: none; | |
| } | |
| .thinking-icon { | |
| font-size: 1.1rem; | |
| } | |
| .thinking-title { | |
| color: var(--text-main); | |
| flex-grow: 1; | |
| } | |
| .thinking-badge { | |
| font-size: 0.72rem; | |
| background: #ede9fe; | |
| color: #6d28d9; | |
| padding: 2px 8px; | |
| border-radius: 9999px; | |
| font-weight: 700; | |
| } | |
| body.dark-mode .thinking-badge { | |
| background: #4c1d9555; | |
| color: #c4b5fd; | |
| } | |
| .thinking-body { | |
| margin-top: 14px; | |
| padding-top: 12px; | |
| border-top: 1px solid var(--border-subtle); | |
| font-size: 0.88rem; | |
| line-height: 1.6; | |
| color: var(--text-muted); | |
| font-family: var(--font-sans); | |
| } | |
| .thinking-step { | |
| margin-bottom: 8px; | |
| } | |
| .thinking-step strong { | |
| color: var(--text-main); | |
| } | |
| .thinking-math { | |
| font-family: var(--font-mono); | |
| background: var(--bg-subtle); | |
| padding: 2px 6px; | |
| border-radius: 4px; | |
| color: var(--text-main); | |
| } | |
| /* Aliases for thinking and summary classes */ | |
| .thinking { | |
| background: var(--bg-subtle); | |
| border: 1px dashed var(--border-card); | |
| border-radius: var(--radius-lg); | |
| padding: 12px 18px; | |
| margin-bottom: 12px; | |
| transition: all 0.2s ease; | |
| } | |
| .thinking[open] { | |
| background: var(--bg-card); | |
| border-style: solid; | |
| border-color: #cbd5e1; | |
| box-shadow: var(--shadow-sm); | |
| } | |
| body.dark-mode .thinking { | |
| border-color: #374151; | |
| background: #11182788; | |
| } | |
| body.dark-mode .thinking[open] { | |
| background: #1f2937; | |
| border-color: #4b5563; | |
| } | |
| .summary { | |
| background: var(--bg-card); | |
| border: 1px solid var(--border-card); | |
| border-left: 5px solid var(--accent-color); | |
| border-radius: var(--radius-lg); | |
| padding: 20px 24px; | |
| box-shadow: var(--shadow-md); | |
| margin-top: 10px; | |
| } | |
| .summary .lead { | |
| font-size: 1.05rem; | |
| font-weight: 500; | |
| color: var(--text-main); | |
| margin: 10px 0 0 0; | |
| line-height: 1.6; | |
| } | |
| /* Modern List System (Kills the Markdown / 90s bullet look) */ | |
| .ai-view ul { | |
| list-style: none ; | |
| padding-left: 0 ; | |
| margin: 12px 0 ; | |
| display: flex ; | |
| flex-direction: column ; | |
| gap: 8px ; | |
| } | |
| .ai-view ul li { | |
| position: relative ; | |
| padding: 8px 14px 8px 30px ; | |
| background: rgba(0, 0, 0, 0.02) ; | |
| border-radius: var(--radius-sm, 8px) ; | |
| border: 1px solid rgba(0, 0, 0, 0.05) ; | |
| color: var(--text-body) ; | |
| line-height: 1.5 ; | |
| font-size: 0.92rem ; | |
| transition: all 0.15s ease ; | |
| } | |
| .ai-view ul li:hover { | |
| background: rgba(37, 99, 235, 0.04) ; | |
| border-color: rgba(37, 99, 235, 0.15) ; | |
| } | |
| .ai-view ul li::before { | |
| content: "" ; | |
| position: absolute ; | |
| left: 12px ; | |
| top: 14px ; | |
| width: 7px ; | |
| height: 7px ; | |
| border-radius: 50% ; | |
| background: var(--accent-color, #2563eb) ; | |
| box-shadow: 0 0 0 3px var(--accent-bg, rgba(37, 99, 235, 0.15)) ; | |
| } | |
| /* Grid Child Auto-Cardify: if model outputs bare <div> inside .grid, give it card polish */ | |
| .grid > div:not(.card) { | |
| background: #f8fafc ; | |
| border: 1px solid var(--border-card, #e2e8f0) ; | |
| border-radius: var(--radius-md, 12px) ; | |
| padding: 18px 20px ; | |
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) ; | |
| } | |
| .grid > div:not(.card) h3 { | |
| margin-bottom: 12px ; | |
| padding-bottom: 6px ; | |
| border-bottom: 1px solid rgba(0, 0, 0, 0.06) ; | |
| } | |
| /* Auto-span single child in grid (Prevents blank ghost columns when model outputs only 1 child) */ | |
| .grid > :only-child, | |
| .grid-2 > :only-child, | |
| .grid-3 > :only-child { | |
| grid-column: 1 / -1 ; | |
| } | |
| /* Grid Child Container Safety: Never allow child to burst out of grid track */ | |
| .grid > div, | |
| .grid-2 > div, | |
| .grid-3 > div { | |
| min-width: 0 ; | |
| box-sizing: border-box ; | |
| } | |
| /* Feature List & Item (Upgraded from old-school bullet points; clean vertical card flow) */ | |
| .feature-list { | |
| display: flex ; | |
| flex-direction: column ; | |
| gap: 8px ; | |
| margin: 10px 0 ; | |
| width: 100% ; | |
| box-sizing: border-box ; | |
| } | |
| .feature-item { | |
| display: flex ; | |
| flex-direction: column ; | |
| align-items: flex-start ; | |
| gap: 6px ; | |
| padding: 10px 14px ; | |
| background: #ffffff ; | |
| border-radius: var(--radius-sm, 8px) ; | |
| border: 1px solid var(--border-card, #e2e8f0) ; | |
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) ; | |
| transition: all 0.15s ease ; | |
| width: 100% ; | |
| box-sizing: border-box ; | |
| } | |
| .feature-item:hover { | |
| border-color: #cbd5e1 ; | |
| box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04) ; | |
| } | |
| .feature-item .badge { | |
| font-size: 0.72rem ; | |
| padding: 2px 8px ; | |
| line-height: 1.4 ; | |
| display: inline-flex ; | |
| } | |
| .feature-item p { | |
| margin: 0 ; | |
| font-size: 0.88rem ; | |
| color: var(--text-body, #334155) ; | |
| line-height: 1.5 ; | |
| width: 100% ; | |
| } | |
| .feature-item:hover { | |
| border-color: #cbd5e1 ; | |
| box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04) ; | |
| transform: translateX(2px) ; | |
| } | |
| .feature-item .badge { | |
| flex-shrink: 0 ; | |
| margin-top: 1px ; | |
| font-size: 0.75rem ; | |
| } | |
| .feature-item p { | |
| margin: 0 ; | |
| font-size: 0.92rem ; | |
| color: var(--text-body, #334155) ; | |
| line-height: 1.5 ; | |
| flex-grow: 1 ; | |
| } | |
| answer { | |
| display: inline-block; | |
| font-family: var(--font-mono); | |
| font-weight: 800; | |
| font-size: 1.15rem; | |
| color: var(--accent-color); | |
| background: var(--accent-bg); | |
| border: 1px solid rgba(37, 99, 235, 0.25); | |
| padding: 2px 10px; | |
| border-radius: 6px; | |
| letter-spacing: -0.01em; | |
| } | |