Spaces:
Running
on
Zero
Running
on
Zero
Update utils.py (#11)
Browse files- Update utils.py (1ee8bb8d2a9b77c6b601de0a009cb51a07e7daeb)
Co-authored-by: John Smith <[email protected]>
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", "")
|