pub fn decode(&self, ids: Vec<u32>, skip_special_tokens: bool) -> Result<String> {
        let tokens = ids
            .into_iter()
            .filter_map(|id| {
                self.added_vocabulary
                    .id_to_token(id, &self.model)
                    .filter(|token| {
                        !skip_special_tokens || !self.added_vocabulary.is_special_token(token)
                    })
            })
            .collect::<Vec<_>>();

        if let Some(decoder) = &self.decoder {
            decoder.decode(tokens)
        } else {
            Ok(tokens.join(" "))
        }
    }
/// Decode the given ids, back to a String
Decode the given ids, back to a String
Decode the given ids back to a String
pub fn decode(&self, ids: Vec<u32>, skip_special_tokens: bool) -> Result<String> {
        let tokens = ids
            .into_iter()
            .filter_map(|id| {
                self.added_vocabulary
                    .id_to_token(id, &self.model)
                    .filter(|token| {
                        !skip_special_tokens || !self.added_vocabulary.is_special_token(token)
                    })
            })
            .collect::<Vec<_>>();
        if let Some(decoder) = &self.decoder {
            decoder.decode(tokens)
        } else {
            Ok(tokens.join(" "))
        }
    }
pub fn decode ( & self , ids : Vec < u32 > , skip_special_tokens : bool ) -> Result < String > { let tokens = ids . into_iter ( ) . filter_map ( | id | { self . added_vocabulary . id_to_token ( id , & self . model ) . filter ( | token | { ! skip_special_tokens || ! self . added_vocabulary . is_special_token ( token ) } ) } ) . collect :: < Vec < _ > > ( ) ; if let Some ( decoder ) = & self . decoder { decoder . decode ( tokens ) } else { Ok ( tokens . join ( " " ) ) } }
Decode the given ids, back to a String
Decode the given ids back to a String
&self
ids
Vec<u32>
skip_special_tokens
bool