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 BYTE_UNITS = [2 'B',3 'kB',4 'MB',5 'GB',6 'TB',7 'PB',8 'EB',9 'ZB',10 'YB',11];12 13const BIBYTE_UNITS = [14 'B',15 'KiB',16 'MiB',17 'GiB',18 'TiB',19 'PiB',20 'EiB',21 'ZiB',22 'YiB',23];24 25const BIT_UNITS = [26 'b',27 'kbit',28 'Mbit',29 'Gbit',30 'Tbit',31 'Pbit',32 'Ebit',33 'Zbit',34 'Ybit',35];36 37const BIBIT_UNITS = [38 'b',39 'kibit',40 'Mibit',41 'Gibit',42 'Tibit',43 'Pibit',44 'Eibit',45 'Zibit',46 'Yibit',47];48 49/*50Formats the given number using `Number#toLocaleString`.51- If locale is a string, the value is expected to be a locale-key (for example: `de`).52- If locale is true, the system default locale is used for translation.53- If no value for locale is specified, the number is returned unmodified.54*/55const toLocaleString = (number, locale, options) => {56 let result = number;57 if (typeof locale === 'string' || Array.isArray(locale)) {58 result = number.toLocaleString(locale, options);59 } else if (locale === true || options !== undefined) {60 result = number.toLocaleString(undefined, options);61 }62 63 return result;64};65 66export default function prettyBytes(number, options) {67 if (!Number.isFinite(number)) {68 throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);69 }70 71 options = {72 bits: false,73 binary: false,74 space: true,75 ...options,76 };77 78 const UNITS = options.bits79 ? (options.binary ? BIBIT_UNITS : BIT_UNITS)80 : (options.binary ? BIBYTE_UNITS : BYTE_UNITS);81 82 const separator = options.space ? ' ' : '';83 84 if (options.signed && number === 0) {85 return ` 0${separator}${UNITS[0]}`;86 }87 88 const isNegative = number < 0;89 const prefix = isNegative ? '-' : (options.signed ? '+' : '');90 91 if (isNegative) {92 number = -number;93 }94 95 let localeOptions;96 97 if (options.minimumFractionDigits !== undefined) {98 localeOptions = {minimumFractionDigits: options.minimumFractionDigits};99 }100 101 if (options.maximumFractionDigits !== undefined) {102 localeOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};103 }104 105 if (number < 1) {106 const numberString = toLocaleString(number, options.locale, localeOptions);107 return prefix + numberString + separator + UNITS[0];108 }109 110 const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);111 number /= (options.binary ? 1024 : 1000) ** exponent;112 113 if (!localeOptions) {114 number = number.toPrecision(3);115 }116 117 const numberString = toLocaleString(Number(number), options.locale, localeOptions);118 119 const unit = UNITS[exponent];120 121 return prefix + numberString + separator + unit;122}123 