Add WanTransformerBlock.fp8da/example.py from zerogpu-aoti/Wan2
Browse files
WanTransformerBlock.fp8da/example.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
+
import torch
|
| 3 |
+
from diffusers import DiffusionPipeline
|
| 4 |
+
from torchao import quantize_
|
| 5 |
+
|
| 6 |
+
pipeline = DiffusionPipeline.from_pretrained('Wan2.2')
|
| 7 |
+
quantize_(pipeline.transformer, Float8Config())
|
| 8 |
+
spaces.aoti_blocks_load(pipeline.transformer, 'zerogpu-aoti/Wan2', variant='fp8da')
|