Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
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()
|