From 875dfbbf0e463fea4b52126f3fc037555110c5f0 Mon Sep 17 00:00:00 2001 From: takatost Date: Tue, 10 Oct 2023 17:44:19 +0800 Subject: [PATCH] fix: openllm completion start with prompt, remove it (#1303) --- api/core/third_party/langchain/llms/openllm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/api/core/third_party/langchain/llms/openllm.py b/api/core/third_party/langchain/llms/openllm.py index a2a2857b15..6151fe3f1c 100644 --- a/api/core/third_party/langchain/llms/openllm.py +++ b/api/core/third_party/langchain/llms/openllm.py @@ -66,6 +66,7 @@ class OpenLLM(LLM): json_response = response.json() completion = json_response["responses"][0] + completion = completion.lstrip(prompt) if stop is not None: completion = enforce_stop_tokens(completion, stop)