fix: support integer LoRA scalar conversion to FP32 (#2263)

This commit is contained in:
leejet authored and GitHub committed 2026-11-03 00:07:40 +08:00
1 parent 250ea6e385
commit b4d6b83af6
1 file changed
+4
+4
View File
@@ -132,6 +132,10 @@ void convert_tensor(void* src,
} else if (dst_type == GGML_TYPE_F32) { } else if (dst_type == GGML_TYPE_F32) {
if (src_type == GGML_TYPE_F16) { if (src_type == GGML_TYPE_F16) {
ggml_fp16_to_fp32_row((ggml_fp16_t*)src, (float*)dst, n); ggml_fp16_to_fp32_row((ggml_fp16_t*)src, (float*)dst, n);
} else if (src_type == GGML_TYPE_I32) {
for (int i = 0; i < n; i++) {
((float*)dst)[i] = static_cast<float>(((int32_t*)src)[i]);
}
} else { } else {
auto qtype = ggml_get_type_traits(src_type); auto qtype = ggml_get_type_traits(src_type);
if (qtype->to_float == nullptr) { if (qtype->to_float == nullptr) {