Instructions to use almvos/chess_model4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use almvos/chess_model4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="almvos/chess_model4")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("almvos/chess_model4") model = AutoModelForCausalLM.from_pretrained("almvos/chess_model4") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use almvos/chess_model4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "almvos/chess_model4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "almvos/chess_model4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/almvos/chess_model4
- SGLang
How to use almvos/chess_model4 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 "almvos/chess_model4" \ --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": "almvos/chess_model4", "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 "almvos/chess_model4" \ --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": "almvos/chess_model4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use almvos/chess_model4 with Docker Model Runner:
docker model run hf.co/almvos/chess_model4
Model Card for chess_model4
Model Description
The model was trained to be used for a chess-playing agent built on a fine-tuned GPT-2 model. It was trained for the player to take a board position in FEN format and returns a legal move in UCI notation.
- Developed by: Aliyah Vos
- Model type: Decoder Causal LM
- Finetuned from model: openai-community/gpt2
Model Sources
- Repository: almvos/Midtrm/Chess/Tournament
Uses
Direct Use
Given a chess board in FEN notation, the model predicts the next best move in the form of a UCI string.
Out-of-Scope Use
This model has been fine-tuned for chess move prediction.
Training Details
Training Data
A combination of different datasets was used to train the model
HF: "Vasanth/chessdevilai_fen_dataset"
HF: "bonna46/Chess-FEN-and-NL-Format-30K-Dataset"
Kaggle: "yousefradwanlmao/stockfish-best-moves-compilation"
Preprocessing
The different datasets were normalised to be in the same format and shuffled to combine. The kaggle dataset was filtered for missing "Best move" values.
Training Hyperparameters
learning_rate = 3e-5
metric_for_best_model = "eval_loss"
weight_decay = 0.01
warmup_ratio = 0.05
- Downloads last month
- 46
Model tree for almvos/chess_model4
Base model
openai-community/gpt2