balaramas commited on
Commit
1928de9
1 Parent(s): 06816f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,7 +10,7 @@ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
10
  model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
11
  tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
12
  def summariser(ar_en, lang):
13
- summ = summarizer(ar_en, max_length=130, min_length=30, do_sample=False)['summary_text']
14
  tokenizer.src_lang = "en_XX"
15
  encoded_ar = tokenizer(summ, return_tensors="pt")
16
  if(lang=='Hindi'):
@@ -31,7 +31,7 @@ def summariser(ar_en, lang):
31
  iface = gr.Interface(
32
  fn=summariser,
33
  inputs=[gr.Textbox(label="Enter the paragraph in English", placeholder="Type here..."), gr.Radio(["Hindi", "Gujrati", "Bengali", "Tamil"], label="Language to be summarised in:")],
34
- outputs="text",
35
  title="English to Indic Summariser"
36
  )
37
  iface.launch()
 
10
  model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
11
  tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-many-to-many-mmt")
12
  def summariser(ar_en, lang):
13
+ summ = summarizer(ar_en, max_length=130, min_length=30, do_sample=False)[0]['summary_text']
14
  tokenizer.src_lang = "en_XX"
15
  encoded_ar = tokenizer(summ, return_tensors="pt")
16
  if(lang=='Hindi'):
 
31
  iface = gr.Interface(
32
  fn=summariser,
33
  inputs=[gr.Textbox(label="Enter the paragraph in English", placeholder="Type here..."), gr.Radio(["Hindi", "Gujrati", "Bengali", "Tamil"], label="Language to be summarised in:")],
34
+ outputs=gr.Textbox(label="Summarised Text"),
35
  title="English to Indic Summariser"
36
  )
37
  iface.launch()