Spaces:
Paused
Paused
Download visualization/render.py from Jellyfish042/RWKV-ScaleLens: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/spaces/Jellyfish042/RWKV-ScaleLens/resolve/main/visualization/render.py
- Command line
-
hf download hf://spaces/Jellyfish042/RWKV-ScaleLens/visualization/render.py
-
curl -L -o render.py https://huggingface.co/spaces/Jellyfish042/RWKV-ScaleLens/resolve/main/visualization/render.py
413 Bytes
| """ | |
| Page rendering using a lightweight template. | |
| """ | |
| from pathlib import Path | |
| from string import Template | |
| from typing import Dict | |
| _TEMPLATE_PATH = Path(__file__).resolve().parent / "templates" / "page.html.tmpl" | |
| def render_page(context: Dict[str, str]) -> str: | |
| template_text = _TEMPLATE_PATH.read_text(encoding="utf-8") | |
| template = Template(template_text) | |
| return template.safe_substitute(context) | |