Skip to content

Commit fd4c9b2

Browse files
committed
sync : vendor
ggml-ci
1 parent 2b13162 commit fd4c9b2

File tree

15 files changed

+3131
-2301
lines changed

15 files changed

+3131
-2301
lines changed

common/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@ add_library(${TARGET} STATIC
5858
arg.cpp
5959
arg.h
6060
base64.hpp
61-
chat.cpp
62-
chat.h
6361
chat-parser.cpp
6462
chat-parser.h
63+
chat.cpp
64+
chat.h
6565
common.cpp
6666
common.h
6767
console.cpp
6868
console.h
69-
json-schema-to-grammar.cpp
70-
json.hpp
71-
json-partial.h
7269
json-partial.cpp
70+
json-partial.h
71+
json-schema-to-grammar.cpp
7372
llguidance.cpp
7473
log.cpp
7574
log.h
7675
minja/chat-template.hpp
7776
minja/minja.hpp
7877
ngram-cache.cpp
7978
ngram-cache.h
79+
nlohmann/json.hpp
8080
regex-partial.cpp
8181
regex-partial.h
8282
sampling.cpp

common/chat-parser.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
#include "chat.h"
44
#include "json-partial.h"
5-
#include "json.hpp"
65
#include "regex-partial.h"
76

7+
#include "nlohmann/json.hpp"
8+
89
#include <optional>
910
#include <string>
1011
#include <vector>

common/json-partial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "log.h"
44
#include <string>
55

6-
#include <json.hpp>
6+
#include <nlohmann/json.hpp>
77

88
using json = nlohmann::ordered_json;
99

common/json-partial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <json.hpp>
2+
#include <nlohmann/json.hpp>
33

44
// Healing marker (empty if the JSON was fully parsed / wasn't healed).
55
struct common_healing_marker {

common/json-schema-to-grammar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "ggml.h"
44
// Change JSON_ASSERT from assert() to GGML_ASSERT:
55
#define JSON_ASSERT GGML_ASSERT
6-
#include "json.hpp"
6+
#include "nlohmann/json.hpp"
77

88
std::string json_schema_to_grammar(const nlohmann::ordered_json & schema,
99
bool force_gbnf = false);

common/minja/chat-template.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <string>
2323
#include <vector>
2424

25-
#include <json.hpp>
25+
#include <nlohmann/json.hpp>
2626

2727
using json = nlohmann::ordered_json;
2828

common/minja/minja.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <utility>
3030
#include <vector>
3131

32-
#include <json.hpp>
32+
#include <nlohmann/json.hpp>
3333

3434
using json = nlohmann::ordered_json;
3535

common/json.hpp renamed to common/nlohmann/json.hpp

Lines changed: 3027 additions & 2267 deletions
Large diffs are not rendered by default.

scripts/sync_vendor.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python3
2+
3+
vendor = {
4+
"https://github.com/nlohmann/json/releases/latest/download/json.hpp": "common/nlohmann/json.hpp",
5+
6+
# sync manually
7+
#"https://raw.githubusercontent.com/ochafik/minja/refs/heads/main/include/minja/minja.hpp": "common/minja/minja.hpp",
8+
#"https://raw.githubusercontent.com/ochafik/minja/refs/heads/main/include/minja/chat-template.hpp": "common/minja/chat-template.hpp",
9+
10+
"https://raw.githubusercontent.com/nothings/stb/refs/heads/master/stb_image.h": "tools/mtmd/vendor/stb_image.h",
11+
12+
"https://raw.githubusercontent.com/mackron/miniaudio/refs/heads/master/miniaudio.h": "tools/mtmd/vendor/miniaudio.h",
13+
14+
"https://raw.githubusercontent.com/yhirose/cpp-httplib/refs/heads/master/httplib.h": "tools/server/httplib.h",
15+
}
16+
17+
import urllib.request
18+
19+
for url, filename in vendor.items():
20+
print(f"downloading {url} to {filename}")
21+
urllib.request.urlretrieve(url, filename)
22+

tests/test-chat.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
//
88
#include <fstream>
99
#include <iostream>
10-
#include <json.hpp>
1110
#include <string>
1211

12+
#include <nlohmann/json.hpp>
13+
1314
#include "chat.h"
1415

1516
#include "../src/unicode.h"

0 commit comments

Comments
 (0)