Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -60,9 +60,10 @@ class HFEmbedder(nn.Module):
|
|
60 |
return outputs[self.output_key]
|
61 |
|
62 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
66 |
|
67 |
# ---------------- NF4 ----------------
|
68 |
|
|
|
60 |
return outputs[self.output_key]
|
61 |
|
62 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
63 |
+
# Force using safetensors to avoid the torch.load security issue
|
64 |
+
t5 = HFEmbedder("DeepFloyd/t5-v1_1-xxl", max_length=512, torch_dtype=torch.bfloat16, use_safetensors=True).to(device)
|
65 |
+
clip = HFEmbedder("openai/clip-vit-large-patch14", max_length=77, torch_dtype=torch.bfloat16, use_safetensors=True).to(device)
|
66 |
+
ae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16, use_safetensors=True).to(device)
|
67 |
|
68 |
# ---------------- NF4 ----------------
|
69 |
|