Skip to content

Commit

Permalink
stamp: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
nyannyacha committed Aug 22, 2024
1 parent 9fbc276 commit 62187be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/sb_ai/defs/text_classification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl PipelineDefinition for ZeroShotClassificationPipeline {

pad_encodings(encodings.as_mut_slice(), &PaddingParams::default()).unwrap();

let padded_token_length = encodings.get(0).unwrap().len();
let padded_token_length = encodings.first().unwrap().len();
let input_shape = [input.candidate_labels.len(), padded_token_length];

let input_ids = encodings
Expand Down Expand Up @@ -253,7 +253,7 @@ impl PipelineDefinition for ZeroShotClassificationPipeline {
.enumerate()
.map(|(idx, score)| TextClassificationOutput {
label: input.candidate_labels.get(idx).unwrap().to_owned(),
score: score.to_owned().into(),
score: score.to_owned(),
})
.collect::<Vec<_>>();

Expand Down

0 comments on commit 62187be

Please sign in to comment.