From 131a7ddf4a096ade9f00ee89c7451cc615a5896b Mon Sep 17 00:00:00 2001 From: josc146 Date: Wed, 21 Jun 2023 16:07:16 +0800 Subject: [PATCH] fix the prompt cache that contains potential error --- backend-python/utils/rwkv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-python/utils/rwkv.py b/backend-python/utils/rwkv.py index 7f01c35..0f98175 100644 --- a/backend-python/utils/rwkv.py +++ b/backend-python/utils/rwkv.py @@ -325,7 +325,6 @@ The following is a coherent verbose detailed conversation between a girl named { response += delta if stop is not None: if stop in response: - response = response.split(stop)[0] try: state_cache.add_state( state_cache.AddStateBody( @@ -337,6 +336,7 @@ The following is a coherent verbose detailed conversation between a girl named { ) except HTTPException: pass + response = response.split(stop)[0] yield response, "", prompt_token_len, completion_token_len break out_last = begin + i + 1