Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sagar_neuron_gpt2-0.1.9-py3-none-any.whl (195.2 kB view details)

Uploaded Python 3

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

Hashes for sagar_neuron_gpt2-0.1.9.tar.gz
Algorithm Hash digest
SHA256 1f584d958edc69227adc46907777bb349f413103378dd2c8b243076de9bc0e83
MD5 a6e2d9dc389b12311c6f729f73cf8b0b
BLAKE2b-256 b16cc6947ea9ed77bac7f23240b84cf967869fbad7187339eeb4f74320a61ecd

See more details on using hashes here.

File details

Details for the file sagar_neuron_gpt2-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for sagar_neuron_gpt2-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 be9f72222bd2675e9d565b0efc583f428130f88a8acf9037a28e1ac8b6f44364
MD5 9f87cdb46b170ba3d833b457ede3d951
BLAKE2b-256 43ba1b1b9253aef2415794cb2a2fb14bf9d497b55470a88bac82621397996ca5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page