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';2const pLimit = require('p-limit');3 4class EndError extends Error {5 constructor(value) {6 super();7 this.value = value;8 }9}10 11// The input can also be a promise, so we await it12const testElement = async (element, tester) => tester(await element);13 14// The input can also be a promise, so we `Promise.all()` them both15const finder = async element => {16 const values = await Promise.all(element);17 if (values[1] === true) {18 throw new EndError(values[0]);19 }20 21 return false;22};23 24const pLocate = async (iterable, tester, options) => {25 options = {26 concurrency: Infinity,27 preserveOrder: true,28 ...options29 };30 31 const limit = pLimit(options.concurrency);32 33 // Start all the promises concurrently with optional limit34 const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);35 36 // Check the promises either serially or concurrently37 const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);38 39 try {40 await Promise.all(items.map(element => checkLimit(finder, element)));41 } catch (error) {42 if (error instanceof EndError) {43 return error.value;44 }45 46 throw error;47 }48};49 50module.exports = pLocate;51 