A GPT-2 implementation for training and inference in pytorch
Project description
How to Run
Language & Framework
- Language: Python
- Framework: PyTorch
Installation
Make sure you have Python installed, then run the following commands to set up the environment:
## Installation
To install the package without ML dependencies:
pip install sagar-neuron-gpt2
Then you should install
pip install torch
pip install tiktoken
pip install numpy
To include ML dependencies (torch and tiktoken):
pip install sagar-neuron-gpt2[ml]
pip install numpy
Train the Model
To train and save your GPT-2 model weights, run the following:
from sagar_nueron_gpt2.TrainAndSaveGptWeights import Execute
exe = Execute()
exe.execute()
Inference from Trained Model
To run inference using the model you trained:
from sagar_nueron_gpt2.inference_model import Inferencing
exe = Inferencing()
exe.inference()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sagar_neuron_gpt2-0.1.9.tar.gz
(797.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sagar_neuron_gpt2-0.1.9.tar.gz.
File metadata
- Download URL: sagar_neuron_gpt2-0.1.9.tar.gz
- Upload date:
- Size: 797.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f584d958edc69227adc46907777bb349f413103378dd2c8b243076de9bc0e83
|
|
| MD5 |
a6e2d9dc389b12311c6f729f73cf8b0b
|
|
| BLAKE2b-256 |
b16cc6947ea9ed77bac7f23240b84cf967869fbad7187339eeb4f74320a61ecd
|
File details
Details for the file sagar_neuron_gpt2-0.1.9-py3-none-any.whl.
File metadata
- Download URL: sagar_neuron_gpt2-0.1.9-py3-none-any.whl
- Upload date:
- Size: 195.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be9f72222bd2675e9d565b0efc583f428130f88a8acf9037a28e1ac8b6f44364
|
|
| MD5 |
9f87cdb46b170ba3d833b457ede3d951
|
|
| BLAKE2b-256 |
43ba1b1b9253aef2415794cb2a2fb14bf9d497b55470a88bac82621397996ca5
|