1
0
Fork 0
mirror of https://github.com/karpathy/minGPT synced 2024-04-26 20:05:49 +02:00

Merge pull request #84 from ericjang/master

Add setup.py to allow mingpt to be used as a third-party library
This commit is contained in:
Andrej 2022-08-03 21:35:21 -07:00 committed by GitHub
commit 7218bcfa52
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
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',
],
)