mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-04-08 11:24:14 +00:00
upgraded
This commit is contained in:
parent
f4a9bbec32
commit
d1f6f07942
@ -303,7 +303,7 @@ class LollmsApplication(LoLLMsCom):
|
||||
generation_infos["generated_text"] += chunk
|
||||
antiprompt = self.personality.detect_antiprompt(generation_infos["generated_text"])
|
||||
if antiprompt:
|
||||
ASCIIColors.warning(f"\nDetected hallucination with antiprompt: {antiprompt}")
|
||||
ASCIIColors.warning(f"\n{antiprompt} detected. Stopping generation")
|
||||
generation_infos["generated_text"] = self.remove_text_from_string(generation_infos["generated_text"],antiprompt)
|
||||
return False
|
||||
else:
|
||||
|
@ -699,7 +699,7 @@ class AIPersonality:
|
||||
antiprompt = self.detect_antiprompt(bot_says)
|
||||
if antiprompt:
|
||||
self.bot_says = self.remove_text_from_string(bot_says,antiprompt)
|
||||
ASCIIColors.warning(f"\nDetected hallucination with antiprompt: {antiprompt}")
|
||||
ASCIIColors.warning(f"\n{antiprompt} detected. Stopping generation")
|
||||
return False
|
||||
else:
|
||||
if callback:
|
||||
|
@ -441,7 +441,7 @@ async def v1_completion(request: CompletionGenerationRequest):
|
||||
output["text"] += chunk
|
||||
antiprompt = detect_antiprompt(output["text"])
|
||||
if antiprompt:
|
||||
ASCIIColors.warning(f"\nDetected hallucination with antiprompt: {antiprompt}")
|
||||
ASCIIColors.warning(f"\n{antiprompt} detected. Stopping generation")
|
||||
output["text"] = remove_text_from_string(output["text"],antiprompt)
|
||||
return False
|
||||
else:
|
||||
@ -462,7 +462,7 @@ async def v1_completion(request: CompletionGenerationRequest):
|
||||
output["text"] += chunk
|
||||
antiprompt = detect_antiprompt(output["text"])
|
||||
if antiprompt:
|
||||
ASCIIColors.warning(f"\nDetected hallucination with antiprompt: {antiprompt}")
|
||||
ASCIIColors.warning(f"\n{antiprompt} detected. Stopping generation")
|
||||
output["text"] = remove_text_from_string(output["text"],antiprompt)
|
||||
return False
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user