Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ torch.set_float32_matmul_precision("high")
|
|
| 31 |
torch._inductor.config.conv_1x1_as_mm = True
|
| 32 |
torch._inductor.config.coordinate_descent_tuning = True
|
| 33 |
torch._inductor.config.epilogue_fusion = False
|
| 34 |
-
torch._inductor.config.coordinate_descent_check_all_directions =
|
| 35 |
|
| 36 |
# Load LoRAs from JSON file
|
| 37 |
with open('loras.json', 'r') as f:
|
|
@@ -52,7 +52,7 @@ torch_dtype=torch.bfloat16,
|
|
| 52 |
trust_remote_code=True,
|
| 53 |
).to(device)
|
| 54 |
|
| 55 |
-
clipmodel = '
|
| 56 |
if clipmodel == "long":
|
| 57 |
model_id = "zer0int/LongCLIP-GmP-ViT-L-14"
|
| 58 |
config = CLIPConfig.from_pretrained(model_id)
|
|
@@ -68,12 +68,14 @@ pipe.tokenizer = clip_processor.tokenizer
|
|
| 68 |
pipe.text_encoder = clip_model.text_model
|
| 69 |
pipe.tokenizer_max_length = maxtokens
|
| 70 |
pipe.text_encoder.dtype = torch.bfloat16
|
|
|
|
|
|
|
| 71 |
|
| 72 |
pipe.transformer.to(memory_format=torch.channels_last)
|
| 73 |
-
pipe.vae.to(memory_format=torch.channels_last)
|
| 74 |
|
| 75 |
-
pipe.transformer = torch.compile(pipe.transformer, mode="max-autotune", fullgraph=
|
| 76 |
-
pipe.vae.decode = torch.compile(pipe.vae.decode, mode="max-autotune", fullgraph=
|
| 77 |
|
| 78 |
MAX_SEED = 2**32-1
|
| 79 |
|
|
|
|
| 31 |
torch._inductor.config.conv_1x1_as_mm = True
|
| 32 |
torch._inductor.config.coordinate_descent_tuning = True
|
| 33 |
torch._inductor.config.epilogue_fusion = False
|
| 34 |
+
torch._inductor.config.coordinate_descent_check_all_directions = False
|
| 35 |
|
| 36 |
# Load LoRAs from JSON file
|
| 37 |
with open('loras.json', 'r') as f:
|
|
|
|
| 52 |
trust_remote_code=True,
|
| 53 |
).to(device)
|
| 54 |
|
| 55 |
+
clipmodel = 'long'
|
| 56 |
if clipmodel == "long":
|
| 57 |
model_id = "zer0int/LongCLIP-GmP-ViT-L-14"
|
| 58 |
config = CLIPConfig.from_pretrained(model_id)
|
|
|
|
| 68 |
pipe.text_encoder = clip_model.text_model
|
| 69 |
pipe.tokenizer_max_length = maxtokens
|
| 70 |
pipe.text_encoder.dtype = torch.bfloat16
|
| 71 |
+
pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to("cuda")
|
| 72 |
+
|
| 73 |
|
| 74 |
pipe.transformer.to(memory_format=torch.channels_last)
|
| 75 |
+
#pipe.vae.to(memory_format=torch.channels_last)
|
| 76 |
|
| 77 |
+
pipe.transformer = torch.compile(pipe.transformer, mode="max-autotune", fullgraph=False)
|
| 78 |
+
#pipe.vae.decode = torch.compile(pipe.vae.decode, mode="max-autotune", fullgraph=False)
|
| 79 |
|
| 80 |
MAX_SEED = 2**32-1
|
| 81 |
|