Downloads · 30 days
62
100% of all-time downloads
OwaisAli10/laya-snake
laya-snake is a text classification model from OwaisAli10. Use it when you need a label for a piece of text. It is set up for laya. The card lists the license as apache-2.0.
A copy of laya-multilingual (mmBERT-base, 322M) fine-tuned to play Snake. Each tick it answers one Laya choice question (up / down / left / right) about a text description of the board.
Downloads · 30 days
62
100% of all-time downloads
All-time downloads
62
Public
Parameters
322M
678 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors644 MB · 95%
How the weights are stored.
F16322M · 100%
From the Hugging Face model README
A copy of laya-multilingual (mmBERT-base, 322M) fine-tuned to play
Snake. Each tick it answers one Laya choice question (up / down / left / right) about a text description of the
board.
Code, game UI and training pipeline: https://github.com/Okbatti/SnakeGame_Laya
import laya
agent = laya.load("models/laya-snake") # after: hf download OwaisAli10/laya-snake --local-dir models/laya-snake
state = ("heading: right | length: 3 | food: 5 up, 3 left | up: free, room 224 open, tail yes | "
"down: free, room 224 open, tail yes | left: body | right: free, room 224 open, tail yes")
question = {"move": {"type": "choice",
"instructions": "Which direction should the snake move next to reach the food safely?",
"criteria": {"up": "move up", "down": "move down", "left": "move left", "right": "move right"}}}
print(agent.predict(state, question)["answers"]["move"])
The state text must come from snake/encode.py in the GitHub repo; the model only knows that format.
| policy | avg score | best | agrees with teacher | latency p50 |
|---|---|---|---|---|
| teacher (BFS) | 200.5 | 219 | 100% | 0.2 ms |
| laya-snake | 89.9 | 143 | 77.7% | 31.8 ms |
| laya-multilingual (untuned) | 0.4 | 2 | 3.2% | 31.8 ms |
Trained only on the teacher's own trajectories, so it can drift into board layouts it never saw and trap itself. Scores vary a lot per game (46 to 143). It is not a general game-playing model.
Base model: Laya by Convai Innovations (Apache 2.0).