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
1import Sqids from '../sqids'2 3describe('encoding', () => {4 it('simple', () => {5 const sqids = new Sqids()6 7 const numbers = [1, 2, 3]8 const id = '86Rf07'9 10 expect(sqids.encode(numbers)).toBe(id)11 expect(sqids.decode(id)).toEqual(numbers)12 })13 14 it('different inputs', () => {15 const numbers = [16 0,17 0,18 0,19 1,20 2,21 3,22 100,23 1_000,24 100_000,25 1_000_000,26 Number.MAX_SAFE_INTEGER,27 ]28 29 const sqids = new Sqids()30 expect(sqids.decode(sqids.encode(numbers))).toEqual(numbers)31 })32 33 it('incremental numbers', () => {34 const sqids = new Sqids()35 36 const ids = {37 bM: [0],38 Uk: [1],39 gb: [2],40 Ef: [3],41 Vq: [4],42 uw: [5],43 OI: [6],44 AX: [7],45 p6: [8],46 nJ: [9],47 }48 49 for (const [id, numbers] of Object.entries(ids)) {50 expect(sqids.encode(numbers)).toBe(id)51 expect(sqids.decode(id)).toEqual(numbers)52 }53 })54 55 it('incremental numbers, same index 0', () => {56 const sqids = new Sqids()57 58 const ids = {59 SvIz: [0, 0],60 n3qa: [0, 1],61 tryF: [0, 2],62 eg6q: [0, 3],63 rSCF: [0, 4],64 sR8x: [0, 5],65 uY2M: [0, 6],66 '74dI': [0, 7],67 '30WX': [0, 8],68 moxr: [0, 9],69 }70 71 for (const [id, numbers] of Object.entries(ids)) {72 expect(sqids.encode(numbers)).toBe(id)73 expect(sqids.decode(id)).toEqual(numbers)74 }75 })76 77 it('incremental numbers, same index 1', () => {78 const sqids = new Sqids()79 80 const ids = {81 SvIz: [0, 0],82 nWqP: [1, 0],83 tSyw: [2, 0],84 eX68: [3, 0],85 rxCY: [4, 0],86 sV8a: [5, 0],87 uf2K: [6, 0],88 '7Cdk': [7, 0],89 '3aWP': [8, 0],90 m2xn: [9, 0],91 }92 93 for (const [id, numbers] of Object.entries(ids)) {94 expect(sqids.encode(numbers)).toBe(id)95 expect(sqids.decode(id)).toEqual(numbers)96 }97 })98 99 it('multi input', () => {100 const sqids = new Sqids()101 102 const numbers = [103 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,104 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,105 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,106 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,107 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,108 93, 94, 95, 96, 97, 98, 99,109 ]110 const output = sqids.decode(sqids.encode(numbers))111 expect(numbers).toEqual(output)112 })113 114 it('encoding no numbers', () => {115 const sqids = new Sqids()116 expect(sqids.encode([])).toBe('')117 })118 119 it('decoding empty string', () => {120 const sqids = new Sqids()121 expect(sqids.decode('')).toEqual([])122 })123 124 it('decoding an ID with an invalid character', () => {125 const sqids = new Sqids()126 expect(sqids.decode('*')).toEqual([])127 })128 129 it('encode out-of-range numbers', () => {130 const sqids = new Sqids()131 const encodingError = `Encoding supports numbers between 0 and ${Number.MAX_SAFE_INTEGER}`132 133 expect(() => sqids.encode([-1])).toThrow(encodingError)134 expect(() => sqids.encode([Number.MAX_SAFE_INTEGER + 1])).toThrow(135 encodingError,136 )137 })138})139 