| 81 | |
| 82 | |
| 83 | class ChatPrediction(TypedDict, total=False): |
| 84 | generation: Message |
| 85 | tokens: List[str] # not required |
| 86 | logprobs: List[float] # not required |
| 87 | |
| 88 | def sample_top_p(probs, p): |
| 89 | probs_sort, probs_idx = torch.sort(probs, dim=-1, descending=True) |
nothing calls this directly
no outgoing calls
no test coverage detected