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// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L1342 3const decodeMap = new Map([4 [0, 65_533],5 // C1 Unicode control character reference replacements6 [128, 8364],7 [130, 8218],8 [131, 402],9 [132, 8222],10 [133, 8230],11 [134, 8224],12 [135, 8225],13 [136, 710],14 [137, 8240],15 [138, 352],16 [139, 8249],17 [140, 338],18 [142, 381],19 [145, 8216],20 [146, 8217],21 [147, 8220],22 [148, 8221],23 [149, 8226],24 [150, 8211],25 [151, 8212],26 [152, 732],27 [153, 8482],28 [154, 353],29 [155, 8250],30 [156, 339],31 [158, 382],32 [159, 376],33]);34 35/**36 * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.37 */38export const fromCodePoint: (...codePoints: number[]) => string =39 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins40 String.fromCodePoint ??41 function (codePoint: number): string {42 let output = "";43 44 if (codePoint > 0xff_ff) {45 codePoint -= 0x1_00_00;46 output += String.fromCharCode(47 ((codePoint >>> 10) & 0x3_ff) | 0xd8_00,48 );49 codePoint = 0xdc_00 | (codePoint & 0x3_ff);50 }51 52 output += String.fromCharCode(codePoint);53 return output;54 };55 56/**57 * Replace the given code point with a replacement character if it is a58 * surrogate or is outside the valid range. Otherwise return the code59 * point unchanged.60 */61export function replaceCodePoint(codePoint: number): number {62 if (63 (codePoint >= 0xd8_00 && codePoint <= 0xdf_ff) ||64 codePoint > 0x10_ff_ff65 ) {66 return 0xff_fd;67 }68 69 return decodeMap.get(codePoint) ?? codePoint;70}71 72/**73 * Replace the code point if relevant, then convert it to a string.74 *75 * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.76 * @param codePoint The code point to decode.77 * @returns The decoded code point.78 */79export function decodeCodePoint(codePoint: number): string {80 return fromCodePoint(replaceCodePoint(codePoint));81}82 