maayanorner commited on
Commit
91f4685
1 Parent(s): 75c12c2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -0
README.md CHANGED
@@ -22,6 +22,8 @@ from transformers import (
22
 
23
 
24
  def summarize(text, tokenizer, model, num_beams=4, temperature=1, max_new_tokens=512):
 
 
25
  # This text template is important.
26
  inputs = tokenizer(f'{text}\n### סיכום:', return_tensors="pt")
27
  in_data = inputs.input_ids.to('cuda')
 
22
 
23
 
24
  def summarize(text, tokenizer, model, num_beams=4, temperature=1, max_new_tokens=512):
25
+ if len(text) < 20:
26
+ raise ValueError('Text must be at least 20 characters long.')
27
  # This text template is important.
28
  inputs = tokenizer(f'{text}\n### סיכום:', return_tensors="pt")
29
  in_data = inputs.input_ids.to('cuda')