Instructions to use Zipeng365/WISP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use Zipeng365/WISP with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Zipeng365/WISP", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Download scripts/update_sha256sums.py from Zipeng365/WISP: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/Zipeng365/WISP/resolve/main/scripts/update_sha256sums.py
- Command line
-
hf download hf://Zipeng365/WISP/scripts/update_sha256sums.py
-
curl -L -o update_sha256sums.py https://huggingface.co/Zipeng365/WISP/resolve/main/scripts/update_sha256sums.py
1.6 kB
| """Rewrite SHA256SUMS for the files of this tree, keeping the lines of files that live only on | |
| the Hub (``models/``, ``videos/``), which this tree does not contain. | |
| python scripts/update_sha256sums.py [--check] | |
| Hashed: every git-tracked file (except SHA256SUMS itself) plus wheels in ``dist/``. | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| import hashlib | |
| import subprocess | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| KEEP_PREFIXES = ("models/", "videos/") | |
| def sha256(path: Path) -> str: | |
| h = hashlib.sha256() | |
| with path.open("rb") as f: | |
| for chunk in iter(lambda: f.read(1 << 20), b""): | |
| h.update(chunk) | |
| return h.hexdigest() | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--check", action="store_true") | |
| a = ap.parse_args() | |
| target = ROOT / "SHA256SUMS" | |
| kept = [line for line in target.read_text().splitlines() if line[66:].startswith(KEEP_PREFIXES)] | |
| files = subprocess.run(["git", "ls-files"], cwd=ROOT, capture_output=True, text=True, check=True).stdout.split() | |
| files += [str(p.relative_to(ROOT)) for p in sorted((ROOT / "dist").glob("*.whl"))] | |
| lines = [f"{sha256(ROOT / f)} {f}" for f in sorted(set(files)) if f != "SHA256SUMS" and (ROOT / f).is_file()] | |
| text = "\n".join(sorted(lines + kept, key=lambda line: line[66:])) + "\n" | |
| if a.check: | |
| raise SystemExit(0 if target.read_text() == text else "SHA256SUMS is out of date") | |
| target.write_text(text) | |
| print(f"{len(lines)} tree files, {len(kept)} Hub-only lines kept") | |
| if __name__ == "__main__": | |
| main() | |