From 0e6aadf5e10c13aedbdbaa8f0a931683abe3620a Mon Sep 17 00:00:00 2001 From: Cyberes Date: Fri, 25 Aug 2023 13:44:41 -0600 Subject: [PATCH] fix missing empty strings logged when errors --- llm_server/routes/v1/generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llm_server/routes/v1/generate.py b/llm_server/routes/v1/generate.py index 436854c..2434813 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, None, parameters, dict(request.headers), response if response else 0) + log_prompt(client_ip, token, request_json_body['prompt'], '', None, parameters, dict(request.headers), response if response else 0) return jsonify({ 'code': 500, 'error': 'failed to reach backend', @@ -112,7 +112,7 @@ def generate(): } else: raise Exception - log_prompt(client_ip, token, request_json_body['prompt'], backend_response, elapsed_time, parameters, dict(request.headers), response.status_code) + log_prompt(client_ip, token, request_json_body['prompt'], '', elapsed_time, parameters, dict(request.headers), response.status_code) return jsonify({ 'code': 500, 'error': 'the backend did not return valid JSON',