Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- chess
|
| 6 |
+
- game
|
| 7 |
+
- pytorch
|
| 8 |
+
- causal-lm
|
| 9 |
+
datasets:
|
| 10 |
+
- custom
|
| 11 |
+
widget:
|
| 12 |
+
- text: "1.e4"
|
| 13 |
+
example_title: "Chess Opening"
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# tiny-gpt2-finetuned-ajem
|
| 17 |
+
|
| 18 |
+
Este es un modelo de lenguaje entrenado espec铆ficamente para jugar ajedrez usando notaci贸n algebraica est谩ndar.
|
| 19 |
+
|
| 20 |
+
## Uso
|
| 21 |
+
|
| 22 |
+
```python
|
| 23 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 24 |
+
|
| 25 |
+
tokenizer = AutoTokenizer.from_pretrained("tu-usuario/tiny-gpt2-finetuned-ajem")
|
| 26 |
+
model = AutoModelForCausalLM.from_pretrained("tu-usuario/tiny-gpt2-finetuned-ajem")
|
| 27 |
+
|
| 28 |
+
# Generar siguiente movimiento
|
| 29 |
+
input_text = "1.e4 e5 2.Nf3"
|
| 30 |
+
inputs = tokenizer.encode(input_text, return_tensors="pt")
|
| 31 |
+
outputs = model.generate(inputs, max_length=50, do_sample=True)
|
| 32 |
+
next_move = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## Entrenamiento
|
| 36 |
+
|
| 37 |
+
Modelo entrenado en partidas de ajedrez usando PyTorch con arquitectura Transformer personalizada.
|