Spaces:
Sleeping
Sleeping
Download core/utils.py from ZTXRiley/ASR_AGENT_: direct link, hf CLI and curl.
- Browser
- Download file 353 Bytes
-
https://huggingface.co/spaces/ZTXRiley/ASR_AGENT_/resolve/main/core/utils.py
- Command line
-
hf download hf://spaces/ZTXRiley/ASR_AGENT_/core/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/ZTXRiley/ASR_AGENT_/resolve/main/core/utils.py
353 Bytes
| from __future__ import annotations | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| from typing import Any, Dict | |
| def stable_hash(d: Dict[str, Any]) -> str: | |
| s = json.dumps(d, sort_keys=True, ensure_ascii=False) | |
| return hashlib.md5(s.encode("utf-8")).hexdigest()[:8] | |
| def ensure_dir(p: Path) -> None: | |
| p.mkdir(parents=True, exist_ok=True) | |