Skip to content

Commit db39b70

Browse files
committed
talk-llama : fix new rope interface
1 parent 8c0c0da commit db39b70

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

examples/talk-llama/llama.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,6 @@ static T checked_mul(T a, T b) {
281281
return ret;
282282
}
283283

284-
static size_t checked_div(size_t a, size_t b) {
285-
if (b == 0 || a % b != 0) {
286-
throw format("error dividing %zu / %zu", a, b);
287-
}
288-
return a / b;
289-
}
290-
291284
static std::string llama_format_tensor_shape(const std::vector<uint32_t> & ne) {
292285
char buf[256];
293286
snprintf(buf, sizeof(buf), "%5u", ne.at(0));
@@ -1237,8 +1230,8 @@ static bool llama_eval_internal(
12371230
// self-attention
12381231
{
12391232
// compute Q and K and RoPE them
1240-
struct ggml_tensor * Qcur = ggml_rope_inplace(ctx0, ggml_reshape_3d(ctx0, ggml_mul_mat(ctx0, model.layers[il].wq, cur), n_embd/n_head, n_head, N), n_past, n_rot, 0);
1241-
struct ggml_tensor * Kcur = ggml_rope_inplace(ctx0, ggml_reshape_3d(ctx0, ggml_mul_mat(ctx0, model.layers[il].wk, cur), n_embd/n_head, n_head, N), n_past, n_rot, 0);
1233+
struct ggml_tensor * Qcur = ggml_rope_inplace(ctx0, ggml_reshape_3d(ctx0, ggml_mul_mat(ctx0, model.layers[il].wq, cur), n_embd/n_head, n_head, N), n_past, n_rot, 0, 0);
1234+
struct ggml_tensor * Kcur = ggml_rope_inplace(ctx0, ggml_reshape_3d(ctx0, ggml_mul_mat(ctx0, model.layers[il].wk, cur), n_embd/n_head, n_head, N), n_past, n_rot, 0, 0);
12421235
ggml_set_name(Qcur, "Qcur");
12431236
ggml_set_name(Kcur, "Kcur");
12441237

0 commit comments

Comments
 (0)