Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
orangecat
ollama
Commits
c2168505
Unverified
Commit
c2168505
authored
Dec 12, 2024
by
Pascal Patry
Committed by
GitHub
Dec 12, 2024
Browse files
llama: parse JSON schema using nlohmann::ordered_json to maintain ordering (#8071)
parent
18f6a98b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
llama/sampling_ext.cpp
llama/sampling_ext.cpp
+1
-1
No files found.
llama/sampling_ext.cpp
View file @
c2168505
...
...
@@ -49,7 +49,7 @@ int schema_to_grammar(const char *json_schema, char *grammar, size_t max_len)
{
try
{
nlohmann
::
json
schema
=
nlohmann
::
json
::
parse
(
json_schema
);
nlohmann
::
ordered_
json
schema
=
nlohmann
::
ordered_
json
::
parse
(
json_schema
);
std
::
string
grammar_str
=
json_schema_to_grammar
(
schema
);
size_t
len
=
grammar_str
.
length
();
if
(
len
>=
max_len
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment