mirror of
https://github.com/mudler/LocalAI.git
synced 2025-04-30 16:00:05 +00:00
feat: add typical_p to model parameters (#598)
Signed-off-by: mudler <mudler@mocaccino.org>
This commit is contained in:
parent
1ba88258a9
commit
295f3030a9
@ -236,6 +236,10 @@ func updateConfig(config *Config, input *OpenAIRequest) {
|
|||||||
config.MirostatTAU = input.MirostatTAU
|
config.MirostatTAU = input.MirostatTAU
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if input.TypicalP != 0 {
|
||||||
|
config.TypicalP = input.TypicalP
|
||||||
|
}
|
||||||
|
|
||||||
switch inputs := input.Input.(type) {
|
switch inputs := input.Input.(type) {
|
||||||
case string:
|
case string:
|
||||||
if inputs != "" {
|
if inputs != "" {
|
||||||
|
@ -133,6 +133,8 @@ type OpenAIRequest struct {
|
|||||||
// Image (not supported by OpenAI)
|
// Image (not supported by OpenAI)
|
||||||
Mode int `json:"mode"`
|
Mode int `json:"mode"`
|
||||||
Step int `json:"step"`
|
Step int `json:"step"`
|
||||||
|
|
||||||
|
TypicalP float64 `json:"typical_p" yaml:"typical_p"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func defaultRequest(modelFile string) OpenAIRequest {
|
func defaultRequest(modelFile string) OpenAIRequest {
|
||||||
|
@ -238,6 +238,7 @@ func buildLLamaPredictOptions(c Config, modelPath string) []llama.PredictOption
|
|||||||
predictOptions = append(predictOptions, llama.SetPredictionMainGPU(c.MainGPU))
|
predictOptions = append(predictOptions, llama.SetPredictionMainGPU(c.MainGPU))
|
||||||
predictOptions = append(predictOptions, llama.SetPredictionTensorSplit(c.TensorSplit))
|
predictOptions = append(predictOptions, llama.SetPredictionTensorSplit(c.TensorSplit))
|
||||||
predictOptions = append(predictOptions, llama.SetTailFreeSamplingZ(c.TFZ))
|
predictOptions = append(predictOptions, llama.SetTailFreeSamplingZ(c.TFZ))
|
||||||
|
predictOptions = append(predictOptions, llama.SetTypicalP(c.TypicalP))
|
||||||
|
|
||||||
return predictOptions
|
return predictOptions
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user