MCPcopy
hub / github.com/mudler/LocalAI / resolvePath

Function resolvePath

backend/go/vibevoice-cpp/govibevoicecpp.go:153–158  ·  view source on GitHub ↗

resolvePath joins a relative path onto `relTo`. The gallery convention is that Options[] carry paths relative to the LocalAI models dir (opts.ModelPath), so anything not absolute is treated as a sibling of the primary ModelFile - never CWD. Empty / already- absolute / no-relTo inputs pass through un

(p, relTo string)

Source from the content-addressed store, hash-verified

151// as a sibling of the primary ModelFile - never CWD. Empty / already-
152// absolute / no-relTo inputs pass through unchanged.
153func resolvePath(p, relTo string) string {
154 if p == "" || filepath.IsAbs(p) || relTo == "" {
155 return p
156 }
157 return filepath.Join(relTo, p)
158}
159
160// parseOptions reads opts.Options[] and pulls out the per-role
161// overrides documented in the gallery entries. Accepts both "key=value"

Callers 4

parseOptionsMethod · 0.85
parseRefAudioFunction · 0.85
TTSMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected