Spaces:
Running
Running
Upload 3 files
Browse files- app.py +19 -0
- article_highlights.pkl +3 -0
- requirements.txt +0 -0
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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')
|
7 |
+
|
8 |
+
def generate_summary(article_text):
|
9 |
+
# Perform inference using the loaded model
|
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()
|
article_highlights.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d02e4db319f0c8753d63047bf8fe53079f42d742670c451f0c84de82cad4ee14
|
3 |
+
size 1230734737
|
requirements.txt
ADDED
Binary file (108 Bytes). View file
|
|