Downloads · 30 days
5
17% of all-time downloads
araviiiman/game21-sft
game21-sft is a machine learning model from araviiiman. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as mit.
This is the Supervised Fine-Tuned (SFT) model for the Game of 21 AI project. It was trained using LoRA (Low-Rank Adaptation) on optimal Game of 21 gameplay examples with distilgpt2 as the base model.
Downloads · 30 days
5
17% of all-time downloads
All-time downloads
29
Public
Repo size
1.6 MB
Likes
0
Public
Click a slice to open those files.
.json4.4 MB · 68%
From the Hugging Face model README
This is the Supervised Fine-Tuned (SFT) model for the Game of 21 AI project. It was trained using LoRA (Low-Rank Adaptation) on optimal Game of 21 gameplay examples with distilgpt2 as the base model.
This model was trained to play the strategic Game of 21, where:
This model was trained using supervised fine-tuning:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("distilgpt2")
tokenizer = AutoTokenizer.from_pretrained("distilgpt2")
# Load SFT adapter
model = PeftModel.from_pretrained(base_model, "araviiiman/game21-sft")
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
# Game prompt
prompt = """
Game Rules: Two players start at 0. On each turn, add 1, 2, 3, or 4 to the running total.
The player who reaches 21 or more loses.
Current total: 5
What number (1, 2, 3, or 4) do you add?
I will add: """
# Generate response (using direct tokenization for distilgpt2 compatibility)
input_text = f"System: You are a strategic game player.\nUser: {prompt}"
input_ids = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(input_ids.input_ids, max_new_tokens=5, temperature=0.7, do_sample=False)
response = tokenizer.decode(outputs[0][input_ids.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
The model was trained on examples of optimal Game of 21 play, including:
@misc{game21-ai-sft,
title={Game of 21 AI - SFT Model},
author={Your Name},
year={2025},
url={https://huggingface.co/araviiiman/game21-sft}
}
This model is licensed under the MIT License.