kriton commited on
Commit
97a1c44
1 Parent(s): 70c854f

Create new file

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ summarizer = pipeline("summarization", model="sdi/greek-title-generator")
4
+
5
+ def calculate_summary(article):
6
+ return summarizer(article)[0]["summary_text"]
7
+
8
+ import gradio as gr
9
+
10
+ iface = gr.Interface(
11
+ fn=calculate_summary,
12
+ inputs=gr.Textbox(lines=20, placeholder="Article Here", label='Article'),
13
+ outputs=gr.Textbox(lines=2, placeholder="Title", label='Title'),
14
+ btn = gr.Button("Generate")
15
+ )
16
+ iface.launch()