natfil commited on
Commit
96c36ce
1 Parent(s): 8d98553

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -2,15 +2,13 @@ import torch
2
  import gradio as gr
3
  from transformers import pipeline
4
 
5
- #text_summary = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6", torch_dtype=torch.bfloat16)
6
- de_text_summary = pipeline("summarization", model="Shahm/bart-german")
7
- #de_text_summary= pipeline("summarization", model="Joemgu/mlong-t5-large-sumstew")
8
 
9
  def summary (input):
10
  max_length = 1024 # adjust this value as needed
11
  if len(input) > max_length:
12
  input = input[:max_length]
13
- output = de_text_summary(input)
14
  return output[0]['summary_text']
15
 
16
  gr.close_all()
 
2
  import gradio as gr
3
  from transformers import pipeline
4
 
5
+ text_summary = pipeline("summarization", model="Falconsai/text_summarization", torch_dtype=torch.bfloat16)
 
 
6
 
7
  def summary (input):
8
  max_length = 1024 # adjust this value as needed
9
  if len(input) > max_length:
10
  input = input[:max_length]
11
+ output = text_summary(input)
12
  return output[0]['summary_text']
13
 
14
  gr.close_all()