Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
fix: move to self device (#309)
Browse files Browse the repository at this point in the history
* move to self device
* chlog

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Borda and pre-commit-ci[bot] authored Nov 21, 2022
1 parent 2e38190 commit 375be3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed passing config name to `CNNDailyMailSummarizationDataModule` ([#310](https://github.com/Lightning-AI/lightning-transformers/pull/310))


- Fixed move pipeline to `self.device` as default ([#309](https://github.com/Lightning-AI/lightning-transformers/pull/309))


## [0.2.4] - 2022-11-03

### Changed
Expand Down
1 change: 1 addition & 0 deletions lightning_transformers/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def hf_pipeline_task(self) -> Optional[str]:
def hf_pipeline(self) -> Pipeline:
if self._hf_pipeline is None:
if self.hf_pipeline_task is not None:
self._hf_pipeline_kwargs["device"] = self._hf_pipeline_kwargs.get("device", self.device)
self._hf_pipeline = hf_transformers_pipeline(
task=self.hf_pipeline_task, model=self.model, tokenizer=self.tokenizer, **self._hf_pipeline_kwargs
)
Expand Down

0 comments on commit 375be3e

Please sign in to comment.