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 {makeSpan} from "../buildCommon";2import defineFunction from "../defineFunction";3import {MathNode} from "../mathMLTree";4import {assertNodeType} from "../parseNode";5import {calculateSize, makeEm} from "../units";6 7defineFunction({8 type: "rule",9 names: ["\\rule"],10 props: {11 numArgs: 2,12 numOptionalArgs: 1,13 allowedInText: true,14 allowedInMath: true,15 argTypes: ["size", "size", "size"],16 },17 handler({parser}, args, optArgs) {18 const shift = optArgs[0];19 const width = assertNodeType(args[0], "size");20 const height = assertNodeType(args[1], "size");21 return {22 type: "rule",23 mode: parser.mode,24 shift: shift && assertNodeType(shift, "size").value,25 width: width.value,26 height: height.value,27 };28 },29 htmlBuilder(group, options) {30 // Make an empty span for the rule31 const rule = makeSpan(["mord", "rule"], [], options);32 33 // Calculate the shift, width, and height of the rule, and account for units34 const width = calculateSize(group.width, options);35 const height = calculateSize(group.height, options);36 const shift = (group.shift) ? calculateSize(group.shift, options) : 0;37 38 // Style the rule to the right size39 rule.style.borderRightWidth = makeEm(width);40 rule.style.borderTopWidth = makeEm(height);41 rule.style.bottom = makeEm(shift);42 43 // Record the height and width44 rule.width = width;45 rule.height = height + shift;46 rule.depth = -shift;47 // Font size is the number large enough that the browser will48 // reserve at least `absHeight` space above the baseline.49 // The 1.125 factor was empirically determined50 rule.maxFontSize = height * 1.125 * options.sizeMultiplier;51 52 return rule;53 },54 mathmlBuilder(group, options) {55 const width = calculateSize(group.width, options);56 const height = calculateSize(group.height, options);57 const shift = (group.shift) ? calculateSize(group.shift, options) : 0;58 const color = options.color && options.getColor() || "black";59 60 const rule = new MathNode("mspace");61 rule.setAttribute("mathbackground", color);62 rule.setAttribute("width", makeEm(width));63 rule.setAttribute("height", makeEm(height));64 65 const wrapper = new MathNode("mpadded", [rule]);66 if (shift >= 0) {67 wrapper.setAttribute("height", makeEm(shift));68 } else {69 wrapper.setAttribute("height", makeEm(shift));70 wrapper.setAttribute("depth", makeEm(-shift));71 }72 wrapper.setAttribute("voffset", makeEm(shift));73 74 return wrapper;75 },76});77 