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/apps/profile_step.py from cklxx/laya-browser: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/cklxx/laya-browser/resolve/main/code/apps/profile_step.py
- Command line
-
hf download hf://cklxx/laya-browser/code/apps/profile_step.py
-
curl -L -o profile_step.py https://huggingface.co/cklxx/laya-browser/resolve/main/code/apps/profile_step.py
1.19 kB
| """Time one real browser step (recorded in finetune/out/dagger_cases.jsonl) end to end inside the server process. | |
| python apps/profile_step.py <checkpoint dir>""" | |
| import json, os, sys | |
| sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))); sys.path.insert(0, "/home/ckl/projects/S/laya/finetune") | |
| os.environ.setdefault("LAYA_FMT", "v2") | |
| from common import get_agent | |
| from common_ft import build_request | |
| from fast_batch import profile_step | |
| agent = get_agent(sys.argv[1]) | |
| if agent.cfg.get("head_max_len_train"): agent.cfg["head_max_len"] = agent.cfg["head_max_len_train"] | |
| cases = [json.loads(l) for l in open("/home/ckl/projects/S/laya/finetune/out/dagger_cases.jsonl")] | |
| for c in cases[:4]: | |
| page = c["page_obj"]; state, questions, _, _ = build_request(page, c["goal"], c.get("history", [])) | |
| n_opts = sum(len(q["criteria"]) for q in questions.values()) | |
| r = profile_step(agent, state, questions) | |
| print(f"{len(questions)} questions / {n_opts:3d} options / {r['tokens']:4d} tokens: agent.predict {r['predict_ms']:6.1f} ms | fast {r['predict_fast_ms']:6.1f} ms " | |
| f"(tokenize {r['tokenize_ms']:.1f} + forward {r['forward_ms']:.1f} + post {r['post_ms']:.1f})") | |