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 GetIntrinsic = require('get-intrinsic');4 5var $SyntaxError = require('es-errors/syntax');6var $TypeError = require('es-errors/type');7var isInteger = require('math-intrinsics/isInteger');8var $Uint8Array = GetIntrinsic('%Uint8Array%', true);9 10var IsBigIntElementType = require('./IsBigIntElementType');11var IsDetachedBuffer = require('./IsDetachedBuffer');12var NumericToRawBytes = require('./NumericToRawBytes');13 14var isArrayBuffer = require('is-array-buffer');15var isSharedArrayBuffer = require('is-shared-array-buffer');16var hasOwn = require('hasown');17 18var tableTAO = require('./tables/typed-array-objects');19 20var defaultEndianness = require('../helpers/defaultEndianness');21var forEach = require('../helpers/forEach');22 23// https://262.ecma-international.org/15.0/#sec-setvalueinbuffer24 25/* eslint max-params: 0 */26 27module.exports = function SetValueInBuffer(arrayBuffer, byteIndex, type, value, isTypedArray, order) {28 var isSAB = isSharedArrayBuffer(arrayBuffer);29 if (!isArrayBuffer(arrayBuffer) && !isSAB) {30 throw new $TypeError('Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer');31 }32 33 if (!isInteger(byteIndex) || byteIndex < 0) {34 throw new $TypeError('Assertion failed: `byteIndex` must be a non-negative integer');35 }36 37 if (typeof type !== 'string' || !hasOwn(tableTAO.size, '$' + type)) {38 throw new $TypeError('Assertion failed: `type` must be one of ' + tableTAO.choices);39 }40 41 if (typeof value !== 'number' && typeof value !== 'bigint') {42 throw new $TypeError('Assertion failed: `value` must be a Number or a BigInt');43 }44 45 if (typeof isTypedArray !== 'boolean') {46 throw new $TypeError('Assertion failed: `isTypedArray` must be a boolean');47 }48 if (order !== 'SEQ-CST' && order !== 'UNORDERED' && order !== 'INIT') {49 throw new $TypeError('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');50 }51 52 if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {53 throw new $TypeError('Assertion failed: `isLittleEndian` must be a boolean, if present');54 }55 56 if (IsDetachedBuffer(arrayBuffer)) {57 throw new $TypeError('Assertion failed: ArrayBuffer is detached'); // step 158 }59 60 // 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.61 62 if (IsBigIntElementType(type) ? typeof value !== 'bigint' : typeof value !== 'number') { // step 363 throw new $TypeError('Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number');64 }65 66 // 4. Let block be arrayBuffer’s [[ArrayBufferData]] internal slot.67 68 var elementSize = tableTAO.size['$' + type]; // step 569 70 // 6. If isLittleEndian is not present, set isLittleEndian to either true or false. The choice is implementation dependent and should be the alternative that is most efficient for the implementation. An implementation must use the same value each time this step is executed and the same value must be used for the corresponding step in the GetValueFromBuffer abstract operation.71 var isLittleEndian = arguments.length > 6 ? arguments[6] : defaultEndianness === 'little'; // step 672 73 var rawBytes = NumericToRawBytes(type, value, isLittleEndian); // step 774 75 if (isSAB) { // step 876 /*77 Let execution be the [[CandidateExecution]] field of the surrounding agent's Agent Record.78 Let eventList be the [[EventList]] field of the element in execution.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().79 If isTypedArray is true and IsNoTearConfiguration(type, order) is true, let noTear be true; otherwise let noTear be false.80 Append WriteSharedMemory { [[Order]]: order, [[NoTear]]: noTear, [[Block]]: block, [[ByteIndex]]: byteIndex, [[ElementSize]]: elementSize, [[Payload]]: rawBytes } to eventList.81 */82 throw new $SyntaxError('SharedArrayBuffer is not supported by this implementation');83 } else {84 // 9. Store the individual bytes of rawBytes into block, in order, starting at block[byteIndex].85 var arr = new $Uint8Array(arrayBuffer, byteIndex, elementSize);86 forEach(rawBytes, function (rawByte, i) {87 arr[i] = rawByte;88 });89 }90 91 // 10. Return NormalCompletion(undefined).92};93 