From b60c8bd285552be5d73e3b353a670ecbf6d8a9d5 Mon Sep 17 00:00:00 2001 From: Yaohui Liu Date: Tue, 8 Aug 2023 00:16:23 +0800 Subject: [PATCH] fix: antiprompt does not work in stateless executor. --- LLama/LLamaStatelessExecutor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LLama/LLamaStatelessExecutor.cs b/LLama/LLamaStatelessExecutor.cs index 88fa16954..0e2978358 100644 --- a/LLama/LLamaStatelessExecutor.cs +++ b/LLama/LLamaStatelessExecutor.cs @@ -87,7 +87,7 @@ public IEnumerable Infer(string text, InferenceParams? inferenceParams = string last_output = ""; foreach (var token in lastTokens) { - last_output += Utils.PtrToString(NativeApi.llama_token_to_str(_model.NativeHandle, id), _model.Encoding); + last_output += Utils.PtrToString(NativeApi.llama_token_to_str(_model.NativeHandle, token), _model.Encoding); } bool should_break = false;