Spaces:
Runtime error
Runtime error
Commit
Β·
b3d04f6
1
Parent(s):
c989aa1
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,16 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
st.set_page_config(page_title='
|
5 |
-
st.title('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
predefined_text = """Nico: the moon is very beautiful tonight.
|
8 |
Demo: I agree with you.
|
@@ -19,9 +27,11 @@ button = st.button('Summarize')
|
|
19 |
|
20 |
if button:
|
21 |
progress_text = "Model loading. Please wait."
|
22 |
-
|
|
|
23 |
pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
st.set_page_config(page_title='πβοΈ Chat Summarizer ππ')
|
5 |
+
st.title('πβοΈ Chat Summarizer ππ')
|
6 |
+
|
7 |
+
|
8 |
+
# Define available models and their corresponding names
|
9 |
+
models = {
|
10 |
+
"PEGASUS fine-tuned": "nicoladisabato/pegasus-samsum"
|
11 |
+
}
|
12 |
+
|
13 |
+
selected_model = st.selectbox("Select a model", list(models.keys()))
|
14 |
|
15 |
predefined_text = """Nico: the moon is very beautiful tonight.
|
16 |
Demo: I agree with you.
|
|
|
27 |
|
28 |
if button:
|
29 |
progress_text = "Model loading. Please wait."
|
30 |
+
spinner = st.spinner(progress_text)
|
31 |
+
with spinner:
|
32 |
pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")
|
33 |
+
spinner.stop()
|
34 |
+
progress_text = "Summarization in progress. Please wait."
|
35 |
+
with st.spinner(progress_text):
|
36 |
+
out = pipe(text)
|
37 |
+
st.json(out)
|