8000 GitHub - wawachen/Transformer_from_zero2one
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wawachen/Transformer_from_zero2one

Repository files navigation

Transformer_from_zero2one

Simple single-card training of transformer for machine translation
This code is training with 4090 Nvidia GPU. If the version of your GPU is lower, please decrease the batch size.

Installation

pip install transformers
pip install sentencepiece
pip install sacrebleu

The dataset of Helsinki-NLP and translation2019zh is shared in the alipan. The link is shown below.
https://www.alipan.com/s/F5dRWAwod7w

Usage

Finetune huggingface model

python train_huggingface.py

Test huggingface model

python test_huggingface.py

Train from scratch

python train.py

We provide a trained model for you to test the performance of our scratched model. Download the model_weights.pt from the provided link below,
https://pan.baidu.com/s/1lGRzWyrK0_IxgDPTqVPgcQ 提取码: tran

Then create a folder in root folder called record.
Finally, put the model_weights.pt into the record folder.

To train the model, set train_flag = 1. To test the model, set set train_flag = 0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0