Compare commits

...

2 Commits

Author SHA1 Message Date
Ettore Di Giacinto
4ebf3c7ac4 Merge branch 'master' into disable_grammar_by_default 2024-07-19 09:28:00 +02:00
Ettore Di Giacinto
2a96232f99 feat(grammar): mark grammar disabled by default
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2024-07-19 09:07:29 +02:00
3 changed files with 5 additions and 4 deletions

View File

@@ -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,

View File

@@ -10,7 +10,8 @@ config_file: |-
- <|end_of_text|>
function:
return_name_in_function_response: true
grammar:
enable: true
template:
chat: |

View File

@@ -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