suriya7 commited on
Commit
1347fb5
·
verified ·
1 Parent(s): cf22a47

Update README.md

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