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 $TypeError = require('es-errors/type');4 5var ArrayCreate = require('./ArrayCreate');6var CreateDataPropertyOrThrow = require('./CreateDataPropertyOrThrow');7var GetMatchIndexPair = require('./GetMatchIndexPair');8var IsArray = require('./IsArray');9var OrdinaryObjectCreate = require('./OrdinaryObjectCreate');10var ToString = require('./ToString');11 12var every = require('../helpers/every');13var isMatchRecord = require('../helpers/records/match-record');14 15var isStringOrUndefined = function isStringOrUndefined(s) {16 return typeof s === 'undefined' || typeof s === 'string';17};18 19var isMatchRecordOrUndefined = function isMatchRecordOrUndefined(m) {20 return typeof m === 'undefined' || isMatchRecord(m);21};22 23var MAX_ARRAY_LENGTH = require('math-intrinsics/constants/maxArrayLength');24 25// https://262.ecma-international.org/13.0/#sec-getmatchindexpair26 27module.exports = function MakeMatchIndicesIndexPairArray(S, indices, groupNames, hasGroups) {28 if (typeof S !== 'string') {29 throw new $TypeError('Assertion failed: `S` must be a String');30 }31 if (!IsArray(indices) || !every(indices, isMatchRecordOrUndefined)) {32 throw new $TypeError('Assertion failed: `indices` must be a List of either Match Records or `undefined`');33 }34 if (!IsArray(groupNames) || !every(groupNames, isStringOrUndefined)) {35 throw new $TypeError('Assertion failed: `groupNames` must be a List of either Strings or `undefined`');36 }37 if (typeof hasGroups !== 'boolean') {38 throw new $TypeError('Assertion failed: `hasGroups` must be a Boolean');39 }40 41 var n = indices.length; // step 142 if (!(n < MAX_ARRAY_LENGTH)) {43 throw new $TypeError('Assertion failed: `indices` length must be less than the max array size, 2**32 - 1');44 }45 if (groupNames.length !== n - 1) {46 throw new $TypeError('Assertion failed: `groupNames` must have exactly one fewer item than `indices`');47 }48 49 var A = ArrayCreate(n); // step 550 var groups = hasGroups ? OrdinaryObjectCreate(null) : void undefined; // step 6-751 CreateDataPropertyOrThrow(A, 'groups', groups); // step 852 53 for (var i = 0; i < n; i += 1) { // step 954 var matchIndices = indices[i]; // step 9.a55 // eslint-disable-next-line no-negated-condition56 var matchIndexPair = typeof matchIndices !== 'undefined' ? GetMatchIndexPair(S, matchIndices) : void undefined; // step 9.b-9.c57 CreateDataPropertyOrThrow(A, ToString(i), matchIndexPair); // step 9.d58 if (i > 0 && typeof groupNames[i - 1] !== 'undefined') { // step 9.e59 if (!groups) {60 throw new $TypeError('if `hasGroups` is `false`, `groupNames` can only contain `undefined` values');61 }62 CreateDataPropertyOrThrow(groups, groupNames[i - 1], matchIndexPair); // step 9.e.i63 }64 }65 return A; // step 1066};67 