Skip to content

Commit

Permalink
Bug fix in downloading pretrained models with multilabel classification
Browse files Browse the repository at this point in the history
  • Loading branch information
ThilinaRajapakse committed Jan 20, 2020
1 parent 8ade0f4 commit ce5afd7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.18.8] - 2020-01-18
## [0.18.9] - 2020-01-20
### Fixed
- Fixed bug with importing certain pre-trained models in `MultiLabelClassificationModel`.

## [0.18.8] - 2020-01-20
### Added
- Added `**kwargs` to the init methods of `ClassificationModel`, `MultiLabelClassificationModel`, `QuestionAnsweringModel`, and `NERModel`. These will be passed to the `from_pretrained()` method of the underlying model class.

Expand Down Expand Up @@ -192,7 +196,9 @@ Model checkpoint is now saved for all epochs again.
- This CHANGELOG file to hopefully serve as an evolving example of a
standardized open source project CHANGELOG.

[0.18.8]: https://github.com/ThilinaRajapakse/simpletransformers/compare/44afa70...HEAD
[0.18.9]: https://github.com/ThilinaRajapakse/simpletransformers/compare/8ade0f4...HEAD

[0.18.8]: https://github.com/ThilinaRajapakse/simpletransformers/compare/44afa70...8ade0f4

[0.18.6]: https://github.com/ThilinaRajapakse/simpletransformers/compare/aa7f650...44afa70

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="simpletransformers",
version="0.18.8",
version="0.18.9",
author="Thilina Rajapakse",
author_email="chaturangarajapakshe@gmail.com",
description="An easy-to-use wrapper library for the Transformers library.",
Expand Down
14 changes: 2 additions & 12 deletions simpletransformers/custom_models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,8 @@

from transformers.modeling_albert import AlbertConfig, AlbertPreTrainedModel, AlbertModel


ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP = {
'roberta-base': "https://s3.amazonaws.com/models.huggingface.co/bert/roberta-base-pytorch_model.bin",
'roberta-large': "https://s3.amazonaws.com/models.huggingface.co/bert/roberta-large-pytorch_model.bin",
'roberta-large-mnli': "https://s3.amazonaws.com/models.huggingface.co/bert/roberta-large-mnli-pytorch_model.bin",
'distilroberta-base': "https://s3.amazonaws.com/models.huggingface.co/bert/distilroberta-base-pytorch_model.bin",
}

DISTILBERT_PRETRAINED_MODEL_ARCHIVE_MAP = {
'distilbert-base-uncased': "https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-pytorch_model.bin",
'distilbert-base-uncased-distilled-squad': "https://s3.amazonaws.com/models.huggingface.co/bert/distilbert-base-uncased-distilled-squad-pytorch_model.bin"
}
from transformers.modeling_roberta import ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP
from transformers.modeling_distilbert import DISTILBERT_PRETRAINED_MODEL_ARCHIVE_MAP

from torch.nn import BCEWithLogitsLoss

Expand Down

0 comments on commit ce5afd7

Please sign in to comment.