Feature Extraction
Transformers
Safetensors
Laya
English
multilingual
laya_browser
custom_code
system-1
browser-agent
web-navigation
decision-model
mmbert
mind2web
tilelang
Instructions to use cklxx/laya-browser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cklxx/laya-browser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="cklxx/laya-browser", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("cklxx/laya-browser", trust_remote_code=True, device_map="auto") - Laya
How to use cklxx/laya-browser 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 code/apps/inbox_triage.py from cklxx/laya-browser: direct link, hf CLI and curl.
- Browser
- Download file 2.6 kB
-
https://huggingface.co/cklxx/laya-browser/resolve/main/code/apps/inbox_triage.py
- Command line
-
hf download hf://cklxx/laya-browser/code/apps/inbox_triage.py
-
curl -L -o inbox_triage.py https://huggingface.co/cklxx/laya-browser/resolve/main/code/apps/inbox_triage.py
2.6 kB
| """多语言工单/邮件分诊:一次前向传播同时回答 部门 / 紧急度 / 流失风险 / 情绪。 | |
| 用法: python apps/inbox_triage.py # 跑内置样例(中/英/日/西/印地语) | |
| python apps/inbox_triage.py "你的邮件正文" | |
| """ | |
| import sys, json, time | |
| from common import get_agent, show | |
| QUESTIONS = { | |
| "department": {"type": "choice", "instructions": "Which team should handle this message?", | |
| "criteria": {"billing": "invoices, payments, refunds, double charge", | |
| "technical": "bugs, crashes, outages, login failures", | |
| "sales": "pricing, quotes, upgrades, enterprise plans", | |
| "shipping": "delivery, tracking, lost or damaged package"}}, | |
| "urgency": {"type": "score", "instructions": "How urgent is this?", | |
| "criteria": ["not urgent", "soon", "blocking"]}, | |
| "churn_risk": {"type": "noul", "instructions": "Does the user threaten to cancel or leave?"}, | |
| "sentiment": {"type": "choice", "instructions": "What is the customer's tone?", | |
| "criteria": {"angry": "furious, threatening, insulting", | |
| "frustrated": "annoyed but civil", "neutral": "matter of fact", | |
| "happy": "grateful, positive"}}, | |
| } | |
| SAMPLES = [ | |
| {"subject": "Duplicate charge on invoice 4411", | |
| "body": "We were billed twice for March. Please refund the duplicate or we're moving to a competitor."}, | |
| {"subject": "登录一直失败", "body": "从昨天开始整个团队都登录不了后台,报 502,我们的上线被卡住了,急!"}, | |
| {"subject": "見積もりのお願い", "body": "エンタープライズプランの料金と年間契約の割引について教えてください。"}, | |
| {"subject": "Paquete perdido", "body": "El rastreo dice entregado pero no recibí nada. Llevo una semana esperando, estoy muy molesto."}, | |
| {"subject": "धन्यवाद", "body": "आपकी टीम ने मेरी समस्या बहुत जल्दी हल कर दी। बहुत बहुत धन्यवाद!"}, | |
| ] | |
| def main(): | |
| agent = get_agent("multilingual") | |
| states = [{"subject": "(cli)", "body": " ".join(sys.argv[1:])}] if len(sys.argv) > 1 else SAMPLES | |
| for s in states: | |
| t = time.time() | |
| r = agent.predict(s, QUESTIONS) | |
| dt = (time.time() - t) * 1000 | |
| print(f"\n=== {s['subject']} [{dt:.0f} ms]\n {s['body'][:80]}") | |
| show(r) | |
| if __name__ == "__main__": | |
| main() | |