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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -17,15 +17,20 @@ progress_text = "Model loading. Please wait."
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)
 
17
  text = st.text_area("Enter your chat", value=predefined_text, height=200)
18
  button = st.button('Summarize')
19
 
20
+ def load_pipeline():
21
+ pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")
22
+ return pipe
23
+
24
  if button:
25
+ st.text(progress_text)
26
+
27
+ # Load the pipeline with progress visualization
28
+ with st.spinner("Loading model..."):
29
+ pipe = st.cache(load_pipeline)()
30
+
31
+ st.success("Model loaded.")
32
+
33
+ st.text("Generating summary...")
34
  out = pipe(text)
35
+
36
  st.json(out)