From 350b52edd964b74521c81d52a3685f14e69fc90f Mon Sep 17 00:00:00 2001 From: Rusyaidi Date: Sun, 4 Aug 2024 14:14:25 +0800 Subject: [PATCH] fix: instruct suffixes never being added --- app/constants/APIState/BaseAPI.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/constants/APIState/BaseAPI.ts b/app/constants/APIState/BaseAPI.ts index 433d3ab..f88e280 100644 --- a/app/constants/APIState/BaseAPI.ts +++ b/app/constants/APIState/BaseAPI.ts @@ -1,11 +1,11 @@ +import { AppSettings, Global } from '@constants/GlobalValues' import { Characters } from 'app/constants/Characters' import { Chats, useInference } from 'app/constants/Chat' -import { AppSettings, Global } from '@constants/GlobalValues' import { InstructType, Instructs } from 'app/constants/Instructs' import { Logger } from 'app/constants/Logger' +import { mmkv } from 'app/constants/MMKV' import { SamplerPreset } from 'app/constants/Presets' import { replaceMacros } from 'app/constants/Utils' -import { mmkv } from 'app/constants/MMKV' import EventSource from 'react-native-sse' import { SamplerID, Samplers } from '../Samplers' @@ -122,8 +122,9 @@ export abstract class APIBase implements IAPIBase { if (!is_last) { message_shard += `${message.is_user ? currentInstruct.input_suffix : currentInstruct.output_suffix}` - is_last = false } + // ensure no more is_last checks after this + is_last = false if (currentInstruct.wrap) { message_shard += `\n`