Text Classification
Transformers
Safetensors
Laya
system-one
calibrated-decisions
rlcd
classification
routing
scoring
guardrails
moderation
reinforcement-learning
commercial-use
Instructions to use kp-forks/laya with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kp-forks/laya with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="kp-forks/laya")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kp-forks/laya", device_map="auto") - Laya
How to use kp-forks/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
Commit ·
28149c4
1
Parent(s): 8bffd14
README: installation, quickstart and docs first, laya 0.3.16 notes
Browse files
README.md
CHANGED
|
@@ -17,11 +17,37 @@ pip install laya
|
|
| 17 |
|
| 18 |
Python 3.10 or newer. Optional extras: `laya[serve]` (HTTP server), `laya[mcp]` (MCP server), `laya[langchain]` (LangChain and LangGraph), `laya[onnx]` (ONNX Runtime), `laya[fast]` (TileLang GPU fast path). Platform-by-platform setup is in the [GitHub README](https://github.com/NandhaKishorM/laya#installation-details).
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
## Documentation
|
| 21 |
|
| 22 |
**[nandhakishorm.github.io/laya](https://nandhakishorm.github.io/laya/)**: guides for [prediction hooks](https://nandhakishorm.github.io/laya/hooks/), [schema-driven decisions](https://nandhakishorm.github.io/laya/structured/), [Docker](https://nandhakishorm.github.io/laya/docker/) and [LangChain and LangGraph](https://nandhakishorm.github.io/laya/langchain/), plus a full [API reference](https://nandhakishorm.github.io/laya/reference/).
|
| 23 |
|
| 24 |
-
## What's new in laya 0.3.
|
| 25 |
|
| 26 |
The checkpoints themselves are unchanged. `pip install -U laya` for the latest runtime fixes:
|
| 27 |
|
|
|
|
| 17 |
|
| 18 |
Python 3.10 or newer. Optional extras: `laya[serve]` (HTTP server), `laya[mcp]` (MCP server), `laya[langchain]` (LangChain and LangGraph), `laya[onnx]` (ONNX Runtime), `laya[fast]` (TileLang GPU fast path). Platform-by-platform setup is in the [GitHub README](https://github.com/NandhaKishorM/laya#installation-details).
|
| 19 |
|
| 20 |
+
## Quickstart
|
| 21 |
+
|
| 22 |
+
```python
|
| 23 |
+
from laya import Router
|
| 24 |
+
|
| 25 |
+
router = Router() # downloads a checkpoint on first use; Router(preload=True) loads all three up front
|
| 26 |
+
|
| 27 |
+
state = "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan."
|
| 28 |
+
questions = {
|
| 29 |
+
"department": {"type": "choice", "instructions": "Which department should handle this?",
|
| 30 |
+
"criteria": {"billing": "invoices, payments, refunds",
|
| 31 |
+
"technical": "bugs, outages, system errors",
|
| 32 |
+
"other": "everything else"}},
|
| 33 |
+
"urgency": {"type": "score", "instructions": "How urgent is this?",
|
| 34 |
+
"criteria": ["not urgent", "soon", "blocking"]},
|
| 35 |
+
"churn_risk": {"type": "noul", "instructions": "Does the user threaten to cancel or leave?"},
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
result = router.predict(state, questions)
|
| 39 |
+
print(result["answers"]["department"]["choice"]) # billing
|
| 40 |
+
print(result["answers"]["churn_risk"]["noul"]) # probability the answer is yes
|
| 41 |
+
print(result["routing"]["model"]) # english
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
Text in any of 100+ languages works the same way: the `Router` sends it to `laya-multilingual` automatically.
|
| 45 |
+
|
| 46 |
## Documentation
|
| 47 |
|
| 48 |
**[nandhakishorm.github.io/laya](https://nandhakishorm.github.io/laya/)**: guides for [prediction hooks](https://nandhakishorm.github.io/laya/hooks/), [schema-driven decisions](https://nandhakishorm.github.io/laya/structured/), [Docker](https://nandhakishorm.github.io/laya/docker/) and [LangChain and LangGraph](https://nandhakishorm.github.io/laya/langchain/), plus a full [API reference](https://nandhakishorm.github.io/laya/reference/).
|
| 49 |
|
| 50 |
+
## What's new in laya 0.3.16
|
| 51 |
|
| 52 |
The checkpoints themselves are unchanged. `pip install -U laya` for the latest runtime fixes:
|
| 53 |
|