Skip to content

Commit 6512a8b

Browse files
committed
cont : header clean-up
ggml-ci
1 parent c51c3a2 commit 6512a8b

File tree

11 files changed

+21
-25
lines changed

11 files changed

+21
-25
lines changed

common/arg.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#include "gguf.h" // for reading GGUF splits
21
#include "arg.h"
32

3+
#include "chat.h"
44
#include "common.h"
5+
#include "gguf.h" // for reading GGUF splits
6+
#include "json-schema-to-grammar.h"
57
#include "log.h"
68
#include "sampling.h"
7-
#include "chat.h"
8-
#include "json-schema-to-grammar.h"
99

1010
// fix problem with std::min and std::max
1111
#if defined(_WIN32)
@@ -16,6 +16,7 @@
1616
#include <windows.h>
1717
#endif
1818

19+
#define JSON_ASSERT GGML_ASSERT
1920
#include <nlohmann/json.hpp>
2021

2122
#include <algorithm>

common/chat.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#include "chat.h"
22
#include "chat-parser.h"
33
#include "common.h"
4+
#include "json-partial.h"
45
#include "json-schema-to-grammar.h"
56
#include "log.h"
6-
#include "json-partial.h"
7-
#include "minja/chat-template.hpp"
8-
#include "minja/minja.hpp"
97
#include "regex-partial.h"
108

9+
#include <minja/chat-template.hpp>
10+
#include <minja/minja.hpp>
11+
1112
#include <cstdio>
1213
#include <exception>
1314
#include <iostream>
@@ -16,7 +17,6 @@
1617
#include <string>
1718
#include <vector>
1819

19-
2020
static std::string format_time(const std::chrono::system_clock::time_point & now, const std::string & format) {
2121
auto time = std::chrono::system_clock::to_time_t(now);
2222
auto local_time = *std::localtime(&time);

common/json-partial.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
#include <json-partial.h>
2-
#include "ggml.h"
1+
#include "json-partial.h"
2+
33
#include "log.h"
4-
#include <string>
54

65
#include <nlohmann/json.hpp>
76

7+
#include <string>
8+
89
using json = nlohmann::ordered_json;
910

1011
enum common_json_stack_element_type {

common/json-partial.h

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

45
// Healing marker (empty if the JSON was fully parsed / wasn't healed).

common/json-schema-to-grammar.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <nlohmann/json.hpp>
55

66
#include <algorithm>
7-
#include <fstream>
87
#include <map>
98
#include <regex>
109
#include <sstream>

common/json-schema-to-grammar.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#pragma once
22

3-
#include "ggml.h"
4-
5-
// Change JSON_ASSERT from assert() to GGML_ASSERT:
6-
#define JSON_ASSERT GGML_ASSERT
73
#include <nlohmann/json_fwd.hpp>
84

95
#include <functional>

tests/test-chat.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
//
66
// cmake -B build && cmake --build build --parallel && ./build/bin/test-chat ../minja/build/tests/*.jinja 2>/dev/null
77
//
8-
#include <fstream>
9-
#include <iostream>
10-
#include <string>
11-
12-
#include <nlohmann/json.hpp>
13-
148
#include "chat.h"
159

1610
#include "../src/unicode.h"
1711
#include "../src/llama-grammar.h"
1812

13+
#include <nlohmann/json.hpp>
14+
15+
#include <fstream>
16+
#include <iostream>
17+
#include <string>
18+
1919
using json = nlohmann::ordered_json;
2020

2121
static std::ostream & operator<<(std::ostream & os, const common_chat_msg_diff & diff) {

tools/run/run.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "linenoise.cpp/linenoise.h"
77

8+
#define JSON_ASSERT GGML_ASSERT
89
#include <nlohmann/json.hpp>
910

1011
#if defined(_WIN32)

tools/server/server.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#include "mtmd.h"
1212
#include "mtmd-helper.h"
1313

14-
// Change JSON_ASSERT from assert() to GGML_ASSERT:
15-
#define JSON_ASSERT GGML_ASSERT
16-
#include <nlohmann/json.hpp>
1714
// mime type for sending response
1815
#define MIMETYPE_JSON "application/json; charset=utf-8"
1916

tools/server/utils.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define CPPHTTPLIB_TCP_NODELAY true
1616
#include <cpp-httplib/httplib.h>
1717

18-
// Change JSON_ASSERT from assert() to GGML_ASSERT:
1918
#define JSON_ASSERT GGML_ASSERT
2019
#include <nlohmann/json.hpp>
2120

0 commit comments

Comments
 (0)