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
CacheFirst.js90 linesDownload Raw Back to workbox-strategies
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 { assert } from 'workbox-core/_private/assert.js';9import { logger } from 'workbox-core/_private/logger.js';10import { WorkboxError } from 'workbox-core/_private/WorkboxError.js';11import { Strategy } from './Strategy.js';12import { messages } from './utils/messages.js';13import './_version.js';14/**15 * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)16 * request strategy.17 *18 * A cache first strategy is useful for assets that have been revisioned,19 * such as URLs like `/styles/example.a8f5f1.css`, since they20 * can be cached for long periods of time.21 *22 * If the network request fails, and there is no cache match, this will throw23 * a `WorkboxError` exception.24 *25 * @extends workbox-strategies.Strategy26 * @memberof workbox-strategies27 */28class CacheFirst extends Strategy {29    /**30     * @private31     * @param {Request|string} request A request to run this strategy for.32     * @param {workbox-strategies.StrategyHandler} handler The event that33     *     triggered the request.34     * @return {Promise<Response>}35     */36    async _handle(request, handler) {37        const logs = [];38        if (process.env.NODE_ENV !== 'production') {39            assert.isInstance(request, Request, {40                moduleName: 'workbox-strategies',41                className: this.constructor.name,42                funcName: 'makeRequest',43                paramName: 'request',44            });45        }46        let response = await handler.cacheMatch(request);47        let error = undefined;48        if (!response) {49            if (process.env.NODE_ENV !== 'production') {50                logs.push(`No response found in the '${this.cacheName}' cache. ` +51                    `Will respond with a network request.`);52            }53            try {54                response = await handler.fetchAndCachePut(request);55            }56            catch (err) {57                if (err instanceof Error) {58                    error = err;59                }60            }61            if (process.env.NODE_ENV !== 'production') {62                if (response) {63                    logs.push(`Got response from network.`);64                }65                else {66                    logs.push(`Unable to get a response from the network.`);67                }68            }69        }70        else {71            if (process.env.NODE_ENV !== 'production') {72                logs.push(`Found a cached response in the '${this.cacheName}' cache.`);73            }74        }75        if (process.env.NODE_ENV !== 'production') {76            logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));77            for (const log of logs) {78                logger.log(log);79            }80            messages.printFinalResponse(response);81            logger.groupEnd();82        }83        if (!response) {84            throw new WorkboxError('no-response', { url: request.url, error });85        }86        return response;87    }88}89export { CacheFirst };90 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai