Skip to content

Commit a9fd063

Browse files
author
Shivanand Roy
committed
updated readme.md
1 parent dc6e4da commit a9fd063

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<img align="center" src="data/st5.png" alt="simpleT5">
22

33
<p align="center">
4-
<b>Quickly train T5 models in just 3 lines of code with ONNX inference
4+
<b>Quickly train T5/mT5/byT5 models in just 3 lines of code
55
</b>
66
</p>
7-
87
<p align="center">
98
<a href="https://badge.fury.io/py/simplet5"><img src="https://badge.fury.io/py/simplet5.svg" alt="PyPI version" height="18"></a>
109

1110
<a href="https://badge.fury.io/py/simplet5">
1211
<img alt="Stars" src="https://img.shields.io/github/stars/Shivanandroy/simpleT5?color=blue">
1312
</a>
1413
<a href="https://pepy.tech/project/simplet5">
15-
<img alt="Stats" src="https://static.pepy.tech/personalized-badge/simplet5?period=month&units=international_system&left_color=black&right_color=orange&left_text=downloads/month">
14+
<img alt="Stats" src="https://static.pepy.tech/personalized-badge/simplet5?period=total&units=international_system&left_color=black&right_color=brightgreen&left_text=Downloads">
1615
</a>
1716
<a href="https://opensource.org/licenses/MIT">
1817
<img alt="License" src="https://img.shields.io/badge/License-MIT-yellow.svg">
@@ -41,7 +40,7 @@ from simplet5 import SimpleT5
4140
# instantiate
4241
model = SimpleT5()
4342

44-
# load (supports t5, mt5 models)
43+
# load (supports t5, mt5, byT5 models)
4544
model.from_pretrained("t5","t5-base")
4645

4746
# train
@@ -63,10 +62,6 @@ model.load_model("t5","path/to/trained/model/directory", use_gpu=False)
6362
# predict
6463
model.predict("input text for prediction")
6564

66-
# need faster inference on CPU, get ONNX support
67-
model.convert_and_load_onnx_model("path/to/T5 model/directory")
68-
model.onnx_predict("input text for prediction")
69-
7065
```
7166
## Articles
7267
- [Geek Culture: simpleT5 — Train T5 Models in Just 3 Lines of Code](https://medium.com/geekculture/simplet5-train-t5-models-in-just-3-lines-of-code-by-shivanand-roy-2021-354df5ae46ba)

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pandas
22
sentencepiece
33
torch>=1.7.0,!=1.8.0
4-
transformers==4.6.1
5-
pytorch-lightning==1.3.3
6-
fastt5==0.0.6
4+
transformers==4.10.0
5+
pytorch-lightning==1.4.5

simplet5/simplet5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def training_epoch_end(self, training_step_outputs):
248248
torch.mean(torch.stack([x["loss"] for x in training_step_outputs])).item(),
249249
4,
250250
)
251-
path = f"{self.outputdir}/SimpleT5-epoch-{self.current_epoch}-train-loss-{str(avg_traning_loss)}"
251+
path = f"{self.outputdir}/simplet5-epoch-{self.current_epoch}-train-loss-{str(avg_traning_loss)}"
252252
self.tokenizer.save_pretrained(path)
253253
self.model.save_pretrained(path)
254254

0 commit comments

Comments
 (0)