Skip to content

Commit aa441eb

Browse files
committed
granite-switch: GGML_ASSERT token input to avoid UB on embeddings
1 parent 085a499 commit aa441eb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/models/granite-switch.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ llama_model_granite_switch::graph::graph(
201201

202202
const auto & smodel = static_cast<const llama_model_granite_switch &>(model);
203203

204+
GGML_ASSERT(ubatch.token && "granite-switch requires token input");
205+
204206
const int64_t n_embd_head = hparams.n_embd_head_v();
205207
GGML_ASSERT(n_embd_head == hparams.n_embd_head_k());
206208
GGML_ASSERT(n_embd_head == n_rot);

0 commit comments

Comments
 (0)