rashmikamath01 commited on
Commit
34a917f
·
1 Parent(s): 9caaa40

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipepile
2
+ import gradio as gr
3
+
4
+ summarizer = pipline("summarization", model="t5-base", tokenizer="t5-base", truncation=True, framework="tf")
5
+
6
+ def translate(text):
7
+ results = summarizer(text, min_length=180, truncation = True)
8
+ return results
9
+
10
+ iface = gr.Interface(
11
+ fn=translate,
12
+ inputs= gr.inputs.Textbox(lines=10, placeholder = "Enter text to summarize ... "),
13
+ outputs = "text"
14
+ )
15
+
16
+ iface.launch()