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 tests/test_installed.py from Zipeng365/WISP: direct link, hf CLI and curl.
- Browser
- Download file 1.63 kB
-
https://huggingface.co/Zipeng365/WISP/resolve/main/tests/test_installed.py
- Command line
-
hf download hf://Zipeng365/WISP/tests/test_installed.py
-
curl -L -o test_installed.py https://huggingface.co/Zipeng365/WISP/resolve/main/tests/test_installed.py
1.63 kB
| """When run against an installed wheel (WISP_EXPECT_INSTALLED=1), check what is imported.""" | |
| import importlib.util | |
| import os | |
| from pathlib import Path | |
| import pytest | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def test_imports_resolve_outside_source_tree(): | |
| import wisp | |
| import wisp_fast | |
| import wisp_release | |
| for mod in (wisp, wisp_fast, wisp_release): | |
| assert ROOT / "src" not in Path(mod.__file__).resolve().parents, mod.__file__ | |
| assert wisp.__version__ == "0.4.0" | |
| def test_native_kernels_presence(): | |
| names = ("_kernels", "_family_kernels", "_cis_intervals", "_cis_conv", | |
| "funnel._kernels", "funnel._family_kernels", "funnel._cis_intervals", "funnel._cis_lite") | |
| found = [importlib.util.find_spec(f"wisp_fast.{n}") is not None for n in names] | |
| if os.environ["WISP_EXPECT_NATIVE"] == "1": | |
| assert all(found), found | |
| else: | |
| assert not any(found), found | |
| def test_public_names(): | |
| import wisp | |
| for name in ("WISPClassifier", "WISPRepresentation", "HMMSmoother", "WISPSelect", "WISPSearch", | |
| "recipes", "blocks", "adapters", "datasets", "hub", "metrics"): | |
| assert getattr(wisp, name) is not None | |
| with pytest.raises(NotImplementedError): | |
| wisp.hub.load_pretrained(method="random", dataset="adl", fold=0, seed=42) | |
| from wisp.cli import main | |
| assert main(["recipes", "--source", "fixed"]) == 0 | |