Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1// This function is taken from Node.js project.2// Full implementation can be found from https://github.com/nodejs/node/blob/main/lib/internal/querystring.js3const hexTable = Array.from({ length: 256 }, (_, i) => '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());4// These characters do not need escaping when generating query strings:5// ! - . _ ~6// ' ( ) *7// digits8// alpha (uppercase)9// alpha (lowercase)10const noEscape = new Int8Array([11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,12 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1,13 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,14 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,15 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 016]);17/**18 * @param {string} str19 * @returns {string}20 */21export function encodeString(str) {22 const len = str.length;23 if (len === 0) {24 return '';25 }26 let out = '';27 let lastPos = 0;28 let i = 0;29 outer: for (; i < len; i++) {30 let c = str.charCodeAt(i);31 // ASCII32 while (c < 0x80) {33 if (noEscape[c] !== 1) {34 if (lastPos < i)35 out += str.slice(lastPos, i);36 lastPos = i + 1;37 out += hexTable[c];38 }39 if (++i === len)40 break outer;41 c = str.charCodeAt(i);42 }43 if (lastPos < i)44 out += str.slice(lastPos, i);45 // Multi-byte characters ...46 if (c < 0x800) {47 lastPos = i + 1;48 out += hexTable[0xc0 | (c >> 6)] + hexTable[0x80 | (c & 0x3f)];49 continue;50 }51 if (c < 0xd800 || c >= 0xe000) {52 lastPos = i + 1;53 out +=54 hexTable[0xe0 | (c >> 12)] +55 hexTable[0x80 | ((c >> 6) & 0x3f)] +56 hexTable[0x80 | (c & 0x3f)];57 continue;58 }59 // Surrogate pair60 ++i;61 // This branch should never happen because all URLSearchParams entries62 // should already be converted to USVString. But, included for63 // completion's sake anyway.64 if (i >= len) {65 throw new Error('URI malformed');66 }67 const c2 = str.charCodeAt(i) & 0x3ff;68 lastPos = i + 1;69 c = 0x10000 + (((c & 0x3ff) << 10) | c2);70 out +=71 hexTable[0xf0 | (c >> 18)] +72 hexTable[0x80 | ((c >> 12) & 0x3f)] +73 hexTable[0x80 | ((c >> 6) & 0x3f)] +74 hexTable[0x80 | (c & 0x3f)];75 }76 if (lastPos === 0)77 return str;78 if (lastPos < len)79 return out + str.slice(lastPos);80 return out;81}82 