prithivMLmods commited on
Commit
216ef6f
·
verified ·
1 Parent(s): fc5162c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +141 -1
README.md CHANGED
@@ -6,4 +6,144 @@ tags:
6
  - mlx
7
  base_model:
8
  - microsoft/AesCode-8B
9
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  - mlx
7
  base_model:
8
  - microsoft/AesCode-8B
9
+ ---
10
+
11
+ # **microsoft-AesCode-8B**
12
+
13
+ > **AesCode-8B** is Microsoft's 8B vision-language model, built on Qwen3-VL-8B-Instruct, for generating information-rich visual artifacts such as slides, posters, dashboards and reports as structured, editable HTML/CSS. It addresses a gap between two kinds of generator: code models can't see how layout, hierarchy and color come together on the canvas, while image generators compose attractive pages but misrender text, numbers and logical relationships. AesCode therefore takes an image generated from the same prompt as an aesthetic reference and follows the prompt for the required content. Tables come out as HTML table structures and charts as ECharts specifications, so both stay inspectable and verifiable. Training was cold-start SFT on 3,000 demonstrations, followed by GDPO reinforcement learning for 400 steps over 7,408 prompts, using verl and no separately trained reward model. Each target is represented as a design graph, and the reward is split into seven decoupled channels: execution, text, boundary, tablechart, layout, whitespace and design. Deterministic verifiers score what can be parsed from the code and its rendering, and a VLM judge scores the rest against a sample-specific Visual Graph Rubric. On the card's 300 infographic samples, AesCode-8B scores 82.94 Overall (Rule 90.07, Visual 75.80). That is above the reference-conditioned GPT-5.5 (81.28) and Claude Opus 4.8 (80.39), and 31.0 points above its reference-conditioned Qwen3-VL-8B backbone. The 32B companion model leads at 85.89. Style is a ceiling for every system, with no model above 60. The reference image is optional, since withholding it costs AesCode-8B only 1.00 Visual point, versus 19.55 for the base model, though quality is highest with it. The model loads through standard Transformers or vLLM, with the training code, verifier stack and rubric builder released on GitHub. The paper is still listed as under review. It is released under Apache 2.0.
14
+
15
+ ## Use with mlx
16
+
17
+ Install the required library:
18
+
19
+ ```bash
20
+ pip install -U mlx-vlm
21
+ ```
22
+
23
+ > **Usage Note:** `AesCode-8B` produces clean, standalone HTML/CSS with embedded inline ECharts or tables. Feeding an aesthetic reference image alongside your content specification prompt yields the highest-fidelity page styling and layouts. Supplying the reference image is optional.
24
+
25
+ ### BF16 Variant (Base Weights)
26
+
27
+ The unquantized BF16 weights reside directly in the root repository path:
28
+
29
+ #### CLI (Terminal)
30
+
31
+ ```bash
32
+ python -m mlx_vlm generate \
33
+ --model prithivMLmods/microsoft-AesCode-8B-MLX \
34
+ --max-tokens 2048 \
35
+ --temperature 0.7 \
36
+ --prompt "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS." \
37
+ --image <path_to_reference_image>
38
+ ```
39
+
40
+ #### Python API
41
+
42
+ ```python
43
+ from mlx_vlm import load, generate
44
+ from mlx_vlm.prompt_utils import apply_chat_template
45
+ from mlx_vlm.utils import load_config
46
+
47
+ model_path = "prithivMLmods/microsoft-AesCode-8B-MLX"
48
+ model, processor = load(model_path)
49
+ config = load_config(model_path)
50
+
51
+ # Reference image is optional
52
+ image = ["<path_to_reference_image>"]
53
+ prompt = "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS."
54
+ formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
55
+
56
+ output = generate(
57
+ model,
58
+ processor,
59
+ formatted_prompt,
60
+ image=image,
61
+ max_tokens=2048,
62
+ temperature=0.7
63
+ )
64
+ print(output.text)
65
+ ```
66
+
67
+ ### 8-bit Variant
68
+
69
+ Access the 8-bit quantized files using `--subfolder 8bit`:
70
+
71
+ #### CLI (Terminal)
72
+
73
+ ```bash
74
+ python -m mlx_vlm generate \
75
+ --model prithivMLmods/microsoft-AesCode-8B-MLX \
76
+ --subfolder 8bit \
77
+ --max-tokens 2048 \
78
+ --temperature 0.7 \
79
+ --prompt "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS." \
80
+ --image <path_to_reference_image>
81
+ ```
82
+
83
+ #### Python API
84
+
85
+ ```python
86
+ from mlx_vlm import load, generate
87
+ from mlx_vlm.prompt_utils import apply_chat_template
88
+ from mlx_vlm.utils import load_config
89
+
90
+ model_path = "prithivMLmods/microsoft-AesCode-8B-MLX"
91
+ model, processor = load(model_path, subfolder="8bit")
92
+ config = load_config(model_path, subfolder="8bit")
93
+
94
+ image = ["<path_to_reference_image>"]
95
+ prompt = "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS."
96
+ formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
97
+
98
+ output = generate(
99
+ model,
100
+ processor,
101
+ formatted_prompt,
102
+ image=image,
103
+ max_tokens=2048,
104
+ temperature=0.7
105
+ )
106
+ print(output.text)
107
+ ```
108
+
109
+ ### 4-bit Variant
110
+
111
+ Access the 4-bit quantized files using `--subfolder 4bit`:
112
+
113
+ #### CLI (Terminal)
114
+
115
+ ```bash
116
+ python -m mlx_vlm generate \
117
+ --model prithivMLmods/microsoft-AesCode-8B-MLX \
118
+ --subfolder 4bit \
119
+ --max-tokens 2048 \
120
+ --temperature 0.7 \
121
+ --prompt "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS." \
122
+ --image <path_to_reference_image>
123
+ ```
124
+
125
+ #### Python API
126
+
127
+ ```python
128
+ from mlx_vlm import load, generate
129
+ from mlx_vlm.prompt_utils import apply_chat_template
130
+ from mlx_vlm.utils import load_config
131
+
132
+ model_path = "prithivMLmods/microsoft-AesCode-8B-MLX"
133
+ model, processor = load(model_path, subfolder="4bit")
134
+ config = load_config(model_path, subfolder="4bit")
135
+
136
+ image = ["<path_to_reference_image>"]
137
+ prompt = "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS."
138
+ formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
139
+
140
+ output = generate(
141
+ model,
142
+ processor,
143
+ formatted_prompt,
144
+ image=image,
145
+ max_tokens=2048,
146
+ temperature=0.7
147
+ )
148
+ print(output.text)
149
+ ```