Download code/settings.py from CollinMa/nextgpt-chapter6-report: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/spaces/CollinMa/nextgpt-chapter6-report/resolve/main/code/settings.py
- Command line
-
hf download hf://spaces/CollinMa/nextgpt-chapter6-report/code/settings.py
-
curl -L -o settings.py https://huggingface.co/spaces/CollinMa/nextgpt-chapter6-report/resolve/main/code/settings.py
1.76 kB
| """Paths and pinned upstream model sources; this module has no ML dependencies.""" | |
| import os | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parent | |
| LEGACY = ROOT / "vendor" / "nextgpt" | |
| CODE = LEGACY / "code" | |
| WEIGHTS = Path(os.getenv("NEXTGPT_WEIGHTS", str(ROOT / "weights"))).resolve() | |
| OUTPUTS = Path(os.getenv("NEXTGPT_OUTPUTS", str(ROOT / "outputs"))).resolve() | |
| UPSTREAM_COMMIT = "60d618b067ee4cb0d70e7075ae79852780b34fc2" | |
| MODELS = { | |
| "nextgpt": ("ChocoWu/nextgpt_7b_tiva_v0", "f28bea33714c810ef6cb9b9e440edcddb93297a4"), | |
| "llama": ("huggyllama/llama-7b", "4782ad278652c7c71b72204d462d6d01eaaf7549"), | |
| "vicuna_delta": ("lmsys/vicuna-7b-delta-v0", "fa5967d19dcc5d89c0a39d68766281ae6021e304"), | |
| "image": ("stable-diffusion-v1-5/stable-diffusion-v1-5", "451f4fe16113bff5a5d2269ed5ad43b0592e9a14"), | |
| "video": ("cerspense/zeroscope_v2_576w", "6963642a64dbefa93663d1ecebb4ceda2d9ecb28"), | |
| "audio": ("cvssp/audioldm-l-full", "26aec6fc5bb4f855a11e8357e0d69c8dc9d0ab95"), | |
| } | |
| IMAGEBIND_URL = "https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth" | |
| def weight_paths(): | |
| return { | |
| "imagebind": WEIGHTS / "pretrained" / "imagebind_ckpt" / "huge" / "imagebind_huge.pth", | |
| "vicuna": WEIGHTS / "pretrained" / "vicuna_ckpt" / "7b_v0", | |
| "nextgpt": WEIGHTS / "nextgpt" / "pytorch_model.pt", | |
| } | |
| def missing_weights(): | |
| paths = weight_paths() | |
| missing = [key for key in ("imagebind", "nextgpt") if not paths[key].is_file()] | |
| vicuna = paths["vicuna"] | |
| if not ((vicuna / "config.json").is_file() and (vicuna / "tokenizer.model").is_file() | |
| and any(vicuna.glob("pytorch_model*.bin")) | |
| and (vicuna / "merge_complete.json").is_file()): | |
| missing.append("vicuna") | |
| return missing | |