Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,9 @@ from openai import OpenAI
|
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
|
16 |
pipe = CogView4Pipeline.from_pretrained("THUDM/CogView4-6B", torch_dtype=torch.bfloat16).to(device)
|
17 |
-
|
|
|
|
|
18 |
|
19 |
def clean_string(s):
|
20 |
s = s.replace("\n", " ")
|
|
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
|
16 |
pipe = CogView4Pipeline.from_pretrained("THUDM/CogView4-6B", torch_dtype=torch.bfloat16).to(device)
|
17 |
+
pipe.enable_model_cpu_offload()
|
18 |
+
pipe.vae.enable_slicing()
|
19 |
+
pipe.vae.enable_tiling()
|
20 |
|
21 |
def clean_string(s):
|
22 |
s = s.replace("\n", " ")
|