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 modeling_chessbot.py
Browse files- modeling_chessbot.py +1 -1
modeling_chessbot.py
CHANGED
|
@@ -613,7 +613,7 @@ class ChessBotModel(ChessBotPreTrainedModel):
|
|
| 613 |
# Find the move with the highest policy value that is legal
|
| 614 |
legal_moves_mask = - torch.ones_like(policy) * 999
|
| 615 |
for move in legal_moves:
|
| 616 |
-
legal_moves_mask[policy_index
|
| 617 |
policy = legal_moves_mask + policy
|
| 618 |
return policy_index[torch.argmax(policy).item()]
|
| 619 |
else:
|
|
|
|
| 613 |
# Find the move with the highest policy value that is legal
|
| 614 |
legal_moves_mask = - torch.ones_like(policy) * 999
|
| 615 |
for move in legal_moves:
|
| 616 |
+
legal_moves_mask[policy_index.index(move)] = 0
|
| 617 |
policy = legal_moves_mask + policy
|
| 618 |
return policy_index[torch.argmax(policy).item()]
|
| 619 |
else:
|