fix: correct conversion from sd_type_t to ggml_type (#1519)

This commit is contained in:
Wagner Bruna authored and GitHub committed 2026-06-16 23:54:42 +08:00
1 parent 5a34bc7f6e
commit 710bc91c8f
4 files changed
+13 -4

No files matched your search

+9
View File
@@ -406,6 +406,15 @@ std::vector<std::string> split_string(const std::string& str, char delimiter) {
return result;
}
ggml_type sd_type_to_ggml_type(sd_type_t sdtype) {
const int type_value = static_cast<int>(sdtype);
if (type_value < std::min<int>(SD_TYPE_COUNT, GGML_TYPE_COUNT)) {
return static_cast<ggml_type>(type_value);
} else {
return GGML_TYPE_COUNT;
}
}
KeyValueArgs parse_key_value_args(const char* args, const char* context) {
KeyValueArgs pairs;
+2
View File
@@ -80,6 +80,8 @@ void pretty_bytes_progress(int step, int steps, uint64_t bytes_processed, float
void log_printf(sd_log_level_t level, const char* file, int line, const char* format, ...);
ggml_type sd_type_to_ggml_type(sd_type_t sdtype);
std::string trim(const std::string& s);
std::vector<std::pair<std::string, float>> parse_prompt_attention(const std::string& text);