Download Brain_O_Codebase/brain_v0_5/Models/Benchmarks/perplexity.py from BraegnAI/Brain-o: direct link, hf CLI and curl.
- Browser
- Download file 138 Bytes
-
https://huggingface.co/datasets/BraegnAI/Brain-o/resolve/main/Brain_O_Codebase/brain_v0_5/Models/Benchmarks/perplexity.py
- Command line
-
hf download hf://datasets/BraegnAI/Brain-o/Brain_O_Codebase/brain_v0_5/Models/Benchmarks/perplexity.py
-
curl -L -o perplexity.py https://huggingface.co/datasets/BraegnAI/Brain-o/resolve/main/Brain_O_Codebase/brain_v0_5/Models/Benchmarks/perplexity.py
138 Bytes
| from __future__ import annotations | |
| import math | |
| def from_loss(loss: float) -> float: | |
| return math.exp(min(max(float(loss), 0.0), 20.0)) | |