mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
fix bug and test
This commit is contained in:
parent
cc0845bce4
commit
afe7cc9e9e
3 changed files with 36 additions and 79 deletions
|
|
@ -416,15 +416,14 @@ class ArchFunctionHandler(ArchBaseHandler):
|
|||
has_tool_calls, has_hallucination = None, False
|
||||
for _ in self.hallucination_state:
|
||||
# check if the first token is <tool_call>
|
||||
if len(self.hallucination_state.tokens) > 5 and has_tool_calls is None:
|
||||
content = "".join(self.hallucination_state.tokens)
|
||||
if "tool_calls" in content:
|
||||
logger.info(
|
||||
f"[Content]: {content}"
|
||||
)
|
||||
has_tool_calls = True
|
||||
else:
|
||||
has_tool_calls = False
|
||||
content = "".join(self.hallucination_state.tokens)
|
||||
if "tool_calls" in content:
|
||||
logger.info(
|
||||
f"[Content]: {content}"
|
||||
)
|
||||
has_tool_calls = True
|
||||
else:
|
||||
has_tool_calls = False
|
||||
|
||||
|
||||
# if the model is hallucinating, start parameter gathering
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class MaskToken(Enum):
|
|||
|
||||
|
||||
HALLUCINATION_THRESHOLD_DICT = {
|
||||
"entropy": 0.28,
|
||||
"varentropy": 1.4,
|
||||
"entropy": 0.35,
|
||||
"varentropy": 1.1,
|
||||
"probability": 0.8,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue