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
utility.cjs302 linesDownload Raw Back to dist
1/*!2  Copyright 2013 Lovell Fuller and others.3  SPDX-License-Identifier: Apache-2.04*/5 6const events = require('node:events');7 8const { availableParallelism } = require("node:os");9const detectLibc = require('detect-libc');10 11const is = require('./is.cjs');12const libvips = require('./libvips.cjs');13const sharp = require('./sharp.cjs');14const pkg = require("../package.json");15 16 17const runtimePlatform = libvips.runtimePlatformArch();18const libvipsVersion = sharp.libvipsVersion();19 20/**21 * An Object containing nested boolean values representing the available input and output formats/methods.22 * @member23 * @example24 * console.log(sharp.format);25 * @returns {Object}26 */27const format = sharp.format();28format.heif.output.alias = ['avif', 'heic'];29format.jpeg.output.alias = ['jpe', 'jpg'];30format.tiff.output.alias = ['tif'];31format.jp2.output.alias = ['j2c', 'j2k', 'jp2', 'jpx'];32 33/**34 * An Object containing the available interpolators and their proper values35 * @readonly36 * @enum {string}37 */38const interpolators = {39  /** [Nearest neighbour interpolation](http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation). Suitable for image enlargement only. */40  nearest: 'nearest',41  /** [Bilinear interpolation](http://en.wikipedia.org/wiki/Bilinear_interpolation). Faster than bicubic but with less smooth results. */42  bilinear: 'bilinear',43  /** [Bicubic interpolation](http://en.wikipedia.org/wiki/Bicubic_interpolation) (the default). */44  bicubic: 'bicubic',45  /** [LBB interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/lbb.cpp#L100). Prevents some "[acutance](http://en.wikipedia.org/wiki/Acutance)" but typically reduces performance by a factor of 2. */46  locallyBoundedBicubic: 'lbb',47  /** [Nohalo interpolation](http://eprints.soton.ac.uk/268086/). Prevents acutance but typically reduces performance by a factor of 3. */48  nohalo: 'nohalo',49  /** [VSQBS interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/vsqbs.cpp#L48). Prevents "staircasing" when enlarging. */50  vertexSplitQuadraticBasisSpline: 'vsqbs'51};52 53/**54 * An Object containing the version numbers of sharp, libvips55 * and (when using prebuilt binaries) its dependencies.56 *57 * @member58 * @example59 * console.log(sharp.versions);60 */61let versions = {62  vips: libvipsVersion.semver63};64/* node:coverage ignore next 15 */65if (!libvipsVersion.isGlobal) {66  if (!libvipsVersion.isWasm) {67    try {68      versions = require(`@img/sharp-${runtimePlatform}/versions`);69    } catch (_) {70      try {71        versions = require(`@img/sharp-libvips-${runtimePlatform}/versions`);72      } catch (_) {}73    }74  } else {75    try {76      versions = require('@img/sharp-wasm32/versions');77    } catch (_) {}78  }79}80versions.sharp = pkg.version;81 82/* node:coverage ignore next 5 */83if (versions.heif && format.heif) {84  // Prebuilt binaries provide AV185  format.heif.input.fileSuffix = ['.avif'];86  format.heif.output.alias = ['avif'];87}88 89/**90 * Gets or, when options are provided, sets the limits of _libvips'_ operation cache.91 * Existing entries in the cache will be trimmed after any change in limits.92 * This method always returns cache statistics,93 * useful for determining how much working memory is required for a particular task.94 *95 * @example96 * const stats = sharp.cache();97 * @example98 * sharp.cache( { items: 200 } );99 * sharp.cache( { files: 0 } );100 * sharp.cache(false);101 *102 * @param {Object|boolean} [options=true] - Object with the following attributes, or boolean where true uses default cache settings and false removes all caching103 * @param {number} [options.memory=50] - is the maximum memory in MB to use for this cache104 * @param {number} [options.files=20] - is the maximum number of files to hold open105 * @param {number} [options.items=100] - is the maximum number of operations to cache106 * @returns {Object}107 */108function cache (options) {109  if (is.bool(options)) {110    if (options) {111      // Default cache settings of 50MB, 20 files, 100 items112      return sharp.cache(50, 20, 100);113    } else {114      return sharp.cache(0, 0, 0);115    }116  } else if (is.object(options)) {117    for (const property of ['memory', 'files', 'items']) {118      const value = options[property];119      if (is.defined(value) && !(is.integer(value) && value >= 0)) {120        throw is.invalidParameterError(property, 'a positive integer', value);121      }122    }123    return sharp.cache(options.memory, options.files, options.items);124  } else {125    return sharp.cache();126  }127}128cache(true);129 130/**131 * Gets or, when a concurrency is provided, sets132 * the maximum number of threads _libvips_ should use to process _each image_.133 * These are from a thread pool managed by glib,134 * which helps avoid the overhead of creating new threads.135 *136 * This method always returns the current concurrency.137 *138 * The default value is the number of CPU cores,139 * except when using glibc-based Linux without jemalloc,140 * where the default is `1` to help reduce memory fragmentation.141 *142 * A value of `0` will reset this to the number of CPU cores.143 *144 * Some image format libraries spawn additional threads,145 * e.g. libaom manages its own 4 threads when encoding AVIF images,146 * and these are independent of the value set here.147 *148 * :::note149 * Further {@link /performance/ control over performance} is available.150 * :::151 *152 * @example153 * const threads = sharp.concurrency(); // 4154 * sharp.concurrency(2); // 2155 * sharp.concurrency(0); // 4156 *157 * @param {number} [concurrency]158 * @returns {number} concurrency159 */160function concurrency (concurrency) {161  return sharp.concurrency(is.integer(concurrency) ? concurrency : null);162}163/* node:coverage ignore next 7 */164if (!process.env.MALLOC_ARENA_MAX && detectLibc.familySync() === detectLibc.GLIBC && !sharp._isUsingJemalloc()) {165  // Reduce default concurrency to 1 when using glibc memory allocator166  sharp.concurrency(1);167} else if (detectLibc.familySync() === detectLibc.MUSL && sharp.concurrency() === 1024) {168  // Reduce default concurrency when musl thread over-subscription detected169  sharp.concurrency(availableParallelism());170}171 172/**173 * An EventEmitter that emits a `change` event when a task is either:174 * - queued, waiting for _libuv_ to provide a worker thread175 * - complete176 * @member177 * @example178 * sharp.queue.on('change', function(queueLength) {179 *   console.log('Queue contains ' + queueLength + ' task(s)');180 * });181 */182const queue = new events.EventEmitter();183 184/**185 * Provides access to internal task counters.186 * - queue is the number of tasks this module has queued waiting for _libuv_ to provide a worker thread from its pool.187 * - process is the number of resize tasks currently being processed.188 *189 * @example190 * const counters = sharp.counters(); // { queue: 2, process: 4 }191 *192 * @returns {Object}193 */194function counters () {195  return sharp.counters();196}197 198/**199 * Get and set use of SIMD vector unit instructions.200 * Requires libvips to have been compiled with highway support.201 *202 * Improves the performance of `resize`, `blur` and `sharpen` operations203 * by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON.204 *205 * @example206 * const simd = sharp.simd();207 * // simd is `true` if the runtime use of highway is currently enabled208 * @example209 * const simd = sharp.simd(false);210 * // prevent libvips from using highway at runtime211 *212 * @param {boolean} [simd=true]213 * @returns {boolean}214 */215function simd (simd) {216  return sharp.simd(is.bool(simd) ? simd : null);217}218 219/**220 * Block libvips operations at runtime.221 *222 * This is in addition to the `VIPS_BLOCK_UNTRUSTED` environment variable,223 * which when set will block all "untrusted" operations.224 *225 * @since 0.32.4226 *227 * @example <caption>Block all TIFF input.</caption>228 * sharp.block({229 *   operation: ['VipsForeignLoadTiff']230 * });231 *232 * @param {Object} options233 * @param {Array<string>} options.operation - List of libvips low-level operation names to block.234 */235function block (options) {236  if (is.object(options)) {237    if (Array.isArray(options.operation) && options.operation.every(is.string)) {238      sharp.block(options.operation, true);239    } else {240      throw is.invalidParameterError('operation', 'Array<string>', options.operation);241    }242  } else {243    throw is.invalidParameterError('options', 'object', options);244  }245}246 247/**248 * Unblock libvips operations at runtime.249 *250 * This is useful for defining a list of allowed operations.251 *252 * @since 0.32.4253 *254 * @example <caption>Block all input except WebP from the filesystem.</caption>255 * sharp.block({256 *   operation: ['VipsForeignLoad']257 * });258 * sharp.unblock({259 *   operation: ['VipsForeignLoadWebpFile']260 * });261 *262 * @example <caption>Block all input except JPEG and PNG from a Buffer or Stream.</caption>263 * sharp.block({264 *   operation: ['VipsForeignLoad']265 * });266 * sharp.unblock({267 *   operation: ['VipsForeignLoadJpegBuffer', 'VipsForeignLoadPngBuffer']268 * });269 *270 * @param {Object} options271 * @param {Array<string>} options.operation - List of libvips low-level operation names to unblock.272 */273function unblock (options) {274  if (is.object(options)) {275    if (Array.isArray(options.operation) && options.operation.every(is.string)) {276      sharp.block(options.operation, false);277    } else {278      throw is.invalidParameterError('operation', 'Array<string>', options.operation);279    }280  } else {281    throw is.invalidParameterError('options', 'object', options);282  }283}284 285/**286 * Decorate the Sharp class with utility-related functions.287 * @module Sharp288 * @private289 */290module.exports = (Sharp) => {291  Sharp.cache = cache;292  Sharp.concurrency = concurrency;293  Sharp.counters = counters;294  Sharp.simd = simd;295  Sharp.format = format;296  Sharp.interpolators = interpolators;297  Sharp.versions = versions;298  Sharp.queue = queue;299  Sharp.block = block;300  Sharp.unblock = unblock;301};302 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai