Spaces:
Runtime error
Runtime error
first test
Browse files- app.py +27 -2
- requirements.txt +2 -0
app.py
CHANGED
@@ -1,4 +1,29 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
pipeline = pipeline(task="summarization", model="lidiya/bart-large-xsum-samsum")
|
5 |
+
|
6 |
+
st.title("Résumé de conversation avec BART")
|
7 |
+
txt = """Hannah: Hey, do you have Betty's number?
|
8 |
+
Amanda: Lemme check
|
9 |
+
Amanda: Sorry, can't find it.
|
10 |
+
Amanda: Ask Larry
|
11 |
+
Amanda: He called her last time we were at the park together
|
12 |
+
Hannah: I don't know him well
|
13 |
+
Amanda: Don't be shy, he's very nice
|
14 |
+
Hannah: If you say so..
|
15 |
+
Hannah: I'd rather you texted him
|
16 |
+
Amanda: Just text him 🙂
|
17 |
+
Hannah: Urgh.. Alright
|
18 |
+
Hannah: Bye
|
19 |
+
Amanda: Bye bye
|
20 |
+
"""
|
21 |
+
|
22 |
+
col1, col2 = st.columns(2)
|
23 |
+
summary = pipeline(txt)
|
24 |
+
|
25 |
+
col1.header("Texte original")
|
26 |
+
col1.subheader(txt)
|
27 |
+
|
28 |
+
col2.header("Texte résumé")
|
29 |
+
col2.subheader(summary)
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
torch
|