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
workbox-streams.dev.js304 linesDownload Raw Back to build
1this.workbox = this.workbox || {};2this.workbox.streams = (function (exports, assert_js, Deferred_js, logger_js, WorkboxError_js, canConstructReadableStream_js) {3    'use strict';4 5    // @ts-ignore6    try {7      self['workbox:streams:7.4.0'] && _();8    } catch (e) {}9 10    /*11      Copyright 2018 Google LLC12 13      Use of this source code is governed by an MIT-style14      license that can be found in the LICENSE file or at15      https://opensource.org/licenses/MIT.16    */17    /**18     * Takes either a Response, a ReadableStream, or a19     * [BodyInit](https://fetch.spec.whatwg.org/#bodyinit) and returns the20     * ReadableStreamReader object associated with it.21     *22     * @param {workbox-streams.StreamSource} source23     * @return {ReadableStreamReader}24     * @private25     */26    function _getReaderFromSource(source) {27      if (source instanceof Response) {28        // See https://github.com/GoogleChrome/workbox/issues/299829        if (source.body) {30          return source.body.getReader();31        }32        throw new WorkboxError_js.WorkboxError('opaque-streams-source', {33          type: source.type34        });35      }36      if (source instanceof ReadableStream) {37        return source.getReader();38      }39      return new Response(source).body.getReader();40    }41    /**42     * Takes multiple source Promises, each of which could resolve to a Response, a43     * ReadableStream, or a [BodyInit](https://fetch.spec.whatwg.org/#bodyinit).44     *45     * Returns an object exposing a ReadableStream with each individual stream's46     * data returned in sequence, along with a Promise which signals when the47     * stream is finished (useful for passing to a FetchEvent's waitUntil()).48     *49     * @param {Array<Promise<workbox-streams.StreamSource>>} sourcePromises50     * @return {Object<{done: Promise, stream: ReadableStream}>}51     *52     * @memberof workbox-streams53     */54    function concatenate(sourcePromises) {55      {56        assert_js.assert.isArray(sourcePromises, {57          moduleName: 'workbox-streams',58          funcName: 'concatenate',59          paramName: 'sourcePromises'60        });61      }62      const readerPromises = sourcePromises.map(sourcePromise => {63        return Promise.resolve(sourcePromise).then(source => {64          return _getReaderFromSource(source);65        });66      });67      const streamDeferred = new Deferred_js.Deferred();68      let i = 0;69      const logMessages = [];70      const stream = new ReadableStream({71        pull(controller) {72          return readerPromises[i].then(reader => {73            if (reader instanceof ReadableStreamDefaultReader) {74              return reader.read();75            } else {76              return;77            }78          }).then(result => {79            if (result === null || result === void 0 ? void 0 : result.done) {80              {81                logMessages.push(['Reached the end of source:', sourcePromises[i]]);82              }83              i++;84              if (i >= readerPromises.length) {85                // Log all the messages in the group at once in a single group.86                {87                  logger_js.logger.groupCollapsed(`Concatenating ${readerPromises.length} sources.`);88                  for (const message of logMessages) {89                    if (Array.isArray(message)) {90                      logger_js.logger.log(...message);91                    } else {92                      logger_js.logger.log(message);93                    }94                  }95                  logger_js.logger.log('Finished reading all sources.');96                  logger_js.logger.groupEnd();97                }98                controller.close();99                streamDeferred.resolve();100                return;101              }102              // The `pull` method is defined because we're inside it.103              return this.pull(controller);104            } else {105              controller.enqueue(result === null || result === void 0 ? void 0 : result.value);106            }107          }).catch(error => {108            {109              logger_js.logger.error('An error occurred:', error);110            }111            streamDeferred.reject(error);112            throw error;113          });114        },115        cancel() {116          {117            logger_js.logger.warn('The ReadableStream was cancelled.');118          }119          streamDeferred.resolve();120        }121      });122      return {123        done: streamDeferred.promise,124        stream125      };126    }127 128    /*129      Copyright 2018 Google LLC130 131      Use of this source code is governed by an MIT-style132      license that can be found in the LICENSE file or at133      https://opensource.org/licenses/MIT.134    */135    /**136     * This is a utility method that determines whether the current browser supports137     * the features required to create streamed responses. Currently, it checks if138     * [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)139     * is available.140     *141     * @private142     * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,143     * `'text/html'` will be used by default.144     * @return {boolean} `true`, if the current browser meets the requirements for145     * streaming responses, and `false` otherwise.146     *147     * @memberof workbox-streams148     */149    function createHeaders(headersInit = {}) {150      // See https://github.com/GoogleChrome/workbox/issues/1461151      const headers = new Headers(headersInit);152      if (!headers.has('content-type')) {153        headers.set('content-type', 'text/html');154      }155      return headers;156    }157 158    /*159      Copyright 2018 Google LLC160 161      Use of this source code is governed by an MIT-style162      license that can be found in the LICENSE file or at163      https://opensource.org/licenses/MIT.164    */165    /**166     * Takes multiple source Promises, each of which could resolve to a Response, a167     * ReadableStream, or a [BodyInit](https://fetch.spec.whatwg.org/#bodyinit),168     * along with a169     * [HeadersInit](https://fetch.spec.whatwg.org/#typedefdef-headersinit).170     *171     * Returns an object exposing a Response whose body consists of each individual172     * stream's data returned in sequence, along with a Promise which signals when173     * the stream is finished (useful for passing to a FetchEvent's waitUntil()).174     *175     * @param {Array<Promise<workbox-streams.StreamSource>>} sourcePromises176     * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,177     * `'text/html'` will be used by default.178     * @return {Object<{done: Promise, response: Response}>}179     *180     * @memberof workbox-streams181     */182    function concatenateToResponse(sourcePromises, headersInit) {183      const {184        done,185        stream186      } = concatenate(sourcePromises);187      const headers = createHeaders(headersInit);188      const response = new Response(stream, {189        headers190      });191      return {192        done,193        response194      };195    }196 197    /*198      Copyright 2018 Google LLC199 200      Use of this source code is governed by an MIT-style201      license that can be found in the LICENSE file or at202      https://opensource.org/licenses/MIT.203    */204    /**205     * This is a utility method that determines whether the current browser supports206     * the features required to create streamed responses. Currently, it checks if207     * [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)208     * can be created.209     *210     * @return {boolean} `true`, if the current browser meets the requirements for211     * streaming responses, and `false` otherwise.212     *213     * @memberof workbox-streams214     */215    function isSupported() {216      return canConstructReadableStream_js.canConstructReadableStream();217    }218 219    /*220      Copyright 2018 Google LLC221 222      Use of this source code is governed by an MIT-style223      license that can be found in the LICENSE file or at224      https://opensource.org/licenses/MIT.225    */226    /**227     * A shortcut to create a strategy that could be dropped-in to Workbox's router.228     *229     * On browsers that do not support constructing new `ReadableStream`s, this230     * strategy will automatically wait for all the `sourceFunctions` to complete,231     * and create a final response that concatenates their values together.232     *233     * @param {Array<function({event, request, url, params})>} sourceFunctions234     * An array of functions similar to {@link workbox-routing~handlerCallback}235     * but that instead return a {@link workbox-streams.StreamSource} (or a236     * Promise which resolves to one).237     * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,238     * `'text/html'` will be used by default.239     * @return {workbox-routing~handlerCallback}240     * @memberof workbox-streams241     */242    function strategy(sourceFunctions, headersInit) {243      return async ({244        event,245        request,246        url,247        params248      }) => {249        const sourcePromises = sourceFunctions.map(fn => {250          // Ensure the return value of the function is always a promise.251          return Promise.resolve(fn({252            event,253            request,254            url,255            params256          }));257        });258        if (isSupported()) {259          const {260            done,261            response262          } = concatenateToResponse(sourcePromises, headersInit);263          if (event) {264            event.waitUntil(done);265          }266          return response;267        }268        {269          logger_js.logger.log(`The current browser doesn't support creating response ` + `streams. Falling back to non-streaming response instead.`);270        }271        // Fallback to waiting for everything to finish, and concatenating the272        // responses.273        const blobPartsPromises = sourcePromises.map(async sourcePromise => {274          const source = await sourcePromise;275          if (source instanceof Response) {276            return source.blob();277          } else {278            // Technically, a `StreamSource` object can include any valid279            // `BodyInit` type, including `FormData` and `URLSearchParams`, which280            // cannot be passed to the Blob constructor directly, so we have to281            // convert them to actual Blobs first.282            return new Response(source).blob();283          }284        });285        const blobParts = await Promise.all(blobPartsPromises);286        const headers = createHeaders(headersInit);287        // Constructing a new Response from a Blob source is well-supported.288        // So is constructing a new Blob from multiple source Blobs or strings.289        return new Response(new Blob(blobParts), {290          headers291        });292      };293    }294 295    exports.concatenate = concatenate;296    exports.concatenateToResponse = concatenateToResponse;297    exports.isSupported = isSupported;298    exports.strategy = strategy;299 300    return exports;301 302})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private);303//# sourceMappingURL=workbox-streams.dev.js.map304 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai