Skip to content

RaviNaik/GPT-from-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERA-SESSION21 - GPT from scratch

🤗Space Link

This is an implementation of GPT Let's build GPT: from scratch, in code, spelled out. by Andrej Karpathy.
Dataset used to train: tinyshakespeare.

Tasks:

  1. ✔️ Go through this video and train your GPT from scratch.
  2. ✔️ Upload the model to HuggingFace Apps, and share the link.

Results

Bigram Base model training and results

image

GPT Model training results

image

Generation Output:

model = torch.load("checkpoints/model.pth", map_location={"cpu": device})
results = generate("hello", model, block_size, 1000, device)
print(results)
hellows thence grown from thee.
Since thou hast raim, thou thast well were quarterned; and
ever man tree can saw for words word from her at hour
Whiles contrations or devoided from ere years;
Yea, foul vice, indelice on the bird of the
noble of Hermione.

PARIS:
Sir, adies, sir, hate no choping but to your good.

HENRY BOLINGBROKE:
Yes, to ask you might, foreweed.

WARCK:
'Tis he made moust true.

RORSET:
It is an hour fastal that cracknaf at the chase
Upon; you are your hearing news a daughter.

KING EDWARD IV:
Tut, Lord Warwick, thou shouldst aft Rutlansps?
Thou tust but back hild, he countemn'd my lady's seal,
For access dead the treature moon! and the Englisting!
Thy vage for yonder see thou be donen?
O, count thou dost not Romeo, thou pratheeo sir,
That sweet thou feigh with no past blood on
Be see, here through on that find bears, if an
pretterinctors three and aspect die meeds thou,
Behing mine of thy denigning state lain business?

SAMPSA:
Sir, ha! but thou refused? thyself food, gr

Gradio Interface

image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published