diff options
author | Juarez Bochi <juarez.bochi@grammarly.com> | 2023-11-06 23:35:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 05:35:37 +0100 |
commit | 508f811b93035f076e18778fe08106f15abfa8a7 (patch) | |
tree | b31cf3c6bbaf335ab8371f71a1353fe597bab8fd /candle-examples/examples/quantized-t5/main.rs | |
parent | a773a4b22b88d9955f51de552d72717441d49729 (diff) | |
download | candle-508f811b93035f076e18778fe08106f15abfa8a7.tar.gz candle-508f811b93035f076e18778fe08106f15abfa8a7.tar.bz2 candle-508f811b93035f076e18778fe08106f15abfa8a7.zip |
Add support for MADLAD400 (#1285)
* Add support for madlad
* Add support for quantized MADLAD
Diffstat (limited to 'candle-examples/examples/quantized-t5/main.rs')
-rw-r--r-- | candle-examples/examples/quantized-t5/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/candle-examples/examples/quantized-t5/main.rs b/candle-examples/examples/quantized-t5/main.rs index 5a1cdf0c..0ea2e0bd 100644 --- a/candle-examples/examples/quantized-t5/main.rs +++ b/candle-examples/examples/quantized-t5/main.rs @@ -173,7 +173,11 @@ fn main() -> Result<()> { .to_vec(); let input_token_ids = Tensor::new(&tokens[..], device)?.unsqueeze(0)?; let mut model = builder.build_model()?; - let mut output_token_ids = [builder.config.pad_token_id as u32].to_vec(); + let mut output_token_ids = [builder + .config + .decoder_start_token_id + .unwrap_or(builder.config.pad_token_id) as u32] + .to_vec(); let temperature = if args.temperature <= 0. { None } else { |