From 508089ce11cdb51e9dcb63d1b1bf00e60118e660 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Wed, 23 Aug 2023 16:07:43 -0600 Subject: [PATCH] model info timeout and additional info --- llm_server/llm/info.py | 2 +- llm_server/routes/v1/info.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llm_server/llm/info.py b/llm_server/llm/info.py index f9a5369..0f4ed9b 100644 --- a/llm_server/llm/info.py +++ b/llm_server/llm/info.py @@ -6,7 +6,7 @@ from llm_server import opts def get_running_model(): if opts.mode == 'oobabooga': try: - backend_response = requests.get(f'{opts.backend_url}/api/v1/model') + backend_response = requests.get(f'{opts.backend_url}/api/v1/model', timeout=3) except Exception as e: return False, e try: diff --git a/llm_server/routes/v1/info.py b/llm_server/routes/v1/info.py index ce15154..084f38f 100644 --- a/llm_server/routes/v1/info.py +++ b/llm_server/routes/v1/info.py @@ -25,10 +25,10 @@ def get_model(): model, error = get_running_model() if not model: return jsonify({ - 'code': 500, + 'code': 502, 'error': 'failed to reach backend', - 'msg': error - }), 500 + 'type': error.__class__.__name__ + }), 502 else: return jsonify({ 'result': model,