Skip to content

Commit

Permalink
adds test
Browse files Browse the repository at this point in the history
  • Loading branch information
JBGruber committed Apr 28, 2024
1 parent 65f2d05 commit 221dcb5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/lib.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ pgrs <- function(resp) {
the$str_prgs$stream_resp <- c(the$str_prgs$stream_resp, resp)
resp <- the$str_prgs$stream_resp

status <- strsplit(rawToChar(resp), "\n")[[1]] |>
grep("}$", x = _, value = TRUE) |>
status <- strsplit(rawToChar(resp), "\n")[[1]]
status <- grep("}$", x = status, value = TRUE) |>
textConnection() |>
jsonlite::stream_in(verbose = FALSE, simplifyVector = FALSE)

Expand Down
9 changes: 9 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,35 @@ CMD
ChatGPT
Codecov
Embeddings
GQA
Hvitfeldt
JSON
LLM
LLMs
Mirostat
Modelfile
ORCID
Ollama
OpenAI's
OpenAI’s
RMDs
Reichardt
arXiv
behaviour
config
ctx
embeddings
gpu
gqa
http
httr
llava
macOS
mirostat
modelfile
modelname
num
orca
tfs
tibble
unnesting
7 changes: 7 additions & 0 deletions tests/testthat/test-models.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ test_that("delete model", {
"model.mario-copy.removed")
})

test_that("model missing", {
skip_if_not(ping_ollama(silent = TRUE))
expect_error(check_model_installed("NOMODEL"),
"Model NOMODEL not installed.")
})


0 comments on commit 221dcb5

Please sign in to comment.