Team Ai
Datasetpublic

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.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
helpers.js160 linesDownload Raw Back to lib
1const ansiColors = {2    bold: ['1', '22'],3    dim: ['2', '22'],4    italic: ['3', '23'],5    underline: ['4', '24'],6    // 5 & 6 are blinking7    inverse: ['7', '27'],8    hidden: ['8', '28'],9    strike: ['9', '29'],10    // 10-20 are fonts11    // 21-29 are resets for 1-912    black: ['30', '39'],13    red: ['31', '39'],14    green: ['32', '39'],15    yellow: ['33', '39'],16    blue: ['34', '39'],17    magenta: ['35', '39'],18    cyan: ['36', '39'],19    white: ['37', '39'],20    brightblack: ['30;1', '39'],21    brightred: ['31;1', '39'],22    brightgreen: ['32;1', '39'],23    brightyellow: ['33;1', '39'],24    brightblue: ['34;1', '39'],25    brightmagenta: ['35;1', '39'],26    brightcyan: ['36;1', '39'],27    brightwhite: ['37;1', '39'],28    grey: ['90', '39'],29};30const styles = {31    special: 'cyan',32    number: 'yellow',33    bigint: 'yellow',34    boolean: 'yellow',35    undefined: 'grey',36    null: 'bold',37    string: 'green',38    symbol: 'green',39    date: 'magenta',40    regexp: 'red',41};42export const truncator = '…';43function colorise(value, styleType) {44    const color = ansiColors[styles[styleType]] || ansiColors[styleType] || '';45    if (!color) {46        return String(value);47    }48    return `\u001b[${color[0]}m${String(value)}\u001b[${color[1]}m`;49}50export function normaliseOptions({ showHidden = false, depth = 2, colors = false, customInspect = true, showProxy = false, maxArrayLength = Infinity, breakLength = Infinity, seen = [], 51// eslint-disable-next-line no-shadow52truncate = Infinity, stylize = String, } = {}, inspect) {53    const options = {54        showHidden: Boolean(showHidden),55        depth: Number(depth),56        colors: Boolean(colors),57        customInspect: Boolean(customInspect),58        showProxy: Boolean(showProxy),59        maxArrayLength: Number(maxArrayLength),60        breakLength: Number(breakLength),61        truncate: Number(truncate),62        seen,63        inspect,64        stylize,65    };66    if (options.colors) {67        options.stylize = colorise;68    }69    return options;70}71function isHighSurrogate(char) {72    return char >= '\ud800' && char <= '\udbff';73}74export function truncate(string, length, tail = truncator) {75    string = String(string);76    const tailLength = tail.length;77    const stringLength = string.length;78    if (tailLength > length && stringLength > tailLength) {79        return tail;80    }81    if (stringLength > length && stringLength > tailLength) {82        let end = length - tailLength;83        if (end > 0 && isHighSurrogate(string[end - 1])) {84            end = end - 1;85        }86        return `${string.slice(0, end)}${tail}`;87    }88    return string;89}90// eslint-disable-next-line complexity91export function inspectList(list, options, inspectItem, separator = ', ') {92    inspectItem = inspectItem || options.inspect;93    const size = list.length;94    if (size === 0)95        return '';96    const originalLength = options.truncate;97    let output = '';98    let peek = '';99    let truncated = '';100    for (let i = 0; i < size; i += 1) {101        const last = i + 1 === list.length;102        const secondToLast = i + 2 === list.length;103        truncated = `${truncator}(${list.length - i})`;104        const value = list[i];105        // If there is more than one remaining we need to account for a separator of `, `106        options.truncate = originalLength - output.length - (last ? 0 : separator.length);107        const string = peek || inspectItem(value, options) + (last ? '' : separator);108        const nextLength = output.length + string.length;109        const truncatedLength = nextLength + truncated.length;110        // If this is the last element, and adding it would111        // take us over length, but adding the truncator wouldn't - then break now112        if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) {113            break;114        }115        // If this isn't the last or second to last element to scan,116        // but the string is already over length then break here117        if (!last && !secondToLast && truncatedLength > originalLength) {118            break;119        }120        // Peek at the next string to determine if we should121        // break early before adding this item to the output122        peek = last ? '' : inspectItem(list[i + 1], options) + (secondToLast ? '' : separator);123        // If we have one element left, but this element and124        // the next takes over length, the break early125        if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) {126            break;127        }128        output += string;129        // If the next element takes us to length -130        // but there are more after that, then we should truncate now131        if (!last && !secondToLast && nextLength + peek.length >= originalLength) {132            truncated = `${truncator}(${list.length - i - 1})`;133            break;134        }135        truncated = '';136    }137    return `${output}${truncated}`;138}139function quoteComplexKey(key) {140    if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {141        return key;142    }143    return JSON.stringify(key)144        .replace(/'/g, "\\'")145        .replace(/\\"/g, '"')146        .replace(/(^"|"$)/g, "'");147}148export function inspectProperty([key, value], options) {149    options.truncate -= 2;150    if (typeof key === 'string') {151        key = quoteComplexKey(key);152    }153    else if (typeof key !== 'number') {154        key = `[${options.inspect(key, options)}]`;155    }156    options.truncate -= key.length;157    value = options.inspect(value, options);158    return `${key}: ${value}`;159}160 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai