fix: preserve K-quantized embedding weights (#1936)

This commit is contained in:
nan 2026-09-07 23:50:16 +08:00 committed by GitHub
parent 31ab2b2e08
commit 9cdb6b6fc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -307,11 +307,22 @@ public:
};
__STATIC_INLINE__ bool support_get_rows(ggml_type wtype) {
std::set<ggml_type> allow_types = {GGML_TYPE_F16, GGML_TYPE_Q8_0, GGML_TYPE_Q5_1, GGML_TYPE_Q5_0, GGML_TYPE_Q4_1, GGML_TYPE_Q4_0};
if (allow_types.find(wtype) != allow_types.end()) {
return true;
switch (wtype) {
case GGML_TYPE_F16:
case GGML_TYPE_Q8_0:
case GGML_TYPE_Q5_1:
case GGML_TYPE_Q5_0:
case GGML_TYPE_Q4_1:
case GGML_TYPE_Q4_0:
case GGML_TYPE_Q2_K:
case GGML_TYPE_Q3_K:
case GGML_TYPE_Q4_K:
case GGML_TYPE_Q5_K:
case GGML_TYPE_Q6_K:
return true;
default:
return false;
}
return false;
}
class Embedding : public UnaryBlock {