Upload 2 files
Browse files- handler.py +4 -2
- requirements.txt +0 -1
handler.py
CHANGED
|
@@ -16,8 +16,10 @@ if IS_COMPILE:
|
|
| 16 |
def compile_pipeline(pipe) -> Any:
|
| 17 |
pipe.transformer.fuse_qkv_projections()
|
| 18 |
pipe.transformer.to(memory_format=torch.channels_last)
|
| 19 |
-
|
| 20 |
-
pipe.
|
|
|
|
|
|
|
| 21 |
return pipe
|
| 22 |
|
| 23 |
class EndpointHandler:
|
|
|
|
| 16 |
def compile_pipeline(pipe) -> Any:
|
| 17 |
pipe.transformer.fuse_qkv_projections()
|
| 18 |
pipe.transformer.to(memory_format=torch.channels_last)
|
| 19 |
+
pipe.transformer = torch.compile(pipe.transformer, mode="reduce-overhead", fullgraph=False, dynamic=False, backend="inductor")
|
| 20 |
+
pipe.vae.fuse_qkv_projections()
|
| 21 |
+
pipe.vae.to(memory_format=torch.channels_last)
|
| 22 |
+
pipe.vae = torch.compile(pipe.vae, mode="reduce-overhead", fullgraph=False, dynamic=False, backend="inductor")
|
| 23 |
return pipe
|
| 24 |
|
| 25 |
class EndpointHandler:
|
requirements.txt
CHANGED
|
@@ -12,4 +12,3 @@ Pillow
|
|
| 12 |
sentencepiece
|
| 13 |
protobuf
|
| 14 |
pytorch-lightning
|
| 15 |
-
xformers
|
|
|
|
| 12 |
sentencepiece
|
| 13 |
protobuf
|
| 14 |
pytorch-lightning
|
|
|