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 {defineFunctionBuilders} from "../defineFunction";2import {mathsym, makeOrd, makeSpan} from "../buildCommon";3import {MathNode, TextNode} from "../mathMLTree";4import ParseError from "../ParseError";5 6// A map of CSS-based spacing functions to their CSS class.7const cssSpace: Record<string, string> = {8 "\\nobreak": "nobreak",9 "\\allowbreak": "allowbreak",10};11 12// A lookup table to determine whether a spacing function/symbol should be13// treated like a regular space character. If a symbol or command is a key14// in this table, then it should be a regular space character. Furthermore,15// the associated value may have a `className` specifying an extra CSS class16// to add to the created `span`.17const regularSpace: Record<string, {className?: string}> = {18 " ": {},19 "\\ ": {},20 "~": {21 className: "nobreak",22 },23 "\\space": {},24 "\\nobreakspace": {25 className: "nobreak",26 },27};28 29// ParseNode<"spacing"> created in Parser.js from the "spacing" symbol Groups in30// src/symbols.js.31defineFunctionBuilders({32 type: "spacing",33 htmlBuilder(group, options) {34 if (regularSpace.hasOwnProperty(group.text)) {35 const className = regularSpace[group.text].className || "";36 // Spaces are generated by adding an actual space. Each of these37 // things has an entry in the symbols table, so these will be turned38 // into appropriate outputs.39 if (group.mode === "text") {40 const ord = makeOrd(group, options, "textord");41 ord.classes.push(className);42 return ord;43 } else {44 return makeSpan(["mspace", className],45 [mathsym(group.text, group.mode, options)],46 options);47 }48 } else if (cssSpace.hasOwnProperty(group.text)) {49 // Spaces based on just a CSS class.50 return makeSpan(51 ["mspace", cssSpace[group.text]],52 [], options);53 } else {54 throw new ParseError(`Unknown type of space "${group.text}"`);55 }56 },57 mathmlBuilder(group, options) {58 let node;59 60 if (regularSpace.hasOwnProperty(group.text)) {61 node = new MathNode(62 "mtext", [new TextNode("\u00a0")]);63 } else if (cssSpace.hasOwnProperty(group.text)) {64 // CSS-based MathML spaces (\nobreak, \allowbreak) are ignored65 return new MathNode("mspace");66 } else {67 throw new ParseError(`Unknown type of space "${group.text}"`);68 }69 70 return node;71 },72});73 