Spaces:
Sleeping
Sleeping
Commit
•
ba35348
1
Parent(s):
9b729f7
Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,13 @@ with open(lora_list, "r") as file:
|
|
31 |
|
32 |
for item in sdxl_loras:
|
33 |
saved_name = hf_hub_download(item["repo"], item["weights"])
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
item["saved_name"] = saved_name
|
35 |
-
state_dict = load_file(saved_name)
|
36 |
item["state_dict"] = {k: v.to(device="cuda", dtype=torch.float16) for k, v in state_dict.items() if torch.is_tensor(v)}
|
37 |
|
38 |
css = '''
|
|
|
31 |
|
32 |
for item in sdxl_loras:
|
33 |
saved_name = hf_hub_download(item["repo"], item["weights"])
|
34 |
+
|
35 |
+
if saved_name.endswith('.safetensors'):
|
36 |
+
state_dict = load_file(saved_name)
|
37 |
+
else:
|
38 |
+
state_dict = torch.load(saved_name)
|
39 |
+
|
40 |
item["saved_name"] = saved_name
|
|
|
41 |
item["state_dict"] = {k: v.to(device="cuda", dtype=torch.float16) for k, v in state_dict.items() if torch.is_tensor(v)}
|
42 |
|
43 |
css = '''
|