Text Classification
Laya
ONNX
Safetensors
English
llm-router
prompt-routing
modernbert
Eval Results (legacy)
Instructions to use KVRun/kvrun-relay-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use KVRun/kvrun-relay-v1 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 examples/predict.py from KVRun/kvrun-relay-v1: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/KVRun/kvrun-relay-v1/resolve/main/examples/predict.py
- Command line
-
hf download hf://KVRun/kvrun-relay-v1/examples/predict.py
-
curl -L -o predict.py https://huggingface.co/KVRun/kvrun-relay-v1/resolve/main/examples/predict.py
643 Bytes
| """Classify prompts with router-laya-v1 using the `laya` package (PyTorch). | |
| pip install laya huggingface_hub | |
| python predict.py "Write a Rust function that parses ISO 8601 dates" | |
| """ | |
| import json | |
| import sys | |
| import laya | |
| from huggingface_hub import hf_hub_download | |
| REPO = "[org]/router-laya-v1" | |
| agent = laya.load(REPO) | |
| questions = json.load(open(hf_hub_download(REPO, "questions.json"))) | |
| for prompt in sys.argv[1:] or ["hi there", "Prove that the square root of 2 is irrational"]: | |
| a = agent.predict(prompt, questions)["answers"] | |
| print(f"{a['category']['choice']:<18} complexity={a['complexity']['score']:.2f} {prompt[:60]}") | |