Skip to content

Commit c637fcd

Browse files
authored
fix: divide 0 exception in mamba (#7932)
Signed-off-by: thxCode <[email protected]>
1 parent 6a2f0b3 commit c637fcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llama.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5383,7 +5383,7 @@ static bool llm_load_tensors(
53835383
// create tensors for the weights
53845384
{
53855385
const int64_t n_embd = hparams.n_embd;
5386-
const int64_t n_embd_head = n_embd / hparams.n_head;
5386+
const int64_t n_embd_head = (hparams.n_head == 0) ? 0 : n_embd / hparams.n_head;
53875387
const int64_t n_embd_k_gqa = hparams.n_embd_k_gqa();
53885388
const int64_t n_embd_v_gqa = hparams.n_embd_v_gqa();
53895389
const int64_t n_embd_gqa = n_embd_v_gqa;

0 commit comments

Comments
 (0)