mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 03:24:30 +00:00
fix: support integer LoRA scalar conversion to FP32 (#2263)
This commit is contained in:
1 parent
250ea6e385
commit
b4d6b83af6
1 file changed
+4
@@ -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) {
|
||||||
|
|||||||
Reference in new issue
Block a user