Spaces:
Runtime error
Runtime error
Commit
Β·
7576a55
1
Parent(s):
b3d04f6
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,12 @@
|
|
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 ππ')
|
@@ -29,8 +36,8 @@ 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)
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
+
from tqdm import tqdm
|
4 |
+
import time
|
5 |
+
|
6 |
+
def estimate_loading_time():
|
7 |
+
total_steps = 100 # Adjust the total steps as needed
|
8 |
+
for _ in tqdm(range(total_steps), desc="Loading model..."):
|
9 |
+
time.sleep(0.05) # Simulate loading time
|
10 |
|
11 |
st.set_page_config(page_title='πβοΈ Chat Summarizer ππ')
|
12 |
st.title('πβοΈ Chat Summarizer ππ')
|
|
|
36 |
progress_text = "Model loading. Please wait."
|
37 |
spinner = st.spinner(progress_text)
|
38 |
with spinner:
|
39 |
+
estimate_loading_time()
|
40 |
pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")
|
|
|
41 |
progress_text = "Summarization in progress. Please wait."
|
42 |
with st.spinner(progress_text):
|
43 |
out = pipe(text)
|