Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -218,7 +218,7 @@ def download_ckpt(ckpt_url_2, ckpt_name_2):
|
|
218 |
return "error download ckpt!"
|
219 |
|
220 |
|
221 |
-
def to_safetensors(safetensors_name_2):
|
222 |
os.system("mkdir safetensors")
|
223 |
weights = torch.load(f"ckpt/{ckpt_name_2}.ckpt")
|
224 |
if "state_dict" in weights:
|
@@ -278,7 +278,7 @@ def download_safetensors(safetensors_url, safetensors_name):
|
|
278 |
except Exception as e:
|
279 |
return "error download safetensors!"
|
280 |
|
281 |
-
def from_safetensors_to_ckpt(ckpt_name):
|
282 |
weights = load_file(f"safetensors/{safetensors_name}.safetensors", device="cpu")
|
283 |
os.system("mkdir ckpt")
|
284 |
torch.save(weights, f"ckpt/{ckpt_name}.ckpt")
|
|
|
218 |
return "error download ckpt!"
|
219 |
|
220 |
|
221 |
+
def to_safetensors(ckpt_name_2, safetensors_name_2):
|
222 |
os.system("mkdir safetensors")
|
223 |
weights = torch.load(f"ckpt/{ckpt_name_2}.ckpt")
|
224 |
if "state_dict" in weights:
|
|
|
278 |
except Exception as e:
|
279 |
return "error download safetensors!"
|
280 |
|
281 |
+
def from_safetensors_to_ckpt(safetensors_name, ckpt_name):
|
282 |
weights = load_file(f"safetensors/{safetensors_name}.safetensors", device="cpu")
|
283 |
os.system("mkdir ckpt")
|
284 |
torch.save(weights, f"ckpt/{ckpt_name}.ckpt")
|