mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
Gumbel-Softmax sampling. (#2894)
* Gumbel-Softmax sampling. * Add a sampling test. * Share the gumbel-softmax bits.
This commit is contained in:
@ -46,7 +46,7 @@ impl TextGeneration {
|
||||
Sampling::ArgMax
|
||||
} else {
|
||||
match (top_k, top_p) {
|
||||
(None, None) => Sampling::All { temperature },
|
||||
(None, None) => Sampling::GumbelSoftmax { temperature },
|
||||
(Some(k), None) => Sampling::TopK { k, temperature },
|
||||
(None, Some(p)) => Sampling::TopP { p, temperature },
|
||||
(Some(k), Some(p)) => Sampling::TopKThenTopP { k, p, temperature },
|
||||
|
Reference in New Issue
Block a user