fix: set default rope freq base to 10000 during model load

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2023-07-29 10:40:56 +02:00
parent e70b91aaef
commit 00ccb8d4f1

View File

@ -17,9 +17,20 @@ type LLM struct {
}
func (llm *LLM) Load(opts *pb.ModelOptions) error {
ropeFreqBase := float32(10000)
ropeFreqScale := float32(1)
if opts.RopeFreqBase != 0 {
ropeFreqBase = opts.RopeFreqBase
}
if opts.RopeFreqScale != 0 {
ropeFreqScale = opts.RopeFreqScale
}
llamaOpts := []llama.ModelOption{
llama.WithRopeFreqBase(opts.RopeFreqBase),
llama.WithRopeFreqScale(opts.RopeFreqScale),
llama.WithRopeFreqBase(ropeFreqBase),
llama.WithRopeFreqScale(ropeFreqScale),
}
if opts.ContextSize != 0 {