Update README.md
Browse files
README.md
CHANGED
@@ -17,23 +17,21 @@ This model is based on the Facebook BART (Bidirectional and Auto-Regressive Tran
|
|
17 |
- **Fine-tuning dataset**: [xsum]
|
18 |
|
19 |
### Inference
|
20 |
-
|
21 |
```bash
|
22 |
-
|
23 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
24 |
|
25 |
tokenizer = AutoTokenizer.from_pretrained("suriya7/text_summarize")
|
26 |
model = AutoModelForSeq2SeqLM.from_pretrained("suriya7/text_summarize")
|
27 |
-
|
28 |
def generate_summary(text):
|
29 |
-
|
30 |
inputs = tokenizer([text], max_length=1024, return_tensors='pt', truncation=True)
|
31 |
-
|
32 |
summary_ids = model.generate(inputs['input_ids'],max_new_tokens=100, do_sample=False)
|
33 |
-
|
34 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
35 |
return summary
|
36 |
-
|
37 |
text_to_summarize = "Now, there is no doubt that one of the most important aspects of any Pixel phone is its camera.
|
38 |
And there might be good news for all camera lovers. Rumours have suggested that the Pixel 9 could come with a telephoto lens,
|
39 |
improving its photography capabilities even further. Google will likely continue to focus on using AI to
|
|
|
17 |
- **Fine-tuning dataset**: [xsum]
|
18 |
|
19 |
### Inference
|
|
|
20 |
```bash
|
|
|
21 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
22 |
|
23 |
tokenizer = AutoTokenizer.from_pretrained("suriya7/text_summarize")
|
24 |
model = AutoModelForSeq2SeqLM.from_pretrained("suriya7/text_summarize")
|
25 |
+
|
26 |
def generate_summary(text):
|
27 |
+
|
28 |
inputs = tokenizer([text], max_length=1024, return_tensors='pt', truncation=True)
|
29 |
+
|
30 |
summary_ids = model.generate(inputs['input_ids'],max_new_tokens=100, do_sample=False)
|
31 |
+
|
32 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
33 |
return summary
|
34 |
+
|
35 |
text_to_summarize = "Now, there is no doubt that one of the most important aspects of any Pixel phone is its camera.
|
36 |
And there might be good news for all camera lovers. Rumours have suggested that the Pixel 9 could come with a telephoto lens,
|
37 |
improving its photography capabilities even further. Google will likely continue to focus on using AI to
|