-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(grammar): add llama3.1 schema (#3015)
* wip Signed-off-by: Ettore Di Giacinto <[email protected]> * get rid of panics Signed-off-by: Ettore Di Giacinto <[email protected]> * expose it properly from the config Signed-off-by: Ettore Di Giacinto <[email protected]> * Simplify Signed-off-by: Ettore Di Giacinto <[email protected]> * forgot to commit Signed-off-by: Ettore Di Giacinto <[email protected]> * Remove focus on test Signed-off-by: Ettore Di Giacinto <[email protected]> * Small fixups Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: Ettore Di Giacinto <[email protected]>
- Loading branch information
Showing
14 changed files
with
609 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package grammars_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/mudler/LocalAI/pkg/functions" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestGrammar(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Grammar test suite") | ||
} | ||
|
||
func createFunction(field1 string, field2 string, name string, properties map[string]interface{}) map[string]interface{} { | ||
property := map[string]interface{}{} | ||
property[field1] = FunctionName{Const: name} | ||
property[field2] = Argument{ | ||
Type: "object", | ||
Properties: properties, | ||
} | ||
return property | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
pkg/functions/grammar_json_schema_test.go → pkg/functions/grammars/json_schema_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.