We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e64a0e commit 419dd92Copy full SHA for 419dd92
otherarch/sdcpp/clip.hpp
@@ -547,6 +547,12 @@ class CLIPEmbeddings : public GGMLBlock {
547
548
void init_params(struct ggml_context* ctx, const String2GGMLType& tensor_types = {}, const std::string prefix = "") {
549
enum ggml_type token_wtype = GGML_TYPE_F32;
550
+ #if 1
551
+ // kcpp reduce memory usage (reverts https://github.com/leejet/stable-diffusion.cpp/pull/601)
552
+ auto tensor_type = tensor_types.find(prefix + "token_embedding.weight");
553
+ if (tensor_type != tensor_types.end())
554
+ token_wtype = tensor_type->second;
555
+ #endif
556
enum ggml_type position_wtype = GGML_TYPE_F32;
557
558
params["token_embedding.weight"] = ggml_new_tensor_2d(ctx, token_wtype, embed_dim, vocab_size);
0 commit comments