Feature Extraction
Transformers
Safetensors
English
multilingual
laya_browser
laya
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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("cklxx/laya-browser", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download code/README.md from cklxx/laya-browser: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/cklxx/laya-browser/resolve/main/code/README.md
- Command line
-
hf download hf://cklxx/laya-browser/code/README.md
-
curl -L -o README.md https://huggingface.co/cklxx/laya-browser/resolve/main/code/README.md
1.66 kB
| # Laya 本机加速 + 应用 | |
| [convaiinnovations/laya](https://huggingface.co/convaiinnovations/laya):非自回归“System 1”决策模型(ModernBERT/mmBERT 编码器 + 决策头), | |
| 一次前向同时回答多个 `choice / score / noul` 问题,输出校准概率,不生成文本。 | |
| ## 环境 | |
| ```fish | |
| source env.sh # HF 镜像 + 清华 PyPI + 关闭代理 | |
| .venv/bin/python ... # Python 3.12, torch 2.11+cu130, tilelang 0.1.14 | |
| ``` | |
| ## 应用(apps/) | |
| | 脚本 | 说明 | | |
| |---|---| | |
| | `apps/inbox_triage.py [正文]` | 多语言工单分诊:部门 / 紧急度 / 流失风险 / 情绪 | | |
| | `apps/moderator.py [file]` | 评论审核台:有害 / 垃圾 / 主题 / 严重度,按风险排序 | | |
| | `apps/hn_radar.py [N]` | 拉 Hacker News 热帖实时打标签 | | |
| | `apps/web_console.py [port]` | 零依赖 Web 决策台,自定义问题 JSON,实时概率条 | | |
| 在任何应用里加两行即可启用加速: | |
| ```python | |
| import sys; sys.path.insert(0, "kernels") | |
| from fast_laya import accelerate; accelerate(agent) | |
| ``` | |
| ## TileLang 加速(kernels/) | |
| * `tl_kernels.py` — GEMM(+bias/act 融合)、GEMM+GEGLU 融合、残差+LayerNorm 融合、原地 RoPE、 | |
| 带 padding 掩码与滑动窗口的 flash attention。行数 M 为运行时符号,每个 kernel 只编译一次。 | |
| * `fast_laya.py` — 用上述 kernel 重写整个编码器 + 决策头前向,bf16 权重常驻,按 (batch, L) 桶捕获 CUDA Graph。 | |
| `accelerate(agent)` 原地替换 `agent.model.forward`。 | |
| * `test_kernels.py` / `verify_and_bench.py` — 单 kernel 对拍、端到端数值一致性与延迟对比。 | |
| * `tune.py` — tile 参数扫描。 | |