Skip to content

Commit

Permalink
Update model binary
Browse files Browse the repository at this point in the history
  • Loading branch information
haven-jeon committed Feb 27, 2021
1 parent 6b6753f commit 485f717
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ pip install git+https://github.com/SKT-AI/KoBART#egg=kobart
>>> model = BartModel.from_pretrained(get_pytorch_kobart_model())
>>> inputs = kobart_tokenizer(['안녕하세요.'], return_tensors='pt')
>>> model(inputs['input_ids'])
Seq2SeqModelOutput(last_hidden_state=tensor([[[ 1.5513, -0.6550, -1.2556, ..., -1.6575, -4.7325, -0.2962],
[ 1.9180, -1.0223, 0.8865, ..., 0.0894, -4.3982, 0.6679]]],
grad_fn=<NativeLayerNormBackward>), past_key_values=((tensor([[[[-0.1339, 0.1619, -1.2464, ..., 0.5346, 0.2715, -0.6445],
Seq2SeqModelOutput(last_hidden_state=tensor([[[-0.4418, -4.3673, 3.2404, ..., 5.8832, 4.0629, 3.5540],
[-0.1316, -4.6446, 2.5955, ..., 6.0093, 2.7467, 3.0007]]],
grad_fn=<NativeLayerNormBackward>), past_key_values=((tensor([[[[-9.7980e-02, -6.6584e-01, -1.8089e+00, ..., 9.6023e-01, -1.8818e-01, -1.3252e+00],
```

### Performances
Expand Down
2 changes: 1 addition & 1 deletion examples/nsmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def training_step(self, batch, batch_idx):
def validation_step(self, batch, batch_idx):
pred = self(batch['input_ids'], batch['attention_mask'])
labels = batch['labels']
accuracy = self.metric_acc(pred.logits, labels)
accuracy = self.metric_acc(torch.nn.functional.softmax(pred.logits, dim=1), labels)
self.log('accuracy', accuracy)
result = {'accuracy': accuracy}
# Checkpoint model based on validation loss
Expand Down
3 changes: 2 additions & 1 deletion examples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytorch_lightning==1.1.2
transformers == 4.3.3
pytorch-lightning == 1.2.1
pandas
6 changes: 3 additions & 3 deletions kobart/pytorch_kobart.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

pytorch_kobart = {
'url':
'https://kobert.blob.core.windows.net/models/kobart/kobart_base_cased_0e7711aa26.zip',
'fname': 'kobart_base_cased_0e7711aa26.zip',
'chksum': '0e7711aa26'
'https://kobert.blob.core.windows.net/models/kobart/kobart_base_cased_ff4bda5738.zip',
'fname': 'kobart_base_cased_ff4bda5738.zip',
'chksum': 'ff4bda5738'
}


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
torch == 1.7.1
transformers == 4.1.1
transformers == 4.3.3
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from setuptools import find_packages, setup

setup(name='kobart',
version=0.3,
version=0.4,
url='https://github.com/SKT-AI/KoBART.git',
license='midified MIT',
author='Heewon Jeon',
Expand All @@ -39,7 +39,7 @@
zip_safe=False,
include_package_data=True,
install_requires=[
'transformers == 4.1.1',
'transformers == 4.3.3',
'torch == 1.7.1'
]
)

0 comments on commit 485f717

Please sign in to comment.