Skip to content

Commit

Permalink
fix typo in SentenceEmbeddingsModelOuput (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpirosMakris committed May 2, 2023
1 parent 02967b1 commit 06e6b32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pipelines/sentence_embeddings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub use config::{
SentenceEmbeddingsTokenizerConfig,
};
pub use pipeline::{
SentenceEmbeddingsModel, SentenceEmbeddingsModelOuput, SentenceEmbeddingsOption,
SentenceEmbeddingsModel, SentenceEmbeddingsModelOutput, SentenceEmbeddingsOption,
SentenceEmbeddingsTokenizerOuput,
};

Expand Down
10 changes: 5 additions & 5 deletions src/pipelines/sentence_embeddings/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl SentenceEmbeddingsModel {
pub fn encode_as_tensor<S>(
&self,
inputs: &[S],
) -> Result<SentenceEmbeddingsModelOuput, RustBertError>
) -> Result<SentenceEmbeddingsModelOutput, RustBertError>
where
S: AsRef<str> + Sync,
{
Expand Down Expand Up @@ -368,7 +368,7 @@ impl SentenceEmbeddingsModel {
maybe_linear
};

Ok(SentenceEmbeddingsModelOuput {
Ok(SentenceEmbeddingsModelOutput {
embeddings: maybe_normalized,
all_attentions,
})
Expand All @@ -379,7 +379,7 @@ impl SentenceEmbeddingsModel {
where
S: AsRef<str> + Sync,
{
let SentenceEmbeddingsModelOuput { embeddings, .. } = self.encode_as_tensor(inputs)?;
let SentenceEmbeddingsModelOutput { embeddings, .. } = self.encode_as_tensor(inputs)?;
Ok(Vec::from(embeddings))
}

Expand Down Expand Up @@ -423,7 +423,7 @@ impl SentenceEmbeddingsModel {
where
S: AsRef<str> + Sync,
{
let SentenceEmbeddingsModelOuput {
let SentenceEmbeddingsModelOutput {
embeddings,
all_attentions,
} = self.encode_as_tensor(inputs)?;
Expand Down Expand Up @@ -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<Vec<Tensor>>,
}

0 comments on commit 06e6b32

Please sign in to comment.