Skip to content

Commit

Permalink
✨ New download script with LoRA selection
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanZhouDev committed Jan 2, 2025
1 parent 7ae17ea commit 49c98db
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions download.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
import json
from huggingface_hub import hf_hub_download

REPO_ID = "EvanZhouDev/open-genmoji"
FILENAME = "flux-dev.safetensors"
# Read info.json
with open("./lora/info.json", "r") as f:
models = json.load(f)

print(
"Downloaded weights to: "
+ hf_hub_download(repo_id=REPO_ID, filename=FILENAME, local_dir="./lora")
)
# Print menu
print("Available models:")
for i, model in enumerate(models):
print(
f"[{i}] {model['name']} ({model['model'].split("/")[1]})\n> {model['description']}"
)

# Get user choice
choice = int(input("\nSelect a model (enter number): "))

if 0 <= choice < len(models):
selected = models[choice]
filename = f"{selected['name']}.safetensors"

print(f"\nDownloading {selected['name']}...")
print(
"Downloaded weights to: "
+ hf_hub_download(
repo_id=selected["huggingface"], filename=filename, local_dir="./lora"
)
)
else:
print("Invalid selection")

0 comments on commit 49c98db

Please sign in to comment.