summaryrefslogtreecommitdiff
path: root/ggml.h
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-06-27 00:06:51 +0300
committerGeorgi Gerganov <ggerganov@gmail.com>2023-06-27 00:06:51 +0300
commitd9779021bd59ed96daae75e820a5ac5da47ca8ff (patch)
tree1ba4204697c8cf798346211330cc401c4f7f23e2 /ggml.h
parentd38e45157862b58a1824387e64860d68ca3533a7 (diff)
ggml : add support for ChatGLM RoPE
Diffstat (limited to 'ggml.h')
-rw-r--r--ggml.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/ggml.h b/ggml.h
index 08025e57..45991322 100644
--- a/ggml.h
+++ b/ggml.h
@@ -1036,13 +1036,15 @@ extern "C" {
// rotary position embedding
// if mode & 1 == 1, skip n_past elements
// if mode & 2 == 1, GPT-NeoX style
+ // if mode & 4 == 1, ChatGLM style
// TODO: avoid creating a new tensor every time
GGML_API struct ggml_tensor * ggml_rope(
struct ggml_context * ctx,
struct ggml_tensor * a,
int n_past,
int n_dims,
- int mode);
+ int mode,
+ int n_ctx);
// in-place, returns view(a)
GGML_API struct ggml_tensor * ggml_rope_inplace(
@@ -1050,7 +1052,8 @@ extern "C" {
struct ggml_tensor * a,
int n_past,
int n_dims,
- int mode);
+ int mode,
+ int n_ctx);
// rotary position embedding backward, i.e compute dx from dy
// a - dy