Skip to content

Commit dc66e20

Browse files
committed
chore: add sd_ prefix to format()
Avoid a symbol conflict with the same named function from libllama. Fixes #1011
1 parent f284d0c commit dc66e20

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

model.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ void convert_tensor(void* src,
265265
} else {
266266
auto qtype = ggml_get_type_traits(src_type);
267267
if (qtype->to_float == nullptr) {
268-
throw std::runtime_error(format("type %s unsupported for integer quantization: no dequantization available",
269-
ggml_type_name(src_type)));
268+
throw std::runtime_error(sd_format("type %s unsupported for integer quantization: no dequantization available",
269+
ggml_type_name(src_type)));
270270
}
271271
qtype->to_float(src, (float*)dst, n);
272272
}
@@ -275,8 +275,8 @@ void convert_tensor(void* src,
275275
// src_type is quantized => dst_type == GGML_TYPE_F16 or dst_type is quantized
276276
auto qtype = ggml_get_type_traits(src_type);
277277
if (qtype->to_float == nullptr) {
278-
throw std::runtime_error(format("type %s unsupported for integer quantization: no dequantization available",
279-
ggml_type_name(src_type)));
278+
throw std::runtime_error(sd_format("type %s unsupported for integer quantization: no dequantization available",
279+
ggml_type_name(src_type)));
280280
}
281281
std::vector<char> buf;
282282
buf.resize(sizeof(float) * n);

util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void replace_all_chars(std::string& str, char target, char replacement) {
5757
}
5858
}
5959

60-
std::string format(const char* fmt, ...) {
60+
std::string sd_format(const char* fmt, ...) {
6161
va_list ap;
6262
va_list ap2;
6363
va_start(ap, fmt);

util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ bool ends_with(const std::string& str, const std::string& ending);
1414
bool starts_with(const std::string& str, const std::string& start);
1515
bool contains(const std::string& str, const std::string& substr);
1616

17-
std::string format(const char* fmt, ...);
17+
std::string sd_format(const char* fmt, ...);
1818

1919
void replace_all_chars(std::string& str, char target, char replacement);
2020

0 commit comments

Comments
 (0)