Spaces:
Sleeping
Sleeping
Download dataset/problem_16/buggy.py from Viraj0112/rl_code_fix_env: direct link, hf CLI and curl.
- Browser
- Download file 380 Bytes
-
https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_16/buggy.py
- Command line
-
hf download hf://spaces/Viraj0112/rl_code_fix_env/dataset/problem_16/buggy.py
-
curl -L -o buggy.py https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_16/buggy.py
380 Bytes
| from dataset.problem_16.helpers import normalize_scores | |
| def top_label(scores: dict[str, float]) -> str: | |
| """Return label with highest normalized probability.""" | |
| labels = list(scores.keys()) | |
| probs = normalize_scores(list(scores.values())) | |
| # BUG: chooses min instead of max. | |
| idx = min(range(len(probs)), key=lambda i: probs[i]) | |
| return labels[idx] | |