Skip to content

Commit

Permalink
Fixed clippy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-be committed Oct 17, 2020
1 parent 7b84ff5 commit 642b30d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pipelines/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ impl Conversation {
/// # Ok(())
/// # }
/// ```
pub fn load_from_history<'a, ST, SI, STR, SIN>(&mut self, texts: ST, ids: SI)
pub fn load_from_history<ST, SI, STR, SIN>(&mut self, texts: ST, ids: SI)
where
ST: AsRef<[STR]>,
SI: AsRef<[SIN]>,
Expand Down Expand Up @@ -733,7 +733,7 @@ impl ConversationModel {

let history = active_conversations
.iter()
.map(|c| c.history.iter().flatten().map(|&v| v).collect())
.map(|c| c.history.iter().flatten().copied().collect())
.collect_vec();

let prompt_ids = self.encode_prompts(texts.as_slice());
Expand Down Expand Up @@ -795,7 +795,7 @@ impl ConversationModel {
removed_tokens
}

fn concat_input_history(&self, inputs: &Vec<Vec<i64>>, history: Vec<Vec<i64>>) -> Tensor {
fn concat_input_history(&self, inputs: &[Vec<i64>], history: Vec<Vec<i64>>) -> Tensor {
// Concatenates the history token indices with new user input
let pad_token = self.model.get_pad_id().unwrap_or(self.eos_token_id);

Expand Down

0 comments on commit 642b30d

Please sign in to comment.