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'use strict';2 3var $pow = require('math-intrinsics/pow');4 5module.exports = function bytesAsFloat32(rawBytes) {6 // return new $Float16Array(new $Uint8Array(rawBytes).buffer)[0];7 /*8 Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2019 binary16 value.9 If value is a NaN, return NaN.10 Return the Number value that corresponds to value.11 */12 13 var bits = (rawBytes[1] << 8) | rawBytes[0];14 15 // extract sign, exponent, mantissa16 var sign = bits & 0x8000 ? -1 : 1;17 var exponent = (bits & 0x7C00) >> 10;18 var mantissa = bits & 0x03FF;19 20 // zero (±0)21 if (exponent === 0 && mantissa === 0) {22 return sign === 1 ? 0 : -0;23 }24 25 // infinities26 if (exponent === 0x1F && mantissa === 0) {27 return sign === 1 ? Infinity : -Infinity;28 }29 30 // NaN31 if (exponent === 0x1F && mantissa !== 0) {32 return NaN;33 }34 35 // remove bias (15)36 exponent -= 15;37 38 // subnormals39 if (exponent === -15) {40 // value = sign * (mantissa) * 2^(1-bias-10) = mantissa * 2^(-14-10)41 return sign * mantissa * $pow(2, -24);42 }43 44 // normals45 // value = sign * (1 + mantissa/2^10) * 2^exponent46 return sign * (1 + (mantissa * $pow(2, -10))) * $pow(2, exponent);47};48 