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// TODO(kevinb): implement \\sl and \\sc2 3import {binrelClass} from "./mclass";4import defineFunction, {normalizeArgument} from "../defineFunction";5import {isCharacterBox} from "../utils";6 7import * as html from "../buildHTML";8import * as mml from "../buildMathML";9 10import type Options from "../Options";11import type {ParseNode} from "../parseNode";12import type {Slice1} from "../types";13 14const htmlBuilder = (group: ParseNode<"font">, options: Options) => {15 const font = group.font;16 const newOptions = options.withFont(font);17 return html.buildGroup(group.body, newOptions);18};19 20const mathmlBuilder = (group: ParseNode<"font">, options: Options) => {21 const font = group.font;22 const newOptions = options.withFont(font);23 return mml.buildGroup(group.body, newOptions);24};25 26const fontAliases = {27 "\\Bbb": "\\mathbb",28 "\\bold": "\\mathbf",29 "\\frak": "\\mathfrak",30} as const;31 32type OldFontCommands = "\\rm" | "\\sf" | "\\tt" | "\\bf" | "\\it" | "\\cal";33type FontCommands =34 "\\mathrm" | "\\mathit" | "\\mathbf" | "\\mathnormal" | "\\mathsfit" |35 "\\mathbb" | "\\mathcal" | "\\mathfrak" | "\\mathscr" | "\\mathsf" |36 "\\mathtt";37 38defineFunction({39 type: "font",40 names: [41 // styles, except \boldsymbol defined below42 "\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", "\\mathsfit",43 44 // families45 "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf",46 "\\mathtt",47 48 // aliases, except \bm defined below49 "\\Bbb", "\\bold", "\\frak",50 ] satisfies (FontCommands | keyof typeof fontAliases)[],51 props: {52 numArgs: 1,53 allowedInArgument: true,54 },55 handler: ({parser, funcName}, args) => {56 const body = normalizeArgument(args[0]);57 let func = funcName;58 if (func in fontAliases) {59 func = fontAliases[func as keyof typeof fontAliases];60 }61 return {62 type: "font",63 mode: parser.mode,64 font: func.slice(1) as Slice1<FontCommands>,65 body,66 };67 },68 htmlBuilder,69 mathmlBuilder,70});71 72defineFunction({73 type: "mclass",74 names: ["\\boldsymbol", "\\bm"],75 props: {76 numArgs: 1,77 },78 handler: ({parser}, args) => {79 const body = args[0];80 // amsbsy.sty's \boldsymbol uses \binrel spacing to inherit the81 // argument's bin|rel|ord status82 return {83 type: "mclass",84 mode: parser.mode,85 mclass: binrelClass(body),86 body: [87 {88 type: "font",89 mode: parser.mode,90 font: "boldsymbol",91 body,92 },93 ],94 isCharacterBox: isCharacterBox(body),95 };96 },97});98 99// Old font changing functions100defineFunction({101 type: "font",102 names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],103 props: {104 numArgs: 0,105 allowedInText: true,106 },107 handler: ({parser, funcName, breakOnTokenText}, args) => {108 const {mode} = parser;109 const body = parser.parseExpression(true, breakOnTokenText);110 111 return {112 type: "font",113 mode: mode,114 font: `math${funcName.slice(1) as Slice1<OldFontCommands>}`,115 body: {116 type: "ordgroup",117 mode: parser.mode,118 body,119 },120 };121 },122 htmlBuilder,123 mathmlBuilder,124});125 