Text Generation
Transformers
Safetensors
chess_transformer
chess
llm-course
chess-challenge
custom_code
Instructions to use LLM-course/chess-sam with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LLM-course/chess-sam with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LLM-course/chess-sam", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LLM-course/chess-sam", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LLM-course/chess-sam with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LLM-course/chess-sam" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-course/chess-sam", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LLM-course/chess-sam
- SGLang
How to use LLM-course/chess-sam 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 "LLM-course/chess-sam" \ --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": "LLM-course/chess-sam", "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 "LLM-course/chess-sam" \ --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": "LLM-course/chess-sam", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LLM-course/chess-sam with Docker Model Runner:
docker model run hf.co/LLM-course/chess-sam
Chess Challenge submission by Sammy972
Browse files- config.json +0 -8
- tokenizer.py +4 -1
config.json
CHANGED
|
@@ -3,11 +3,6 @@
|
|
| 3 |
"architectures": [
|
| 4 |
"ChessForCausalLM"
|
| 5 |
],
|
| 6 |
-
"auto_map": {
|
| 7 |
-
"AutoConfig": "model.ChessConfig",
|
| 8 |
-
"AutoModelForCausalLM": "model.ChessForCausalLM"
|
| 9 |
-
},
|
| 10 |
-
|
| 11 |
"bos_token_id": 1,
|
| 12 |
"dropout": 0.1,
|
| 13 |
"eos_token_id": 2,
|
|
@@ -23,7 +18,4 @@
|
|
| 23 |
"torch_dtype": "float32",
|
| 24 |
"transformers_version": "4.46.3",
|
| 25 |
"vocab_size": 85
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
}
|
|
|
|
| 3 |
"architectures": [
|
| 4 |
"ChessForCausalLM"
|
| 5 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
"bos_token_id": 1,
|
| 7 |
"dropout": 0.1,
|
| 8 |
"eos_token_id": 2,
|
|
|
|
| 18 |
"torch_dtype": "float32",
|
| 19 |
"transformers_version": "4.46.3",
|
| 20 |
"vocab_size": 85
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
tokenizer.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
"""
|
| 4 |
Factorized Chess Tokenizer for the Chess Challenge.
|
|
|
|
| 1 |
+
# =========================
|
| 2 |
+
# CELLULE 1 — src/tokenizer.py
|
| 3 |
+
# ➜ Remplace TOUT le contenu du fichier par ce code
|
| 4 |
+
# =========================
|
| 5 |
|
| 6 |
"""
|
| 7 |
Factorized Chess Tokenizer for the Chess Challenge.
|