fix homepage incorrectly showing online when all backends are offline

This commit is contained in:
Cyberes 2023-11-13 20:57:19 -07:00
parent 009039dbd8
commit 885b2d64f7
2 changed files with 5 additions and 5 deletions

View File

@ -108,8 +108,11 @@ def get_model_choices(regen: bool = False):
default_backend_url = get_a_cluster_backend()
default_backend_info = cluster_config.get_backend(default_backend_url)
if not default_backend_info.get('model'):
return {}, None
default_model = default_backend_info['model']
# If everything is offline.
model_choices = {}
default_model = None
else:
default_model = default_backend_info['model']
redis.setp('model_choices', (model_choices, default_model))
return model_choices, default_model

View File

@ -5,9 +5,6 @@
<title>{{ llm_middleware_name }}</title>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
{{ analytics_tracking_code|safe }}
<!-- https://highlightjs.org/demo#lang=json -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<style>
.container {
padding: 1em 3em;