forked from EvanZhouDev/open-genmoji
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ New download script with LoRA selection
- Loading branch information
1 parent
7ae17ea
commit 49c98db
Showing
1 changed file
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |