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
fileUploadUtils.js85 linesDownload Raw Back to server
1"use strict";2var __create = Object.create;3var __defProp = Object.defineProperty;4var __getOwnPropDesc = Object.getOwnPropertyDescriptor;5var __getOwnPropNames = Object.getOwnPropertyNames;6var __getProtoOf = Object.getPrototypeOf;7var __hasOwnProp = Object.prototype.hasOwnProperty;8var __export = (target, all) => {9  for (var name in all)10    __defProp(target, name, { get: all[name], enumerable: true });11};12var __copyProps = (to, from, except, desc) => {13  if (from && typeof from === "object" || typeof from === "function") {14    for (let key of __getOwnPropNames(from))15      if (!__hasOwnProp.call(to, key) && key !== except)16        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });17  }18  return to;19};20var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(21  // If the importer is in node compatibility mode or this is not an ESM22  // file that has been converted to a CommonJS file using a Babel-23  // compatible transform (i.e. "__esModule" has not been set), then set24  // "default" to the CommonJS "module.exports" for node compatibility.25  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,26  mod27));28var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);29var fileUploadUtils_exports = {};30__export(fileUploadUtils_exports, {31  fileUploadSizeLimit: () => fileUploadSizeLimit,32  prepareFilesForUpload: () => prepareFilesForUpload33});34module.exports = __toCommonJS(fileUploadUtils_exports);35var import_fs = __toESM(require("fs"));36var import_path = __toESM(require("path"));37var import_assert = require("../utils/isomorphic/assert");38var import_utilsBundle = require("../utilsBundle");39const fileUploadSizeLimit = 50 * 1024 * 1024;40async function filesExceedUploadLimit(files) {41  const sizes = await Promise.all(files.map(async (file) => (await import_fs.default.promises.stat(file)).size));42  return sizes.reduce((total, size) => total + size, 0) >= fileUploadSizeLimit;43}44async function prepareFilesForUpload(frame, params) {45  const { payloads, streams, directoryStream } = params;46  let { localPaths, localDirectory } = params;47  if ([payloads, localPaths, localDirectory, streams, directoryStream].filter(Boolean).length !== 1)48    throw new Error("Exactly one of payloads, localPaths and streams must be provided");49  if (streams)50    localPaths = streams.map((c) => c.path());51  if (directoryStream)52    localDirectory = directoryStream.path();53  if (localPaths) {54    for (const p of localPaths)55      (0, import_assert.assert)(import_path.default.isAbsolute(p) && import_path.default.resolve(p) === p, "Paths provided to localPaths must be absolute and fully resolved.");56  }57  let fileBuffers = payloads;58  if (!frame._page.browserContext._browser._isCollocatedWithServer) {59    if (localPaths) {60      if (await filesExceedUploadLimit(localPaths))61        throw new Error("Cannot transfer files larger than 50Mb to a browser not co-located with the server");62      fileBuffers = await Promise.all(localPaths.map(async (item) => {63        return {64          name: import_path.default.basename(item),65          buffer: await import_fs.default.promises.readFile(item),66          lastModifiedMs: (await import_fs.default.promises.stat(item)).mtimeMs67        };68      }));69      localPaths = void 0;70    }71  }72  const filePayloads = fileBuffers?.map((payload) => ({73    name: payload.name,74    mimeType: payload.mimeType || import_utilsBundle.mime.getType(payload.name) || "application/octet-stream",75    buffer: payload.buffer.toString("base64"),76    lastModifiedMs: payload.lastModifiedMs77  }));78  return { localPaths, localDirectory, filePayloads };79}80// Annotate the CommonJS export names for ESM import in node:810 && (module.exports = {82  fileUploadSizeLimit,83  prepareFilesForUpload84});85 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai