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
|
@@ -60,7 +60,22 @@ model = model.to(device)
|
|
| 60 |
|
| 61 |
# Get the best move
|
| 62 |
move = model.get_move_from_fen_no_thinking(fen, T=0.1, device=device)
|
| 63 |
-
print(f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
```
|
| 65 |
|
| 66 |
## Requirements
|
|
|
|
| 60 |
|
| 61 |
# Get the best move
|
| 62 |
move = model.get_move_from_fen_no_thinking(fen, T=0.1, device=device)
|
| 63 |
+
print(f"Policy-based move: {move}")
|
| 64 |
+
|
| 65 |
+
# Get the best move using value analysis
|
| 66 |
+
value_move = model.get_best_move_value(fen, T=0, device=device)
|
| 67 |
+
print(f"Value-based move: {value_move}")
|
| 68 |
+
|
| 69 |
+
# Get position evaluation
|
| 70 |
+
position_value = model.get_position_value(fen, device=device)
|
| 71 |
+
print(f"Position value [black_win, draw, white_win]: {position_value}")
|
| 72 |
+
|
| 73 |
+
# Get move probabilities
|
| 74 |
+
probs = model.get_move_from_fen_no_thinking(fen, T=1, device=device, return_probs=True)
|
| 75 |
+
top_moves = sorted(probs.items(), key=lambda x: x[1], reverse=True)[:5]
|
| 76 |
+
print("Top 5 moves:")
|
| 77 |
+
for move, prob in top_moves:
|
| 78 |
+
print(f" {move}: {prob:.4f}")
|
| 79 |
```
|
| 80 |
|
| 81 |
## Requirements
|