Skip to content

Commit 5c99bdc

Browse files
author
ochafik
committed
direct throw to avoid ggml.h include
1 parent 9b620e5 commit 5c99bdc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

common/regex-partial.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include <regex>
44
#include <string>
5-
#include "ggml.h"
65

76
enum common_regex_match_type {
87
COMMON_REGEX_MATCH_TYPE_NONE,
@@ -14,7 +13,9 @@ struct common_string_range {
1413
size_t begin;
1514
size_t end;
1615
common_string_range(size_t begin, size_t end) : begin(begin), end(end) {
17-
GGML_ASSERT(begin <= end);
16+
if (begin > end) {
17+
throw std::runtime_error("Invalid range");
18+
}
1819
}
1920
// prevent default ctor
2021
common_string_range() = delete;

0 commit comments

Comments
 (0)