This is a simple notebook for text generation using the models available on Hugging Face. It allows you to generate text using a pretrained model and tokenizer in a friendly interface.
The preferred way to run this notebook is to use a virtual environment. If you are on Linux, the helper script setup-venv.sh
will create it for you and give you further instructions. If you would like to do it manually, you can use the following commands:
python3 -m venv .venv
source .venv/bin/activate # Only for bash/zsh!
source .venv/bin/activate.fish # Only for fish!
pip install -r requirements.txt
Make sure that you install the pytorch version that matches your computer. You can find the instructions here. If you are running this notebook in the cloud, check that it supports pytorch.
If you are using Jupyter, you can install the kernel for the virtual environment so that you can use it in the notebook. To do so, run the following command:
python -m ipykernel install --user --name=.venv
Now you can run the notebook. If you are using Jupyter, you can run the following command:
jupyter notebook notebook.ipynb
In the notebook, be sure to use the kernel that you installed in the previous step.
Instructions can be found within the notebook itself. While basic familiarity with Jupyter is assumed, the notebook is designed to be as simple as possible.
If you have any issues, please open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details. Remember that the models as well as the dependencies are licensed under their own licenses. Make sure to check them out before using them.