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
File size: 1,066 Bytes
4307208 580ed2b 4307208 580ed2b 4307208 580ed2b 4307208 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | """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")
|