Skip to content

Commit

Permalink
Test: serialize models to temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
barucden committed Apr 19, 2024
1 parent dbf9f65 commit a18c094
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,12 @@ end
kernel(x1, x2) = x1' * x2

model₁ = svmtrain(X, y, kernel=kernel)
serialize("serialized_svm.jls", model₁)

model₂ = deserialize("serialized_svm.jls")
model₂ = mktempdir() do path
modelpath = joinpath(path, "serialized_svm.jls")
serialize(modelpath, model₁)
return deserialize(modelpath)
end

y₁ = svmpredict(model₁, X)
y₂ = svmpredict(model₂, X)
Expand Down

0 comments on commit a18c094

Please sign in to comment.