x/model: preserve build casing

This commit is contained in:
Blake Mizerany 2024-04-05 21:33:56 -07:00
parent fc595d89bf
commit 3cb07b3ac9
2 changed files with 5 additions and 2 deletions

View File

@ -134,7 +134,7 @@ func ParseName(s string) Name {
case Tag:
r.tag = part
case Build:
r.build = strings.ToUpper(part)
r.build = part
case Invalid:
return Name{}
}

View File

@ -15,12 +15,15 @@ var testNames = map[string]Name{
"mistral:7b+Q4_0": {model: "mistral", tag: "7b", build: "Q4_0"},
"mistral+KQED": {model: "mistral", build: "KQED"},
"mistral.x-3:7b+Q4_0": {model: "mistral.x-3", tag: "7b", build: "Q4_0"},
"mistral:7b+q4_0": {model: "mistral", tag: "7b", build: "Q4_0"},
"mistral:7b+q4_0": {model: "mistral", tag: "7b", build: "q4_0"},
"llama2": {model: "llama2"},
"user/model": {namespace: "user", model: "model"},
"example.com/ns/mistral:7b+Q4_0": {host: "example.com", namespace: "ns", model: "mistral", tag: "7b", build: "Q4_0"},
"example.com/ns/mistral:7b+x": {host: "example.com", namespace: "ns", model: "mistral", tag: "7b", build: "X"},
// preserves case for build
"x+b": {model: "x", build: "b"},
// invalid (includes fuzzing trophies)
" / / : + ": {},
" / : + ": {},