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'2 3let { existsSync, readFileSync } = require('fs')4let { dirname, isAbsolute, join, relative, sep } = require('path')5let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')6 7function fromBase64(str) {8 if (Buffer) {9 return Buffer.from(str, 'base64').toString()10 } else {11 /* c8 ignore next 2 */12 return window.atob(str)13 }14}15 16class PreviousMap {17 constructor(css, opts) {18 if (opts.map === false) return19 if (opts.unsafeMap) this.unsafeMap = true20 this.loadAnnotation(css)21 this.inline = this.startWith(this.annotation, 'data:')22 23 let prev = opts.map ? opts.map.prev : undefined24 let text = this.loadMap(opts.from, prev)25 if (!this.mapFile && opts.from) {26 this.mapFile = opts.from27 }28 if (this.mapFile) this.root = dirname(this.mapFile)29 if (text) this.text = text30 }31 32 consumer() {33 if (!this.consumerCache) {34 this.consumerCache = new SourceMapConsumer(this.json || this.text)35 }36 return this.consumerCache37 }38 39 decodeInline(text) {40 let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/41 let baseUri = /^data:application\/json;base64,/42 let charsetUri = /^data:application\/json;charset=utf-?8,/43 let uri = /^data:application\/json,/44 45 let uriMatch = text.match(charsetUri) || text.match(uri)46 if (uriMatch) {47 return decodeURIComponent(text.substr(uriMatch[0].length))48 }49 50 let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri)51 if (baseUriMatch) {52 return fromBase64(text.substr(baseUriMatch[0].length))53 }54 55 let encoding = text.slice('data:application/json;'.length)56 encoding = encoding.slice(0, encoding.indexOf(','))57 throw new Error('Unsupported source map encoding ' + encoding)58 }59 60 getAnnotationURL(sourceMapString) {61 return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim()62 }63 64 isMap(map) {65 if (typeof map !== 'object') return false66 return (67 typeof map.mappings === 'string' ||68 typeof map._mappings === 'string' ||69 Array.isArray(map.sections)70 )71 }72 73 loadAnnotation(css) {74 let comments = css.match(/\/\*\s*# sourceMappingURL=/g)75 if (!comments) return76 77 // sourceMappingURLs from comments, strings, etc.78 let start = css.lastIndexOf(comments.pop())79 let end = css.indexOf('*/', start)80 81 if (start > -1 && end > -1) {82 // Locate the last sourceMappingURL to avoid pickin83 this.annotation = this.getAnnotationURL(css.substring(start, end))84 }85 }86 87 loadFile(path, cssFile, trusted) {88 if (!trusted && !this.unsafeMap) {89 if (!/\.map$/i.test(path)) return undefined90 if (!cssFile) return undefined91 92 let rel = relative(dirname(cssFile), path)93 if (rel === '..' || rel.startsWith('..' + sep) || isAbsolute(rel)) {94 return undefined95 }96 }97 this.root = dirname(path)98 if (existsSync(path)) {99 this.mapFile = path100 return readFileSync(path, 'utf-8').toString().trim()101 }102 }103 104 loadMap(file, prev) {105 if (prev === false) return false106 107 if (prev) {108 if (typeof prev === 'string') {109 return prev110 } else if (typeof prev === 'function') {111 let prevPath = prev(file)112 if (prevPath) {113 let map = this.loadFile(prevPath, file, true)114 if (!map) {115 throw new Error(116 'Unable to load previous source map: ' + prevPath.toString()117 )118 }119 return map120 }121 } else if (prev instanceof SourceMapConsumer) {122 return SourceMapGenerator.fromSourceMap(prev).toString()123 } else if (prev instanceof SourceMapGenerator) {124 return prev.toString()125 } else if (this.isMap(prev)) {126 return JSON.stringify(prev)127 } else {128 throw new Error(129 'Unsupported previous source map format: ' + prev.toString()130 )131 }132 } else if (this.inline) {133 return this.decodeInline(this.annotation)134 } else if (this.annotation) {135 let map = this.annotation136 if (file) map = join(dirname(file), map)137 let unknown = this.loadFile(map, file, false)138 if (unknown) {139 try {140 /* c8 ignore next 4 */141 this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, ''))142 } catch {143 return undefined144 }145 }146 return unknown147 }148 }149 150 startWith(string, start) {151 if (!string) return false152 return string.substr(0, start.length) === start153 }154 155 withContent() {156 return !!(157 this.consumer().sourcesContent &&158 this.consumer().sourcesContent.length > 0159 )160 }161}162 163module.exports = PreviousMap164PreviousMap.default = PreviousMap165 