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#!/usr/bin/env node2// Simple CLI for KaTeX.3// Reads TeX from stdin, outputs HTML to stdout.4// To run this from the repository, you must first build KaTeX by running5// `yarn` and `yarn build`.6 7/* eslint no-console:0 */8 9let katex;10try {11 katex = require("./");12} catch (e) {13 console.error(14 "KaTeX could not import, likely because dist/katex.js is missing.");15 console.error("Please run 'yarn' and 'yarn build' before running");16 console.error("cli.js from the KaTeX repository.");17 console.error();18 throw e;19}20const {version} = require("./package.json");21const fs = require("fs");22 23const {program} = require("commander");24program.version(version);25 26for (const prop in katex.SETTINGS_SCHEMA) {27 if (katex.SETTINGS_SCHEMA.hasOwnProperty(prop)) {28 const opt = katex.SETTINGS_SCHEMA[prop];29 if (opt.cli !== false) {30 program.option(opt.cli || "--" + prop, opt.cliDescription ||31 opt.description, opt.cliProcessor, opt.cliDefault);32 }33 }34}35program.option("-f, --macro-file <path>",36 "Read macro definitions, one per line, from the given file.")37 .option("-i, --input <path>", "Read LaTeX input from the given file.")38 .option("-o, --output <path>", "Write html output to the given file.");39 40let options;41 42function readMacros() {43 if (options.macroFile) {44 fs.readFile(options.macroFile, "utf-8", function(err, data) {45 if (err) {throw err;}46 splitMacros(data.toString().split('\n'));47 });48 } else {49 splitMacros([]);50 }51}52 53function splitMacros(macroStrings) {54 // Override macros from macro file (if any)55 // with macros from command line (if any)56 macroStrings = macroStrings.concat(options.macro);57 58 const macros = {};59 60 for (const m of macroStrings) {61 const i = m.search(":");62 if (i !== -1) {63 macros[m.substring(0, i).trim()] = m.substring(i + 1).trim();64 }65 }66 67 options.macros = macros;68 readInput();69}70 71function readInput() {72 let input = "";73 74 if (options.input) {75 fs.readFile(options.input, "utf-8", function(err, data) {76 if (err) {throw err;}77 input = data.toString();78 writeOutput(input);79 });80 } else {81 process.stdin.on("data", function(chunk) {82 input += chunk.toString();83 });84 85 process.stdin.on("end", function() {86 writeOutput(input);87 });88 }89}90 91function writeOutput(input) {92 // --format specifies the KaTeX output93 const outputFile = options.output;94 options.output = options.format;95 96 const output = katex.renderToString(input, options) + "\n";97 98 if (outputFile) {99 fs.writeFile(outputFile, output, function(err) {100 if (err) {101 return console.log(err);102 }103 });104 } else {105 console.log(output);106 }107}108 109if (require.main !== module) {110 module.exports = program;111} else {112 options = program.parse(process.argv).opts();113 readMacros();114}115 