-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2a4c93
commit 7d4f50b
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
argmax_sampler(logits; device=identity) = logits |> device |> Top_k(1) |> logitsample | ||
argmax_sampler(; kwargs...) = logits -> argmax_sampler(logits; kwargs...) | ||
|
||
top_pk_sampler(logits; p = 0.5f0, k = 5, device = identity) = logits |> device |> Top_pk(p, k) |> logitsample | ||
top_pk_sampler(; kwargs...) = logits -> top_pk_sampler(logits; kwargs...) | ||
|
||
min_p_sampler(logits; pbase = 0.5f0, device = identity) = logits |> device |> Min_p(pbase) |> logitsample | ||
min_p_sampler(; kwargs...) = logits -> min_p_sampler(logits; kwargs...) | ||
|
||
top_nσ_sampler(logits; temperature = 1.0f0, n = 1.0f0, device = identity) = logits |> device |> Temperature(temperature) |> Top_nσ(n) |> logitsample | ||
top_nσ_sampler(; kwargs...) = logits -> top_nσ_sampler(logits; kwargs...) |
7d4f50b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
Release notes:
logitsample
function for GPU-friendly weighted sampling in the log domain.LogitTransform
type.Temperate
type.Top_pk
type with additionalTop_p
andTop_k
constructors.Min_p
type.Top_nσ
type.argmax_sampler
,top_pk_sampler
,min_p_sampler
, andtop_nσ_sampler
functions.7d4f50b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request updated: JuliaRegistries/General/120312
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: