# Pegasus Model Weights Compression/Pruning

**URL:** <https://discuss.huggingface.co/t/pegasus-model-weights-compression-pruning/6381>\
**Category:** Models\
**Created:** [May 26, 2021, 7:42am UTC](https://discuss.huggingface.co/t/pegasus-model-weights-compression-pruning/6381 "2021-05-26T07:42:08Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](https://discuss.huggingface.co/u/lewtun)\
**Post date:** [June 4, 2021, 4:25pm UTC](https://discuss.huggingface.co/t/pegasus-model-weights-compression-pruning/6381/7 "2021-06-04T16:25:08Z")

</div>

hmm this is a bit odd 😬

how did you do the quantization? i just remembered that someone already asked about quantizing pegasus [here](https://discuss.huggingface.co/t/fast-cpu-inference-on-pegasus-large-finetuned-model-currently-impossible/4048/2) so maybe you can check whether you can dynamically quantize the model in a similar to how i described it there and then try generating some outputs with the same model in memory (i.e. don’t save and reload)

if that works, then my guess is that `from_pretrained` doesn’t support loading quantized models (i can have a look) and you might need to do the loading in native pytorch

---

_[View the full topic](https://discuss.huggingface.co/t/pegasus-model-weights-compression-pruning/6381)._
