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
input.js274 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 input_exports = {};30__export(input_exports, {31  Keyboard: () => Keyboard,32  Mouse: () => Mouse,33  Touchscreen: () => Touchscreen,34  keypadLocation: () => keypadLocation,35  resolveSmartModifier: () => resolveSmartModifier,36  resolveSmartModifierString: () => resolveSmartModifierString37});38module.exports = __toCommonJS(input_exports);39var import_utils = require("../utils");40var keyboardLayout = __toESM(require("./usKeyboardLayout"));41var import_dom = require("./dom");42const keypadLocation = keyboardLayout.keypadLocation;43const kModifiers = ["Alt", "Control", "Meta", "Shift"];44class Keyboard {45  constructor(raw, page) {46    this._pressedModifiers = /* @__PURE__ */ new Set();47    this._pressedKeys = /* @__PURE__ */ new Set();48    this._raw = raw;49    this._page = page;50  }51  async down(progress, key) {52    const description = this._keyDescriptionForString(key);53    const autoRepeat = this._pressedKeys.has(description.code);54    this._pressedKeys.add(description.code);55    if (kModifiers.includes(description.key))56      this._pressedModifiers.add(description.key);57    await this._raw.keydown(progress, this._pressedModifiers, key, description, autoRepeat);58  }59  _keyDescriptionForString(str) {60    const keyString = resolveSmartModifierString(str);61    let description = usKeyboardLayout.get(keyString);62    if (!description)63      throw new import_dom.NonRecoverableDOMError(`Unknown key: "${keyString}"`);64    const shift = this._pressedModifiers.has("Shift");65    description = shift && description.shifted ? description.shifted : description;66    if (this._pressedModifiers.size > 1 || !this._pressedModifiers.has("Shift") && this._pressedModifiers.size === 1)67      return { ...description, text: "" };68    return description;69  }70  async up(progress, key) {71    const description = this._keyDescriptionForString(key);72    if (kModifiers.includes(description.key))73      this._pressedModifiers.delete(description.key);74    this._pressedKeys.delete(description.code);75    await this._raw.keyup(progress, this._pressedModifiers, key, description);76  }77  async insertText(progress, text) {78    await this._raw.sendText(progress, text);79  }80  async type(progress, text, options) {81    const delay = options && options.delay || void 0;82    for (const char of text) {83      if (usKeyboardLayout.has(char)) {84        await this.press(progress, char, { delay });85      } else {86        if (delay)87          await progress.wait(delay);88        await this.insertText(progress, char);89      }90    }91  }92  async press(progress, key, options = {}) {93    function split(keyString) {94      const keys = [];95      let building = "";96      for (const char of keyString) {97        if (char === "+" && building) {98          keys.push(building);99          building = "";100        } else {101          building += char;102        }103      }104      keys.push(building);105      return keys;106    }107    const tokens = split(key);108    key = tokens[tokens.length - 1];109    for (let i = 0; i < tokens.length - 1; ++i)110      await this.down(progress, tokens[i]);111    await this.down(progress, key);112    if (options.delay)113      await progress.wait(options.delay);114    await this.up(progress, key);115    for (let i = tokens.length - 2; i >= 0; --i)116      await this.up(progress, tokens[i]);117  }118  async ensureModifiers(progress, mm) {119    const modifiers = mm.map(resolveSmartModifier);120    for (const modifier of modifiers) {121      if (!kModifiers.includes(modifier))122        throw new Error("Unknown modifier " + modifier);123    }124    const restore = Array.from(this._pressedModifiers);125    for (const key of kModifiers) {126      const needDown = modifiers.includes(key);127      const isDown = this._pressedModifiers.has(key);128      if (needDown && !isDown)129        await this.down(progress, key);130      else if (!needDown && isDown)131        await this.up(progress, key);132    }133    return restore;134  }135  _modifiers() {136    return this._pressedModifiers;137  }138}139function resolveSmartModifierString(key) {140  if (key === "ControlOrMeta")141    return process.platform === "darwin" ? "Meta" : "Control";142  return key;143}144function resolveSmartModifier(m) {145  return resolveSmartModifierString(m);146}147class Mouse {148  constructor(raw, page) {149    this._x = 0;150    this._y = 0;151    this._lastButton = "none";152    this._buttons = /* @__PURE__ */ new Set();153    this._raw = raw;154    this._page = page;155    this._keyboard = this._page.keyboard;156  }157  currentPoint() {158    return { x: this._x, y: this._y };159  }160  async move(progress, x, y, options = {}) {161    const { steps = 1 } = options;162    const fromX = this._x;163    const fromY = this._y;164    this._x = x;165    this._y = y;166    for (let i = 1; i <= steps; i++) {167      const middleX = fromX + (x - fromX) * (i / steps);168      const middleY = fromY + (y - fromY) * (i / steps);169      await this._raw.move(progress, middleX, middleY, this._lastButton, this._buttons, this._keyboard._modifiers(), !!options.forClick);170    }171  }172  async down(progress, options = {}) {173    const { button = "left", clickCount = 1 } = options;174    this._lastButton = button;175    this._buttons.add(button);176    await this._raw.down(progress, this._x, this._y, this._lastButton, this._buttons, this._keyboard._modifiers(), clickCount);177  }178  async up(progress, options = {}) {179    const { button = "left", clickCount = 1 } = options;180    this._lastButton = "none";181    this._buttons.delete(button);182    await this._raw.up(progress, this._x, this._y, button, this._buttons, this._keyboard._modifiers(), clickCount);183  }184  async click(progress, x, y, options = {}) {185    const { delay = null, clickCount = 1 } = options;186    if (delay) {187      this.move(progress, x, y, { forClick: true });188      for (let cc = 1; cc <= clickCount; ++cc) {189        await this.down(progress, { ...options, clickCount: cc });190        await progress.wait(delay);191        await this.up(progress, { ...options, clickCount: cc });192        if (cc < clickCount)193          await progress.wait(delay);194      }195    } else {196      const promises = [];197      promises.push(this.move(progress, x, y, { forClick: true }));198      for (let cc = 1; cc <= clickCount; ++cc) {199        promises.push(this.down(progress, { ...options, clickCount: cc }));200        promises.push(this.up(progress, { ...options, clickCount: cc }));201      }202      await Promise.all(promises);203    }204  }205  async wheel(progress, deltaX, deltaY) {206    await this._raw.wheel(progress, this._x, this._y, this._buttons, this._keyboard._modifiers(), deltaX, deltaY);207  }208}209const aliases = /* @__PURE__ */ new Map([210  ["ShiftLeft", ["Shift"]],211  ["ControlLeft", ["Control"]],212  ["AltLeft", ["Alt"]],213  ["MetaLeft", ["Meta"]],214  ["Enter", ["\n", "\r"]]215]);216const usKeyboardLayout = buildLayoutClosure(keyboardLayout.USKeyboardLayout);217function buildLayoutClosure(layout) {218  const result = /* @__PURE__ */ new Map();219  for (const code in layout) {220    const definition = layout[code];221    const description = {222      key: definition.key || "",223      keyCode: definition.keyCode || 0,224      keyCodeWithoutLocation: definition.keyCodeWithoutLocation || definition.keyCode || 0,225      code,226      text: definition.text || "",227      location: definition.location || 0228    };229    if (definition.key.length === 1)230      description.text = description.key;231    let shiftedDescription;232    if (definition.shiftKey) {233      (0, import_utils.assert)(definition.shiftKey.length === 1);234      shiftedDescription = { ...description };235      shiftedDescription.key = definition.shiftKey;236      shiftedDescription.text = definition.shiftKey;237      if (definition.shiftKeyCode)238        shiftedDescription.keyCode = definition.shiftKeyCode;239    }240    result.set(code, { ...description, shifted: shiftedDescription });241    if (aliases.has(code)) {242      for (const alias of aliases.get(code))243        result.set(alias, description);244    }245    if (definition.location)246      continue;247    if (description.key.length === 1)248      result.set(description.key, description);249    if (shiftedDescription)250      result.set(shiftedDescription.key, { ...shiftedDescription, shifted: void 0 });251  }252  return result;253}254class Touchscreen {255  constructor(raw, page) {256    this._raw = raw;257    this._page = page;258  }259  async tap(progress, x, y) {260    if (!this._page.browserContext._options.hasTouch)261      throw new Error("hasTouch must be enabled on the browser context before using the touchscreen.");262    await this._raw.tap(progress, x, y, this._page.keyboard._modifiers());263  }264}265// Annotate the CommonJS export names for ESM import in node:2660 && (module.exports = {267  Keyboard,268  Mouse,269  Touchscreen,270  keypadLocation,271  resolveSmartModifier,272  resolveSmartModifierString273});274 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai