Fixed multiline responses.

This commit is contained in:
Patrick_Pluto 2024-09-16 12:17:06 +02:00
parent d7544c082f
commit 1e639383c2
2 changed files with 3 additions and 3 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
venv/
__pycache__

View file

@ -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