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(function (Prism) {2 3 /**4 * Returns the placeholder for the given language id and index.5 *6 * @param {string} language7 * @param {string|number} index8 * @returns {string}9 */10 function getPlaceholder(language, index) {11 return '___' + language.toUpperCase() + index + '___';12 }13 14 Object.defineProperties(Prism.languages['markup-templating'] = {}, {15 buildPlaceholders: {16 /**17 * Tokenize all inline templating expressions matching `placeholderPattern`.18 *19 * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns20 * `true` will be replaced.21 *22 * @param {object} env The environment of the `before-tokenize` hook.23 * @param {string} language The language id.24 * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.25 * @param {(match: string) => boolean} [replaceFilter]26 */27 value: function (env, language, placeholderPattern, replaceFilter) {28 if (env.language !== language) {29 return;30 }31 32 var tokenStack = env.tokenStack = [];33 34 env.code = env.code.replace(placeholderPattern, function (match) {35 if (typeof replaceFilter === 'function' && !replaceFilter(match)) {36 return match;37 }38 var i = tokenStack.length;39 var placeholder;40 41 // Check for existing strings42 while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {43 ++i;44 }45 46 // Create a sparse array47 tokenStack[i] = match;48 49 return placeholder;50 });51 52 // Switch the grammar to markup53 env.grammar = Prism.languages.markup;54 }55 },56 tokenizePlaceholders: {57 /**58 * Replace placeholders with proper tokens after tokenizing.59 *60 * @param {object} env The environment of the `after-tokenize` hook.61 * @param {string} language The language id.62 */63 value: function (env, language) {64 if (env.language !== language || !env.tokenStack) {65 return;66 }67 68 // Switch the grammar back69 env.grammar = Prism.languages[language];70 71 var j = 0;72 var keys = Object.keys(env.tokenStack);73 74 function walkTokens(tokens) {75 for (var i = 0; i < tokens.length; i++) {76 // all placeholders are replaced already77 if (j >= keys.length) {78 break;79 }80 81 var token = tokens[i];82 if (typeof token === 'string' || (token.content && typeof token.content === 'string')) {83 var k = keys[j];84 var t = env.tokenStack[k];85 var s = typeof token === 'string' ? token : token.content;86 var placeholder = getPlaceholder(language, k);87 88 var index = s.indexOf(placeholder);89 if (index > -1) {90 ++j;91 92 var before = s.substring(0, index);93 var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);94 var after = s.substring(index + placeholder.length);95 96 var replacement = [];97 if (before) {98 replacement.push.apply(replacement, walkTokens([before]));99 }100 replacement.push(middle);101 if (after) {102 replacement.push.apply(replacement, walkTokens([after]));103 }104 105 if (typeof token === 'string') {106 tokens.splice.apply(tokens, [i, 1].concat(replacement));107 } else {108 token.content = replacement;109 }110 }111 } else if (token.content /* && typeof token.content !== 'string' */) {112 walkTokens(token.content);113 }114 }115 116 return tokens;117 }118 119 walkTokens(env.tokens);120 }121 }122 });123 124}(Prism));125 