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

Function writePartialClassifierModel

core/http/middleware/route_model_test.go:529–542  ·  view source on GitHub ↗

writePartialClassifierModel writes a classifier model that has the outer Chat template but no ChatMessage — exercises the newTemplateRenderer "refuse partial templating" branch, which makes buildClassifier reject the router with a missing-template error.

(modelDir, name string)

Source from the content-addressed store, hash-verified

527// newTemplateRenderer "refuse partial templating" branch, which makes
528// buildClassifier reject the router with a missing-template error.
529func writePartialClassifierModel(modelDir, name string) {
530 body := `name: ` + name + `
531backend: llama-cpp
532known_usecases:
533 - score
534stopwords:
535 - <|im_end|>
536template:
537 chat: |
538 {{.Input -}}
539 <|im_start|>assistant
540`
541 Expect(os.WriteFile(filepath.Join(modelDir, name+".yaml"), []byte(body), 0o644)).To(Succeed())
542}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected