MCPcopy Create free account
hub / github.com/antirez/ds4 / byte_encode

Function byte_encode

ds4.c:21927–21937  ·  view source on GitHub ↗

GPT-2 byte-level BPE first maps raw bytes to printable Unicode codepoints * so merges can operate on UTF-8 strings without losing byte identity. */

Source from the content-addressed store, hash-verified

21925 uint32_t raw_count = hi - lo + 1u;
21926 if (raw_count > 256u) raw_count = 256u;
21927 return raw_count;
21928}
21929
21930static bool metal_graph_cuda_splitkv_score_may_engage(
21931 const ds4_gpu_graph *g,
21932 uint32_t pos) {
21933 if (!g) return false;
21934
21935 const uint32_t min_score = metal_graph_cuda_greedy_splitkv_min_score();
21936 const uint32_t n_raw = metal_graph_raw_span_for_batch(g, pos, 1);
21937 for (uint32_t il = 0; il < DS4_N_LAYER; il++) {
21938 const uint32_t ratio = ds4_layer_compress_ratio(il);
21939 uint32_t visible_comp = 0;
21940 const uint32_t n_comp = g->layer_n_comp[il];

Callers 1

bpe_emit_pieceFunction · 0.85

Calls 3

gpt2_byte_to_codepointFunction · 0.85
xmallocFunction · 0.70
utf8_putFunction · 0.70

Tested by

no test coverage detected