(self, sample_method)
| 17 | class Sampling(): |
| 18 | |
| 19 | def __init__(self, sample_method): |
| 20 | if sample_method == "top_k": |
| 21 | self.sample_method = self.top_k_logits |
| 22 | elif sample_method == "top_p": |
| 23 | self.sample_method = self.top_p_logits |
| 24 | else: |
| 25 | print("[ERROR] the sample method should be one of top_k and top_p") |
| 26 | exit(-1) |
| 27 | |
| 28 | pass |
| 29 | |
| 30 | def sample(self, logits, threshold, num_samples=1): |
| 31 | ''' |
nothing calls this directly
no outgoing calls
no test coverage detected