Instructions to use sigmoidneuron123/NeoChess with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use sigmoidneuron123/NeoChess with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir NeoChess sigmoidneuron123/NeoChess
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Update selfchess.py
Browse files- selfchess.py +6 -3
selfchess.py
CHANGED
|
@@ -16,7 +16,7 @@ CONFIG = {
|
|
| 16 |
"num_games": 3000,
|
| 17 |
"stockfish_time_limit": 1.0,
|
| 18 |
"search_depth": 1,
|
| 19 |
-
"epsilon":
|
| 20 |
}
|
| 21 |
|
| 22 |
device = CONFIG["device"]
|
|
@@ -157,8 +157,11 @@ def game_gen(engine_side):
|
|
| 157 |
keys = list(evaling.keys())
|
| 158 |
logits = torch.tensor(list(evaling.values())).to(device)
|
| 159 |
probs = torch.softmax(logits,dim=0)
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
| 162 |
else:
|
| 163 |
result = engine.play(board, lim)
|
| 164 |
move = result.move
|
|
|
|
| 16 |
"num_games": 3000,
|
| 17 |
"stockfish_time_limit": 1.0,
|
| 18 |
"search_depth": 1,
|
| 19 |
+
"epsilon": 4
|
| 20 |
}
|
| 21 |
|
| 22 |
device = CONFIG["device"]
|
|
|
|
| 157 |
keys = list(evaling.keys())
|
| 158 |
logits = torch.tensor(list(evaling.values())).to(device)
|
| 159 |
probs = torch.softmax(logits,dim=0)
|
| 160 |
+
bests = torch.multinomial(probs,num_samples=CONFIG["epsilon"])
|
| 161 |
+
bestl = []
|
| 162 |
+
for idx in bests:
|
| 163 |
+
bestl += [logits[idx].item()]
|
| 164 |
+
move = keys[torch.argmax(bestl).item()]
|
| 165 |
else:
|
| 166 |
result = engine.play(board, lim)
|
| 167 |
move = result.move
|