mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 19:36:33 +00:00
fix: preserve BF16 embedding weights for get_rows (#1959)
This commit is contained in:
1 parent
b68d58624d
commit
e95ab96997
2 files changed
+5
No files matched your search
@@ -309,6 +309,7 @@ public:
|
|||||||
__STATIC_INLINE__ bool support_get_rows(ggml_type wtype) {
|
__STATIC_INLINE__ bool support_get_rows(ggml_type wtype) {
|
||||||
switch (wtype) {
|
switch (wtype) {
|
||||||
case GGML_TYPE_F16:
|
case GGML_TYPE_F16:
|
||||||
|
case GGML_TYPE_BF16:
|
||||||
case GGML_TYPE_Q8_0:
|
case GGML_TYPE_Q8_0:
|
||||||
case GGML_TYPE_Q5_1:
|
case GGML_TYPE_Q5_1:
|
||||||
case GGML_TYPE_Q5_0:
|
case GGML_TYPE_Q5_0:
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ protected:
|
|||||||
params["position_embedding.weight"] = ggml_new_tensor_2d(ctx, position_wtype, embed_dim, num_positions);
|
params["position_embedding.weight"] = ggml_new_tensor_2d(ctx, position_wtype, embed_dim, num_positions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ggml_op param_usage_op(const std::string& name) const override {
|
||||||
|
return name == "token_embedding.weight" ? GGML_OP_GET_ROWS : GGML_OP_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CLIPEmbeddings(int64_t embed_dim,
|
CLIPEmbeddings(int64_t embed_dim,
|
||||||
int64_t vocab_size = 49408,
|
int64_t vocab_size = 49408,
|
||||||
|
|||||||
Reference in new issue
Block a user