1
0
Fork 0
mirror of https://github.com/karpathy/minGPT synced 2024-04-25 19:35:11 +02:00

Add setup.py to allow mingpt to be used as a third-party library

This commit is contained in:
Eric 2022-08-03 16:55:11 -07:00
parent cafce4544b
commit 48c815bb16
2 changed files with 22 additions and 0 deletions

View File

@ -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):

12
setup.py Normal file
View File

@ -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',
],
)