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/verify.py from cklxx/laya-browser: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/cklxx/laya-browser/resolve/main/code/verify.py
- Command line
-
hf download hf://cklxx/laya-browser/code/verify.py
-
curl -L -o verify.py https://huggingface.co/cklxx/laya-browser/resolve/main/code/verify.py
1.07 kB
| """Smoke test: load laya-browser from the Hub (or a local dir) and answer one recorded browser step. | |
| uv run python verify.py # downloads cklxx/laya-browser (model at the repo root) | |
| uv run python verify.py /path/to/dir # a local copy | |
| uv run python verify.py --fast # laya's TileLang fast path (CUDA) | |
| """ | |
| import json, os, sys | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| sys.path.insert(0, os.path.join(HERE, "apps")) | |
| from laya_browser import LayaBrowser | |
| src = next((a for a in sys.argv[1:] if not a.startswith("--")), "cklxx/laya-browser") | |
| lb = LayaBrowser.from_pretrained(src, fast="--fast" in sys.argv) | |
| body = json.load(open(os.path.join(HERE, "sample_request.json"))) # a request as jev-ultrafast sends it | |
| for _ in range(3): | |
| out = lb.systemone(body)["answers"] | |
| op = out["operation"]["choice"] | |
| print("operation:", op, round(out["operation"]["confidence"], 3)) | |
| tq = op.lower() + "_target" | |
| if tq in out: | |
| print("target:", out[tq]["choice"], body["questions"][tq]["criteria"][out[tq]["choice"]]) | |
| print("ok") | |