mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-18 20:27:57 +00:00
feat: add trimsuffix (#1528)
This commit is contained in:
parent
fd48cb6506
commit
85e2767dca
@ -159,6 +159,9 @@ func Finetune(config config.Config, input, prediction string) string {
|
|||||||
for _, c := range config.TrimSpace {
|
for _, c := range config.TrimSpace {
|
||||||
prediction = strings.TrimSpace(strings.TrimPrefix(prediction, c))
|
prediction = strings.TrimSpace(strings.TrimPrefix(prediction, c))
|
||||||
}
|
}
|
||||||
return prediction
|
|
||||||
|
|
||||||
|
for _, c := range config.TrimSuffix {
|
||||||
|
prediction = strings.TrimSpace(strings.TrimSuffix(prediction, c))
|
||||||
|
}
|
||||||
|
return prediction
|
||||||
}
|
}
|
||||||
|
@ -111,16 +111,18 @@ type LLMConfig struct {
|
|||||||
StopWords []string `yaml:"stopwords"`
|
StopWords []string `yaml:"stopwords"`
|
||||||
Cutstrings []string `yaml:"cutstrings"`
|
Cutstrings []string `yaml:"cutstrings"`
|
||||||
TrimSpace []string `yaml:"trimspace"`
|
TrimSpace []string `yaml:"trimspace"`
|
||||||
ContextSize int `yaml:"context_size"`
|
TrimSuffix []string `yaml:"trimsuffix"`
|
||||||
NUMA bool `yaml:"numa"`
|
|
||||||
LoraAdapter string `yaml:"lora_adapter"`
|
ContextSize int `yaml:"context_size"`
|
||||||
LoraBase string `yaml:"lora_base"`
|
NUMA bool `yaml:"numa"`
|
||||||
LoraScale float32 `yaml:"lora_scale"`
|
LoraAdapter string `yaml:"lora_adapter"`
|
||||||
NoMulMatQ bool `yaml:"no_mulmatq"`
|
LoraBase string `yaml:"lora_base"`
|
||||||
DraftModel string `yaml:"draft_model"`
|
LoraScale float32 `yaml:"lora_scale"`
|
||||||
NDraft int32 `yaml:"n_draft"`
|
NoMulMatQ bool `yaml:"no_mulmatq"`
|
||||||
Quantization string `yaml:"quantization"`
|
DraftModel string `yaml:"draft_model"`
|
||||||
MMProj string `yaml:"mmproj"`
|
NDraft int32 `yaml:"n_draft"`
|
||||||
|
Quantization string `yaml:"quantization"`
|
||||||
|
MMProj string `yaml:"mmproj"`
|
||||||
|
|
||||||
RopeScaling string `yaml:"rope_scaling"`
|
RopeScaling string `yaml:"rope_scaling"`
|
||||||
YarnExtFactor float32 `yaml:"yarn_ext_factor"`
|
YarnExtFactor float32 `yaml:"yarn_ext_factor"`
|
||||||
|
@ -3,6 +3,8 @@ context_size: 2048
|
|||||||
f16: true
|
f16: true
|
||||||
gpu_layers: 90
|
gpu_layers: 90
|
||||||
mmap: true
|
mmap: true
|
||||||
|
trimsuffix:
|
||||||
|
- "\n"
|
||||||
parameters:
|
parameters:
|
||||||
model: huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
|
model: huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
|
||||||
temperature: 0.2
|
temperature: 0.2
|
||||||
|
Loading…
Reference in New Issue
Block a user