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
valueToFloat32Bytes.js68 linesDownload Raw Back to helpers
1'use strict';2 3var $abs = require('math-intrinsics/abs');4var $floor = require('math-intrinsics/floor');5var $pow = require('math-intrinsics/pow');6 7var isFinite = require('math-intrinsics/isFinite');8var isNaN = require('math-intrinsics/isNaN');9var isNegativeZero = require('math-intrinsics/isNegativeZero');10 11var maxFiniteFloat32 = 3.4028234663852886e+38; // roughly 2 ** 128 - 112 13module.exports = function valueToFloat32Bytes(value, isLittleEndian) {14	if (isNaN(value)) {15		return isLittleEndian ? [0, 0, 192, 127] : [127, 192, 0, 0]; // hardcoded16	}17 18	var leastSig;19 20	if (value === 0) {21		leastSig = isNegativeZero(value) ? 0x80 : 0;22		return isLittleEndian ? [0, 0, 0, leastSig] : [leastSig, 0, 0, 0];23	}24 25	if ($abs(value) > maxFiniteFloat32 || !isFinite(value)) {26		leastSig = value < 0 ? 255 : 127;27		return isLittleEndian ? [0, 0, 128, leastSig] : [leastSig, 128, 0, 0];28	}29 30	var sign = value < 0 ? 1 : 0;31	value = $abs(value); // eslint-disable-line no-param-reassign32 33	var exponent = 0;34	while (value >= 2) {35		exponent += 1;36		value /= 2; // eslint-disable-line no-param-reassign37	}38 39	while (value < 1) {40		exponent -= 1;41		value *= 2; // eslint-disable-line no-param-reassign42	}43 44	var mantissa = value - 1;45	mantissa *= $pow(2, 23) + 0.5;46	mantissa = $floor(mantissa);47 48	exponent += 127;49	exponent <<= 23;50 51	var result = (sign << 31)52        | exponent53        | mantissa;54 55	var byte0 = result & 255;56	result >>= 8;57	var byte1 = result & 255;58	result >>= 8;59	var byte2 = result & 255;60	result >>= 8;61	var byte3 = result & 255;62 63	if (isLittleEndian) {64		return [byte0, byte1, byte2, byte3];65	}66	return [byte3, byte2, byte1, byte0];67};68 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai