aminaj commited on
Commit
67fb701
·
verified ·
1 Parent(s): 7a4c4ea

Update BrainBot.py

Browse files
Files changed (1) hide show
  1. BrainBot.py +10 -0
BrainBot.py CHANGED
@@ -5,6 +5,16 @@ import validators
5
  import os
6
  from utils import setup_logging, log_error
7
 
 
 
 
 
 
 
 
 
 
 
8
  # Custom CSS
9
  with open('styles.css') as f:
10
  css = f.read()
 
5
  import os
6
  from utils import setup_logging, log_error
7
 
8
+ def start_server():
9
+ os.system("uvicorn main:app --port 8000 --host 0.0.0.0")
10
+ st.session_state['server_started'] = True
11
+
12
+ if 'server_started' not in st.session_state:
13
+ st.session_state['server_started'] = False
14
+
15
+ if not st.session_state['server_started']:
16
+ start_server()
17
+
18
  # Custom CSS
19
  with open('styles.css') as f:
20
  css = f.read()