Wootang01 commited on
Commit
c3787f9
·
1 Parent(s): 1b03b55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -4,7 +4,19 @@ import json
4
  import requests
5
  import time
6
  import os
7
-
 
 
 
 
 
 
 
 
 
 
 
 
8
  def get_correction(input_text):
9
  st.markdown(f'##### Corrected text:')
10
  st.write('')
 
4
  import requests
5
  import time
6
  import os
7
+
8
+ def load_models():
9
+ if not is_port_in_use(8080):
10
+ with st.spinner(text="The model is loading."):
11
+ proc = Process(target=start_server, args=(), daemon=True)
12
+ proc.start()
13
+ while not is_port_in_use(8080):
14
+ time.sleep(1)
15
+ st.success("Model server started.")
16
+ else:
17
+ st.success("The model has loaded.")
18
+ st.session_state['models_loaded'] = True
19
+
20
  def get_correction(input_text):
21
  st.markdown(f'##### Corrected text:')
22
  st.write('')