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
File size: 756 Bytes
80b01cc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # 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
|