Update README.md
Browse files
README.md
CHANGED
|
@@ -14,13 +14,12 @@ This model is fine-tuned to generate formal text from informal text based on the
|
|
| 14 |
|
| 15 |
```python
|
| 16 |
|
| 17 |
-
from transformers import
|
|
|
|
| 18 |
|
| 19 |
model = T5ForConditionalGeneration.from_pretrained('PardisSzah/PersianTextFormalizer')
|
| 20 |
tokenizer = AutoTokenizer.from_pretrained('PardisSzah/PersianTextFormalizer')
|
| 21 |
|
| 22 |
-
from transformers import (T5ForConditionalGeneration, AutoTokenizer, pipeline)
|
| 23 |
-
import torch
|
| 24 |
pipe = pipeline(task='text2text-generation', model=model, tokenizer=tokenizer)
|
| 25 |
def test_model(text):
|
| 26 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
|
| 14 |
|
| 15 |
```python
|
| 16 |
|
| 17 |
+
from transformers import (T5ForConditionalGeneration, AutoTokenizer, pipeline)
|
| 18 |
+
import torch
|
| 19 |
|
| 20 |
model = T5ForConditionalGeneration.from_pretrained('PardisSzah/PersianTextFormalizer')
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained('PardisSzah/PersianTextFormalizer')
|
| 22 |
|
|
|
|
|
|
|
| 23 |
pipe = pipeline(task='text2text-generation', model=model, tokenizer=tokenizer)
|
| 24 |
def test_model(text):
|
| 25 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|