From 1e639383c2a5bbad15c0eeb1fe36886d88737c1e Mon Sep 17 00:00:00 2001 From: Patrick_Pluto Date: Mon, 16 Sep 2024 12:17:06 +0200 Subject: [PATCH] Fixed multiline responses. --- .gitignore | 1 + py/api.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f7275bb..c65a729 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ venv/ +__pycache__ diff --git a/py/api.py b/py/api.py index 9e6b40d..8ed3afb 100644 --- a/py/api.py +++ b/py/api.py @@ -29,8 +29,7 @@ class API: response_data.append(line_raw["response"]) final_response = "".join(response_data) - generated_text = final_response.splitlines()[-1] - return generated_text + return final_response else: return "Error: " + response.text @@ -47,4 +46,4 @@ class API: answer = self.process_text_transformers(message, "meta-llama/Meta-Llama-3.1-8B") else: return "Invalid choice" - return answer + return answer \ No newline at end of file