From fe18962802fac60a6fe14dc76cca18685559e9a1 Mon Sep 17 00:00:00 2001 From: monofuel Date: Sun, 21 Apr 2024 00:53:31 -0400 Subject: [PATCH] Revert "fix dump hooks" This reverts commit ee59d479b08b7bceb9d33946457f6324c84da873. --- src/llama_leap.nim | 2 +- tests/test_llama_leap.nim | 25 +------------------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/llama_leap.nim b/src/llama_leap.nim index 16f5745..073b992 100644 --- a/src/llama_leap.nim +++ b/src/llama_leap.nim @@ -129,7 +129,7 @@ proc dumpHook(v: var ShowModel, fieldName: var string) = fieldName = "template" -proc dumpHook*(s: var string, v: object) = +proc dumpHook(s: var string, v: object) = ## jsony `hack` to skip optional fields that are nil s.add '{' var i = 0 diff --git a/tests/test_llama_leap.nim b/tests/test_llama_leap.nim index 27d30e2..eb8db04 100644 --- a/tests/test_llama_leap.nim +++ b/tests/test_llama_leap.nim @@ -3,31 +3,8 @@ import llama_leap, jsony, std/[unittest, json, options, strutils] -proc dumpHook*(s: var string, v: object) = - ## jsony `hack` to skip optional fields that are nil - s.add '{' - var i = 0 - # Normal objects. - for k, e in v.fieldPairs: - when compiles(e.isSome): - if e.isSome: - if i > 0: - s.add ',' - s.dumpHook(k) - s.add ':' - s.dumpHook(e) - inc i - else: - if i > 0: - s.add ',' - s.dumpHook(k) - s.add ':' - s.dumpHook(e) - inc i - s.add '}' - const - TestModel = "llama3" + TestModel = "llama2" TestModelfileName = "test-pirate-llama2" suite "llama_leap":