Fix GPT2 not loading due to graph too small

This commit is contained in:
Concedo 2023-11-26 23:06:42 +08:00
parent eb42c73953
commit a6eb9b8010
8 changed files with 21 additions and 19 deletions

View file

@ -455,7 +455,7 @@ bool gpt2_eval(
struct ggml_context * ctx0 = ggml_init(params);
struct ggml_cgraph * gf = ggml_new_graph(ctx0);
struct ggml_cgraph * gf = ggml_new_graph_custom(ctx0, 8192, false);
struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));