MCPcopy Create free account
hub / github.com/docker/model-test / sanitizeModelName

Function sanitizeModelName

main.go:220–231  ·  view source on GitHub ↗

sanitizeModelName sanitizes the model name for use in filenames

(modelName string)

Source from the content-addressed store, hash-verified

218
219// sanitizeModelName sanitizes the model name for use in filenames
220func sanitizeModelName(modelName string) string {
221 if modelName == "" {
222 modelName = "gpt-4o-mini"
223 }
224
225 // Replace problematic characters with underscores
226 sanitized := strings.ReplaceAll(modelName, "/", "_")
227 sanitized = strings.ReplaceAll(sanitized, " ", "_")
228 sanitized = strings.ReplaceAll(sanitized, ":", "_")
229
230 return sanitized
231}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected