Upload 2 files
Browse files- handler.py +5 -5
- requirements.txt +1 -0
handler.py
CHANGED
|
@@ -20,14 +20,14 @@ from huggingface_inference_toolkit.logging import logger
|
|
| 20 |
import subprocess
|
| 21 |
subprocess.run("pip list", shell=True)
|
| 22 |
|
| 23 |
-
print("
|
| 24 |
-
print("
|
| 25 |
|
| 26 |
IS_TURBO = False
|
| 27 |
-
IS_4BIT =
|
| 28 |
IS_PARA = True
|
| 29 |
IS_LVRAM = False
|
| 30 |
-
IS_COMPILE =
|
| 31 |
IS_AUTOQ = False
|
| 32 |
IS_CC90 = True if torch.cuda.get_device_capability() >= (9, 0) else False
|
| 33 |
IS_CC89 = True if torch.cuda.get_device_capability() >= (8, 9) else False
|
|
@@ -160,7 +160,7 @@ def load_pipeline_opt(repo_id: str, dtype: torch.dtype) -> Any:
|
|
| 160 |
else: quantize_(vae, weight, device="cuda")
|
| 161 |
vae.to(memory_format=torch.channels_last)
|
| 162 |
vae = torch.compile(vae, mode="max-autotune", fullgraph=True)
|
| 163 |
-
pipe = FluxPipeline.from_pretrained(repo_id, transformer=None, vae=None,
|
| 164 |
pipe.transformer = transformer
|
| 165 |
pipe.vae = vae
|
| 166 |
return pipe
|
|
|
|
| 20 |
import subprocess
|
| 21 |
subprocess.run("pip list", shell=True)
|
| 22 |
|
| 23 |
+
print("Device Name:", torch.cuda.get_device_name())
|
| 24 |
+
print("Device Capability:", torch.cuda.get_device_capability())
|
| 25 |
|
| 26 |
IS_TURBO = False
|
| 27 |
+
IS_4BIT = False
|
| 28 |
IS_PARA = True
|
| 29 |
IS_LVRAM = False
|
| 30 |
+
IS_COMPILE = True
|
| 31 |
IS_AUTOQ = False
|
| 32 |
IS_CC90 = True if torch.cuda.get_device_capability() >= (9, 0) else False
|
| 33 |
IS_CC89 = True if torch.cuda.get_device_capability() >= (8, 9) else False
|
|
|
|
| 160 |
else: quantize_(vae, weight, device="cuda")
|
| 161 |
vae.to(memory_format=torch.channels_last)
|
| 162 |
vae = torch.compile(vae, mode="max-autotune", fullgraph=True)
|
| 163 |
+
pipe = FluxPipeline.from_pretrained(repo_id, transformer=None, vae=None, torch_dtype=dtype, quantization_config=quantization_config)
|
| 164 |
pipe.transformer = transformer
|
| 165 |
pipe.vae = vae
|
| 166 |
return pipe
|
requirements.txt
CHANGED
|
@@ -15,6 +15,7 @@ sentencepiece
|
|
| 15 |
protobuf
|
| 16 |
triton
|
| 17 |
gemlite
|
|
|
|
| 18 |
para-attn
|
| 19 |
bitsandbytes
|
| 20 |
optimum-quanto
|
|
|
|
| 15 |
protobuf
|
| 16 |
triton
|
| 17 |
gemlite
|
| 18 |
+
tabulate
|
| 19 |
para-attn
|
| 20 |
bitsandbytes
|
| 21 |
optimum-quanto
|