Spaces:
Running
on
Zero
Running
on
Zero
Update utils.py
Browse filesPrevents the downloaded file name from Civitai becoming a zip file of training data.
utils.py
CHANGED
@@ -62,7 +62,7 @@ class ModelInformation:
|
|
62 |
self.download_url = json_data.get("downloadUrl", "")
|
63 |
self.model_url = f"https://civitai.com/models/{self.model_id}?modelVersionId={self.model_version_id}"
|
64 |
self.filename_url = next(
|
65 |
-
(v.get("name", "") for v in json_data.get("files", []) if str(self.model_version_id) in v.get("downloadUrl", "")), ""
|
66 |
)
|
67 |
self.filename_url = self.filename_url if self.filename_url else ""
|
68 |
self.description = json_data.get("description", "")
|
|
|
62 |
self.download_url = json_data.get("downloadUrl", "")
|
63 |
self.model_url = f"https://civitai.com/models/{self.model_id}?modelVersionId={self.model_version_id}"
|
64 |
self.filename_url = next(
|
65 |
+
(v.get("name", "") for v in reversed(json_data.get("files", [])) if str(self.model_version_id) in v.get("downloadUrl", "")), ""
|
66 |
)
|
67 |
self.filename_url = self.filename_url if self.filename_url else ""
|
68 |
self.description = json_data.get("description", "")
|