Skip to content

Commit 1c51e1f

Browse files
committed
remove trailing whitespace
1 parent 9d26580 commit 1c51e1f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

llama.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,10 +2253,10 @@ std::vector<std::pair<std::string, struct ggml_tensor *>>& llama_internal_get_te
22532253
// Returns the size of the state
22542254
size_t llama_get_state_size(struct llama_context * ctx) {
22552255
const size_t s_bool = sizeof(int32_t);
2256-
// we don't know size of rng until we actually serialize it. so reserve more than enough memory for its serialized state.
2256+
// we don't know size of rng until we actually serialize it. so reserve more than enough memory for its serialized state.
22572257
// for reference, std::mt19937(1337) serializes to 6701 bytes.
2258-
const size_t s_rng_size = sizeof(size_t);
2259-
const size_t s_rng = 64*1024;
2258+
const size_t s_rng_size = sizeof(size_t);
2259+
const size_t s_rng = 64*1024;
22602260
const size_t s_logits_capacity = sizeof(size_t);
22612261
const size_t s_logits_size = sizeof(size_t);
22622262
const size_t s_logits = ctx->logits.capacity() * sizeof(float);
@@ -2300,7 +2300,7 @@ size_t llama_copy_state_data(struct llama_context * ctx, uint8_t * dest) {
23002300
memcpy(out, &logits_capacity, sizeof(size_t)); out += sizeof(size_t);
23012301
memcpy(out, &logits_size, sizeof(size_t)); out += sizeof(size_t);
23022302
if (logits_size) {
2303-
memcpy(out, ctx->logits.data(), logits_size * sizeof(float));
2303+
memcpy(out, ctx->logits.data(), logits_size * sizeof(float));
23042304
}
23052305
out += logits_capacity * sizeof(float);
23062306
memcpy(out, &embedding_size, sizeof(size_t)); out += sizeof(size_t);
@@ -2342,13 +2342,13 @@ size_t llama_set_state_data(struct llama_context * ctx, const uint8_t * src) {
23422342
LLAMA_ASSERT(ctx->logits.capacity() == logits_capacity);
23432343
if (logits_size) {
23442344
ctx->logits.resize(logits_size);
2345-
memcpy(ctx->logits.data(), in, logits_size * sizeof(float));
2345+
memcpy(ctx->logits.data(), in, logits_size * sizeof(float));
23462346
}
23472347
in += logits_capacity * sizeof(float);
23482348
memcpy(&embedding_size, in, sizeof(size_t)); in += sizeof(size_t);
23492349
LLAMA_ASSERT(ctx->embedding.capacity() == embedding_size);
23502350
if (embedding_size) {
2351-
memcpy(ctx->embedding.data(), in, embedding_size * sizeof(float));
2351+
memcpy(ctx->embedding.data(), in, embedding_size * sizeof(float));
23522352
in += embedding_size * sizeof(float);
23532353
}
23542354
memcpy(&kv_size, in, sizeof(size_t)); in += sizeof(size_t);
@@ -2357,7 +2357,7 @@ size_t llama_set_state_data(struct llama_context * ctx, const uint8_t * src) {
23572357
LLAMA_ASSERT(ctx->model.kv_self.buf.size == kv_size);
23582358
void * k_data = ctx->model.kv_self.k->data; // remember data pointers
23592359
void * v_data = ctx->model.kv_self.v->data; // because their value is stored in buf and overwritten by memcpy
2360-
memcpy(ctx->model.kv_self.buf.addr, in, kv_size);
2360+
memcpy(ctx->model.kv_self.buf.addr, in, kv_size);
23612361
ctx->model.kv_self.k->data = k_data; // restore correct data pointers
23622362
ctx->model.kv_self.v->data = v_data;
23632363
in += kv_size;

llama.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ extern "C" {
132132
// Returns the size in bytes of the state (rng, logits, embedding and kv_cache)
133133
LLAMA_API size_t llama_get_state_size(struct llama_context * ctx);
134134

135-
// Copies the state to the specified destination address.
136-
// Destination needs to have allocated enough memory.
135+
// Copies the state to the specified destination address.
136+
// Destination needs to have allocated enough memory.
137137
// Returns the number of bytes copied
138138
LLAMA_API size_t llama_copy_state_data(struct llama_context * ctx, uint8_t * dest);
139139

0 commit comments

Comments
 (0)