From 01b8442b957eace99b1bb1e8194f32be058eb3f3 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Thu, 24 Aug 2023 21:10:00 -0600 Subject: [PATCH] update current model when we generate_stats() --- llm_server/pages/__init__.py | 0 llm_server/pages/about.py | 1 + llm_server/pages/api.py | 1 + llm_server/routes/v1/generate_stats.py | 7 ++++--- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 llm_server/pages/__init__.py create mode 100644 llm_server/pages/about.py create mode 100644 llm_server/pages/api.py diff --git a/llm_server/pages/__init__.py b/llm_server/pages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/llm_server/pages/about.py b/llm_server/pages/about.py new file mode 100644 index 0000000..99dce6b --- /dev/null +++ b/llm_server/pages/about.py @@ -0,0 +1 @@ +# TODO: add an about page \ No newline at end of file diff --git a/llm_server/pages/api.py b/llm_server/pages/api.py new file mode 100644 index 0000000..5803cfe --- /dev/null +++ b/llm_server/pages/api.py @@ -0,0 +1 @@ +# TODO: explain the API, how to use it, the endpoints diff --git a/llm_server/routes/v1/generate_stats.py b/llm_server/routes/v1/generate_stats.py index ad32b54..edb3322 100644 --- a/llm_server/routes/v1/generate_stats.py +++ b/llm_server/routes/v1/generate_stats.py @@ -13,11 +13,12 @@ from llm_server.routes.stats import SemaphoreCheckerThread, calculate_avg_gen_ti # TODO: have routes/__init__.py point to the latest API version generate_stats() def generate_stats(): - model_list, error = get_running_model() # will return False when the fetch fails - if isinstance(model_list, bool): + model_name, error = get_running_model() # will return False when the fetch fails + if isinstance(model_name, bool): online = False else: online = True + opts.running_model = model_name # t = elapsed_times.copy() # copy since we do multiple operations and don't want it to change # if len(t) == 0: @@ -59,7 +60,7 @@ def generate_stats(): 'gatekeeper': 'none' if opts.auth_required is False else 'token', 'context_size': opts.context_size, 'queue_size': opts.concurrent_gens, - 'model': model_list, + 'model': model_name, 'mode': opts.mode, }, 'keys': {