Run this model with HF Jobs
Run Maxlegrec/ChessBot on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Maxlegrec/ChessBot. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Maxlegrec/ChessBot on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Maxlegrec/ChessBot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Maxlegrec/ChessBot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Maxlegrec/ChessBot", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Maxlegrec/ChessBot", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files22 unmodified lines23242526262728293031323334353637382829303132334243343536473738394041424344454647484950515253545522 unmodified lines
```pythonimport torchfrom huggingface_hub import snapshot_downloadfrom transformers import AutoModel
# Download the model filesmodel_path = snapshot_download(repo_id="Maxlegrec/ChessBot")
# Add to path and importimport syssys.path.append(model_path)from modeling_chessbot import ChessBotModel, ChessBotConfig
# Load the modelconfig = ChessBotConfig()model = ChessBotModel.from_pretrained(model_path)model = AutoModel.from_pretrained("Maxlegrec/ChessBot", trust_remote_code=True)device = "cuda" if torch.cuda.is_available() else "cpu"model = model.to(device)
# Example usagefen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"device = "cuda" if torch.cuda.is_available() else "cpu"model = model.to(device)
# Get the best movemove = model.get_move_from_fen_no_thinking(fen, T=0.1, device=device)print(f"Predicted move: {move}")print(f"Policy-based move: {move}")
# Get the best move using value analysisvalue_move = model.get_best_move_value(fen, T=0, device=device)print(f"Value-based move: {value_move}")
# Get position evaluationposition_value = model.get_position_value(fen, device=device)print(f"Position value [black_win, draw, white_win]: {position_value}")
# Get move probabilitiesprobs = model.get_move_from_fen_no_thinking(fen, T=1, device=device, return_probs=True)top_moves = sorted(probs.items(), key=lambda x: x[1], reverse=True)[:5]print("Top 5 moves:")for move, prob in top_moves: print(f" {move}: {prob:.4f}")```
## RequirementsREADME.md+20-15