Skip to content

Playing go using transformers from huggingface.

License

Notifications You must be signed in to change notification settings

kblomdahl/hugging_go

Repository files navigation

Transformers for Go

A little experiment at using transformers to play go. The basic concept is to feed a sequence of moves to the transformer and predict the next move.

Run

A GTP interface can be started from the command-line, or if you prefer you can build a docker image that runs the bot in an isolated environment:

python3 -m hugging_go

Docker

make build-image
docker run -it `docker build -q .`

Build

pip install -r requirements.txt

Training

Tokenizer

You can train a tokenizer from scratch on a given dataset, which should consist of one-line SGF files. The resulting tokenizer will be saved to model/tokenizer.json:

python3 -m hugging_go --train_token=True data/kgs_big.sgf

Model

After training the tokenizer the main model can be trained using the same one-line SGF files. This will probably take a long time:

python3 -m hugging_go --train-model=True data/kgs_big.sgf

About

Playing go using transformers from huggingface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages