Skip to content

Commit

Permalink
Merge pull request #84 from ericjang/master
Browse files Browse the repository at this point in the history
Add setup.py to allow mingpt to be used as a third-party library
  • Loading branch information
karpathy committed Aug 4, 2022
2 parents cafce45 + 48c815b commit 7218bcf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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',
],
)

0 comments on commit 7218bcf

Please sign in to comment.