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
schema.js110 linesDownload Raw Back to lib
1'use strict'2 3const YAMLException = require('./exception')4const Type = require('./type')5 6function compileList (schema, name) {7  const result = []8 9  schema[name].forEach(function (currentType) {10    let newIndex = result.length11 12    result.forEach(function (previousType, previousIndex) {13      if (previousType.tag === currentType.tag &&14          previousType.kind === currentType.kind &&15          previousType.multi === currentType.multi) {16        newIndex = previousIndex17      }18    })19 20    result[newIndex] = currentType21  })22 23  return result24}25 26function compileMap (/* lists... */) {27  const result = {28    scalar: {},29    sequence: {},30    mapping: {},31    fallback: {},32    multi: {33      scalar: [],34      sequence: [],35      mapping: [],36      fallback: []37    }38  }39  function collectType (type) {40    if (type.multi) {41      result.multi[type.kind].push(type)42      result.multi['fallback'].push(type)43    } else {44      result[type.kind][type.tag] = result['fallback'][type.tag] = type45    }46  }47 48  for (let index = 0, length = arguments.length; index < length; index += 1) {49    arguments[index].forEach(collectType)50  }51  return result52}53 54function Schema (definition) {55  return this.extend(definition)56}57 58Schema.prototype.extend = function extend (definition) {59  let implicit = []60  let explicit = []61 62  if (definition instanceof Type) {63    // Schema.extend(type)64    explicit.push(definition)65  } else if (Array.isArray(definition)) {66    // Schema.extend([ type1, type2, ... ])67    explicit = explicit.concat(definition)68  } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {69    // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })70    if (definition.implicit) implicit = implicit.concat(definition.implicit)71    if (definition.explicit) explicit = explicit.concat(definition.explicit)72  } else {73    throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +74      'or a schema definition ({ implicit: [...], explicit: [...] })')75  }76 77  implicit.forEach(function (type) {78    if (!(type instanceof Type)) {79      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')80    }81 82    if (type.loadKind && type.loadKind !== 'scalar') {83      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.')84    }85 86    if (type.multi) {87      throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.')88    }89  })90 91  explicit.forEach(function (type) {92    if (!(type instanceof Type)) {93      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')94    }95  })96 97  const result = Object.create(Schema.prototype)98 99  result.implicit = (this.implicit || []).concat(implicit)100  result.explicit = (this.explicit || []).concat(explicit)101 102  result.compiledImplicit = compileList(result, 'implicit')103  result.compiledExplicit = compileList(result, 'explicit')104  result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit)105 106  return result107}108 109module.exports = Schema110 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai