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
ffExecutionContext.js151 linesDownload Raw Back to firefox
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 ffExecutionContext_exports = {};30__export(ffExecutionContext_exports, {31  FFExecutionContext: () => FFExecutionContext,32  createHandle: () => createHandle33});34module.exports = __toCommonJS(ffExecutionContext_exports);35var import_assert = require("../../utils/isomorphic/assert");36var import_stackTrace = require("../../utils/isomorphic/stackTrace");37var import_utilityScriptSerializers = require("../../utils/isomorphic/utilityScriptSerializers");38var js = __toESM(require("../javascript"));39var dom = __toESM(require("../dom"));40var import_protocolError = require("../protocolError");41class FFExecutionContext {42  constructor(session, executionContextId) {43    this._session = session;44    this._executionContextId = executionContextId;45  }46  async rawEvaluateJSON(expression) {47    const payload = await this._session.send("Runtime.evaluate", {48      expression,49      returnByValue: true,50      executionContextId: this._executionContextId51    }).catch(rewriteError);52    checkException(payload.exceptionDetails);53    return payload.result.value;54  }55  async rawEvaluateHandle(context, expression) {56    const payload = await this._session.send("Runtime.evaluate", {57      expression,58      returnByValue: false,59      executionContextId: this._executionContextId60    }).catch(rewriteError);61    checkException(payload.exceptionDetails);62    return createHandle(context, payload.result);63  }64  async evaluateWithArguments(expression, returnByValue, utilityScript, values, handles) {65    const payload = await this._session.send("Runtime.callFunction", {66      functionDeclaration: expression,67      args: [68        { objectId: utilityScript._objectId, value: void 0 },69        ...values.map((value) => ({ value })),70        ...handles.map((handle) => ({ objectId: handle._objectId, value: void 0 }))71      ],72      returnByValue,73      executionContextId: this._executionContextId74    }).catch(rewriteError);75    checkException(payload.exceptionDetails);76    if (returnByValue)77      return (0, import_utilityScriptSerializers.parseEvaluationResultValue)(payload.result.value);78    return createHandle(utilityScript._context, payload.result);79  }80  async getProperties(object) {81    const response = await this._session.send("Runtime.getObjectProperties", {82      executionContextId: this._executionContextId,83      objectId: object._objectId84    });85    const result = /* @__PURE__ */ new Map();86    for (const property of response.properties)87      result.set(property.name, createHandle(object._context, property.value));88    return result;89  }90  async releaseHandle(handle) {91    if (!handle._objectId)92      return;93    await this._session.send("Runtime.disposeObject", {94      executionContextId: this._executionContextId,95      objectId: handle._objectId96    });97  }98}99function checkException(exceptionDetails) {100  if (!exceptionDetails)101    return;102  if (exceptionDetails.value)103    throw new js.JavaScriptErrorInEvaluate(JSON.stringify(exceptionDetails.value));104  else105    throw new js.JavaScriptErrorInEvaluate(exceptionDetails.text + (exceptionDetails.stack ? "\n" + exceptionDetails.stack : ""));106}107function rewriteError(error) {108  if (error.message.includes("cyclic object value") || error.message.includes("Object is not serializable"))109    return { result: { type: "undefined", value: void 0 } };110  if (error instanceof TypeError && error.message.startsWith("Converting circular structure to JSON"))111    (0, import_stackTrace.rewriteErrorMessage)(error, error.message + " Are you passing a nested JSHandle?");112  if (!js.isJavaScriptErrorInEvaluate(error) && !(0, import_protocolError.isSessionClosedError)(error))113    throw new Error("Execution context was destroyed, most likely because of a navigation.");114  throw error;115}116function potentiallyUnserializableValue(remoteObject) {117  const value = remoteObject.value;118  const unserializableValue = remoteObject.unserializableValue;119  return unserializableValue ? js.parseUnserializableValue(unserializableValue) : value;120}121function renderPreview(object) {122  if (object.type === "undefined")123    return "undefined";124  if (object.unserializableValue)125    return String(object.unserializableValue);126  if (object.type === "symbol")127    return "Symbol()";128  if (object.subtype === "regexp")129    return "RegExp";130  if (object.subtype === "weakmap")131    return "WeakMap";132  if (object.subtype === "weakset")133    return "WeakSet";134  if (object.subtype)135    return object.subtype[0].toUpperCase() + object.subtype.slice(1);136  if ("value" in object)137    return String(object.value);138}139function createHandle(context, remoteObject) {140  if (remoteObject.subtype === "node") {141    (0, import_assert.assert)(context instanceof dom.FrameExecutionContext);142    return new dom.ElementHandle(context, remoteObject.objectId);143  }144  return new js.JSHandle(context, remoteObject.subtype || remoteObject.type || "", renderPreview(remoteObject), remoteObject.objectId, potentiallyUnserializableValue(remoteObject));145}146// Annotate the CommonJS export names for ESM import in node:1470 && (module.exports = {148  FFExecutionContext,149  createHandle150});151 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai