Large Language Models, Quantization, Machine Learning, Data Science, Hands On Tutorials.
calculate_perplexity(model_abs, absmax_text) ppl_zp = calculate_perplexity(model_zp, absmax_text) print(f"Original perplexity: {ppl.item():.2f}") print(f"Absmax perplexity: {ppl_abs.item():.2f}") print(f"Zeropoint perplexity: {ppl_zp.item():.2f}") Original perplexity: 15.53 Absmax perplexity: 17.92