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'use strict';2 3const ANSI_BACKGROUND_OFFSET = 10;4 5const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;6 7const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;8 9function assembleStyles() {10 const codes = new Map();11 const styles = {12 modifier: {13 reset: [0, 0],14 // 21 isn't widely supported and 22 does the same thing15 bold: [1, 22],16 dim: [2, 22],17 italic: [3, 23],18 underline: [4, 24],19 overline: [53, 55],20 inverse: [7, 27],21 hidden: [8, 28],22 strikethrough: [9, 29]23 },24 color: {25 black: [30, 39],26 red: [31, 39],27 green: [32, 39],28 yellow: [33, 39],29 blue: [34, 39],30 magenta: [35, 39],31 cyan: [36, 39],32 white: [37, 39],33 34 // Bright color35 blackBright: [90, 39],36 redBright: [91, 39],37 greenBright: [92, 39],38 yellowBright: [93, 39],39 blueBright: [94, 39],40 magentaBright: [95, 39],41 cyanBright: [96, 39],42 whiteBright: [97, 39]43 },44 bgColor: {45 bgBlack: [40, 49],46 bgRed: [41, 49],47 bgGreen: [42, 49],48 bgYellow: [43, 49],49 bgBlue: [44, 49],50 bgMagenta: [45, 49],51 bgCyan: [46, 49],52 bgWhite: [47, 49],53 54 // Bright color55 bgBlackBright: [100, 49],56 bgRedBright: [101, 49],57 bgGreenBright: [102, 49],58 bgYellowBright: [103, 49],59 bgBlueBright: [104, 49],60 bgMagentaBright: [105, 49],61 bgCyanBright: [106, 49],62 bgWhiteBright: [107, 49]63 }64 };65 66 // Alias bright black as gray (and grey)67 styles.color.gray = styles.color.blackBright;68 styles.bgColor.bgGray = styles.bgColor.bgBlackBright;69 styles.color.grey = styles.color.blackBright;70 styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;71 72 for (const [groupName, group] of Object.entries(styles)) {73 for (const [styleName, style] of Object.entries(group)) {74 styles[styleName] = {75 open: `\u001B[${style[0]}m`,76 close: `\u001B[${style[1]}m`77 };78 79 group[styleName] = styles[styleName];80 81 codes.set(style[0], style[1]);82 }83 84 Object.defineProperty(styles, groupName, {85 value: group,86 enumerable: false87 });88 }89 90 Object.defineProperty(styles, 'codes', {91 value: codes,92 enumerable: false93 });94 95 styles.color.close = '\u001B[39m';96 styles.bgColor.close = '\u001B[49m';97 98 styles.color.ansi256 = wrapAnsi256();99 styles.color.ansi16m = wrapAnsi16m();100 styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);101 styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);102 103 // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js104 Object.defineProperties(styles, {105 rgbToAnsi256: {106 value: (red, green, blue) => {107 // We use the extended greyscale palette here, with the exception of108 // black and white. normal palette only has 4 greyscale shades.109 if (red === green && green === blue) {110 if (red < 8) {111 return 16;112 }113 114 if (red > 248) {115 return 231;116 }117 118 return Math.round(((red - 8) / 247) * 24) + 232;119 }120 121 return 16 +122 (36 * Math.round(red / 255 * 5)) +123 (6 * Math.round(green / 255 * 5)) +124 Math.round(blue / 255 * 5);125 },126 enumerable: false127 },128 hexToRgb: {129 value: hex => {130 const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));131 if (!matches) {132 return [0, 0, 0];133 }134 135 let {colorString} = matches.groups;136 137 if (colorString.length === 3) {138 colorString = colorString.split('').map(character => character + character).join('');139 }140 141 const integer = Number.parseInt(colorString, 16);142 143 return [144 (integer >> 16) & 0xFF,145 (integer >> 8) & 0xFF,146 integer & 0xFF147 ];148 },149 enumerable: false150 },151 hexToAnsi256: {152 value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),153 enumerable: false154 }155 });156 157 return styles;158}159 160// Make the export immutable161Object.defineProperty(module, 'exports', {162 enumerable: true,163 get: assembleStyles164});165 