Skip to content

Commit

Permalink
Packaging tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
murrellb committed Nov 25, 2024
1 parent 864c221 commit 58743b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "1.0.0-DEV"

[deps]
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
julia = "1.9"
Expand Down
2 changes: 2 additions & 0 deletions src/LogitSamplers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module LogitSamplers

using NNlib, StatsBase

include("samplers.jl")

export argmax_sampler, top_pk_sampler, min_p_sampler, top_nσ_sampler
Expand Down
3 changes: 3 additions & 0 deletions src/samplers.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#To do: refactor into a combination of modified_softmax and sample. This way we can viz the result of the modified logits without having to sample.
#This won't be visible to the user. Any method that doesn't fit this interface can be implemented directly.

function argmax_sampler(logits::AbstractVector; device = identity)
return argmax(device(logits))
end
Expand Down

0 comments on commit 58743b2

Please sign in to comment.