Archisman Karmakar
commited on
Commit
·
50d6ab0
1
Parent(s):
4b7388b
Update app_main_hf.py
Browse files- app_main_hf.py +12 -1
app_main_hf.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import sys
|
|
|
|
| 3 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), )))
|
| 4 |
|
| 5 |
# from streamlit_extras.bottom_container import bottom
|
|
@@ -32,7 +33,7 @@ else:
|
|
| 32 |
asyncio.set_event_loop(asyncio.new_event_loop())
|
| 33 |
|
| 34 |
st.set_page_config(
|
| 35 |
-
|
| 36 |
layout="wide"
|
| 37 |
)
|
| 38 |
|
|
@@ -91,8 +92,18 @@ def free_memory():
|
|
| 91 |
|
| 92 |
|
| 93 |
|
|
|
|
|
|
|
|
|
|
| 94 |
def main():
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
if "current_page" not in st.session_state:
|
| 97 |
st.session_state.current_page = None
|
| 98 |
|
|
|
|
| 1 |
import os
|
| 2 |
import sys
|
| 3 |
+
import time
|
| 4 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), )))
|
| 5 |
|
| 6 |
# from streamlit_extras.bottom_container import bottom
|
|
|
|
| 33 |
asyncio.set_event_loop(asyncio.new_event_loop())
|
| 34 |
|
| 35 |
st.set_page_config(
|
| 36 |
+
page_title="Tachygraphy Microtext Analysis & Normalization",
|
| 37 |
layout="wide"
|
| 38 |
)
|
| 39 |
|
|
|
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
+
if "last_run" not in st.session_state:
|
| 96 |
+
st.session_state.last_run = time.time()
|
| 97 |
+
|
| 98 |
def main():
|
| 99 |
|
| 100 |
+
if "last_run" not in st.session_state:
|
| 101 |
+
st.session_state.last_run = time.time()
|
| 102 |
+
|
| 103 |
+
if time.time() - st.session_state.last_run > 3600:
|
| 104 |
+
st.session_state.clear()
|
| 105 |
+
st.experimental_rerun()
|
| 106 |
+
|
| 107 |
if "current_page" not in st.session_state:
|
| 108 |
st.session_state.current_page = None
|
| 109 |
|