mooncak397
Claude Sonnet 5.5
Claude provider (PROVIDER_APP, PROVIDER_JUDGE), no pacing for Claude, usage and cost report
ef41800 Download evals/usage.py from christopher-dev/recruiter-assistant: direct link, hf CLI and curl.
- Browser
- Download file 456 Bytes
-
https://huggingface.co/spaces/christopher-dev/recruiter-assistant/resolve/main/evals/usage.py
- Command line
-
hf download hf://spaces/christopher-dev/recruiter-assistant/evals/usage.py
-
curl -L -o usage.py https://huggingface.co/spaces/christopher-dev/recruiter-assistant/resolve/main/evals/usage.py
456 Bytes
| """Token usage log for the cost report (evals/.usage.jsonl, not committed).""" | |
| import json | |
| import os | |
| from pathlib import Path | |
| LOG = Path(__file__).resolve().parent / ".usage.jsonl" | |
| def log(role: str, u: dict): | |
| model = os.environ.get("MODEL_APP" if role == "app" else "MODEL_JUDGE", "") | |
| with open(LOG, "a") as f: | |
| f.write(json.dumps({"role": role, "model": model, "in": u.get("input_tokens", 0), "out": u.get("output_tokens", 0)}) + "\n") | |