chore: initialize git repo, add matplotlib dep, extend config

- Add .gitignore for Python/data/models
- Add matplotlib>=3.8.0 for eval plots
- Add PretrainConfig, FinetuneConfig, BalabitAdapterConfig, EvalConfig dataclasses
This commit is contained in:
2026-05-10 12:24:07 +08:00
commit 4d414fd180
44 changed files with 9681 additions and 0 deletions

41
static/js/charts.js Normal file
View File

@@ -0,0 +1,41 @@
/**
* ECharts helpers: color palettes and create/dispose wrappers.
*/
export const TAB10_COLORS = [
'#38bdf8', '#22c55e', '#f59e0b', '#ec4899',
'#a78bfa', '#fb923c', '#34d399', '#f472b6',
'#60a5fa', '#fbbf24',
]
/**
* Map a speed value to a coolwarm hex colour.
* t in [0,1]: 0 = blue (fast), 1 = red (slow)
*/
export function coolwarmColor(t) {
const r = t < .5 ? Math.round(t * 2 * 140) : Math.round(140 + (t - .5) * 2 * 115)
const g = t < .5 ? Math.round(50 + t * 2 * 100) : Math.round(150 - (t - .5) * 2 * 150)
const b = t < .5 ? Math.round(200 - t * 2 * 100) : Math.round(100 - (t - .5) * 2 * 100)
return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`
}
/**
* Create an ECharts instance on a container element.
* @param {HTMLElement} container
* @returns {object} ECharts instance
*/
export function createChart(container) {
return echarts.init(container, 'dark')
}
/**
* Dispose an ECharts instance on a container if one exists.
* @param {object|null} chartInstance - The echarts instance to dispose
* @returns {null}
*/
export function disposeChart(chartInstance) {
if (chartInstance) {
chartInstance.dispose()
}
return null
}