Line data Source code
1 2355 : const ACRONYM_TAGS = new Set(['VAE', 'CLIP', 'GLIGEN'])
2 :
3 0 : export function formatCategoryLabel(raw?: string): string {
4 0 : if (!raw) return 'Models'
5 :
6 : // Special display name mappings
7 0 : if (raw === 'diffusion_models') return 'Diffusion'
8 :
9 0 : return raw
10 : .split('_')
11 : .map((segment) => {
12 0 : const upper = segment.toUpperCase()
13 0 : if (ACRONYM_TAGS.has(upper)) return upper
14 :
15 0 : const lower = segment.toLowerCase()
16 0 : return lower.charAt(0).toUpperCase() + lower.slice(1)
17 : })
18 : .join(' ')
19 : }
|