Paula Leonova
commited on
Commit
·
fb7a57d
1
Parent(s):
1fe6d58
Add timers to model load
Browse files- app.py +9 -2
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
|
| 2 |
from os import write
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
import base64
|
| 5 |
from typing import Sequence
|
|
@@ -32,9 +33,15 @@ with st.form(key='my_form'):
|
|
| 32 |
submit_button = st.form_submit_button(label='Submit')
|
| 33 |
|
| 34 |
|
| 35 |
-
with st.spinner('Loading pretrained
|
|
|
|
| 36 |
summarizer = load_summary_model()
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
if submit_button:
|
|
|
|
| 1 |
|
| 2 |
from os import write
|
| 3 |
+
import time
|
| 4 |
import pandas as pd
|
| 5 |
import base64
|
| 6 |
from typing import Sequence
|
|
|
|
| 33 |
submit_button = st.form_submit_button(label='Submit')
|
| 34 |
|
| 35 |
|
| 36 |
+
with st.spinner('Loading pretrained summarizer mnli model...'):
|
| 37 |
+
start = time.time()
|
| 38 |
summarizer = load_summary_model()
|
| 39 |
+
st.success(f'Time taken to load model: {round(time.time() - start,4)} seconds')
|
| 40 |
+
|
| 41 |
+
with st.spinner('Loading pretrained classifier mnli model...'):
|
| 42 |
+
start = time.time()
|
| 43 |
+
classifier = load_model()
|
| 44 |
+
st.success(f'Time taken to load model: {round(time.time() - start,4)} seconds')
|
| 45 |
|
| 46 |
|
| 47 |
if submit_button:
|
requirements.txt
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
transformers[sentencepiece]==4.11.0
|
| 2 |
pandas
|
|
|
|
| 3 |
streamlit
|
| 4 |
plotly
|
| 5 |
torch
|
|
|
|
| 1 |
transformers[sentencepiece]==4.11.0
|
| 2 |
pandas
|
| 3 |
+
time
|
| 4 |
streamlit
|
| 5 |
plotly
|
| 6 |
torch
|