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'use strict';2 3// See http://www.robvanderwoude.com/escapechars.php4const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;5 6function escapeCommand(arg) {7 // Escape meta chars8 arg = arg.replace(metaCharsRegExp, '^$1');9 10 return arg;11}12 13function escapeArgument(arg, doubleEscapeMetaChars) {14 // Convert to string15 arg = `${arg}`;16 17 // Algorithm below is based on https://qntm.org/cmd18 // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input19 // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information20 21 // Sequence of backslashes followed by a double quote:22 // double up all the backslashes and escape the double quote23 arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');24 25 // Sequence of backslashes followed by the end of the string26 // (which will become a double quote later):27 // double up all the backslashes28 arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');29 30 // All other backslashes occur literally31 32 // Quote the whole thing:33 arg = `"${arg}"`;34 35 // Escape meta chars36 arg = arg.replace(metaCharsRegExp, '^$1');37 38 // Double escape meta chars if necessary39 if (doubleEscapeMetaChars) {40 arg = arg.replace(metaCharsRegExp, '^$1');41 }42 43 return arg;44}45 46module.exports.command = escapeCommand;47module.exports.argument = escapeArgument;48 