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
1const { existsSync } = require('node:fs');2const path = require('node:path');3const { platform, arch, report } = require('node:process');4const { spawnSync } = require('node:child_process');5 6const getReportHeader = () => {7 try {8 if (platform !== 'win32') {9 // Avoid blocking reverse DNS (PTR) lookups on open TCP socket handles.10 // See: https://github.com/nodejs/node/issues/5557611 const previousExcludeNetwork = report.excludeNetwork;12 report.excludeNetwork = true;13 const header = report.getReport().header;14 report.excludeNetwork = previousExcludeNetwork;15 return header;16 }17 18 // This is needed because report.getReport() crashes the process on Windows sometimes.19 const script =20 "const r=require('node:process').report;r.excludeNetwork=true;console.log(JSON.stringify(r.getReport().header));";21 const child = spawnSync(process.execPath, ['-p', script], {22 encoding: 'utf8',23 timeout: 3000,24 windowsHide: true25 });26 27 if (child.status !== 0) {28 return null;29 }30 31 // The output from node -p might include a trailing 'undefined' and newline32 const stdout = child.stdout?.replace(/undefined\r?\n?$/, '').trim();33 if (!stdout) {34 return null;35 }36 37 return JSON.parse(stdout);38 } catch {39 return null;40 }41};42 43let reportHeader;44const isMingw32 = () => {45 reportHeader ??= getReportHeader();46 47 return reportHeader?.osName?.startsWith('MINGW32_NT') ?? false;48};49 50const isMusl = () => {51 reportHeader ??= getReportHeader();52 53 return reportHeader ? !reportHeader.glibcVersionRuntime : false;54};55 56const bindingsByPlatformAndArch = {57 android: {58 arm: { base: 'android-arm-eabi' },59 arm64: { base: 'android-arm64' }60 },61 darwin: {62 arm64: { base: 'darwin-arm64' },63 x64: { base: 'darwin-x64' }64 },65 freebsd: {66 arm64: { base: 'freebsd-arm64' },67 x64: { base: 'freebsd-x64' }68 },69 linux: {70 arm: { base: 'linux-arm-gnueabihf', musl: 'linux-arm-musleabihf' },71 arm64: { base: 'linux-arm64-gnu', musl: 'linux-arm64-musl' },72 loong64: { base: 'linux-loong64-gnu', musl: 'linux-loong64-musl' },73 ppc64: { base: 'linux-ppc64-gnu', musl: 'linux-ppc64-musl' },74 riscv64: { base: 'linux-riscv64-gnu', musl: 'linux-riscv64-musl' },75 s390x: { base: 'linux-s390x-gnu', musl: null },76 x64: { base: 'linux-x64-gnu', musl: 'linux-x64-musl' }77 },78 openbsd: {79 x64: { base: 'openbsd-x64' }80 },81 openharmony: {82 arm64: { base: 'openharmony-arm64' }83 },84 win32: {85 arm64: { base: 'win32-arm64-msvc' },86 ia32: { base: 'win32-ia32-msvc' },87 x64: {88 base: isMingw32() ? 'win32-x64-gnu' : 'win32-x64-msvc'89 }90 }91};92 93const msvcLinkFilenameByArch = {94 arm64: 'vc_redist.arm64.exe',95 ia32: 'vc_redist.x86.exe',96 x64: 'vc_redist.x64.exe'97};98 99const packageBase = getPackageBase();100const localName = `./rollup.${packageBase}.node`;101const requireWithFriendlyError = id => {102 try {103 return require(id);104 } catch (error) {105 if (106 platform === 'win32' &&107 error instanceof Error &&108 error.code === 'ERR_DLOPEN_FAILED' &&109 error.message.includes('The specified module could not be found')110 ) {111 const msvcDownloadLink = `https://aka.ms/vs/17/release/${msvcLinkFilenameByArch[arch]}`;112 throw new Error(113 `Failed to load module ${id}. ` +114 'Required DLL was not found. ' +115 'This error usually happens when Microsoft Visual C++ Redistributable is not installed. ' +116 `You can download it from ${msvcDownloadLink}`,117 { cause: error }118 );119 }120 121 throw new Error(122 `Cannot find module ${id}. ` +123 `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +124 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',125 { cause: error }126 );127 }128};129 130const { parse, parseAsync, xxhashBase64Url, xxhashBase36, xxhashBase16 } = requireWithFriendlyError(131 existsSync(path.join(__dirname, localName)) ? localName : `@rollup/rollup-${packageBase}`132);133 134function getPackageBase() {135 const imported = bindingsByPlatformAndArch[platform]?.[arch];136 if (!imported) {137 throwUnsupportedError(false);138 }139 if ('musl' in imported && isMusl()) {140 return imported.musl || throwUnsupportedError(true);141 }142 return imported.base;143}144 145function throwUnsupportedError(isMusl) {146 throw new Error(147 `Your current platform "${platform}${isMusl ? ' (musl)' : ''}" and architecture "${arch}" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.148 149The following platform-architecture combinations are supported:150${Object.entries(bindingsByPlatformAndArch)151 .flatMap(([platformName, architectures]) =>152 Object.entries(architectures).flatMap(([architectureName, { musl }]) => {153 const name = `${platformName}-${architectureName}`;154 return musl ? [name, `${name} (musl)`] : [name];155 })156 )157 .join('\n')}158 159If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.`160 );161}162 163module.exports.parse = parse;164module.exports.parseAsync = parseAsync;165module.exports.xxhashBase64Url = xxhashBase64Url;166module.exports.xxhashBase36 = xxhashBase36;167module.exports.xxhashBase16 = xxhashBase16;168 