From 06e6b32851f62fa9ee9f490630dd6f4a0055757b Mon Sep 17 00:00:00 2001 From: SpirosMakris <7399023+SpirosMakris@users.noreply.github.com> Date: Tue, 2 May 2023 21:08:22 +0300 Subject: [PATCH] fix typo in SentenceEmbeddingsModelOuput (#365) --- src/pipelines/sentence_embeddings/mod.rs | 2 +- src/pipelines/sentence_embeddings/pipeline.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pipelines/sentence_embeddings/mod.rs b/src/pipelines/sentence_embeddings/mod.rs index 3ac4bcf74..974c33de7 100644 --- a/src/pipelines/sentence_embeddings/mod.rs +++ b/src/pipelines/sentence_embeddings/mod.rs @@ -41,7 +41,7 @@ pub use config::{ SentenceEmbeddingsTokenizerConfig, }; pub use pipeline::{ - SentenceEmbeddingsModel, SentenceEmbeddingsModelOuput, SentenceEmbeddingsOption, + SentenceEmbeddingsModel, SentenceEmbeddingsModelOutput, SentenceEmbeddingsOption, SentenceEmbeddingsTokenizerOuput, }; diff --git a/src/pipelines/sentence_embeddings/pipeline.rs b/src/pipelines/sentence_embeddings/pipeline.rs index 1587ddcb1..249151852 100644 --- a/src/pipelines/sentence_embeddings/pipeline.rs +++ b/src/pipelines/sentence_embeddings/pipeline.rs @@ -337,7 +337,7 @@ impl SentenceEmbeddingsModel { pub fn encode_as_tensor( &self, inputs: &[S], - ) -> Result + ) -> Result where S: AsRef + Sync, { @@ -368,7 +368,7 @@ impl SentenceEmbeddingsModel { maybe_linear }; - Ok(SentenceEmbeddingsModelOuput { + Ok(SentenceEmbeddingsModelOutput { embeddings: maybe_normalized, all_attentions, }) @@ -379,7 +379,7 @@ impl SentenceEmbeddingsModel { where S: AsRef + Sync, { - let SentenceEmbeddingsModelOuput { embeddings, .. } = self.encode_as_tensor(inputs)?; + let SentenceEmbeddingsModelOutput { embeddings, .. } = self.encode_as_tensor(inputs)?; Ok(Vec::from(embeddings)) } @@ -423,7 +423,7 @@ impl SentenceEmbeddingsModel { where S: AsRef + Sync, { - let SentenceEmbeddingsModelOuput { + let SentenceEmbeddingsModelOutput { embeddings, all_attentions, } = self.encode_as_tensor(inputs)?; @@ -463,7 +463,7 @@ pub struct SentenceEmbeddingsTokenizerOuput { } /// Container for the SentenceEmbeddings model output. -pub struct SentenceEmbeddingsModelOuput { +pub struct SentenceEmbeddingsModelOutput { pub embeddings: Tensor, pub all_attentions: Option>, }