Skip to content

Commit

Permalink
llama: parse JSON schema using nlohmann::ordered_json to maintain ord…
Browse files Browse the repository at this point in the history
…ering (ollama#8071)
  • Loading branch information
iscy authored Dec 12, 2024
1 parent 18f6a98 commit c216850
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llama/sampling_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c216850

Please sign in to comment.