Skip to content
Snippets Groups Projects
Commit ac0640fe authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Merge in changes to startup script and addition of status view in API

parent 24d1cf0f
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,14 @@ def list_bounce_back(par1=None, par2=None): ...@@ -28,6 +28,14 @@ def list_bounce_back(par1=None, par2=None):
def list_session_paths(): def list_session_paths():
return session.get_paths() return session.get_paths()
@app.get('/status')
def show_session_status():
return {
'status': 'running',
'models': session.describe_loaded_models(),
'paths': session.get_paths(),
}
def change_path(key, path): def change_path(key, path):
try: try:
if session.get_paths()[key] == path: if session.get_paths()[key] == path:
......
import argparse import argparse
from multiprocessing import Process from multiprocessing import Process
import uvicorn import uvicorn
import webbrowser
from conf.defaults import server_conf from conf.defaults import server_conf
...@@ -44,6 +45,10 @@ if __name__ == '__main__': ...@@ -44,6 +45,10 @@ if __name__ == '__main__':
) )
server_process.start() server_process.start()
url = f'http://{args.host}:{int(args.port):04d}/status'
print(url)
webbrowser.open(url, new=1, autoraise=True)
if args.debug: if args.debug:
print('Running in debug mode') print('Running in debug mode')
print('Type "STOP" to stop server') print('Type "STOP" to stop server')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment