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 src/wisp/utils/jsonl.py from Zipeng365/WISP: direct link, hf CLI and curl.
- Browser
- Download file 756 Bytes
-
https://huggingface.co/Zipeng365/WISP/resolve/main/src/wisp/utils/jsonl.py
- Command line
-
hf download hf://Zipeng365/WISP/src/wisp/utils/jsonl.py
-
curl -L -o jsonl.py https://huggingface.co/Zipeng365/WISP/resolve/main/src/wisp/utils/jsonl.py
756 Bytes
| # Paper-scoped implementation; see SOURCE_PROVENANCE.json. | |
| from __future__ import annotations | |
| import json | |
| from pathlib import Path | |
| from typing import Any, Iterable | |
| def append_jsonl(path: str | Path, row: dict[str, Any]) -> None: | |
| p = Path(path) | |
| p.parent.mkdir(parents=True, exist_ok=True) | |
| with p.open('a', encoding='utf-8') as f: | |
| f.write(json.dumps(row, ensure_ascii=False, sort_keys=True) + '\n') | |
| def read_jsonl(path: str | Path) -> list[dict[str, Any]]: | |
| p = Path(path) | |
| if not p.exists(): | |
| return [] | |
| rows: list[dict[str, Any]] = [] | |
| with p.open('r', encoding='utf-8') as f: | |
| for line in f: | |
| line = line.strip() | |
| if line: | |
| rows.append(json.loads(line)) | |
| return rows | |