Code2aum's picture
Gradio demo: 6 vineyard plotting-code LoRA adapters with sandboxed execution
4c464e3 verified
|
Raw
History Blame Contribute Delete
2.63 kB

A newer version of the Gradio SDK is available: 6.24.0

Upgrade
metadata
title: Vineyard Plotting-Code Models
emoji: πŸ‡
colorFrom: purple
colorTo: green
sdk: gradio
sdk_version: 6.22.0
python_version: '3.12'
app_file: app.py
pinned: false
license: other
short_description: Six LoRA adapters that plot vineyard data

πŸ‡ Vineyard plotting-code models

Six LoRA adapters fine-tuned to write matplotlib/seaborn code against synthetic vineyard DataFrames. Pick an adapter from the dropdown, pick one of the 12 DataFrames, and ask for a chart.

The generated code is then executed in a short-lived subprocess and the chart shown is the one it actually produced β€” the same execution check the offline evaluation scores, so nothing here can pass off plausible-looking code that does not run.

What's in the dropdown

Model Base Adapter
Qwen2.5-Coder-0.5B Β· bf16 Qwen/Qwen2.5-Coder-0.5B-Instruct models/qwen2.5-coder-0.5b-plotter-lora
Qwen2.5-Coder-1.5B Β· bf16 (best checkpoint) unsloth/Qwen2.5-Coder-1.5B-Instruct models/qwen2.5-coder-1.5b-plotter-lora-bf16-best
Qwen2.5-Coder-1.5B Β· bf16 (final step) unsloth/Qwen2.5-Coder-1.5B-Instruct models/qwen2.5-coder-1.5b-plotter-lora-bf16
Qwen2.5-Coder-1.5B Β· 4-bit NF4 run Qwen/Qwen2.5-Coder-1.5B-Instruct models/qwen2.5-coder-1.5b-plotter-lora
Phi-3.5-mini-instruct Β· 3.8B microsoft/Phi-3.5-mini-instruct models/phi35-mini-instruct-lora
LFM2-2.6B LiquidAI/LFM2-2.6B models/lfm-2.6b-lora

The "Use the fine-tuned adapter" checkbox turns the adapter off, so you can run the same prompt against the untuned base and see what the fine-tuning bought. On the 0.5B, the honest answer is house style rather than reliability: the adapter takes tight_layout() from 1/10 to 10/10 and drops invented columns to 0/10, without improving execution pass rate.

How the prompt is built

Identical to training, or the model is off-distribution. A fixed system turn, then a user turn holding the DataFrame preview (schemas.df_preview β€” the single source of truth for that string) followed by the request.

Notes

  • The first request for a given model downloads its base weights; later ones are cached. Only one model is held in memory at a time.
  • Generated code runs with restricted builtins β€” no os, open, eval, compile, subprocess β€” and only data/plotting imports. That is a proportionate guard against hallucinated code, not a hardened sandbox.
  • Base model licences differ: Qwen2.5-Coder is Apache-2.0, Phi-3.5-mini is MIT, LFM2 is under the LFM Open License. The adapters are derivative of their respective bases.