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/// <reference types="../types/index.d.ts" />3 4// (c) 2020-present Andrea Giammarchi5 6const {parse: $parse, stringify: $stringify} = JSON;7const {keys} = Object;8 9const Primitive = String; // it could be Number10const primitive = 'string'; // it could be 'number'11 12const ignore = {};13const object = 'object';14 15const noop = (_, value) => value;16 17const primitives = value => (18 value instanceof Primitive ? Primitive(value) : value19);20 21const Primitives = (_, value) => (22 typeof value === primitive ? new Primitive(value) : value23);24 25const resolver = (input, lazy, parsed, $) => output => {26 for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {27 const k = ke[y];28 const value = output[k];29 if (value instanceof Primitive) {30 const tmp = input[+value];31 if (typeof tmp === object && !parsed.has(tmp)) {32 parsed.add(tmp);33 output[k] = ignore;34 lazy.push({ o: output, k, r: tmp });35 }36 else37 output[k] = $.call(output, k, tmp);38 }39 else if (output[k] !== ignore)40 output[k] = $.call(output, k, value);41 }42 return output;43};44 45const set = (known, input, value) => {46 const index = Primitive(input.push(value) - 1);47 known.set(value, index);48 return index;49};50 51/**52 * Converts a specialized flatted string into a JS value.53 * @param {string} text54 * @param {(this: any, key: string, value: any) => any} [reviver]55 * @returns {any}56 */57const parse = (text, reviver) => {58 const input = $parse(text, Primitives).map(primitives);59 const $ = reviver || noop;60 61 let value = input[0];62 63 if (typeof value === object && value) {64 const lazy = [];65 const revive = resolver(input, lazy, new Set, $);66 value = revive(value);67 68 let i = 0;69 while (i < lazy.length) {70 // it could be a lazy.shift() but that's costly71 const {o, k, r} = lazy[i++];72 o[k] = $.call(o, k, revive(r));73 }74 }75 76 return $.call({'': value}, '', value);77};78exports.parse = parse;79 80/**81 * Converts a JS value into a specialized flatted string.82 * @param {any} value83 * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]84 * @param {string | number | undefined} [space]85 * @returns {string}86 */87const stringify = (value, replacer, space) => {88 const $ = replacer && typeof replacer === object ?89 (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :90 (replacer || noop);91 const known = new Map;92 const input = [];93 const output = [];94 let i = +set(known, input, $.call({'': value}, '', value));95 let firstRun = !i;96 while (i < input.length) {97 firstRun = true;98 output[i] = $stringify(input[i++], replace, space);99 }100 return '[' + output.join(',') + ']';101 function replace(key, value) {102 if (firstRun) {103 firstRun = !firstRun;104 return value;105 }106 const after = $.call(this, key, value);107 switch (typeof after) {108 case object:109 if (after === null) return after;110 case primitive:111 return known.get(after) || set(known, input, after);112 }113 return after;114 }115};116exports.stringify = stringify;117 118/**119 * Converts a generic value into a JSON serializable object without losing recursion.120 * @param {any} value121 * @returns {any}122 */123const toJSON = value => $parse(stringify(value));124exports.toJSON = toJSON;125 126/**127 * Converts a previously serialized object with recursion into a recursive one.128 * @param {any} value129 * @returns {any}130 */131const fromJSON = value => parse($stringify(value));132exports.fromJSON = fromJSON;133 