fix keyerror

This commit is contained in:
Cyberes 2023-10-20 14:02:30 -06:00
parent e838f591aa
commit 763139c949
1 changed files with 2 additions and 2 deletions

View File

@ -2,8 +2,8 @@ import time
from datetime import datetime from datetime import datetime
from llm_server import opts from llm_server import opts
from llm_server.cluster.cluster_config import cluster_config
from llm_server.cluster.backend import get_model_choices from llm_server.cluster.backend import get_model_choices
from llm_server.cluster.cluster_config import cluster_config
from llm_server.custom_redis import redis from llm_server.custom_redis import redis
from llm_server.database.database import get_distinct_ips_24h, sum_column from llm_server.database.database import get_distinct_ips_24h, sum_column
from llm_server.helpers import deep_sort from llm_server.helpers import deep_sort
@ -67,7 +67,7 @@ def generate_stats(regen: bool = False):
backend_uptime = int((datetime.now() - datetime.fromtimestamp(backend_info['startup_time'])).total_seconds()) if opts.show_uptime else None backend_uptime = int((datetime.now() - datetime.fromtimestamp(backend_info['startup_time'])).total_seconds()) if opts.show_uptime else None
output['backends'][backend_info['hash']] = { output['backends'][backend_info['hash']] = {
'uptime': backend_uptime, 'uptime': backend_uptime,
'max_tokens': backend_info['model_config']['max_position_embeddings'], 'max_tokens': backend_info['model_config'].get('max_position_embeddings', -1),
'model': backend_info['model'], 'model': backend_info['model'],
'mode': backend_info['mode'], 'mode': backend_info['mode'],
'nvidia': backend_info['nvidia'], 'nvidia': backend_info['nvidia'],