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

fix loading HF model #306

Merged
merged 6 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.2.2
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand All @@ -56,7 +56,7 @@ repos:
require_serial: false

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
name: Format code
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed loading HF model ([#306](https://github.com/Lightning-AI/lightning-transformers/pull/306))


- Fixed passing config name to `CNNDailyMailSummarizationDataModule` ([#310](https://github.com/Lightning-AI/lightning-transformers/pull/310))


Expand Down
4 changes: 3 additions & 1 deletion lightning_transformers/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def initialize_model(self, pretrained_model_name_or_path: str):
pretrained_model_name_or_path, **self.model_data_kwargs
)
else:
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **self.model_data_kwargs)
config = AutoConfig.from_pretrained(
pretrained_model_name_or_path=self.model_data_kwargs["pretrained_model"], **self.model_data_kwargs
)
self.model = self.downstream_model_type.from_config(config)

def configure_optimizers(self) -> Dict:
Expand Down