MCPcopy Index your code
hub / github.com/mudler/LocalAI / Unique

Function Unique

pkg/utils/strings.go:17–27  ·  view source on GitHub ↗
(arr []string)

Source from the content-addressed store, hash-verified

15}
16
17func Unique(arr []string) []string {
18 unique := make(map[string]bool)
19 var result []string
20 for _, item := range arr {
21 if _, ok := unique[item]; !ok {
22 unique[item] = true
23 result = append(result, item)
24 }
25 }
26 return result
27}

Callers 1

listModelFilesFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected