nicoladisabato commited on
Commit
f16d91a
·
1 Parent(s): d2c9fdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -12,13 +12,20 @@ Nico: So won't you come?
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)
 
12
  Demo: I prefer to go to Lido Le Canne in Pulsano.
13
  Nico: Ahahah
14
  """
15
+ progress_text = "Model loading. Please wait."
16
 
17
  text = st.text_area("Enter your chat", value=predefined_text, height=200)
18
  button = st.button('Summarize')
 
19
 
20
  if button:
21
+ st.progress(0)
22
+
23
+ # Load the pipeline with progress visualization
24
+ def load_pipeline():
25
+ pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")
26
+ return pipe
27
+
28
+ pipe = st.cache(load_pipeline)()
29
+ st.progress(100)
30
  out = pipe(text)
31
  st.json(out)