Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -71,8 +71,12 @@ def generate(
|
|
| 71 |
seed = random.randint(0, MAX_SEED)
|
| 72 |
seed = int(seed)
|
| 73 |
|
| 74 |
-
# Apply / adjust LoRA strength —
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
pipe.set_adapters(adapter_names, adapter_weights=[float(lora_strength)] * len(adapter_names))
|
| 77 |
|
| 78 |
generator = torch.Generator(device=device).manual_seed(seed)
|
|
|
|
| 71 |
seed = random.randint(0, MAX_SEED)
|
| 72 |
seed = int(seed)
|
| 73 |
|
| 74 |
+
# Apply / adjust LoRA strength — load_lora_weights names the adapter "default_0"
|
| 75 |
+
adapters = pipe.get_list_adapters()
|
| 76 |
+
if adapters:
|
| 77 |
+
adapter_names = list(adapters.values())
|
| 78 |
+
else:
|
| 79 |
+
adapter_names = ["default_0"]
|
| 80 |
pipe.set_adapters(adapter_names, adapter_weights=[float(lora_strength)] * len(adapter_names))
|
| 81 |
|
| 82 |
generator = torch.Generator(device=device).manual_seed(seed)
|