Download code/tt_diffusion_planner/__init__.py from changh95/diffusion-planner-p150: direct link, hf CLI and curl.
- Browser
- Download file 1.63 kB
-
https://huggingface.co/changh95/diffusion-planner-p150/resolve/main/code/tt_diffusion_planner/__init__.py
- Command line
-
hf download hf://changh95/diffusion-planner-p150/code/tt_diffusion_planner/__init__.py
-
curl -L -o __init__.py https://huggingface.co/changh95/diffusion-planner-p150/resolve/main/code/tt_diffusion_planner/__init__.py
1.63 kB
| # SPDX-License-Identifier: Apache-2.0 | |
| """Diffusion Planner v5.0 (Autoware diffusion_planner) on a Tenstorrent Blackhole p150 (tt-nn), packaged as | |
| changh95/diffusion-planner-p150. | |
| Python API (see PYTHON.md):: | |
| from tt_diffusion_planner import DiffusionPlanner | |
| with DiffusionPlanner.from_pretrained(device_id=0) as model: | |
| out = model(inputs="code/tt_diffusion_planner/samples/kashiwanoha_dense.npz") | |
| Importing the package has no side effects (no device, no ttnn / torch import, no network); the names below load | |
| on first use. The HTTP server is ``tt_diffusion_planner.server.app:app`` (SERVING.md). ``tt_diffusion_planner.ttaw`` | |
| is the vendored shared package of the Autoware ports (``ttaw/VENDORED.json`` records its version and file hashes; | |
| never edit it here). ``tt_diffusion_planner.reference`` is the fp32 CPU reference (torch) and | |
| ``tt_diffusion_planner.host`` the node's pre- and post-processing (numpy). | |
| """ | |
| __version__ = "0.2.0" | |
| __all__ = ["DiffusionPlanner", "Output", "open_device", "load_inputs", "INPUT_SCHEMA", "__version__"] | |
| _LAZY = { | |
| "DiffusionPlanner": (".api", "DiffusionPlanner"), | |
| "Output": (".api", "Output"), | |
| "open_device": (".device", "open_device"), | |
| "load_inputs": (".io", "load_inputs"), | |
| "INPUT_SCHEMA": (".reference.config", "INPUT_SCHEMA"), | |
| } | |
| def __getattr__(name): | |
| if name in _LAZY: | |
| import importlib | |
| module, attr = _LAZY[name] | |
| return getattr(importlib.import_module(module, __name__), attr) | |
| raise AttributeError(f"module {__name__!r} has no attribute {name!r}") | |
| def __dir__(): | |
| return sorted(list(globals()) + __all__) | |