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 defineFunction, {ordargument} from "../defineFunction";2import {makeAnchor} from "../buildCommon";3import {assertNodeType} from "../parseNode";4import {MathNode} from "../mathMLTree";5 6import * as html from "../buildHTML";7import * as mml from "../buildMathML";8import type {ParseNode} from "../parseNode";9 10defineFunction({11 type: "href",12 names: ["\\href"],13 props: {14 numArgs: 2,15 argTypes: ["url", "original"],16 allowedInText: true,17 },18 handler: ({parser}, args) => {19 const body = args[1];20 const href = assertNodeType(args[0], "url").url;21 22 if (!parser.settings.isTrusted({23 command: "\\href",24 url: href,25 })) {26 return parser.formatUnsupportedCmd("\\href");27 }28 29 return {30 type: "href",31 mode: parser.mode,32 href,33 body: ordargument(body),34 };35 },36 htmlBuilder: (group, options) => {37 const elements = html.buildExpression(group.body, options, false);38 return makeAnchor(group.href, [], elements, options);39 },40 mathmlBuilder: (group, options) => {41 let math = mml.buildExpressionRow(group.body, options);42 if (!(math instanceof MathNode)) {43 math = new MathNode("mrow", [math]);44 }45 (math as MathNode).setAttribute("href", group.href);46 return math;47 },48});49 50defineFunction({51 type: "href",52 names: ["\\url"],53 props: {54 numArgs: 1,55 argTypes: ["url"],56 allowedInText: true,57 },58 handler: ({parser}, args) => {59 const href = assertNodeType(args[0], "url").url;60 61 if (!parser.settings.isTrusted({62 command: "\\url",63 url: href,64 })) {65 return parser.formatUnsupportedCmd("\\url");66 }67 68 const chars: ParseNode<"textord">[] = [];69 for (let i = 0; i < href.length; i++) {70 let c = href[i];71 if (c === "~") {72 c = "\\textasciitilde";73 }74 chars.push({75 type: "textord",76 mode: "text",77 text: c,78 });79 }80 const body: ParseNode<"text"> = {81 type: "text",82 mode: parser.mode,83 font: "\\texttt",84 body: chars,85 };86 return {87 type: "href",88 mode: parser.mode,89 href,90 body: ordargument(body),91 };92 },93});94 