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
1import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'2import {match, charat, substr, strlen, sizeof, replace, combine, filter, assign} from './Utility.js'3import {copy, lift, tokenize} from './Tokenizer.js'4import {serialize} from './Serializer.js'5import {prefix} from './Prefixer.js'6 7/**8 * @param {function[]} collection9 * @return {function}10 */11export function middleware (collection) {12 var length = sizeof(collection)13 14 return function (element, index, children, callback) {15 var output = ''16 17 for (var i = 0; i < length; i++)18 output += collection[i](element, index, children, callback) || ''19 20 return output21 }22}23 24/**25 * @param {function} callback26 * @return {function}27 */28export function rulesheet (callback) {29 return function (element) {30 if (!element.root)31 if (element = element.return)32 callback(element)33 }34}35 36/**37 * @param {object} element38 * @param {number} index39 * @param {object[]} children40 * @param {function} callback41 */42export function prefixer (element, index, children, callback) {43 if (element.length > -1)44 if (!element.return)45 switch (element.type) {46 case DECLARATION: element.return = prefix(element.value, element.length, children)47 return48 case KEYFRAMES:49 return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)50 case RULESET:51 if (element.length)52 return combine(children = element.props, function (value) {53 switch (match(value, callback = /(::plac\w+|:read-\w+)/)) {54 // :read-(only|write)55 case ':read-only': case ':read-write':56 lift(copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]}))57 lift(copy(element, {props: [value]}))58 assign(element, {props: filter(children, callback)})59 break60 // :placeholder61 case '::placeholder':62 lift(copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}))63 lift(copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}))64 lift(copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]}))65 lift(copy(element, {props: [value]}))66 assign(element, {props: filter(children, callback)})67 break68 }69 70 return ''71 })72 }73}74 75/**76 * @param {object} element77 * @param {number} index78 * @param {object[]} children79 */80export function namespace (element) {81 switch (element.type) {82 case RULESET:83 element.props = element.props.map(function (value) {84 return combine(tokenize(value), function (value, index, children) {85 switch (charat(value, 0)) {86 // \f87 case 12:88 return substr(value, 1, strlen(value))89 // \0 ( + > ~90 case 0: case 40: case 43: case 62: case 126:91 return value92 // :93 case 58:94 if (children[++index] === 'global')95 children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1)96 // \s97 case 32:98 return index === 1 ? '' : value99 default:100 switch (index) {101 case 0: element = value102 return sizeof(children) > 1 ? '' : value103 case index = sizeof(children) - 1: case 2:104 return index === 2 ? value + element + element : value + element105 default:106 return value107 }108 }109 })110 })111 }112}113 