Skip to content

Commit

Permalink
switch tests to llama 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
monofuel committed Jul 27, 2024
1 parent fe18962 commit 476c5cd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test_llama_leap.nim
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
## llama_leap API tests
## Ensure that ollama is running!

import llama_leap, jsony, std/[unittest, json, options, strutils]
import
std/[unittest, json, options, strutils],
llama_leap, jsony

const
TestModel = "llama2"
TestModelfileName = "test-pirate-llama2"
TestModel = "llama3.1:8b"
TestModelfileName = "test-pirate-llama3.1"

suite "llama_leap":
var ollama: OllamaAPI
Expand Down Expand Up @@ -33,7 +35,7 @@ suite "llama_leap":

suite "generate":

test "load llama2":
test "load llama3.1":
ollama.loadModel(TestModel)

test "simple /api/generate":
Expand Down Expand Up @@ -118,10 +120,11 @@ suite "llama_leap":
)
let resp = ollama.chat(req)
echo "> " & resp.message.content.strip()

suite "create":
test "create specifying modelfile":
let modelfile = """
FROM llama2
FROM llama3.1:8b
PARAMETER temperature 0
PARAMETER num_ctx 4096
Expand Down
27 changes: 27 additions & 0 deletions tests/test_ollama_tools.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## ollama tools test
## Ensure that ollama is running!

import
std/[unittest],
llama_leap

# Must use a tools compatible model!
const
TestModel = "llama3.1:8b"

suite "ollama tools":
var ollama: OllamaAPI

setup:
ollama = newOllamaAPI()
teardown:
ollama.close()

suite "version":
test "version":
echo "> " & ollama.getVersion()
suite "pull":
test "pull model":
ollama.pullModel(TestModel)

# TODO do the thing

0 comments on commit 476c5cd

Please sign in to comment.