sampleTopPFromLogits(logits, temperature, top_p) {
	        return this.ctx.sampleTopPFromLogits(logits, temperature, top_p, Math.random());
	    }
Sample index via top-p sampling.

@param logits The input logits before normalization.
@param temperature  The temperature factor, will take argmax if temperature = 0.0
@param top_p The top_p
@returns The sampled index.