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('blocklist', () => {4 it('if no custom blocklist param, use the default blocklist', () => {5 const sqids = new Sqids()6 7 expect(sqids.decode('aho1e')).toEqual([4_572_721])8 expect(sqids.encode([4_572_721])).toBe('JExTR')9 })10 11 it(`if an empty blocklist param passed, don't use any blocklist`, () => {12 const sqids = new Sqids({13 blocklist: new Set([]),14 })15 16 expect(sqids.decode('aho1e')).toEqual([4_572_721])17 expect(sqids.encode([4_572_721])).toBe('aho1e')18 })19 20 it('if a non-empty blocklist param passed, use only that', () => {21 const sqids = new Sqids({22 blocklist: new Set([23 'ArUO', // originally encoded [100000]24 ]),25 })26 27 // make sure we don't use the default blocklist28 expect(sqids.decode('aho1e')).toEqual([4_572_721])29 expect(sqids.encode([4_572_721])).toBe('aho1e')30 31 // make sure we are using the passed blocklist32 expect(sqids.decode('ArUO')).toEqual([100_000])33 expect(sqids.encode([100_000])).toBe('QyG4')34 expect(sqids.decode('QyG4')).toEqual([100_000])35 })36 37 it('blocklist', () => {38 const sqids = new Sqids({39 blocklist: new Set([40 'JSwXFaosAN', // normal result of 1st encoding, let's block that word on purpose41 'OCjV9JK64o', // result of 2nd encoding42 'rBHf', // result of 3rd encoding is `4rBHfOiqd3`, let's block a substring43 '79SM', // result of 4th encoding is `dyhgw479SM`, let's block the postfix44 '7tE6', // result of 4th encoding is `7tE6jdAHLe`, let's block the prefix45 ]),46 })47 48 expect(sqids.encode([1_000_000, 2_000_000])).toBe('1aYeB7bRUt')49 expect(sqids.decode('1aYeB7bRUt')).toEqual([1_000_000, 2_000_000])50 })51 52 it('decoding blocklist words should still work', () => {53 const sqids = new Sqids({54 blocklist: new Set(['86Rf07', 'se8ojk', 'ARsz1p', 'Q8AI49', '5sQRZO']),55 })56 57 expect(sqids.decode('86Rf07')).toEqual([1, 2, 3])58 expect(sqids.decode('se8ojk')).toEqual([1, 2, 3])59 expect(sqids.decode('ARsz1p')).toEqual([1, 2, 3])60 expect(sqids.decode('Q8AI49')).toEqual([1, 2, 3])61 expect(sqids.decode('5sQRZO')).toEqual([1, 2, 3])62 })63 64 it('match against a short blocklist word', () => {65 const sqids = new Sqids({66 blocklist: new Set(['pnd']),67 })68 69 expect(sqids.decode(sqids.encode([1_000]))).toEqual([1_000])70 })71 72 it('blocklist filtering in constructor', () => {73 const sqids = new Sqids({74 alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',75 blocklist: new Set(['sxnzkl']), // lowercase blocklist in only-uppercase alphabet76 })77 78 const id = sqids.encode([1, 2, 3])79 const numbers = sqids.decode(id)80 81 expect(id).toBe('IBSHOZ') // without blocklist, would've been "SXNZKL"82 expect(numbers).toEqual([1, 2, 3])83 })84 85 it('max encoding attempts', () => {86 const alphabet = 'abc'87 const minLength = 388 const blocklist = new Set(['cab', 'abc', 'bca'])89 90 const sqids = new Sqids({91 alphabet,92 minLength,93 blocklist,94 })95 96 expect(alphabet).toHaveLength(minLength)97 expect(blocklist.size).toEqual(minLength)98 99 expect(() => sqids.encode([0])).toThrow(100 'Reached max attempts to re-generate the ID',101 )102 })103})104 