".github/workflows/test-ampere.yaml" did not exist on "0f6c974aa5e5182ce785f8dfe5aaf590a31fc374"
0010-Maintain-ordering-for-rules-for-grammar.patch 1004 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ParthSareen <parth.sareen@ollama.com>
Date: Wed, 11 Dec 2024 15:37:32 -0800
Subject: [PATCH] Maintain ordering for rules for grammar

---
 common/json-schema-to-grammar.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/json-schema-to-grammar.cpp b/common/json-schema-to-grammar.cpp
11
index 3ebcc3d9..30c28808 100644
12
13
--- a/common/json-schema-to-grammar.cpp
+++ b/common/json-schema-to-grammar.cpp
14
15
@@ -346,7 +346,7 @@ private:
     friend std::string build_grammar(const std::function<void(const common_grammar_builder &)> & cb, const common_grammar_options & options);
16
17
18
19
20
21
22
     std::function<json(const std::string &)> _fetch_json;
     bool _dotall;
-    std::map<std::string, std::string> _rules;
+    std::unordered_map<std::string, std::string> _rules;
     std::unordered_map<std::string, json> _refs;
     std::unordered_set<std::string> _refs_being_resolved;
     std::vector<std::string> _errors;