Instructions to use Pushkarrrr15151/PolyVL-router-laya with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use Pushkarrrr15151/PolyVL-router-laya with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download input_serializer.py from Pushkarrrr15151/PolyVL-router-laya: direct link, hf CLI and curl.
- Browser
- Download file 742 Bytes
-
https://huggingface.co/Pushkarrrr15151/PolyVL-router-laya/resolve/main/input_serializer.py
- Command line
-
hf download hf://Pushkarrrr15151/PolyVL-router-laya/input_serializer.py
-
curl -L -o input_serializer.py https://huggingface.co/Pushkarrrr15151/PolyVL-router-laya/resolve/main/input_serializer.py
742 Bytes
| """Canonical runtime-visible state; never serialize annotation fields.""" | |
| import json | |
| KEYS = ("message", "history", "assets", "active_image_id", "last_analysis") | |
| def serialize(state): | |
| if set(state) != set(KEYS): | |
| raise ValueError("Unexpected/missing runtime state keys") | |
| # Order is deliberate: newest request must not be lost behind old history. | |
| ordered = {k: state[k] for k in ("message", "assets", "active_image_id", "last_analysis", "history")} | |
| return json.dumps(ordered, ensure_ascii=False, separators=(",", ":"), allow_nan=False) | |
| def supported_asset_exists(state): | |
| return any(a["kind"] == "image" and a["availability"] == "available" | |
| and a["support"] == "supported" for a in state["assets"]) | |