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/**2 * @import {HtmlOptions as Options} from 'micromark-extension-math'3 * @import {HtmlExtension} from 'micromark-util-types'4 */5 6import katex from 'katex';7const renderToString = katex.renderToString;8 9/**10 * Create an extension for `micromark` to support math when serializing to11 * HTML.12 *13 * > 👉 **Note**: this uses KaTeX to render math.14 *15 * @param {Options | null | undefined} [options={}]16 * Configuration (default: `{}`).17 * @returns {HtmlExtension}18 * Extension for `micromark` that can be passed in `htmlExtensions`, to19 * support math when serializing to HTML.20 */21export function mathHtml(options) {22 return {23 enter: {24 mathFlow() {25 this.lineEndingIfNeeded();26 this.tag('<div class="math math-display">');27 },28 mathFlowFenceMeta() {29 this.buffer();30 },31 mathText() {32 // Double?33 this.tag('<span class="math math-inline">');34 this.buffer();35 }36 },37 exit: {38 mathFlow() {39 const value = this.resume();40 this.tag(math(value.replace(/(?:\r?\n|\r)$/, ''), true));41 this.tag('</div>');42 this.setData('mathFlowOpen');43 this.setData('slurpOneLineEnding');44 },45 mathFlowFence() {46 // After the first fence.47 if (!this.getData('mathFlowOpen')) {48 this.setData('mathFlowOpen', true);49 this.setData('slurpOneLineEnding', true);50 this.buffer();51 }52 },53 mathFlowFenceMeta() {54 this.resume();55 },56 mathFlowValue(token) {57 this.raw(this.sliceSerialize(token));58 },59 mathText() {60 const value = this.resume();61 this.tag(math(value, false));62 this.tag('</span>');63 },64 mathTextData(token) {65 this.raw(this.sliceSerialize(token));66 }67 }68 };69 70 /**71 * @param {string} value72 * Math text.73 * @param {boolean} displayMode74 * Whether the math is in display mode.75 * @returns {string}76 * HTML.77 */78 function math(value, displayMode) {79 return renderToString(value, {80 ...options,81 displayMode82 });83 }84}