Download sync_from_website.py from Jam1e3/wing: direct link, hf CLI and curl.
- Browser
- Download file 881 Bytes
-
https://huggingface.co/spaces/Jam1e3/wing/resolve/main/sync_from_website.py
- Command line
-
hf download hf://spaces/Jam1e3/wing/sync_from_website.py
-
curl -L -o sync_from_website.py https://huggingface.co/spaces/Jam1e3/wing/resolve/main/sync_from_website.py
881 Bytes
| """Mirror the WING project page into this static Space. | |
| The page code is copied verbatim apart from asset URLs. Media stays on the | |
| existing project website, so the Space does not duplicate large video files. | |
| """ | |
| from pathlib import Path | |
| SPACE_DIR = Path(__file__).resolve().parent | |
| WEBSITE_DIR = SPACE_DIR.parent | |
| WEBSITE_URL = "https://mikuz12.github.io/wing/" | |
| SOURCE_FILES = ("index.html", "styles.css", "script.js", "experiments.js") | |
| ASSET_PREFIXES = ("assets/", "gen/", "main.pdf", "teaser.pdf", "wing_logo.png") | |
| def main() -> None: | |
| for name in SOURCE_FILES: | |
| content = (WEBSITE_DIR / name).read_text(encoding="utf-8") | |
| for prefix in ASSET_PREFIXES: | |
| content = content.replace(prefix, WEBSITE_URL + prefix) | |
| (SPACE_DIR / name).write_text(content, encoding="utf-8") | |
| print(f"Synced {name}") | |
| if __name__ == "__main__": | |
| main() | |