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
File size: 643 Bytes
5e39d13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | """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]}")
|