Skip to content

Commit

Permalink
fix: insufficient memory error on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
leejet committed Sep 3, 2023
1 parent bb3f19c commit b247581
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stable-diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3222,8 +3222,8 @@ class StableDiffusionGGML {

struct ggml_tensor* hidden_states = cond_stage_model.text_model.forward(ctx, input_ids);

struct ggml_cgraph* cond_graph = ggml_build_forward_ctx(ctx, hidden_states);
struct ggml_cplan cplan = ggml_graph_plan(cond_graph, n_threads);
struct ggml_cgraph cond_graph = ggml_build_forward(hidden_states);
struct ggml_cplan cplan = ggml_graph_plan(&cond_graph, n_threads);
ctx_size += cplan.work_size;

ctx_size += ggml_used_mem(ctx) + ggml_used_mem_of_data(ctx);
Expand Down

0 comments on commit b247581

Please sign in to comment.