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":