{"id":18674039,"url":"https://github.com/jmaczan/gpt","last_synced_at":"2025-06-15T08:06:23.171Z","repository":{"id":242944337,"uuid":"810884682","full_name":"jmaczan/gpt","owner":"jmaczan","description":"Generative Pre-trained Transformer in PyTorch from scratch","archived":false,"fork":false,"pushed_at":"2025-02-01T19:17:02.000Z","size":98,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T13:07:29.583Z","etag":null,"topics":["attention","deep-learning","from-scratch","gpt","machine-learning","pytorch","transformer"],"latest_commit_sha":null,"homepage":"https://pagedout.institute/download/PagedOut_005.pdf#page=6","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmaczan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-05T14:29:59.000Z","updated_at":"2025-02-01T19:17:06.000Z","dependencies_parsed_at":"2025-04-12T13:17:46.352Z","dependency_job_id":null,"html_url":"https://github.com/jmaczan/gpt","commit_stats":null,"previous_names":["jmaczan/gpt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmaczan/gpt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaczan%2Fgpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaczan%2Fgpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaczan%2Fgpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaczan%2Fgpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmaczan","download_url":"https://codeload.github.com/jmaczan/gpt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmaczan%2Fgpt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259942785,"owners_count":22935326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attention","deep-learning","from-scratch","gpt","machine-learning","pytorch","transformer"],"created_at":"2024-11-07T09:17:18.444Z","updated_at":"2025-06-15T08:06:23.137Z","avatar_url":"https://github.com/jmaczan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gpt\n\n\u003e 💜 See also the article how to build the minimalistic GPT version in Paged Out! #5 Issue, page 6 [\"GPT in PyTorch\"](https://pagedout.institute/download/PagedOut_005.pdf#page=6)\n\nGenerative Pre-trained Transformer in PyTorch from scratch\n\n## Train\n\n### CLI\n```sh\npython src/train.py\n```\n\nOptions:\n```sh\n--batch_size 64\n--num-epochs 100\n--lr 0.0001\n--from-checkpoint checkpoint_path.pth\n```\n\nModel is checkpointed after each epoch and stored in `checkpoints/` directory\n\n\n### Code\n```py\nfrom train import train\n\ntrain()\n```\n\n## Run\n\n### CLI\n\n```sh\npython src/run.py --from-checkpoint checkpoint_path.pth\n```\n\n### Code\n```py\nfrom run import run\n\nrun(model_path=\"checkpoint_path.pth\", prompt=\"Rick:\\nMorty, where are you?)\n```\n\n## Cite\nIf you use this software in your research, please use the following citation:\n\n```bibtex\n@misc{Maczan_GPT_2024,\n  title = \"Generative Pre-trained Transformer in PyTorch\",\n  author = \"{Maczan, Jędrzej Paweł}\",\n  howpublished = \"\\url{https://github.com/jmaczan/gpt}\",\n  year = 2024,\n  publisher = {GitHub}\n}\n```\n\n## License\n\nGPL v3\n\n## Author\n\nJędrzej Maczan, 2024\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmaczan%2Fgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmaczan%2Fgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmaczan%2Fgpt/lists"}