跳到正文
Hugging Face Blog·· 2025-09-02AI 评分58

如何用 PyTorch 提前编译让 ZeroGPU Spaces 提速

Make your ZeroGPU Spaces go brrr with ahead-of-time compilation

AI 导读

Hugging Face 介绍在 ZeroGPU Spaces 中使用 PyTorch 提前编译(AoT)的方法,通过 spaces 包的 aoti_capture、aoti_compile 和 aoti_apply 等接口,把模型编译一次后即时重载,避免 torch.compile 在短生命周期进程中反复编译。

来源:Hugging Face Blog · huggingface.co