Skip to content

Commit 72cb1ed

Browse files
committed
Use typos to fix comments and logs.
1 parent 05cd6e5 commit 72cb1ed

19 files changed

+44
-44
lines changed

common/log.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@
6161
// #define LOG_TARGET stderr
6262
// #include "log.h"
6363
//
64-
// The log target can also be redirected to a diffrent function
64+
// The log target can also be redirected to a different function
6565
// like so:
6666
//
67-
// #define LOG_TARGET log_handler_diffrent()
67+
// #define LOG_TARGET log_handler_different()
6868
// #include "log.h"
6969
//
70-
// FILE* log_handler_diffrent()
70+
// FILE* log_handler_different()
7171
// {
7272
// return stderr;
7373
// }
@@ -421,7 +421,7 @@ inline FILE *log_handler2_impl(bool change = false, LogTriState append = LogTriS
421421

422422
// Disables logs entirely at runtime.
423423
// Makes LOG() and LOG_TEE() produce no output,
424-
// untill enabled back.
424+
// until enabled back.
425425
#define log_disable() log_disable_impl()
426426

427427
// INTERNAL, DO NOT USE

common/stb_image.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,7 @@ stbi_inline static int stbi__extend_receive(stbi__jpeg * j, int n) {
21912191
if (j->code_bits < n)
21922192
stbi__grow_buffer_unsafe(j);
21932193
if (j->code_bits < n)
2194-
return 0; // ran out of bits from stream, return 0s intead of continuing
2194+
return 0; // ran out of bits from stream, return 0s instead of continuing
21952195

21962196
sgn = j->code_buffer >> 31; // sign bit always in MSB; 0 if MSB clear (positive), 1 if MSB set (negative)
21972197
k = stbi_lrot(j->code_buffer, n);
@@ -2207,7 +2207,7 @@ stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg * j, int n) {
22072207
if (j->code_bits < n)
22082208
stbi__grow_buffer_unsafe(j);
22092209
if (j->code_bits < n)
2210-
return 0; // ran out of bits from stream, return 0s intead of continuing
2210+
return 0; // ran out of bits from stream, return 0s instead of continuing
22112211
k = stbi_lrot(j->code_buffer, n);
22122212
j->code_buffer = k & ~stbi__bmask[n];
22132213
k &= stbi__bmask[n];
@@ -2220,7 +2220,7 @@ stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg * j) {
22202220
if (j->code_bits < 1)
22212221
stbi__grow_buffer_unsafe(j);
22222222
if (j->code_bits < 1)
2223-
return 0; // ran out of bits from stream, return 0s intead of continuing
2223+
return 0; // ran out of bits from stream, return 0s instead of continuing
22242224
k = j->code_buffer;
22252225
j->code_buffer <<= 1;
22262226
--j->code_bits;
@@ -5015,13 +5015,13 @@ static int stbi__create_png_image_raw(stbi__png * a, stbi_uc * raw, stbi__uint32
50155015

50165016
// we make a separate pass to expand bits to pixels; for performance,
50175017
// this could run two scanlines behind the above code, so it won't
5018-
// intefere with filtering but will still be in the cache.
5018+
// interfere with filtering but will still be in the cache.
50195019
if (depth < 8) {
50205020
for (j = 0; j < y; ++j) {
50215021
stbi_uc * cur = a->out + stride * j;
50225022
stbi_uc * in = a->out + stride * j + x * out_n - img_width_bytes;
50235023
// unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for
5024-
// 1/2/4-bit png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that
5024+
// 1/2/4-bit png guarantee byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that
50255025
// will be skipped in the later loop
50265026
stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range
50275027

@@ -5215,7 +5215,7 @@ static int stbi__expand_png_palette(stbi__png * a, stbi_uc * palette, int len, i
52155215
if (p == NULL)
52165216
return stbi__err("outofmem", "Out of memory");
52175217

5218-
// between here and free(out) below, exitting would leak
5218+
// between here and free(out) below, exiting would leak
52195219
temp_out = p;
52205220

52215221
if (pal_img_n == 3) {
@@ -6281,7 +6281,7 @@ static void * stbi__tga_load(stbi__context * s, int * x, int * y, int * comp, in
62816281
if (tga_width > STBI_MAX_DIMENSIONS)
62826282
return stbi__errpuc("too large", "Very large image (corrupt?)");
62836283

6284-
// do a tiny bit of precessing
6284+
// do a tiny bit of processing
62856285
if (tga_image_type >= 8) {
62866286
tga_image_type -= 8;
62876287
tga_is_RLE = 1;
@@ -7213,7 +7213,7 @@ static stbi_uc * stbi__gif_load_next(stbi__context * s, stbi__gif * g, int * com
72137213
// 0: not specified.
72147214
}
72157215

7216-
// background is what out is after the undoing of the previou frame;
7216+
// background is what out is after the undoing of the previous frame;
72177217
memcpy(g->background, g->out, 4 * g->w * g->h);
72187218
}
72197219

@@ -8277,7 +8277,7 @@ STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const * c, void * us
82778277
1.31 (2011-06-20)
82788278
a few more leak fixes, bug in PNG handling (SpartanJ)
82798279
1.30 (2011-06-11)
8280-
added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
8280+
added ability to load files via callbacks to accommodate custom input streams (Ben Wenger)
82818281
removed deprecated format-specific test/load functions
82828282
removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks
82838283
anyway error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha) fix inefficiency in

convert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def merge_multifile_models(models_plus: list[ModelPlus]) -> ModelPlus:
585585

586586
if any("model.embed_tokens.weight" in mp.model for mp in models_plus):
587587
# Transformers models put different tensors in different files, but
588-
# don't split indivdual tensors between files.
588+
# don't split individual tensors between files.
589589
model: LazyModel = {}
590590
for mp in models_plus:
591591
model.update(mp.model)
@@ -678,7 +678,7 @@ def rebuild_from_type_v2(func, new_type, args, state):
678678
return func(*args)
679679

680680
CLASSES: dict[tuple[str, str], Any] = {
681-
# getattr used here as a workaround for mypy not being smart enough to detrmine
681+
# getattr used here as a workaround for mypy not being smart enough to determine
682682
# the staticmethods have a __func__ attribute.
683683
('torch._tensor', '_rebuild_from_type_v2'): getattr(rebuild_from_type_v2, '__func__'),
684684
('torch._utils', '_rebuild_tensor_v2'): getattr(lazy_rebuild_tensor_v2, '__func__'),

examples/llava/clip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ bool clip_image_preprocess(const clip_ctx * ctx, const clip_image_u8 * img, clip
739739
temp->ny = longer_side;
740740
temp->size = 3 * longer_side * longer_side;
741741
temp->data = new uint8_t[temp->size]();
742-
uint8_t bc[3] = {122, 116, 104}; // bakground color in RGB from LLaVA
742+
uint8_t bc[3] = {122, 116, 104}; // background color in RGB from LLaVA
743743

744744
// fill with background color
745745
for (size_t i = 0; i < temp->size; i++) {

examples/llava/convert-image-encoder-to-gguf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def bytes_to_unicode():
5151
The reversible bpe codes work on unicode strings.
5252
This means you need a large # of unicode characters in your vocab if you want to avoid UNKs.
5353
When you're at something like a 10B token dataset you end up needing around 5K for decent coverage.
54-
This is a signficant percentage of your normal, say, 32K bpe vocab.
54+
This is a significant percentage of your normal, say, 32K bpe vocab.
5555
To avoid that, we want lookup tables between utf-8 bytes and unicode strings.
5656
And avoids mapping to whitespace/control characters the bpe code barfs on.
5757
"""

examples/lookahead/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# llama.cpp/examples/lookahead
22

3-
Demonstartion of lookahead decoding technique:
3+
Demonstration of lookahead decoding technique:
44

55
https://lmsys.org/blog/2023-11-21-lookahead-decoding/
66

examples/server/json.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11227,7 +11227,7 @@ class binary_reader
1122711227
}
1122811228
if (is_ndarray) // ndarray dimensional vector can only contain integers, and can not embed another array
1122911229
{
11230-
return sax->parse_error(chars_read, get_token_string(), parse_error::create(113, chars_read, exception_message(input_format, "ndarray dimentional vector is not allowed", "size"), nullptr));
11230+
return sax->parse_error(chars_read, get_token_string(), parse_error::create(113, chars_read, exception_message(input_format, "ndarray dimensional vector is not allowed", "size"), nullptr));
1123111231
}
1123211232
std::vector<size_t> dim;
1123311233
if (JSON_HEDLEY_UNLIKELY(!get_ubjson_ndarray_size(dim)))

examples/server/public/completion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export async function* llama(prompt, params = {}, config = {}) {
114114
return content;
115115
}
116116

117-
// Call llama, return an event target that you can subcribe to
117+
// Call llama, return an event target that you can subscribe to
118118
//
119119
// Example:
120120
//

examples/server/public/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
cache_prompt: true
239239
})
240240

241-
/* START: Support for storing prompt templates and parameters in borwser LocalStorage */
241+
/* START: Support for storing prompt templates and parameters in browsers LocalStorage */
242242

243243
const local_storage_storageKey = "llamacpp_server_local_storage";
244244

@@ -282,7 +282,7 @@
282282
let importedTemplates = local_storage_getDataAsObject('user_templates')
283283

284284
if (importedTemplates) {
285-
// saved templates were successfuly imported.
285+
// saved templates were successfully imported.
286286

287287
console.log('Processing saved templates and updating default template')
288288
params.value = { ...params.value, image_data: [] };
@@ -303,7 +303,7 @@
303303
}
304304

305305
function userTemplateResetToDefault() {
306-
console.log('Reseting themplate to default')
306+
console.log('Resetting template to default')
307307
selectedUserTemplate.value.name = 'default';
308308
selectedUserTemplate.value.data = savedUserTemplates.value['default'];
309309
}

examples/speculative/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# llama.cpp/examples/speculative
22

3-
Demonstartion of speculative decoding and tree-based speculative decoding techniques
3+
Demonstration of speculative decoding and tree-based speculative decoding techniques
44

55
More info:
66

0 commit comments

Comments
 (0)