Fernando Knüttel commited on
Commit
101cff0
·
1 Parent(s): daaeaa4

try to fixed the shift of the slaph screen in hugging face

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +9 -1
src/streamlit_app.py CHANGED
@@ -20,7 +20,7 @@ def get_base64_of_bin_file(path):
20
 
21
  # Little Password check
22
  def check_password():
23
- HF_PASSWORD = os.environ['password']
24
  def password_entered():
25
  if st.session_state["password"] == HF_PASSWORD:
26
  st.session_state["password_correct"] = True
@@ -135,9 +135,17 @@ if check_password():
135
  """
136
 
137
  st.markdown(splash_html, unsafe_allow_html=True)
 
 
 
 
138
  if not requests.get(API_URL + "/model_status").json()['status'] == "ready":
139
  requests.post(API_URL + "/load_model")
140
 
 
 
 
 
141
 
142
 
143
  st.markdown(
 
20
 
21
  # Little Password check
22
  def check_password():
23
+ HF_PASSWORD = 'Hallo'
24
  def password_entered():
25
  if st.session_state["password"] == HF_PASSWORD:
26
  st.session_state["password_correct"] = True
 
135
  """
136
 
137
  st.markdown(splash_html, unsafe_allow_html=True)
138
+
139
+ min_loader_time = 5
140
+ start = time.time()
141
+
142
  if not requests.get(API_URL + "/model_status").json()['status'] == "ready":
143
  requests.post(API_URL + "/load_model")
144
 
145
+ elapsed = time.time() - start
146
+
147
+ if elapsed < min_loader_time:
148
+ time.sleep(min_loader_time - elapsed)
149
 
150
 
151
  st.markdown(