Instructions to use austindavis/gpt2-chess-uci-hooked with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use austindavis/gpt2-chess-uci-hooked with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="austindavis/gpt2-chess-uci-hooked")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("austindavis/gpt2-chess-uci-hooked") model = AutoModelForCausalLM.from_pretrained("austindavis/gpt2-chess-uci-hooked", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use austindavis/gpt2-chess-uci-hooked with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "austindavis/gpt2-chess-uci-hooked" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "austindavis/gpt2-chess-uci-hooked", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/austindavis/gpt2-chess-uci-hooked
- SGLang
How to use austindavis/gpt2-chess-uci-hooked with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "austindavis/gpt2-chess-uci-hooked" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "austindavis/gpt2-chess-uci-hooked", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "austindavis/gpt2-chess-uci-hooked" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "austindavis/gpt2-chess-uci-hooked", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use austindavis/gpt2-chess-uci-hooked with Docker Model Runner:
docker model run hf.co/austindavis/gpt2-chess-uci-hooked
Download tokenizer.json from austindavis/gpt2-chess-uci-hooked: direct link, hf CLI and curl.
- Browser
- Download file 3.34 kB
-
https://huggingface.co/austindavis/gpt2-chess-uci-hooked/resolve/main/tokenizer.json
- Command line
-
hf download hf://austindavis/gpt2-chess-uci-hooked/tokenizer.json
-
curl -L -o tokenizer.json https://huggingface.co/austindavis/gpt2-chess-uci-hooked/resolve/main/tokenizer.json
3.34 kB
| { | |
| "version": "1.0", | |
| "truncation": null, | |
| "padding": null, | |
| "added_tokens": [ | |
| { | |
| "id": 0, | |
| "content": "<pad>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 1, | |
| "content": "<s>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| } | |
| ], | |
| "normalizer": { | |
| "type": "Strip", | |
| "strip_left": true, | |
| "strip_right": true | |
| }, | |
| "pre_tokenizer": { | |
| "type": "Sequence", | |
| "pretokenizers": [ | |
| { | |
| "type": "Whitespace" | |
| }, | |
| { | |
| "type": "Split", | |
| "pattern": { | |
| "Regex": "([PQRKNB]|[a-h][1-8]|[bnqkr]|\" \")" | |
| }, | |
| "behavior": "Isolated", | |
| "invert": false | |
| } | |
| ] | |
| }, | |
| "post_processor": { | |
| "type": "TemplateProcessing", | |
| "single": [ | |
| { | |
| "SpecialToken": { | |
| "id": "<s>", | |
| "type_id": 0 | |
| } | |
| }, | |
| { | |
| "Sequence": { | |
| "id": "A", | |
| "type_id": 0 | |
| } | |
| } | |
| ], | |
| "pair": [ | |
| { | |
| "SpecialToken": { | |
| "id": "<s>", | |
| "type_id": 0 | |
| } | |
| }, | |
| { | |
| "Sequence": { | |
| "id": "A", | |
| "type_id": 0 | |
| } | |
| }, | |
| { | |
| "SpecialToken": { | |
| "id": "<pad>", | |
| "type_id": 0 | |
| } | |
| }, | |
| { | |
| "Sequence": { | |
| "id": "B", | |
| "type_id": 1 | |
| } | |
| }, | |
| { | |
| "SpecialToken": { | |
| "id": "<pad>", | |
| "type_id": 1 | |
| } | |
| } | |
| ], | |
| "special_tokens": { | |
| "<pad>": { | |
| "id": "<pad>", | |
| "ids": [ | |
| 0 | |
| ], | |
| "tokens": [ | |
| "<pad>" | |
| ] | |
| }, | |
| "<s>": { | |
| "id": "<s>", | |
| "ids": [ | |
| 1 | |
| ], | |
| "tokens": [ | |
| "<s>" | |
| ] | |
| } | |
| } | |
| }, | |
| "decoder": { | |
| "type": "Replace", | |
| "pattern": { | |
| "String": "<pad>" | |
| }, | |
| "content": "" | |
| }, | |
| "model": { | |
| "type": "WordLevel", | |
| "vocab": { | |
| "<pad>": 0, | |
| "<s>": 1, | |
| "</s>": 2, | |
| "P": 3, | |
| "N": 4, | |
| "R": 5, | |
| "B": 6, | |
| "Q": 7, | |
| "K": 8, | |
| "c2": 9, | |
| "c4": 10, | |
| "e7": 11, | |
| "e5": 12, | |
| "g2": 13, | |
| "g3": 14, | |
| "b8": 15, | |
| "c6": 16, | |
| "f1": 17, | |
| "g8": 18, | |
| "f6": 19, | |
| "b1": 20, | |
| "c3": 21, | |
| "f8": 22, | |
| "b4": 23, | |
| "d5": 24, | |
| "e8": 25, | |
| "e2": 26, | |
| "e3": 27, | |
| "e4": 28, | |
| "a2": 29, | |
| "a3": 30, | |
| "d6": 31, | |
| "d8": 32, | |
| "a1": 33, | |
| "e6": 34, | |
| "b2": 35, | |
| "b3": 36, | |
| "c7": 37, | |
| "d2": 38, | |
| "d3": 39, | |
| "f7": 40, | |
| "f5": 41, | |
| "a7": 42, | |
| "a5": 43, | |
| "g1": 44, | |
| "d4": 45, | |
| "g4": 46, | |
| "c5": 47, | |
| "e1": 48, | |
| "d7": 49, | |
| "d1": 50, | |
| "h8": 51, | |
| "c1": 52, | |
| "a4": 53, | |
| "h2": 54, | |
| "h3": 55, | |
| "a8": 56, | |
| "f4": 57, | |
| "g7": 58, | |
| "g5": 59, | |
| "b6": 60, | |
| "b7": 61, | |
| "c8": 62, | |
| "h7": 63, | |
| "h4": 64, | |
| "f3": 65, | |
| "h5": 66, | |
| "h1": 67, | |
| "f2": 68, | |
| "h6": 69, | |
| "g6": 70, | |
| "b5": 71, | |
| "a6": 72, | |
| "q": 73, | |
| "r": 74, | |
| "b": 75, | |
| "n": 76 | |
| }, | |
| "unk_token": "<pad>" | |
| } | |
| } |