Team Ai
Datasetpublic

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.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
glob346 linesDownload Raw Back to .bin
1#!/usr/bin/env node2import { foregroundChild } from 'foreground-child';3import { existsSync } from 'fs';4import { jack } from 'jackspeak';5import { loadPackageJson } from 'package-json-from-dist';6import { basename, join } from 'path';7import { globStream } from './index.js';8const { version } = loadPackageJson(import.meta.url, '../package.json');9const j = jack({10    usage: 'glob [options] [<pattern> [<pattern> ...]]',11})12    .description(`13    Glob v${version}14 15    Expand the positional glob expression arguments into any matching file16    system paths found.17  `)18    .opt({19    cmd: {20        short: 'c',21        hint: 'command',22        description: `Run the command provided, passing the glob expression23                    matches as arguments.`,24    },25})26    .opt({27    default: {28        short: 'p',29        hint: 'pattern',30        description: `If no positional arguments are provided, glob will use31                    this pattern`,32    },33})34    .flag({35    shell: {36        default: false,37        description: `Interpret the command as a shell command by passing it38                    to the shell, with all matched filesystem paths appended,39                    **even if this cannot be done safely**.40 41                    This is **not** unsafe (and usually unnecessary) when using42                    the known Unix shells sh, bash, zsh, and fish, as these can43                    all be executed in such a way as to pass positional44                    arguments safely.45 46                    **Note**: THIS IS UNSAFE IF THE FILE PATHS ARE UNTRUSTED,47                    because a path like \`'some/path/\\$\\(cmd)'\` will be48                    executed by the shell.49 50                    If you do have positional arguments that you wish to pass to51                    the command ahead of the glob pattern matches, use the52                    \`--cmd-arg\`/\`-g\` option instead.53 54                    The next major release of glob will fully remove the ability55                    to use this option unsafely.`,56    },57})58    .optList({59    'cmd-arg': {60        short: 'g',61        hint: 'arg',62        default: [],63        description: `Pass the provided values to the supplied command, ahead of64                    the glob matches.65 66                    For example, the command:67 68                        glob -c echo -g"hello" -g"world" *.txt69 70                    might output:71 72                        hello world a.txt b.txt73 74                    This is a safer (and future-proof) alternative than putting75                    positional arguments in the \`-c\`/\`--cmd\` option.`,76    },77})78    .flag({79    all: {80        short: 'A',81        description: `By default, the glob cli command will not expand any82                    arguments that are an exact match to a file on disk.83 84                    This prevents double-expanding, in case the shell expands85                    an argument whose filename is a glob expression.86 87                    For example, if 'app/*.ts' would match 'app/[id].ts', then88                    on Windows powershell or cmd.exe, 'glob app/*.ts' will89                    expand to 'app/[id].ts', as expected. However, in posix90                    shells such as bash or zsh, the shell will first expand91                    'app/*.ts' to a list of filenames. Then glob will look92                    for a file matching 'app/[id].ts' (ie, 'app/i.ts' or93                    'app/d.ts'), which is unexpected.94 95                    Setting '--all' prevents this behavior, causing glob96                    to treat ALL patterns as glob expressions to be expanded,97                    even if they are an exact match to a file on disk.98 99                    When setting this option, be sure to enquote arguments100                    so that the shell will not expand them prior to passing101                    them to the glob command process.102      `,103    },104    absolute: {105        short: 'a',106        description: 'Expand to absolute paths',107    },108    'dot-relative': {109        short: 'd',110        description: `Prepend './' on relative matches`,111    },112    mark: {113        short: 'm',114        description: `Append a / on any directories matched`,115    },116    posix: {117        short: 'x',118        description: `Always resolve to posix style paths, using '/' as the119                    directory separator, even on Windows. Drive letter120                    absolute matches on Windows will be expanded to their121                    full resolved UNC paths, eg instead of 'C:\\foo\\bar',122                    it will expand to '//?/C:/foo/bar'.123      `,124    },125    follow: {126        short: 'f',127        description: `Follow symlinked directories when expanding '**'`,128    },129    realpath: {130        short: 'R',131        description: `Call 'fs.realpath' on all of the results. In the case132                    of an entry that cannot be resolved, the entry is133                    omitted. This incurs a slight performance penalty, of134                    course, because of the added system calls.`,135    },136    stat: {137        short: 's',138        description: `Call 'fs.lstat' on all entries, whether required or not139                    to determine if it's a valid match.`,140    },141    'match-base': {142        short: 'b',143        description: `Perform a basename-only match if the pattern does not144                    contain any slash characters. That is, '*.js' would be145                    treated as equivalent to '**/*.js', matching js files146                    in all directories.147      `,148    },149    dot: {150        description: `Allow patterns to match files/directories that start151                    with '.', even if the pattern does not start with '.'152      `,153    },154    nobrace: {155        description: 'Do not expand {...} patterns',156    },157    nocase: {158        description: `Perform a case-insensitive match. This defaults to159                    'true' on macOS and Windows platforms, and false on160                    all others.161 162                    Note: 'nocase' should only be explicitly set when it is163                    known that the filesystem's case sensitivity differs164                    from the platform default. If set 'true' on165                    case-insensitive file systems, then the walk may return166                    more or less results than expected.167      `,168    },169    nodir: {170        description: `Do not match directories, only files.171 172                    Note: to *only* match directories, append a '/' at the173                    end of the pattern.174      `,175    },176    noext: {177        description: `Do not expand extglob patterns, such as '+(a|b)'`,178    },179    noglobstar: {180        description: `Do not expand '**' against multiple path portions.181                    Ie, treat it as a normal '*' instead.`,182    },183    'windows-path-no-escape': {184        description: `Use '\\' as a path separator *only*, and *never* as an185                    escape character. If set, all '\\' characters are186                    replaced with '/' in the pattern.`,187    },188})189    .num({190    'max-depth': {191        short: 'D',192        description: `Maximum depth to traverse from the current193                    working directory`,194    },195})196    .opt({197    cwd: {198        short: 'C',199        description: 'Current working directory to execute/match in',200        default: process.cwd(),201    },202    root: {203        short: 'r',204        description: `A string path resolved against the 'cwd', which is205                    used as the starting point for absolute patterns that206                    start with '/' (but not drive letters or UNC paths207                    on Windows).208 209                    Note that this *doesn't* necessarily limit the walk to210                    the 'root' directory, and doesn't affect the cwd211                    starting point for non-absolute patterns. A pattern212                    containing '..' will still be able to traverse out of213                    the root directory, if it is not an actual root directory214                    on the filesystem, and any non-absolute patterns will215                    still be matched in the 'cwd'.216 217                    To start absolute and non-absolute patterns in the same218                    path, you can use '--root=' to set it to the empty219                    string. However, be aware that on Windows systems, a220                    pattern like 'x:/*' or '//host/share/*' will *always*221                    start in the 'x:/' or '//host/share/' directory,222                    regardless of the --root setting.223      `,224    },225    platform: {226        description: `Defaults to the value of 'process.platform' if227                    available, or 'linux' if not. Setting --platform=win32228                    on non-Windows systems may cause strange behavior!`,229        validOptions: [230            'aix',231            'android',232            'darwin',233            'freebsd',234            'haiku',235            'linux',236            'openbsd',237            'sunos',238            'win32',239            'cygwin',240            'netbsd',241        ],242    },243})244    .optList({245    ignore: {246        short: 'i',247        description: `Glob patterns to ignore`,248    },249})250    .flag({251    debug: {252        short: 'v',253        description: `Output a huge amount of noisy debug information about254                    patterns as they are parsed and used to match files.`,255    },256    version: {257        short: 'V',258        description: `Output the version (${version})`,259    },260    help: {261        short: 'h',262        description: 'Show this usage information',263    },264});265try {266    const { positionals, values } = j.parse();267    const { cmd, shell, all, default: def, version: showVersion, help, absolute, cwd, dot, 'dot-relative': dotRelative, follow, ignore, 'match-base': matchBase, 'max-depth': maxDepth, mark, nobrace, nocase, nodir, noext, noglobstar, platform, realpath, root, stat, debug, posix, 'cmd-arg': cmdArg, } = values;268    if (showVersion) {269        console.log(version);270        process.exit(0);271    }272    if (help) {273        console.log(j.usage());274        process.exit(0);275    }276    //const { shell, help } = values277    if (positionals.length === 0 && !def)278        throw 'No patterns provided';279    if (positionals.length === 0 && def)280        positionals.push(def);281    const patterns = all ? positionals : positionals.filter(p => !existsSync(p));282    const matches = all ? [] : positionals.filter(p => existsSync(p)).map(p => join(p));283    const stream = globStream(patterns, {284        absolute,285        cwd,286        dot,287        dotRelative,288        follow,289        ignore,290        mark,291        matchBase,292        maxDepth,293        nobrace,294        nocase,295        nodir,296        noext,297        noglobstar,298        platform: platform,299        realpath,300        root,301        stat,302        debug,303        posix,304    });305    if (!cmd) {306        matches.forEach(m => console.log(m));307        stream.on('data', f => console.log(f));308    }309    else {310        cmdArg.push(...matches);311        stream.on('data', f => cmdArg.push(f));312        // Attempt to support commands that contain spaces and otherwise require313        // shell interpretation, but do NOT shell-interpret the arguments, to avoid314        // injections via filenames. This affordance can only be done on known Unix315        // shells, unfortunately.316        //317        // 'bash', ['-c', cmd + ' "$@"', 'bash', ...matches]318        // 'zsh', ['-c', cmd + ' "$@"', 'zsh', ...matches]319        // 'fish', ['-c', cmd + ' "$argv"', ...matches]320        const { SHELL = 'unknown' } = process.env;321        const shellBase = basename(SHELL);322        const knownShells = ['sh', 'ksh', 'zsh', 'bash', 'fish'];323        if ((shell || /[ "']/.test(cmd)) &&324            knownShells.includes(shellBase)) {325            const cmdWithArgs = `${cmd} "\$${shellBase === 'fish' ? 'argv' : '@'}"`;326            if (shellBase !== 'fish') {327                cmdArg.unshift(SHELL);328            }329            cmdArg.unshift('-c', cmdWithArgs);330            stream.on('end', () => foregroundChild(SHELL, cmdArg));331        }332        else {333            if (shell) {334                process.emitWarning('The --shell option is unsafe, and will be removed. To pass ' +335                    'positional arguments to the subprocess, use -g/--cmd-arg instead.', 'DeprecationWarning', 'GLOB_SHELL');336            }337            stream.on('end', () => foregroundChild(cmd, cmdArg, { shell }));338        }339    }340}341catch (e) {342    console.error(j.usage());343    console.error(e instanceof Error ? e.message : String(e));344    process.exit(1);345}346//# sourceMappingURL=bin.mjs.map
Brunobkr/llama.cpp_AlgMor24_github · Team Ai