https://github.com/ivanbongiorni/shakespeare-gpt
How to build a custom GPT for text generation, based on TensorFlow 2.x and Maximal. Trained on the Shakespeare corpus.
https://github.com/ivanbongiorni/shakespeare-gpt
deep-learning deeplearning generative-ai gpt machine-learning machinlearning maximal natural-language-generation natural-language-processing nlg nlp python tensorflow tensorflow2 transformer transformer-architecture transformer-models
Last synced: about 2 months ago
JSON representation
How to build a custom GPT for text generation, based on TensorFlow 2.x and Maximal. Trained on the Shakespeare corpus.
- Host: GitHub
- URL: https://github.com/ivanbongiorni/shakespeare-gpt
- Owner: IvanBongiorni
- License: mit
- Created: 2023-03-26T22:20:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-13T17:51:43.000Z (almost 3 years ago)
- Last Synced: 2025-02-05T12:28:48.375Z (over 1 year ago)
- Topics: deep-learning, deeplearning, generative-ai, gpt, machine-learning, machinlearning, maximal, natural-language-generation, natural-language-processing, nlg, nlp, python, tensorflow, tensorflow2, transformer, transformer-architecture, transformer-models
- Language: Python
- Homepage: https://github.com/IvanBongiorni/maximal
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shakespeare GPT
This is a tutorial repository to show how easy it is to build a custom GPT model using [Maximal](https://github.com/IvanBongiorni/maximal) and *TensorFlow 2.x* libraries.
For a more in depth documentation on how to build Transformer neural networks with **Maximal** and TensorFlow, refer to the [Official documentation](https://ivanbongiorni.github.io/maximal/) (Tutorials section).
## How to start
You must train a model via: `python train.py`. All hyperparameters can be tweaked in `config.py`.
#### WARNING: a GPU is strongly suggested to run this code.
## How to generate code
Once a model is saved and stored in `/saved_models` folder, you can run: `python chat.py` to load the model and generate text via command line.
In the first public version of this repository, prompt length must be at least as long as the model's input size (controllable in `config.py`).
This is a constraint that will be removed in further versions.
To end the generation either use `Ctr+C` or type `exit`.