Skip to content

Commit

Permalink
fix issue where device selection was lost when creating remote model (g…
Browse files Browse the repository at this point in the history
…uillaume-be#353)

* fix issue where device selection was lost when creating model from remote

* remove local var

* fix
  • Loading branch information
matthewgapp committed Apr 17, 2023
1 parent b40adb8 commit 68543fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pipelines/sentence_embeddings/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ impl SentenceEmbeddingsBuilder<Remote> {
self
}

pub fn create_model(self) -> Result<SentenceEmbeddingsModel, RustBertError> {
pub fn create_model(mut self) -> Result<SentenceEmbeddingsModel, RustBertError> {
self.inner.config.device = self.device;
SentenceEmbeddingsModel::new(self.inner.config)
}
}

0 comments on commit 68543fe

Please sign in to comment.