Add: SVG Business Chart Generation with Gemma 3 12B and Per-Type LoRA Adapters#345
Open
fxops-ai wants to merge 4 commits intogoogle-gemma:mainfrom
Open
Add: SVG Business Chart Generation with Gemma 3 12B and Per-Type LoRA Adapters#345fxops-ai wants to merge 4 commits intogoogle-gemma:mainfrom
fxops-ai wants to merge 4 commits intogoogle-gemma:mainfrom
Conversation
This README provides an overview of the Business Intelligence directory, detailing high-precision SVG generation and the included showcase and key innovations.
if you want to use local inference and download the model adaptors, uncomment the adapter_id for your local repo
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
|
@googlebot I signed the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add: SVG Business Chart Generation with Gemma 3 12B + Per-Type LoRA Adapters
Summary
This notebook demonstrates a per-type LoRA adapter architecture for generating valid, renderable SVG business charts from structured JSON input using Gemma 3 12B on Apple Silicon (MLX). It covers 12 chart types — bar, line, area, pie, donut, funnel, scatter, bubble, grouped_bar, stacked_bar, waterfall, and horizontal_bar — each with a dedicated specialist adapter.
The notebook runs entirely on-device. No API calls required at inference time.
What This Demonstrates
1. Per-type LoRA adapter training on Apple Silicon
Each chart type is trained as a specialist adapter using mlx-lm on an M4 Mac mini (24GB). Adapters are published to HuggingFace at John-Williams-ATL/svg-chart-lora and load remotely via standard adapter_path syntax.
2. Geometry pre-computation as a prompt engineering strategy
Complex coordinate arithmetic (arc paths, running totals, scatter point positions) is pre-computed in Python and injected into the user prompt. The model handles SVG assembly; Python handles the math.
3. A 4-stage SVG validation and repair pipeline
Every generated output passes through GemmaChartValidator — extract → XML parse → coordinate bounds check → element-level repair.
4. Quantitative evaluation across 20 runs per type
The notebook includes an evaluation harness scoring pass rates per check across 20 runs — a distribution, not a single sample.
Adapter Pass Rates (v1.0, 20 runs @ temp=0.1)
Notebook Location
Gemma/Business-Intelligence/gemma3_svg_chart_generation_v2.2.ipynbRelated Resources
Pre-submission Checklist
Hardware Note
Designed for Apple Silicon (MLX backend). A transformers + PeftModel fallback path is included for NVIDIA GPU environments.
Submitted by John Williams — fxops.ai / @fxopsAI