Upload download_deps.py with huggingface_hub
Browse files- download_deps.py +31 -0
download_deps.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Fetch everything else Ideogram 4 needs to run this quantized DiT.
|
| 2 |
+
|
| 3 |
+
This GGUF is the *quantized DiT only*. You also need the text encoder, VAE,
|
| 4 |
+
configs, and the custom inference package. Run this once.
|
| 5 |
+
|
| 6 |
+
Requires your own access to the GATED base repo `ideogram-ai/ideogram-4-fp8`:
|
| 7 |
+
1. Accept its license at https://huggingface.co/ideogram-ai/ideogram-4-fp8
|
| 8 |
+
2. `huggingface-cli login` (or `hf auth login`) with a token that has access.
|
| 9 |
+
"""
|
| 10 |
+
import subprocess
|
| 11 |
+
import sys
|
| 12 |
+
|
| 13 |
+
BASE = "ideogram-ai/ideogram-4-fp8"
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def main():
|
| 17 |
+
# 1) the official Ideogram 4 inference package (provides the pipeline/architecture)
|
| 18 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "-q",
|
| 19 |
+
"git+https://github.com/ideogram-oss/ideogram4.git"], check=True)
|
| 20 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "-q", "gguf"], check=True)
|
| 21 |
+
# 2) base components (text encoder, VAE, configs, tokenizer). Gated download.
|
| 22 |
+
from huggingface_hub import snapshot_download
|
| 23 |
+
path = snapshot_download(repo_id=BASE)
|
| 24 |
+
print("Base Ideogram 4 components downloaded to:\n ", path)
|
| 25 |
+
print("\nNext: run `python usage.py \"your prompt\"` (keep ideogram4-q4_k.gguf in this dir).")
|
| 26 |
+
print("Note: the base repo also contains the FP8 DiT shards, which this loader")
|
| 27 |
+
print("replaces with the Q4_K weights — you can prune those shards to save disk.")
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
if __name__ == "__main__":
|
| 31 |
+
main()
|