Yaron Koresh commited on
Commit
d36d517
·
verified ·
1 Parent(s): e86b43e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -547,11 +547,11 @@ def upscaler(
547
  return enhanced_image
548
 
549
  def summarize_text(
550
- text, min_length=4, max_length=12
551
  ):
552
  log(f'CALL summarize_text')
553
- summ = pipeline("summarization", model="facebook/bart-large-cnn")
554
- summary = summ("summarize: " + text, max_length=max_length, min_length=min_length, do_sample=False)[0]["summary_text"]
555
  log(f'RET summarize_text with summary as {summary}')
556
  return summary
557
 
 
547
  return enhanced_image
548
 
549
  def summarize_text(
550
+ text, min_length=2, max_length=8
551
  ):
552
  log(f'CALL summarize_text')
553
+ summ = pipeline("summarization", model="google/pegasus-large")
554
+ summary = summ("summarize: " + text, max_length=max_length, min_length=min_length, do_sample=True)[0]["summary_text"]
555
  log(f'RET summarize_text with summary as {summary}')
556
  return summary
557