Skip to content

Commit fd56086

Browse files
committed
refac
1 parent 9539122 commit fd56086

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

backend/open_webui/config.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,17 @@ def reachable(host: str, port: int) -> bool:
18841884
ENABLE_USER_STATUS = os.getenv('ENABLE_USER_STATUS', 'True').lower() == 'true'
18851885

18861886
ENABLE_EVALUATION_ARENA_MODELS = os.getenv('ENABLE_EVALUATION_ARENA_MODELS', 'True').lower() == 'true'
1887-
EVALUATION_ARENA_MODELS = []
1887+
try:
1888+
evaluation_arena_models = json.loads(os.getenv('EVALUATION_ARENA_MODELS', '[]'))
1889+
if not isinstance(evaluation_arena_models, list) or not all(
1890+
isinstance(model, dict) for model in evaluation_arena_models
1891+
):
1892+
raise ValueError('EVALUATION_ARENA_MODELS must be a JSON list of objects')
1893+
except Exception as e:
1894+
log.exception(f'Error loading EVALUATION_ARENA_MODELS: {e}')
1895+
evaluation_arena_models = []
1896+
1897+
EVALUATION_ARENA_MODELS = evaluation_arena_models
18881898

18891899
DEFAULT_ARENA_MODEL = {
18901900
'id': 'arena-model',

0 commit comments

Comments
 (0)