Update initializer.py

This commit is contained in:
PSBigBig 2025-06-07 20:53:51 +08:00 committed by GitHub
parent b3844aea62
commit e286e2f39b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,24 +1,8 @@
# wfgy_sdk/initializer.py
import os, zipfile, requests
import os
from .utils import DATA_DIR
URLS = {
"data": "https://zenodo.org/.../wfgy_data.zip",
"weights": "https://zenodo.org/.../wfgy_weights.zip",
"configs": "https://zenodo.org/.../wfgy_configs.zip"
}
def initialize():
os.makedirs(DATA_DIR, exist_ok=True)
for name, url in URLS.items():
target = os.path.join(DATA_DIR, f"{name}.zip")
print(f"Downloading {name}...")
resp = requests.get(url, stream=True)
with open(target, "wb") as f:
for c in resp.iter_content(1024):
f.write(c)
with zipfile.ZipFile(target, "r") as z:
z.extractall(DATA_DIR)
os.remove(target)
print("Initialization complete.")
print("No download required.")
print(f"All demo data is already included in the repository at: {DATA_DIR}")