Spaces:
Running
on
Zero
Running
on
Zero
tori29umai
commited on
Commit
•
9c9bde8
1
Parent(s):
0d4b0ba
Update utils/dl_utils.py
Browse files- utils/dl_utils.py +18 -12
utils/dl_utils.py
CHANGED
@@ -57,16 +57,22 @@ def dl_tagger_model(model_dir):
|
|
57 |
|
58 |
|
59 |
def dl_lora_model(model_dir):
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
else:
|
70 |
-
print(f'
|
71 |
-
else:
|
72 |
-
print(f'{file_name} already exists.')
|
|
|
57 |
|
58 |
|
59 |
def dl_lora_model(model_dir):
|
60 |
+
models = {
|
61 |
+
"syoujomannga_line.safetensors": "https://huggingface.co/tori29umai/Egara_Lora/resolve/main/syoujomannga_line.safetensors",
|
62 |
+
"tori29umai_line.safetensors": "https://huggingface.co/tori29umai/Egara_Lora/resolve/main/tori29umai_line.safetensors",
|
63 |
+
# "gekiga_line.safetensors": "https://huggingface.co/tori29umai/Egara_Lora/resolve/main/gekiga_line.safetensors"
|
64 |
+
}
|
65 |
+
|
66 |
+
# 各モデルを確認し、必要に応じてダウンロード
|
67 |
+
for file_name, url in models.items():
|
68 |
+
file_path = os.path.join(model_dir, file_name)
|
69 |
+
if not os.path.exists(file_path):
|
70 |
+
response = requests.get(url, allow_redirects=True)
|
71 |
+
if response.status_code == 200:
|
72 |
+
with open(file_path, 'wb') as f:
|
73 |
+
f.write(response.content)
|
74 |
+
print(f'Downloaded {file_name}')
|
75 |
+
else:
|
76 |
+
print(f'Failed to download {file_name}')
|
77 |
else:
|
78 |
+
print(f'{file_name} already exists.')
|
|
|
|