Update README.md
Browse files
README.md
CHANGED
|
@@ -8,14 +8,12 @@ inference:
|
|
| 8 |
repetition_penalty: 10.0
|
| 9 |
diversity_penalty: 3.01
|
| 10 |
no_repeat_ngram_size: 2
|
| 11 |
-
temperature: 0.
|
| 12 |
max_length: 128
|
| 13 |
widget:
|
| 14 |
- text: >-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
WhatsApp and Instagram across India and Africa, India Today reported.
|
| 18 |
-
example_title: 1st - Meta News
|
| 19 |
---
|
| 20 |
|
| 21 |
|
|
@@ -37,9 +35,22 @@ This repository contains a fine-tuned text-rewriting model based on the T5-Base
|
|
| 37 |
|
| 38 |
## Getting Started:
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
**Disclaimer:**
|
| 45 |
|
|
|
|
| 8 |
repetition_penalty: 10.0
|
| 9 |
diversity_penalty: 3.01
|
| 10 |
no_repeat_ngram_size: 2
|
| 11 |
+
temperature: 0.8
|
| 12 |
max_length: 128
|
| 13 |
widget:
|
| 14 |
- text: >-
|
| 15 |
+
Deep learning is a type of machine learning and artificial intelligence (AI) that imitates the way humans gain certain types of knowledge.
|
| 16 |
+
example_title: Deep learning
|
|
|
|
|
|
|
| 17 |
---
|
| 18 |
|
| 19 |
|
|
|
|
| 35 |
|
| 36 |
## Getting Started:
|
| 37 |
|
| 38 |
+
```python
|
| 39 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 40 |
+
|
| 41 |
+
# Replace 'YOUR_TOKEN' with your actual Hugging Face access token
|
| 42 |
+
tokenizer = AutoTokenizer.from_pretrained("Ateeqq/Text-Rewriter-Paraphraser", token='YOUR_TOKEN')
|
| 43 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("Ateeqq/Text-Rewriter-Paraphraser", token='YOUR_TOKEN')
|
| 44 |
+
```
|
| 45 |
+
```python
|
| 46 |
+
text = "Data science is a field that deals with extracting knowledge and insights from data. "
|
| 47 |
+
|
| 48 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 49 |
+
|
| 50 |
+
output = model.generate(**inputs, max_length=50)
|
| 51 |
+
|
| 52 |
+
print(tokenizer.decode(output[0]))
|
| 53 |
+
```
|
| 54 |
|
| 55 |
**Disclaimer:**
|
| 56 |
|