mirror of
https://github.com/mudler/LocalAI.git
synced 2026-01-26 07:13:05 -05:00
feat(grammar): mark grammar disabled by default
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
@@ -201,7 +201,7 @@ func ChatEndpoint(cl *config.BackendConfigLoader, ml *model.ModelLoader, startup
|
||||
}
|
||||
|
||||
switch {
|
||||
case !config.FunctionsConfig.GrammarConfig.NoGrammar && shouldUseFn:
|
||||
case config.FunctionsConfig.GrammarConfig.EnableGrammar && shouldUseFn:
|
||||
noActionGrammar := functions.Function{
|
||||
Name: noActionName,
|
||||
Description: noActionDescription,
|
||||
|
||||
@@ -10,7 +10,8 @@ config_file: |-
|
||||
- <|end_of_text|>
|
||||
|
||||
function:
|
||||
return_name_in_function_response: true
|
||||
grammar:
|
||||
enable: true
|
||||
|
||||
template:
|
||||
chat: |
|
||||
|
||||
@@ -25,8 +25,8 @@ type GrammarConfig struct {
|
||||
// In this way if the LLM selects a free string, it won't be mixed necessarly with JSON objects
|
||||
NoMixedFreeString bool `yaml:"no_mixed_free_string"`
|
||||
|
||||
// NoGrammar disables the grammar parsing and parses the responses directly from the LLM
|
||||
NoGrammar bool `yaml:"disable"`
|
||||
// EnableGrammar disables the grammar parsing and parses the responses directly from the LLM
|
||||
EnableGrammar bool `yaml:"enable"`
|
||||
|
||||
// Prefix is the suffix to append to the grammar when being generated
|
||||
// This is useful when models prepend a tag before returning JSON
|
||||
|
||||
Reference in New Issue
Block a user