Giter Site home page Giter Site logo

nanogpt's Introduction

nanogpt

Building a nanogpt following @karpathy's lectures. Check karpathy/nanoGPT.

Setup

pip install -r requirements.txt

If you want to use mps on macbook, select Preview (Nightly) when installing Pytorch from this resource.

Command will look like this:

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu

Train

The model is configured to train on text under input.txt, which is a copy of tinyshakespeare. Feel free to replace the training dataset with anything else.

python train.py

After the model is trained a .pth file will be saved under model_resources/.

Generate Text

python generate.py

Example generated text:

let no mother. No, Lord Richard, if I say I
Wish of your offended disposition: we unto pardon
For Edward for an ill:the fair Romans' him:
Romeo, words be sometime known apparent,
Adbandine widow the peer in his dayers, away,
My faults are doing commission with his weddess'd;
Bearfulnce shorted Boyingbroke, that he before these
The instructed sin, an if despise he were ay,
Tender the Edward thought of Earl of Menenius,
And wast of that she handship the husband all.
Give me his father? Thy valour, that found to last a
Thow swords be compedion'd wind feeling far in death.

MARIANA:
Ay, how! fall would the caln against an heaven!

PAULINA:
Here a mistress'd is in the noble power by hence;
And that this enemy's chair in the choices of my day,
Reverence and war a help Keeperland pieces
To change, in bless and whrt it feel short
She sad ho stand of mine est life.
O, then, to make him!
Fash a brother's a life, till you much lamb wished!

Second Set:
What, gentlement once here new to mine honour'd,
Proceedine than the fill'd for me and majemy
Of York's uncle: yield me for a few-credit,
Ssent disguadined wild taked me another of England's
Despised thy nearer dispositence of the heum?

KING RICHARD III:
Have imposed me to it lamentable bloody!

QUEEN ELIZABETH:
And he did, yet, hear I'll rare you, my wrathest.

QUEEN ELIZABETH:
He hath there.

GLOUCESTER:
My lord!

nanogpt's People

Contributors

mohannadbanayosi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.