From 48c815bb1686ee270e2c97abbb926b8496ca11fd Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 3 Aug 2022 16:55:11 -0700 Subject: [PATCH] Add setup.py to allow mingpt to be used as a third-party library --- README.md | 10 ++++++++++ setup.py | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 setup.py diff --git a/README.md b/README.md index 2705bb2..8629d49 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,16 @@ The minGPT library is three files: [mingpt/model.py](mingpt/model.py) contains t - `demo.ipynb` shows a minimal usage of the `GPT` and `Trainer` in a notebook format on a simple sorting example - `generate.ipynb` shows how one can load a pretrained GPT2 and generate text given some prompt +### Library Installation + +If you want to `import mingpt` into your project: + +``` +git clone https://github.com/karpathy/minGPT.git +cd minGPT +pip install -e . +``` + ### Usage Here's how you'd instantiate a GPT-2 (124M param version): diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..9a2d64f --- /dev/null +++ b/setup.py @@ -0,0 +1,12 @@ +from setuptools import setup + +setup(name='minGPT', + version='0.0.1', + author='Andrej Karpathy', + packages=['mingpt'], + description='A PyTorch re-implementation of GPT', + license='MIT', + install_requires=[ + 'torch', + ], +)