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
colour.mjs200 linesDownload Raw Back to dist
1/*!2  Copyright 2013 Lovell Fuller and others.3  SPDX-License-Identifier: Apache-2.04*/5 6import color from '@img/colour';7import is from './is.mjs';8 9/**10 * Colourspaces.11 * @private12 */13const colourspace = {14  multiband: 'multiband',15  'b-w': 'b-w',16  bw: 'b-w',17  cmyk: 'cmyk',18  srgb: 'srgb'19};20 21/**22 * Tint the image using the provided colour.23 * An alpha channel may be present and will be unchanged by the operation.24 *25 * @example26 * const output = await sharp(input)27 *   .tint({ r: 255, g: 240, b: 16 })28 *   .toBuffer();29 *30 * @param {string|Object} tint - Parsed by the [color](https://www.npmjs.org/package/color) module.31 * @returns {Sharp}32 * @throws {Error} Invalid parameter33 */34function tint (tint) {35  this._setBackgroundColourOption('tint', tint);36  return this;37}38 39/**40 * Convert to 8-bit greyscale; 256 shades of grey.41 * This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use `gamma()` with `greyscale()` for the best results.42 * By default the output image will be web-friendly sRGB and contain three (identical) colour channels.43 * This may be overridden by other sharp operations such as `toColourspace('b-w')`,44 * which will produce an output image containing one colour channel.45 * An alpha channel may be present, and will be unchanged by the operation.46 *47 * @example48 * const output = await sharp(input).greyscale().toBuffer();49 *50 * @param {Boolean} [greyscale=true]51 * @returns {Sharp}52 */53function greyscale (greyscale) {54  this.options.greyscale = is.bool(greyscale) ? greyscale : true;55  return this;56}57 58/**59 * Alternative spelling of `greyscale`.60 * @param {Boolean} [grayscale=true]61 * @returns {Sharp}62 */63function grayscale (grayscale) {64  return this.greyscale(grayscale);65}66 67/**68 * Set the pipeline colourspace.69 *70 * The input image will be converted to the provided colourspace at the start of the pipeline.71 * All operations will use this colourspace before converting to the output colourspace,72 * as defined by {@link #tocolourspace toColourspace}.73 *74 * @since 0.29.075 *76 * @example77 * // Run pipeline in 16 bits per channel RGB while converting final result to 8 bits per channel sRGB.78 * await sharp(input)79 *  .pipelineColourspace('rgb16')80 *  .toColourspace('srgb')81 *  .toFile('16bpc-pipeline-to-8bpc-output.png')82 *83 * @param {string} [colourspace] - pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://www.libvips.org/API/current/enum.Interpretation.html)84 * @returns {Sharp}85 * @throws {Error} Invalid parameters86 */87function pipelineColourspace (colourspace) {88  if (!is.string(colourspace)) {89    throw is.invalidParameterError('colourspace', 'string', colourspace);90  }91  this.options.colourspacePipeline = colourspace;92  return this;93}94 95/**96 * Alternative spelling of `pipelineColourspace`.97 * @param {string} [colorspace] - pipeline colorspace.98 * @returns {Sharp}99 * @throws {Error} Invalid parameters100 */101function pipelineColorspace (colorspace) {102  return this.pipelineColourspace(colorspace);103}104 105/**106 * Set the output colourspace.107 * By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.108 *109 * @example110 * // Output 16 bits per pixel RGB111 * await sharp(input)112 *  .toColourspace('rgb16')113 *  .toFile('16-bpp.png')114 *115 * @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html)116 * @returns {Sharp}117 * @throws {Error} Invalid parameters118 */119function toColourspace (colourspace) {120  if (!is.string(colourspace)) {121    throw is.invalidParameterError('colourspace', 'string', colourspace);122  }123  this.options.colourspace = colourspace;124  return this;125}126 127/**128 * Alternative spelling of `toColourspace`.129 * @param {string} [colorspace] - output colorspace.130 * @returns {Sharp}131 * @throws {Error} Invalid parameters132 */133function toColorspace (colorspace) {134  return this.toColourspace(colorspace);135}136 137/**138 * Create a RGBA colour array from a given value.139 * @private140 * @param {string|Object} value141 * @throws {Error} Invalid value142 */143function _getBackgroundColourOption (value) {144  if (145    is.object(value) ||146    (is.string(value) && value.length >= 3 && value.length <= 200)147  ) {148    const colour = color(value);149    const red = colour.red();150    const green = colour.green();151    const blue = colour.blue();152    const alpha = Math.round(colour.alpha() * 255);153    for (const [channel, component] of [['red', red], ['green', green], ['blue', blue], ['alpha', alpha]]) {154      if (!is.number(component)) {155        throw is.invalidParameterError(`background.${channel}`, 'number', component);156      }157    }158    return [red, green, blue, alpha];159  } else {160    throw is.invalidParameterError('background', 'object or string', value);161  }162}163 164/**165 * Update a colour attribute of the this.options Object.166 * @private167 * @param {string} key168 * @param {string|Object} value169 * @throws {Error} Invalid value170 */171function _setBackgroundColourOption (key, value) {172  if (is.defined(value)) {173    this.options[key] = _getBackgroundColourOption(value);174  }175}176 177/**178 * Decorate the Sharp prototype with colour-related functions.179 * @module Sharp180 * @private181 */182export default (Sharp) => {183  Object.assign(Sharp.prototype, {184    // Public185    tint,186    greyscale,187    grayscale,188    pipelineColourspace,189    pipelineColorspace,190    toColourspace,191    toColorspace,192    // Private193    _getBackgroundColourOption,194    _setBackgroundColourOption195  });196  // Class attributes197  Sharp.colourspace = colourspace;198  Sharp.colorspace = colourspace;199};200 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai