jarif commited on
Commit
cb2c11c
1 Parent(s): 4095838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -1,6 +1,6 @@
 
1
  from fastai.text.all import *
2
  from blurr.text.modeling.all import *
3
- import gradio as gr
4
 
5
  # Load the exported model
6
  learn = load_learner('article_highlights.pkl')
@@ -10,10 +10,14 @@ def generate_summary(article_text):
10
  summary = learn.blurr_generate_summary(article_text)
11
  return summary
12
 
13
- def main():
14
- article_text = input()
15
- summary = generate_summary(article_text)
16
- print(summary)
17
-
18
- if __name__ == "__main__":
19
- main()
 
 
 
 
 
1
+ import gradio as gr
2
  from fastai.text.all import *
3
  from blurr.text.modeling.all import *
 
4
 
5
  # Load the exported model
6
  learn = load_learner('article_highlights.pkl')
 
10
  summary = learn.blurr_generate_summary(article_text)
11
  return summary
12
 
13
+ iface = gr.Interface(
14
+ fn=generate_summary,
15
+ inputs="text",
16
+ outputs="text",
17
+ title="Article Summarizer",
18
+ description="Enter an article and get a summary.",
19
+ examples=[
20
+ ["Text of an article goes here..."]
21
+ ]
22
+ )
23
+ iface.launch()