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
lru-cache.ts55 linesDownload Raw Back to lib
1// Export is needed because TypeScript complains about an error otherwise:2// Error: …/tailwind-merge/src/config-utils.ts(8,17): semantic error TS4058: Return type of exported function has or is using name 'LruCache' from external module "…/tailwind-merge/src/lru-cache" but cannot be named.3export interface LruCache<Key extends string, Value> {4    get(key: Key): Value | undefined5    set(key: Key, value: Value): void6}7 8// LRU cache implementation using plain objects for simplicity9export const createLruCache = <Key extends string, Value>(10    maxCacheSize: number,11): LruCache<Key, Value> => {12    if (maxCacheSize < 1) {13        return {14            get: () => undefined,15            set: () => {},16        }17    }18 19    let cacheSize = 020    let cache: Record<Key, Value> = Object.create(null)21    let previousCache: Record<Key, Value> = Object.create(null)22 23    const update = (key: Key, value: Value) => {24        cache[key] = value25        cacheSize++26 27        if (cacheSize > maxCacheSize) {28            cacheSize = 029            previousCache = cache30            cache = Object.create(null)31        }32    }33 34    return {35        get(key) {36            let value = cache[key]37 38            if (value !== undefined) {39                return value40            }41            if ((value = previousCache[key]) !== undefined) {42                update(key, value)43                return value44            }45        },46        set(key, value) {47            if (key in cache) {48                cache[key] = value49            } else {50                update(key, value)51            }52        },53    }54}55 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai