Download eval/output_behavior.py from Jack04810/agentic-rl-main: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/Jack04810/agentic-rl-main/resolve/main/eval/output_behavior.py
- Command line
-
hf download hf://Jack04810/agentic-rl-main/eval/output_behavior.py
-
curl -L -o output_behavior.py https://huggingface.co/Jack04810/agentic-rl-main/resolve/main/eval/output_behavior.py
593 Bytes
| from __future__ import annotations | |
| from opsd_utils.diagnostics import summarize_template_behavior | |
| BEHAVIOR_KEYS = ( | |
| "full_cot_template", | |
| "partial_cot_template", | |
| "goal_without_answer", | |
| "empty_cot_skeleton", | |
| "malformed_answer_section", | |
| ) | |
| def summarize_output_behavior_counts(texts: list[str]) -> dict[str, int]: | |
| counts = {"total": len(texts), **{key: 0 for key in BEHAVIOR_KEYS}} | |
| for text in texts: | |
| rates = summarize_template_behavior([text]) | |
| for key in BEHAVIOR_KEYS: | |
| counts[key] += int(rates[f"{key}_rate"] > 0.5) | |
| return counts | |