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
File size: 742 Bytes
3639b3c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | """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"])
|