Benign huggingface Download

Brutalsky111/Snapjudge main

imports osImports the NumPy array library
SHA-2563b35f27baff1ba3a2268d02ab31ef7190b5a6009092d26fab0652a0d49126ad8

Evidence

imports os lines 1–11
1:48… CD proper-score fine-tune + temperature fit."""
2import copy, json, math, os, random
3import numpy as np
4import torch
5import torch.nn.functional as F
6
7from .common import QTYPES, build_sequence, collate_items, proper_reward, temp_bucket, ece_score, confidence_from_probs
8from .data_gen import questions_for, generate, split
9
10QIDS = ["q0", "q1", "q2"] # placeholder; real qids per game below
11GAME_QIDS = {"tictactoe": ["next_move …
Python for-range-over-len(X) loop lines 39–46
39:28… :
40 idx=list(range(len(pool))); rng.shuffle(idx)
41 for s in range(0,len(idx),bs):
42 yield [pool[i] for i in idx[s:s+bs]]
43
44def ce_loss(logits, target, mask):
45 logp = torch.log_softmax(logits, -1)
46 re …
imports numpy as _np lines 67–70
67:15… it["game"]; by_game.setdefault(g,[]).append(ok)
68 import numpy as _np
69 correct=_np.array(correct); confs=_np.array(confs)
70 acc=float(correct.mean()); ec …
Imports the NumPy array library lines 113–118
113:43… ure_by_options=temps
114 return temps
115
116def _np_stack(x): import numpy as _n; return _n.stack(x)
117def _np_exp(x): import numpy as _n; return _n.exp(x)
118def _np_log(x): import numpy as _n; return _n.lo …
Serializes to a stream with json.dump() lines 178–185
178:74… }",flush=True)
179 agent.save(out_dir)
180 with open(os.path.join(out_dir,"metrics.json"),"w") as f: json.dump(m,f,indent=2)
181 return m
182
183def _t_opt(agent, lr=2e-5):
184 import torch as _t
185 return _t.optim.AdamW(agent.model.parameters …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.