add more test

This commit is contained in:
cotran 2024-12-09 13:48:30 -08:00
parent 63cc2ef3f3
commit f13947732c
5 changed files with 162 additions and 236 deletions

View file

@ -480,7 +480,7 @@ class ArchFunctionHandler(ArchBaseHandler):
model_response, has_tool_call = "", None
for token in self.hallu_handler:
for _ in self.hallu_handler:
# check if the first token is <tool_call>
if len(self.hallu_handler.tokens) > 0 and has_tool_call == None:
if self.hallu_handler.tokens[0] == "<tool_call>":

View file

@ -27,10 +27,10 @@ class MaskToken(Enum):
HALLUCINATION_THRESHOLD_DICT = {
MaskToken.TOOL_CALL.value: {"entropy": 0.001, "varentropy": 0.005},
MaskToken.TOOL_CALL.value: {"entropy": 0.05, "varentropy": 0.25},
MaskToken.PARAMETER_VALUE.value: {
"entropy": 0.001,
"varentropy": 0.005,
"entropy": 0.05,
"varentropy": 0.25,
},
}