Collect debugging log

This commit is contained in:
Shuguang Chen 2024-12-09 14:15:10 -08:00
parent f13947732c
commit 8871d3f751
4 changed files with 92 additions and 14 deletions

View file

@ -278,6 +278,9 @@ class HallucinationStateHandler:
f"Hallucination: token '{self.tokens[-1]}' is uncertain."
)
# [TODO] - Review: remove the following code
print(f"[Hallucination] - Hallucination detected: {self.error_message}")
def _count_consecutive_token(self, token=MaskToken.PARAMETER_VALUE) -> int:
"""
Counts the number of consecutive occurrences of a given token in the mask.