Have you ever wondered what the third act of "Hamilton" might sound like? Here's a guess :)
This package trains a basic character-level language model, implemented as an RNN with a GRU (gated recurrent unit) as its primary building block. Feel free to try a demo with another of the artists in the /data
folder!
The easiest way to run this code is in a docker container. The only requirements are Docker and nvidia-docker.
Clone the repo:
git clone https://github.com/jastern33/char-rnn-pytorch.git
cd char-rnn-pytorch
Build the docker image (takes awhile):
cd docker
docker build -t deep-learning-pytorch -f Dockerfile . --rm
Run a docker container based on that image:
cd ..
nvidia-docker run -it --name char-rnn --rm -v $(pwd):/code deep-learning-pytorch
Then run the following command in the docker container for a basic demo:
python3 char_rnn_main
To see additional options run:
python3 char_rnn_main --help
(hint: look here ^ to see how to try a new dataset!)
If you want to run the jupyter notebook, it requires a couple of modifications.
Clone the repo:
git clone https://github.com/jastern33/char-rnn-pytorch
cd char-rnn-pytorch
Build the docker image (takes awhile):
cd docker
docker build -t deep-learning-pytorch -f Dockerfile . --rm
Run a docker container based on that image (notice the addition of the -p
flag for port forwarding):
cd ..
nvidia-docker run -it --name char-rnn --rm -p 8890:8890 -v $(pwd):/code deep-learning-pytorch
In the docker container, run:
jupyter notebook --ip 0.0.0.0 --port 8890 --no-browser --allow-root
Then copy the url that it gives you, and paste it into a browser:
http://127.0.0.1:8890/?token=<really_long_token>
Now you can access and run the Jupyter Notebook (which is running inside the container) as if it were running on your own machine.