Instructions to use getSTEAV/system-one-games with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use getSTEAV/system-one-games with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download examples/quickstart.py from getSTEAV/system-one-games: direct link, hf CLI and curl.
- Browser
- Download file 682 Bytes
-
https://huggingface.co/getSTEAV/system-one-games/resolve/main/examples/quickstart.py
- Command line
-
hf download hf://getSTEAV/system-one-games/examples/quickstart.py
-
curl -L -o quickstart.py https://huggingface.co/getSTEAV/system-one-games/resolve/main/examples/quickstart.py
682 Bytes
| """Score a released example: python examples/quickstart.py --game snake.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import sys | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT)) | |
| from system_one_games import GameModel | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--game", choices=["dino", "snake", "tetris"], default="snake") | |
| parser.add_argument("--device", default=None) | |
| args = parser.parse_args() | |
| row = json.loads((ROOT / args.game / "example.json").read_text()) | |
| model = GameModel.from_pretrained(ROOT, game=args.game, device=args.device) | |
| print(json.dumps(model.predict(row["state"], row["question"]), indent=2)) | |