This commit is contained in:
Cyberes 2023-08-23 16:08:52 -06:00
parent 508089ce11
commit fd5796ed07
1 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,6 @@ from llm_server.routes.v1.generate import concurrent_semaphore
from . import bp from . import bp
from .. import stats from .. import stats
from ..cache import cache from ..cache import cache
from ..helpers.http import cache_control
from ..stats import SemaphoreCheckerThread from ..stats import SemaphoreCheckerThread
from ...llm.info import get_running_model from ...llm.info import get_running_model
@ -16,7 +15,7 @@ from ...llm.info import get_running_model
@bp.route('/stats', methods=['GET']) @bp.route('/stats', methods=['GET'])
@cache.cached(timeout=5, query_string=True) @cache.cached(timeout=5, query_string=True)
def get_stats(): def get_stats():
model_list = get_running_model() # will return False when the fetch fails model_list, error = get_running_model() # will return False when the fetch fails
if isinstance(model_list, bool): if isinstance(model_list, bool):
online = False online = False
else: else:
@ -31,7 +30,7 @@ def get_stats():
}, },
'online': online, 'online': online,
'mode': opts.mode, 'mode': opts.mode,
'model': get_running_model(), 'model': model_list,
'endpoints': { 'endpoints': {
'blocking': f'https://{request.headers.get("Host")}/{opts.frontend_api_client.strip("/")}', 'blocking': f'https://{request.headers.get("Host")}/{opts.frontend_api_client.strip("/")}',
}, },