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,