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
comparator.js144 linesDownload Raw Back to classes
1'use strict'2 3const ANY = Symbol('SemVer ANY')4// hoisted class for cyclic dependency5class Comparator {6  static get ANY () {7    return ANY8  }9 10  constructor (comp, options) {11    options = parseOptions(options)12 13    if (comp instanceof Comparator) {14      if (comp.loose === !!options.loose) {15        return comp16      } else {17        comp = comp.value18      }19    }20 21    comp = comp.trim().split(/\s+/).join(' ')22    debug('comparator', comp, options)23    this.options = options24    this.loose = !!options.loose25    this.parse(comp)26 27    if (this.semver === ANY) {28      this.value = ''29    } else {30      this.value = this.operator + this.semver.version31    }32 33    debug('comp', this)34  }35 36  parse (comp) {37    const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]38    const m = comp.match(r)39 40    if (!m) {41      throw new TypeError(`Invalid comparator: ${comp}`)42    }43 44    this.operator = m[1] !== undefined ? m[1] : ''45    if (this.operator === '=') {46      this.operator = ''47    }48 49    // if it literally is just '>' or '' then allow anything.50    if (!m[2]) {51      this.semver = ANY52    } else {53      this.semver = new SemVer(m[2], this.options.loose)54    }55  }56 57  toString () {58    return this.value59  }60 61  test (version) {62    debug('Comparator.test', version, this.options.loose)63 64    if (this.semver === ANY || version === ANY) {65      return true66    }67 68    if (typeof version === 'string') {69      try {70        version = new SemVer(version, this.options)71      } catch (er) {72        return false73      }74    }75 76    return cmp(version, this.operator, this.semver, this.options)77  }78 79  intersects (comp, options) {80    if (!(comp instanceof Comparator)) {81      throw new TypeError('a Comparator is required')82    }83 84    if (this.operator === '') {85      if (this.value === '') {86        return true87      }88      return new Range(comp.value, options).test(this.value)89    } else if (comp.operator === '') {90      if (comp.value === '') {91        return true92      }93      return new Range(this.value, options).test(comp.semver)94    }95 96    options = parseOptions(options)97 98    // Special cases where nothing can possibly be lower99    if (options.includePrerelease &&100      (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {101      return false102    }103    if (!options.includePrerelease &&104      (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {105      return false106    }107 108    // Same direction increasing (> or >=)109    if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {110      return true111    }112    // Same direction decreasing (< or <=)113    if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {114      return true115    }116    // same SemVer and both sides are inclusive (<= or >=)117    if (118      (this.semver.version === comp.semver.version) &&119      this.operator.includes('=') && comp.operator.includes('=')) {120      return true121    }122    // opposite directions less than123    if (cmp(this.semver, '<', comp.semver, options) &&124      this.operator.startsWith('>') && comp.operator.startsWith('<')) {125      return true126    }127    // opposite directions greater than128    if (cmp(this.semver, '>', comp.semver, options) &&129      this.operator.startsWith('<') && comp.operator.startsWith('>')) {130      return true131    }132    return false133  }134}135 136module.exports = Comparator137 138const parseOptions = require('../internal/parse-options')139const { safeRe: re, t } = require('../internal/re')140const cmp = require('../functions/cmp')141const debug = require('../internal/debug')142const SemVer = require('./semver')143const Range = require('./range')144 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai