johnnyfivefingers commited on
Commit
2dc9e73
1 Parent(s): f52aa82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -21,13 +21,14 @@ def summarize(text):
21
 
22
 
23
  generated_summary = summarizer(text, max_length=80, min_length=20)[0]['summary_text']
 
24
 
25
  fields = [text, generated_summary]
26
  with open('input.csv','a', newline='') as f:
27
  writer = csv.writer(f)
28
  writer.writerow(fields)
29
 
30
- return "Summary: " + str(generated_summary)
31
 
32
  iface = gr.Interface(fn=summarize, inputs="text", outputs="text")
33
  iface.launch()
 
21
 
22
 
23
  generated_summary = summarizer(text, max_length=80, min_length=20)[0]['summary_text']
24
+ generated_summary_long = summarizer(text, max_length=200, min_length=40)[0]['summary_text']
25
 
26
  fields = [text, generated_summary]
27
  with open('input.csv','a', newline='') as f:
28
  writer = csv.writer(f)
29
  writer.writerow(fields)
30
 
31
+ return "Summary: " + str(generated_summary) + "\n" + "Longer: " + str(generated_summary_long)
32
 
33
  iface = gr.Interface(fn=summarize, inputs="text", outputs="text")
34
  iface.launch()