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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Maxlegrec/ChessBot", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -44,7 +44,23 @@ model = model.to(device)
|
|
| 44 |
|
| 45 |
# Get the best move
|
| 46 |
move = model.get_move_from_fen_no_thinking(fen, T=0.1, device=device)
|
| 47 |
-
print(f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
```
|
| 49 |
|
| 50 |
## Requirements
|
|
|
|
| 44 |
|
| 45 |
# Get the best move
|
| 46 |
move = model.get_move_from_fen_no_thinking(fen, T=0.1, device=device)
|
| 47 |
+
print(f"Policy-based move: {move}")
|
| 48 |
+
|
| 49 |
+
# Get the best move using value
|
| 50 |
+
value_move = model.get_best_move_value(fen, T=0, device=device)
|
| 51 |
+
print(f"Value-based move: {value_move}")
|
| 52 |
+
|
| 53 |
+
# Get position evaluation
|
| 54 |
+
position_value = model.get_position_value(fen, device=device)
|
| 55 |
+
print(f"Position value [black_win, draw, white_win]: {position_value}")
|
| 56 |
+
|
| 57 |
+
# Get move probabilities
|
| 58 |
+
probs = model.get_move_from_fen_no_thinking(fen, T=1, device=device, return_probs=True)
|
| 59 |
+
top_moves = sorted(probs.items(), key=lambda x: x[1], reverse=True)[:5]
|
| 60 |
+
print("Top 5 moves:")
|
| 61 |
+
for move, prob in top_moves:
|
| 62 |
+
print(f" {move}: {prob:.4f}")
|
| 63 |
+
|
| 64 |
```
|
| 65 |
|
| 66 |
## Requirements
|