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
laya_browser.py: no ModernBERT auto-compile (works without a Triton toolchain); README uses `hf download`
Browse files- code/apps/laya_browser.py +4 -0
- encoder/config.json +3 -2
- laya_browser.py +4 -0
code/apps/laya_browser.py
CHANGED
|
@@ -193,6 +193,10 @@ class LayaBrowser:
|
|
| 193 |
kw["fast"] = True # laya >= 0.3.7
|
| 194 |
agent = laya.load(repo, device=device, **kw)
|
| 195 |
agent.cfg["max_len"], agent.cfg["head_max_len"] = 1024, agent.cfg.get("head_max_len_train", 768)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
return cls(agent)
|
| 197 |
|
| 198 |
def decide(self, page, goal, history=()):
|
|
|
|
| 193 |
kw["fast"] = True # laya >= 0.3.7
|
| 194 |
agent = laya.load(repo, device=device, **kw)
|
| 195 |
agent.cfg["max_len"], agent.cfg["head_max_len"] = 1024, agent.cfg.get("head_max_len_train", 768)
|
| 196 |
+
try: # ModernBERT would torch.compile its embeddings on first use (needs a working Triton/C toolchain)
|
| 197 |
+
agent.model.encoder.config.reference_compile = False
|
| 198 |
+
except AttributeError:
|
| 199 |
+
pass
|
| 200 |
return cls(agent)
|
| 201 |
|
| 202 |
def decide(self, page, goal, history=()):
|
encoder/config.json
CHANGED
|
@@ -75,5 +75,6 @@
|
|
| 75 |
"sparse_prediction": false,
|
| 76 |
"tie_word_embeddings": true,
|
| 77 |
"transformers_version": "5.17.0",
|
| 78 |
-
"vocab_size": 256000
|
| 79 |
-
|
|
|
|
|
|
| 75 |
"sparse_prediction": false,
|
| 76 |
"tie_word_embeddings": true,
|
| 77 |
"transformers_version": "5.17.0",
|
| 78 |
+
"vocab_size": 256000,
|
| 79 |
+
"reference_compile": false
|
| 80 |
+
}
|
laya_browser.py
CHANGED
|
@@ -193,6 +193,10 @@ class LayaBrowser:
|
|
| 193 |
kw["fast"] = True # laya >= 0.3.7
|
| 194 |
agent = laya.load(repo, device=device, **kw)
|
| 195 |
agent.cfg["max_len"], agent.cfg["head_max_len"] = 1024, agent.cfg.get("head_max_len_train", 768)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
return cls(agent)
|
| 197 |
|
| 198 |
def decide(self, page, goal, history=()):
|
|
|
|
| 193 |
kw["fast"] = True # laya >= 0.3.7
|
| 194 |
agent = laya.load(repo, device=device, **kw)
|
| 195 |
agent.cfg["max_len"], agent.cfg["head_max_len"] = 1024, agent.cfg.get("head_max_len_train", 768)
|
| 196 |
+
try: # ModernBERT would torch.compile its embeddings on first use (needs a working Triton/C toolchain)
|
| 197 |
+
agent.model.encoder.config.reference_compile = False
|
| 198 |
+
except AttributeError:
|
| 199 |
+
pass
|
| 200 |
return cls(agent)
|
| 201 |
|
| 202 |
def decide(self, page, goal, history=()):
|