abdulmatinomotoso commited on
Commit
ee75fc5
1 Parent(s): f9d338a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,5 +1,4 @@
1
  #importing the necessary libraries
2
-
3
  import re
4
  import nltk
5
  from nltk.tokenize import sent_tokenize
@@ -50,7 +49,7 @@ def headline_generator_2(file):
50
  batch = tokenizer_2(
51
  text, truncation=True, return_tensors="pt"
52
  )
53
-
54
  translated = model_2.generate(**batch)
55
  summary_2 = tokenizer_2.batch_decode(translated, skip_special_tokens=True, max_length=20)
56
  return summary_2[0]
@@ -60,7 +59,7 @@ demo = gr.Interface(headline_generator_2, inputs=[gr.inputs.File(label="Drop you
60
  title = "HEADLINE GENERATOR",
61
  outputs=[gr.outputs.Textbox(label="Headline")],
62
  theme= "darkhuggingface")
63
-
64
  #launching the app
65
  if __name__ == "__main__":
66
  demo.launch(debug=True)
 
1
  #importing the necessary libraries
 
2
  import re
3
  import nltk
4
  from nltk.tokenize import sent_tokenize
 
49
  batch = tokenizer_2(
50
  text, truncation=True, return_tensors="pt"
51
  )
52
+
53
  translated = model_2.generate(**batch)
54
  summary_2 = tokenizer_2.batch_decode(translated, skip_special_tokens=True, max_length=20)
55
  return summary_2[0]
 
59
  title = "HEADLINE GENERATOR",
60
  outputs=[gr.outputs.Textbox(label="Headline")],
61
  theme= "darkhuggingface")
62
+
63
  #launching the app
64
  if __name__ == "__main__":
65
  demo.launch(debug=True)