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 3/**4 * @tailwindcss/oxide postinstall script5 *6 * This script ensures that the correct binary for the current platform and7 * architecture is downloaded and available.8 */9 10const fs = require('fs')11const path = require('path')12const https = require('https')13const { extract } = require('tar')14const packageJson = require('../package.json')15const detectLibc = require('detect-libc')16 17const version = packageJson.version18 19function getPlatformPackageName() {20 let platform = process.platform21 let arch = process.arch22 23 let libc = ''24 if (platform === 'linux') {25 libc = detectLibc.isNonGlibcLinuxSync() ? 'musl' : 'gnu'26 }27 28 // Map to our package naming conventions29 switch (platform) {30 case 'darwin':31 return arch === 'arm64' ? '@tailwindcss/oxide-darwin-arm64' : '@tailwindcss/oxide-darwin-x64'32 case 'win32':33 if (arch === 'arm64') return '@tailwindcss/oxide-win32-arm64-msvc'34 if (arch === 'ia32') return '@tailwindcss/oxide-win32-ia32-msvc'35 return '@tailwindcss/oxide-win32-x64-msvc'36 case 'linux':37 if (arch === 'x64') {38 return libc === 'musl'39 ? '@tailwindcss/oxide-linux-x64-musl'40 : '@tailwindcss/oxide-linux-x64-gnu'41 } else if (arch === 'arm64') {42 return libc === 'musl'43 ? '@tailwindcss/oxide-linux-arm64-musl'44 : '@tailwindcss/oxide-linux-arm64-gnu'45 } else if (arch === 'arm') {46 return '@tailwindcss/oxide-linux-arm-gnueabihf'47 }48 break49 case 'freebsd':50 return '@tailwindcss/oxide-freebsd-x64'51 case 'android':52 return '@tailwindcss/oxide-android-arm64'53 default:54 return '@tailwindcss/oxide-wasm32-wasi'55 }56}57 58function isPackageAvailable(packageName) {59 try {60 require.resolve(packageName)61 return true62 } catch (e) {63 return false64 }65}66 67// Extract all files from a tarball to a destination directory68async function extractTarball(tarballStream, destDir) {69 if (!fs.existsSync(destDir)) {70 fs.mkdirSync(destDir, { recursive: true })71 }72 73 return new Promise((resolve, reject) => {74 tarballStream75 .pipe(extract({ cwd: destDir, strip: 1 }))76 .on('error', (err) => reject(err))77 .on('end', () => resolve())78 })79}80 81async function downloadAndExtractBinary(packageName) {82 let tarballUrl = `https://registry.npmjs.org/${packageName}/-/${packageName.replace('@tailwindcss/', '')}-${version}.tgz`83 console.log(`Downloading ${tarballUrl}...`)84 85 return new Promise((resolve) => {86 https87 .get(tarballUrl, (response) => {88 if (response.statusCode === 302 || response.statusCode === 301) {89 // Handle redirects90 https.get(response.headers.location, handleResponse).on('error', (err) => {91 console.error('Download error:', err)92 resolve()93 })94 return95 }96 97 handleResponse(response)98 99 async function handleResponse(response) {100 try {101 if (response.statusCode !== 200) {102 throw new Error(`Download failed with status code: ${response.statusCode}`)103 }104 105 await extractTarball(106 response,107 path.join(__dirname, '..', 'node_modules', ...packageName.split('/')),108 )109 console.log(`Successfully downloaded and installed ${packageName}`)110 } catch (error) {111 console.error('Error during extraction:', error)112 resolve()113 } finally {114 resolve()115 }116 }117 })118 .on('error', (err) => {119 console.error('Download error:', err)120 resolve()121 })122 })123}124 125async function main() {126 // Don't run this script in the package source127 try {128 if (fs.existsSync(path.join(__dirname, '..', 'build.rs'))) {129 return130 }131 132 let packageName = getPlatformPackageName()133 if (!packageName) return134 if (isPackageAvailable(packageName)) return135 136 await downloadAndExtractBinary(packageName)137 } catch (error) {138 console.error(error)139 return140 }141}142 143main()144 