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
strategy.js69 linesDownload Raw Back to workbox-streams
1/*2  Copyright 2018 Google LLC3 4  Use of this source code is governed by an MIT-style5  license that can be found in the LICENSE file or at6  https://opensource.org/licenses/MIT.7*/8import { logger } from 'workbox-core/_private/logger.js';9import { createHeaders } from './utils/createHeaders.js';10import { concatenateToResponse } from './concatenateToResponse.js';11import { isSupported } from './isSupported.js';12import './_version.js';13/**14 * A shortcut to create a strategy that could be dropped-in to Workbox's router.15 *16 * On browsers that do not support constructing new `ReadableStream`s, this17 * strategy will automatically wait for all the `sourceFunctions` to complete,18 * and create a final response that concatenates their values together.19 *20 * @param {Array<function({event, request, url, params})>} sourceFunctions21 * An array of functions similar to {@link workbox-routing~handlerCallback}22 * but that instead return a {@link workbox-streams.StreamSource} (or a23 * Promise which resolves to one).24 * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,25 * `'text/html'` will be used by default.26 * @return {workbox-routing~handlerCallback}27 * @memberof workbox-streams28 */29function strategy(sourceFunctions, headersInit) {30    return async ({ event, request, url, params }) => {31        const sourcePromises = sourceFunctions.map((fn) => {32            // Ensure the return value of the function is always a promise.33            return Promise.resolve(fn({ event, request, url, params }));34        });35        if (isSupported()) {36            const { done, response } = concatenateToResponse(sourcePromises, headersInit);37            if (event) {38                event.waitUntil(done);39            }40            return response;41        }42        if (process.env.NODE_ENV !== 'production') {43            logger.log(`The current browser doesn't support creating response ` +44                `streams. Falling back to non-streaming response instead.`);45        }46        // Fallback to waiting for everything to finish, and concatenating the47        // responses.48        const blobPartsPromises = sourcePromises.map(async (sourcePromise) => {49            const source = await sourcePromise;50            if (source instanceof Response) {51                return source.blob();52            }53            else {54                // Technically, a `StreamSource` object can include any valid55                // `BodyInit` type, including `FormData` and `URLSearchParams`, which56                // cannot be passed to the Blob constructor directly, so we have to57                // convert them to actual Blobs first.58                return new Response(source).blob();59            }60        });61        const blobParts = await Promise.all(blobPartsPromises);62        const headers = createHeaders(headersInit);63        // Constructing a new Response from a Blob source is well-supported.64        // So is constructing a new Blob from multiple source Blobs or strings.65        return new Response(new Blob(blobParts), { headers });66    };67}68export { strategy };69 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai