Download scripts/probe_model.py from sroecker/seal-cell: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/spaces/sroecker/seal-cell/resolve/main/scripts/probe_model.py
- Command line
-
hf download hf://spaces/sroecker/seal-cell/scripts/probe_model.py
-
curl -L -o probe_model.py https://huggingface.co/spaces/sroecker/seal-cell/resolve/main/scripts/probe_model.py
725 Bytes
| import json | |
| from pathlib import Path | |
| from sealcell.model import get_model | |
| model = get_model() | |
| source = json.loads(Path("data/fixtures/playground-probes.json").read_text()) | |
| out = Path("reports/local-probes.jsonl") | |
| with out.open("w") as f: | |
| for case in source["cases"]: | |
| result = model.classify(case["text"], source["schema"]) | |
| f.write(json.dumps({"fixture_id": case["id"], **result}) + "\n") | |
| f.flush() | |
| print( | |
| case["id"], | |
| result["error"] or {k: v["selected_label"] for k, v in result["heads"].items()}, | |
| round(result["total_ms"]), | |
| flush=True, | |
| ) | |
| Path("reports/model-metadata.json").write_text(json.dumps(model.metadata, indent=2) + "\n") | |