Skip to content

Commit 037c62f

Browse files
committed
cont : move httplib to /vendor + use json_fwd.hpp
ggml-ci
1 parent aedd1e9 commit 037c62f

File tree

11 files changed

+25
-16
lines changed

11 files changed

+25
-16
lines changed

common/arg.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "log.h"
66
#include "sampling.h"
77
#include "chat.h"
8+
#include "json-schema-to-grammar.h"
89

910
// fix problem with std::min and std::max
1011
#if defined(_WIN32)
@@ -15,6 +16,8 @@
1516
#include <windows.h>
1617
#endif
1718

19+
#include <nlohmann/json.hpp>
20+
1821
#include <algorithm>
1922
#include <climits>
2023
#include <cstdarg>
@@ -34,8 +37,6 @@
3437
#include <future>
3538
#endif
3639

37-
#include "json-schema-to-grammar.h"
38-
3940
using json = nlohmann::ordered_json;
4041

4142
std::initializer_list<enum llama_example> mmproj_examples = {

common/chat-parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "json-partial.h"
55
#include "regex-partial.h"
66

7-
#include "nlohmann/json.hpp"
7+
#include <nlohmann/json.hpp>
88

99
#include <optional>
1010
#include <string>

common/json-schema-to-grammar.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "json-schema-to-grammar.h"
22
#include "common.h"
33

4+
#include <nlohmann/json.hpp>
5+
46
#include <algorithm>
57
#include <fstream>
68
#include <map>

common/json-schema-to-grammar.h

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

33
#include "ggml.h"
4+
45
// Change JSON_ASSERT from assert() to GGML_ASSERT:
56
#define JSON_ASSERT GGML_ASSERT
6-
#include "nlohmann/json.hpp"
7+
#include <nlohmann/json_fwd.hpp>
78

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

tests/test-grammar-integration.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "../src/unicode.h"
88
#include "../src/llama-grammar.h"
99

10+
#include <nlohmann/json.hpp>
11+
1012
#include <cassert>
1113
#include <string>
1214
#include <vector>

tests/test-json-schema-to-grammar.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#include "../src/llama-grammar.h"
88

9+
#include <nlohmann/json.hpp>
10+
911
#include <cassert>
1012
#include <fstream>
1113
#include <sstream>

tools/run/run.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
#include "chat.h"
2+
#include "common.h"
3+
#include "llama-cpp.h"
4+
#include "log.h"
5+
6+
#include "linenoise.cpp/linenoise.h"
7+
8+
#include <nlohmann/json.hpp>
9+
110
#if defined(_WIN32)
211
# include <windows.h>
312
# include <io.h>
@@ -24,14 +33,6 @@
2433
#include <string>
2534
#include <vector>
2635

27-
#include "chat.h"
28-
#include "common.h"
29-
#include "llama-cpp.h"
30-
#include "log.h"
31-
32-
#include "nlohmann/json.hpp"
33-
#include "linenoise.cpp/linenoise.h"
34-
3536
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(_WIN32)
3637
[[noreturn]] static void sigint_handler(int) {
3738
printf("\n" LOG_COL_DEFAULT);

tools/server/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// Change JSON_ASSERT from assert() to GGML_ASSERT:
1515
#define JSON_ASSERT GGML_ASSERT
16-
#include "nlohmann/json.hpp"
16+
#include <nlohmann/json.hpp>
1717
// mime type for sending response
1818
#define MIMETYPE_JSON "application/json; charset=utf-8"
1919

tools/server/utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#define CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH 1048576
1414
// disable Nagle's algorithm
1515
#define CPPHTTPLIB_TCP_NODELAY true
16-
#include "httplib.h"
16+
#include <cpp-httplib/httplib.h>
1717

1818
// Change JSON_ASSERT from assert() to GGML_ASSERT:
1919
#define JSON_ASSERT GGML_ASSERT
20-
#include "nlohmann/json.hpp"
20+
#include <nlohmann/json.hpp>
2121

2222
#include <random>
2323
#include <sstream>

tools/tts/tts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "log.h"
77
#include "llama.h"
88

9-
#include "nlohmann/json.hpp"
9+
#include <nlohmann/json.hpp>
1010

1111
#include <algorithm>
1212
#include <cmath>

0 commit comments

Comments
 (0)