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
1const toDataView = require('to-data-view')2const decodeBmp = require('decode-bmp')3const ImageData = require('@canvas/image-data')4 5function isPng (view, offset) {6 return (view.getUint32(offset + 0) === 0x89504e47 && view.getUint32(offset + 4) === 0x0d0a1a0a)7}8 9function pngBitsPerPixel (view, offset) {10 const bitDepth = view.getUint8(offset + 24)11 const colorType = view.getUint8(offset + 25)12 13 if (colorType === 0) return bitDepth * 114 if (colorType === 2) return bitDepth * 315 if (colorType === 3) return bitDepth * 116 if (colorType === 4) return bitDepth * 217 if (colorType === 6) return bitDepth * 418 19 throw new Error('Invalid PNG colorType')20}21 22function pngWidth (view, offset) {23 return view.getUint32(offset + 16, false)24}25 26function pngHeight (view, offset) {27 return view.getUint32(offset + 20, false)28}29 30module.exports = function decodeIco (input) {31 const view = toDataView(input)32 33 if (view.byteLength < 6) {34 throw new Error('Truncated header')35 }36 37 if (isPng(view, 0)) {38 // the file is actually a png masquerading as an ico39 40 return [{41 bpp: pngBitsPerPixel(view, 0),42 data: new Uint8Array(view.buffer, view.byteOffset, view.byteLength),43 height: pngHeight(view, 0),44 hotspot: null,45 type: 'png',46 width: pngWidth(view, 0)47 }]48 }49 50 if (view.getUint16(0, true) !== 0) {51 throw new Error('Invalid magic bytes')52 }53 54 const type = view.getUint16(2, true)55 56 if (type !== 1 && type !== 2) {57 throw new Error('Invalid image type')58 }59 60 const length = view.getUint16(4, true)61 62 if (view.byteLength < 6 + (16 * length)) {63 throw new Error('Truncated image list')64 }65 66 return Array.from({ length }, (_, idx) => {67 const width = view.getUint8(6 + (16 * idx) + 0)68 const height = view.getUint8(6 + (16 * idx) + 1)69 const size = view.getUint32(6 + (16 * idx) + 8, true)70 const offset = view.getUint32(6 + (16 * idx) + 12, true)71 72 const hotspot = (type !== 2 ? null : {73 x: view.getUint16(6 + (16 * idx) + 4, true),74 y: view.getUint16(6 + (16 * idx) + 6, true)75 })76 77 if (isPng(view, offset)) {78 return {79 bpp: pngBitsPerPixel(view, offset),80 data: new Uint8Array(view.buffer, view.byteOffset + offset, size),81 height: pngHeight(view, offset),82 hotspot,83 type: 'png',84 width: pngWidth(view, offset)85 }86 }87 88 const data = new Uint8Array(view.buffer, view.byteOffset + offset, size)89 const bmp = decodeBmp(data, { width, height, icon: true })90 const info = { bpp: bmp.colorDepth, hotspot, type: 'bmp' }91 92 return Object.assign(new ImageData(bmp.data, bmp.width, bmp.height), info)93 })94}95 