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.
03.1k
1"use strict";2var __defProp = Object.defineProperty;3var __getOwnPropDesc = Object.getOwnPropertyDescriptor;4var __getOwnPropNames = Object.getOwnPropertyNames;5var __hasOwnProp = Object.prototype.hasOwnProperty;6var __export = (target, all) => {7 for (var name in all)8 __defProp(target, name, { get: all[name], enumerable: true });9};10var __copyProps = (to, from, except, desc) => {11 if (from && typeof from === "object" || typeof from === "function") {12 for (let key of __getOwnPropNames(from))13 if (!__hasOwnProp.call(to, key) && key !== except)14 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });15 }16 return to;17};18var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);19var ffConnection_exports = {};20__export(ffConnection_exports, {21 ConnectionEvents: () => ConnectionEvents,22 FFConnection: () => FFConnection,23 FFSession: () => FFSession,24 kBrowserCloseMessageId: () => kBrowserCloseMessageId25});26module.exports = __toCommonJS(ffConnection_exports);27var import_events = require("events");28var import_debugLogger = require("../utils/debugLogger");29var import_helper = require("../helper");30var import_protocolError = require("../protocolError");31const ConnectionEvents = {32 Disconnected: Symbol("Disconnected")33};34const kBrowserCloseMessageId = -9999;35class FFConnection extends import_events.EventEmitter {36 constructor(transport, protocolLogger, browserLogsCollector) {37 super();38 this.setMaxListeners(0);39 this._transport = transport;40 this._protocolLogger = protocolLogger;41 this._browserLogsCollector = browserLogsCollector;42 this._lastId = 0;43 this._sessions = /* @__PURE__ */ new Map();44 this._closed = false;45 this.rootSession = new FFSession(this, "", (message) => this._rawSend(message));46 this._sessions.set("", this.rootSession);47 this._transport.onmessage = this._onMessage.bind(this);48 this._transport.onclose = this._onClose.bind(this);49 }50 nextMessageId() {51 return ++this._lastId;52 }53 _rawSend(message) {54 this._protocolLogger("send", message);55 this._transport.send(message);56 }57 async _onMessage(message) {58 this._protocolLogger("receive", message);59 if (message.id === kBrowserCloseMessageId)60 return;61 const session = this._sessions.get(message.sessionId || "");62 if (session)63 session.dispatchMessage(message);64 }65 _onClose(reason) {66 this._closed = true;67 this._transport.onmessage = void 0;68 this._transport.onclose = void 0;69 this._browserDisconnectedLogs = import_helper.helper.formatBrowserLogs(this._browserLogsCollector.recentLogs(), reason);70 this.rootSession.dispose();71 Promise.resolve().then(() => this.emit(ConnectionEvents.Disconnected));72 }73 close() {74 if (!this._closed)75 this._transport.close();76 }77 createSession(sessionId) {78 const session = new FFSession(this, sessionId, (message) => this._rawSend({ ...message, sessionId }));79 this._sessions.set(sessionId, session);80 return session;81 }82}83class FFSession extends import_events.EventEmitter {84 constructor(connection, sessionId, rawSend) {85 super();86 this._disposed = false;87 this._crashed = false;88 this.setMaxListeners(0);89 this._callbacks = /* @__PURE__ */ new Map();90 this._connection = connection;91 this._sessionId = sessionId;92 this._rawSend = rawSend;93 this.on = super.on;94 this.addListener = super.addListener;95 this.off = super.removeListener;96 this.removeListener = super.removeListener;97 this.once = super.once;98 }99 markAsCrashed() {100 this._crashed = true;101 }102 async send(method, params) {103 if (this._crashed || this._disposed || this._connection._closed || this._connection._browserDisconnectedLogs)104 throw new import_protocolError.ProtocolError(this._crashed ? "crashed" : "closed", void 0, this._connection._browserDisconnectedLogs);105 const id = this._connection.nextMessageId();106 this._rawSend({ method, params, id });107 return new Promise((resolve, reject) => {108 this._callbacks.set(id, { resolve, reject, error: new import_protocolError.ProtocolError("error", method) });109 });110 }111 sendMayFail(method, params) {112 return this.send(method, params).catch((error) => import_debugLogger.debugLogger.log("error", error));113 }114 dispatchMessage(object) {115 if (object.id) {116 const callback = this._callbacks.get(object.id);117 if (callback) {118 this._callbacks.delete(object.id);119 if (object.error) {120 callback.error.setMessage(object.error.message);121 callback.reject(callback.error);122 } else {123 callback.resolve(object.result);124 }125 }126 } else {127 Promise.resolve().then(() => this.emit(object.method, object.params));128 }129 }130 dispose() {131 this._disposed = true;132 this._connection._sessions.delete(this._sessionId);133 for (const callback of this._callbacks.values()) {134 callback.error.type = this._crashed ? "crashed" : "closed";135 callback.error.logs = this._connection._browserDisconnectedLogs;136 callback.reject(callback.error);137 }138 this._callbacks.clear();139 }140}141// Annotate the CommonJS export names for ESM import in node:1420 && (module.exports = {143 ConnectionEvents,144 FFConnection,145 FFSession,146 kBrowserCloseMessageId147});148 