Fix a very noobish C mistake

Oops!
This commit is contained in:
Henri Vasserman 2023-05-19 16:44:32 +03:00
parent 7df9ab9687
commit 5c9b45c204
No known key found for this signature in database
GPG Key ID: 2995FC0F58B1A986

View File

@ -1169,7 +1169,7 @@ static bool llama_eval_internal(
if (lctx.steering_mode != STEERING_OFF) { if (lctx.steering_mode != STEERING_OFF) {
steer = ggml_new_tensor_2d(ctx0, GGML_TYPE_F32, n_embd, N); steer = ggml_new_tensor_2d(ctx0, GGML_TYPE_F32, n_embd, N);
//steer->data = lctx.steering_vector.data() + n_past * n_embd * sizeof(float); //steer->data = lctx.steering_vector.data() + n_past * n_embd * sizeof(float);
memcpy(steer->data, lctx.steering_vector.data() + n_past * n_embd * sizeof(float), ggml_nbytes(steer)); memcpy(steer->data, lctx.steering_vector.data() + n_past * n_embd, ggml_nbytes(steer));
} }
struct ggml_tensor * inpL = ggml_get_rows(ctx0, model.tok_embeddings, embd); struct ggml_tensor * inpL = ggml_get_rows(ctx0, model.tok_embeddings, embd);
@ -1407,7 +1407,7 @@ static bool llama_eval_internal(
if (lctx.steering_mode == STEERING_WRITE) { if (lctx.steering_mode == STEERING_WRITE) {
memcpy(lctx.steering_vector.data() + n_past * n_embd * sizeof(float), steer->data, ggml_nbytes(steer)); memcpy(lctx.steering_vector.data() + n_past * n_embd, steer->data, ggml_nbytes(steer));
} }