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// @ts-ignore TS61332import { expect, test } from "vitest";3 4import * as z from "zod/v3";5import { util } from "../helpers/util.js";6 7const minTwo = z.string().array().min(2);8const maxTwo = z.string().array().max(2);9const justTwo = z.string().array().length(2);10const intNum = z.string().array().nonempty();11const nonEmptyMax = z.string().array().nonempty().max(2);12 13type t1 = z.infer<typeof nonEmptyMax>;14util.assertEqual<[string, ...string[]], t1>(true);15 16type t2 = z.infer<typeof minTwo>;17util.assertEqual<string[], t2>(true);18 19test("passing validations", () => {20 minTwo.parse(["a", "a"]);21 minTwo.parse(["a", "a", "a"]);22 maxTwo.parse(["a", "a"]);23 maxTwo.parse(["a"]);24 justTwo.parse(["a", "a"]);25 intNum.parse(["a"]);26 nonEmptyMax.parse(["a"]);27});28 29test("failing validations", () => {30 expect(() => minTwo.parse(["a"])).toThrow();31 expect(() => maxTwo.parse(["a", "a", "a"])).toThrow();32 expect(() => justTwo.parse(["a"])).toThrow();33 expect(() => justTwo.parse(["a", "a", "a"])).toThrow();34 expect(() => intNum.parse([])).toThrow();35 expect(() => nonEmptyMax.parse([])).toThrow();36 expect(() => nonEmptyMax.parse(["a", "a", "a"])).toThrow();37});38 39test("parse empty array in nonempty", () => {40 expect(() =>41 z42 .array(z.string())43 .nonempty()44 .parse([] as any)45 ).toThrow();46});47 48test("get element", () => {49 justTwo.element.parse("asdf");50 expect(() => justTwo.element.parse(12)).toThrow();51});52 53test("continue parsing despite array size error", () => {54 const schema = z.object({55 people: z.string().array().min(2),56 });57 58 const result = schema.safeParse({59 people: [123],60 });61 expect(result.success).toEqual(false);62 if (!result.success) {63 expect(result.error.issues.length).toEqual(2);64 }65});66 67test("parse should fail given sparse array", () => {68 const schema = z.array(z.string()).nonempty().min(1).max(3);69 70 expect(() => schema.parse(new Array(3))).toThrow();71});72 