mirror of
https://github.com/mudler/LocalAI.git
synced 2026-01-05 18:19:53 -06:00
feat(llama2): add template for chat messages (#782)
Co-authored-by: Aman Karmani <aman@tmm1.net> Lays some of the groundwork for LLAMA2 compatibility as well as other future models with complex prompting schemes. Started small refactoring in pkg/model/loader.go regarding template loading. Currently still a part of ModelLoader, but should be easy to add template loading for situations other than overall prompt templates and the new chat-specific per-message templates Adds support for new chat-endpoint-specific, per-message templates as an alternative to the existing Role: XYZ sprintf method. Includes a temporary prompt template as an example, since I have a few questions before we merge in the model-gallery side changes (see ) Minor debug logging changes.
This commit is contained in:
23
tests/integration/reflect_test.go
Normal file
23
tests/integration/reflect_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package integration_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
config "github.com/go-skynet/LocalAI/api/config"
|
||||
model "github.com/go-skynet/LocalAI/pkg/model"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var _ = Describe("Integration Tests involving reflection in liue of code generation", func() {
|
||||
Context("config.TemplateConfig and model.TemplateType must stay in sync", func() {
|
||||
|
||||
ttc := reflect.TypeOf(config.TemplateConfig{})
|
||||
|
||||
It("TemplateConfig and TemplateType should have the same number of valid values", func() {
|
||||
const lastValidTemplateType = model.IntegrationTestTemplate - 1
|
||||
Expect(lastValidTemplateType).To(Equal(ttc.NumField()))
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user