{"id":20814573,"url":"https://github.com/tunz/transformer-pytorch","last_synced_at":"2025-04-06T05:18:12.669Z","repository":{"id":56733565,"uuid":"164596136","full_name":"tunz/transformer-pytorch","owner":"tunz","description":"Transformer implementation in PyTorch.","archived":false,"fork":false,"pushed_at":"2019-03-07T14:46:06.000Z","size":32,"stargazers_count":481,"open_issues_count":2,"forks_count":108,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T04:09:46.526Z","etag":null,"topics":["pytorch","transformer"],"latest_commit_sha":null,"homepage":"https://tunz.kr/post/4","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tunz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-08T08:01:17.000Z","updated_at":"2025-03-28T04:38:32.000Z","dependencies_parsed_at":"2022-08-16T00:50:20.934Z","dependency_job_id":null,"html_url":"https://github.com/tunz/transformer-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunz%2Ftransformer-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunz%2Ftransformer-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunz%2Ftransformer-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunz%2Ftransformer-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunz","download_url":"https://codeload.github.com/tunz/transformer-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436443,"owners_count":20938564,"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":["pytorch","transformer"],"created_at":"2024-11-17T21:17:16.748Z","updated_at":"2025-04-06T05:18:12.648Z","avatar_url":"https://github.com/tunz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Transformer\n\nThis is a pytorch implementation of the\n[Transformer](https://arxiv.org/abs/1706.03762) model like\n[tensorflow/tensor2tensor](https://github.com/tensorflow/tensor2tensor).\n\n## Prerequisite\n\nI tested it with PyTorch 1.0.0 and Python 3.6.8.\n\nIt's using [SpaCy](https://spacy.io/usage/) to tokenize languages for wmt32k\ndataset. So, if you want to run `wmt32k` problem which is a de/en translation\ndataset, you should download language models first with the following command.\n\n```\n$ pip install spacy\n$ python -m spacy download en\n$ python -m spacy download de\n```\n\n## Usage\n\n1. Train a model.\n```\n$ python train.py --problem wmt32k --output_dir ./output --data_dir ./wmt32k_data\nor\n$ python train.py --problem lm1b --output_dir ./output --data_dir ./lm1b_data\n```\n\nIf you want to try `fast_transformer`, give a `model` argument after installing\n[tcop-pytorch](https://github.com/tunz/tcop-pytorch).\n```\n$ python train.py --problem lm1b --output_dir ./output --data_dir ./lm1b_data --model fast_transformer\n```\n\n\n2. You can translate a single sentence with the trained model.\n```\n$ python decoder.py --translate --data_dir ./wmt32k_data --model_dir ./output/last/models\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunz%2Ftransformer-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunz%2Ftransformer-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunz%2Ftransformer-pytorch/lists"}