Spaces:
Sleeping
Sleeping
Download adsp/communication/cache.py from thanhnv2323/humanize-text-python: direct link, hf CLI and curl.
- Browser
- Download file 517 Bytes
-
https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/adsp/communication/cache.py
- Command line
-
hf download hf://spaces/thanhnv2323/humanize-text-python/adsp/communication/cache.py
-
curl -L -o cache.py https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/adsp/communication/cache.py
517 Bytes
| """Caching abstraction for low-latency persona responses.""" | |
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from typing import Any, Dict, Optional | |
| class CacheClient: | |
| """A naive in-memory cache placeholder. Replace with Redis/Memcached.""" | |
| _entries: Dict[str, Any] = field(default_factory=dict) | |
| def get(self, key: str) -> Optional[Any]: | |
| return self._entries.get(key) | |
| def set(self, key: str, value: Any) -> None: | |
| self._entries[key] = value | |