Update BrainBot.py
Browse files- BrainBot.py +7 -7
BrainBot.py
CHANGED
|
@@ -5,15 +5,15 @@ import validators
|
|
| 5 |
import os
|
| 6 |
from utils import setup_logging, log_error
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
# Custom CSS
|
| 19 |
with open('styles.css') as f:
|
|
|
|
| 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:
|