nicoladisabato commited on
Commit
d2c9fdb
Β·
1 Parent(s): 3cd61f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,8 +4,7 @@ from transformers import pipeline
4
  st.set_page_config(page_title='πŸ–ŠπŸ“„ Chat Summarization WebApp')
5
  st.title('πŸ–ŠπŸ“„ Chat Summarization WebApp')
6
 
7
- predefined_text = """
8
- Nico: the moon is very beautiful tonight.
9
  Demo: I agree with you.
10
  Nico: My dream is to go to the moon one day.
11
  Demo: Are you serious? I'm scared about the space.
@@ -13,11 +12,13 @@ Nico: So won't you come?
13
  Demo: I prefer to go to Lido Le Canne in Pulsano.
14
  Nico: Ahahah
15
  """
 
16
 
17
  text = st.text_area("Enter your chat", value=predefined_text, height=200)
18
  button = st.button('Summarize')
19
  pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")
20
 
21
  if button:
 
22
  out = pipe(text)
23
  st.json(out)
 
4
  st.set_page_config(page_title='πŸ–ŠπŸ“„ Chat Summarization WebApp')
5
  st.title('πŸ–ŠπŸ“„ Chat Summarization WebApp')
6
 
7
+ predefined_text = """Nico: the moon is very beautiful tonight.
 
8
  Demo: I agree with you.
9
  Nico: My dream is to go to the moon one day.
10
  Demo: Are you serious? I'm scared about the space.
 
12
  Demo: I prefer to go to Lido Le Canne in Pulsano.
13
  Nico: Ahahah
14
  """
15
+ progress_text = "Summarization in progress on CPU. Please wait."
16
 
17
  text = st.text_area("Enter your chat", value=predefined_text, height=200)
18
  button = st.button('Summarize')
19
  pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")
20
 
21
  if button:
22
+ st.progress(0, text=progress_text)
23
  out = pipe(text)
24
  st.json(out)