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
testServerConnection.js212 linesDownload Raw Back to isomorphic
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 testServerConnection_exports = {};30__export(testServerConnection_exports, {31  TestServerConnection: () => TestServerConnection,32  WebSocketTestServerTransport: () => WebSocketTestServerTransport33});34module.exports = __toCommonJS(testServerConnection_exports);35var events = __toESM(require("./events"));36class WebSocketTestServerTransport {37  constructor(url) {38    this._ws = new WebSocket(url);39  }40  onmessage(listener) {41    this._ws.addEventListener("message", (event) => listener(event.data.toString()));42  }43  onopen(listener) {44    this._ws.addEventListener("open", listener);45  }46  onerror(listener) {47    this._ws.addEventListener("error", listener);48  }49  onclose(listener) {50    this._ws.addEventListener("close", listener);51  }52  send(data) {53    this._ws.send(data);54  }55  close() {56    this._ws.close();57  }58}59class TestServerConnection {60  constructor(transport) {61    this._onCloseEmitter = new events.EventEmitter();62    this._onReportEmitter = new events.EventEmitter();63    this._onStdioEmitter = new events.EventEmitter();64    this._onTestFilesChangedEmitter = new events.EventEmitter();65    this._onLoadTraceRequestedEmitter = new events.EventEmitter();66    this._lastId = 0;67    this._callbacks = /* @__PURE__ */ new Map();68    this._isClosed = false;69    this.onClose = this._onCloseEmitter.event;70    this.onReport = this._onReportEmitter.event;71    this.onStdio = this._onStdioEmitter.event;72    this.onTestFilesChanged = this._onTestFilesChangedEmitter.event;73    this.onLoadTraceRequested = this._onLoadTraceRequestedEmitter.event;74    this._transport = transport;75    this._transport.onmessage((data) => {76      const message = JSON.parse(data);77      const { id, result, error, method, params } = message;78      if (id) {79        const callback = this._callbacks.get(id);80        if (!callback)81          return;82        this._callbacks.delete(id);83        if (error)84          callback.reject(new Error(error));85        else86          callback.resolve(result);87      } else {88        this._dispatchEvent(method, params);89      }90    });91    const pingInterval = setInterval(() => this._sendMessage("ping").catch(() => {92    }), 3e4);93    this._connectedPromise = new Promise((f, r) => {94      this._transport.onopen(f);95      this._transport.onerror(r);96    });97    this._transport.onclose(() => {98      this._isClosed = true;99      this._onCloseEmitter.fire();100      clearInterval(pingInterval);101    });102  }103  isClosed() {104    return this._isClosed;105  }106  async _sendMessage(method, params) {107    const logForTest = globalThis.__logForTest;108    logForTest?.({ method, params });109    await this._connectedPromise;110    const id = ++this._lastId;111    const message = { id, method, params };112    this._transport.send(JSON.stringify(message));113    return new Promise((resolve, reject) => {114      this._callbacks.set(id, { resolve, reject });115    });116  }117  _sendMessageNoReply(method, params) {118    this._sendMessage(method, params).catch(() => {119    });120  }121  _dispatchEvent(method, params) {122    if (method === "report")123      this._onReportEmitter.fire(params);124    else if (method === "stdio")125      this._onStdioEmitter.fire(params);126    else if (method === "testFilesChanged")127      this._onTestFilesChangedEmitter.fire(params);128    else if (method === "loadTraceRequested")129      this._onLoadTraceRequestedEmitter.fire(params);130  }131  async initialize(params) {132    await this._sendMessage("initialize", params);133  }134  async ping(params) {135    await this._sendMessage("ping", params);136  }137  async pingNoReply(params) {138    this._sendMessageNoReply("ping", params);139  }140  async watch(params) {141    await this._sendMessage("watch", params);142  }143  watchNoReply(params) {144    this._sendMessageNoReply("watch", params);145  }146  async open(params) {147    await this._sendMessage("open", params);148  }149  openNoReply(params) {150    this._sendMessageNoReply("open", params);151  }152  async resizeTerminal(params) {153    await this._sendMessage("resizeTerminal", params);154  }155  resizeTerminalNoReply(params) {156    this._sendMessageNoReply("resizeTerminal", params);157  }158  async checkBrowsers(params) {159    return await this._sendMessage("checkBrowsers", params);160  }161  async installBrowsers(params) {162    await this._sendMessage("installBrowsers", params);163  }164  async runGlobalSetup(params) {165    return await this._sendMessage("runGlobalSetup", params);166  }167  async runGlobalTeardown(params) {168    return await this._sendMessage("runGlobalTeardown", params);169  }170  async startDevServer(params) {171    return await this._sendMessage("startDevServer", params);172  }173  async stopDevServer(params) {174    return await this._sendMessage("stopDevServer", params);175  }176  async clearCache(params) {177    return await this._sendMessage("clearCache", params);178  }179  async listFiles(params) {180    return await this._sendMessage("listFiles", params);181  }182  async listTests(params) {183    return await this._sendMessage("listTests", params);184  }185  async runTests(params) {186    return await this._sendMessage("runTests", params);187  }188  async findRelatedTestFiles(params) {189    return await this._sendMessage("findRelatedTestFiles", params);190  }191  async stopTests(params) {192    await this._sendMessage("stopTests", params);193  }194  stopTestsNoReply(params) {195    this._sendMessageNoReply("stopTests", params);196  }197  async closeGracefully(params) {198    await this._sendMessage("closeGracefully", params);199  }200  close() {201    try {202      this._transport.close();203    } catch {204    }205  }206}207// Annotate the CommonJS export names for ESM import in node:2080 && (module.exports = {209  TestServerConnection,210  WebSocketTestServerTransport211});212