diff --git a/llm_server/routes/v1/generate.py b/llm_server/routes/v1/generate.py index 4529c05..92a2f3b 100644 --- a/llm_server/routes/v1/generate.py +++ b/llm_server/routes/v1/generate.py @@ -75,7 +75,7 @@ def generate(): else: raise Exception - log_prompt(client_ip, token, request_json_body['prompt'], backend_response, elapsed_time, parameters, dict(request.headers), 0) + log_prompt(client_ip, token, request_json_body['prompt'], backend_response, elapsed_time, parameters, dict(request.headers), response if response else 0) return jsonify({ 'code': 500, 'error': 'failed to reach backend',