diff --git a/internal/article/generator.go b/internal/article/generator.go index cf7ee6a..71b7aa5 100644 --- a/internal/article/generator.go +++ b/internal/article/generator.go @@ -329,33 +329,57 @@ func parseGPUModel(lotName string) string { } parts := strings.Split(upper, "_") model := "" + numSuffix := "" mem := "" for i, p := range parts { if p == "" { continue } switch p { - case "NV", "NVIDIA", "INTEL", "AMD", "RADEON", "PCIE", "PCI", "SXM", "SXMX": + case "NV", "NVIDIA", "INTEL", "AMD", "RADEON", "PCIE", "PCI", "SXM", "SXMX", "SFF", "LOVELACE", "AMPERE", "HOPPER": + continue + case "ADA": + if model != "" { + numSuffix += "ADA" + } continue default: if strings.Contains(p, "GB") { mem = p continue } - if model == "" && (i > 0) { + if model == "" && i > 0 { model = p + } else if model != "" && numSuffix == "" && isNumeric(p) { + numSuffix = p } } } - if model != "" && mem != "" { - return model + "_" + mem + full := model + if numSuffix != "" { + full = model + numSuffix } - if model != "" { - return model + if full != "" && mem != "" { + return full + "_" + mem + } + if full != "" { + return full } return normalizeModelToken(lotName) } +func isNumeric(s string) bool { + if s == "" { + return false + } + for _, r := range s { + if r < '0' || r > '9' { + return false + } + } + return true +} + func parseMemGiB(lotName string) int { if m := reMemTiB.FindStringSubmatch(lotName); len(m) == 3 { return atoi(m[1]) * 1024