GithubHelp home page GithubHelp logo

juletx / gpt2-eus Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 13 KB

Pretraining GPT2 model on Basque language

License: MIT License

Shell 10.27% Python 89.73%
basque cc100 gpt gpt2 pretrained-language-model pretraining tokenizer transformers euscrawl mc4 euskara

gpt2-eus's Introduction

Pretraining GPT2 model on Basque

Pretraining code for GPT2 model on Basque language. Includes code to train a tokenizer and a model on various Basque datasets and GPT2 models of different sizes. You can find a base tokenizer and model trained on Euscrawl at https://huggingface.co/HiTZ/gpt2-eus-euscrawl.

Data

There are three choices for pretraining data: Euscrawl, CC100 and mC4. You can add more options.

Tokenizer

The tokenizer is trained on the pretraining data. The tokenizer is trained using the tokenizer/train_tokenizer.py script. The script takes the HuggingFace tokenizer name and dataset names as input. For example, if you want to train the base GPT2 model tokenizer, you can run the following command.

python3 train_tokenizer.py gpt2 HiTZ/euscrawl

The script tokenizer/train_tokenizer.slurm trains a tokenizer for each dataset option. You can modify it to train a tokenizer for other models and datasets.

Model

The model is trained on the pretraining data. The model is trained using the model/run_clm.py script. The script takes a config file as input. The config file contains the model name, tokenizer name, dataset names, and other hyperparameters. For example, if you want to train the base GPT2 model on Euscrawl, you can run the following command.

torchrun --standalone --nproc_per_node=4 run_clm.py ../configs/gpt2-eus-euscrawl.yaml

There are some example configurations in configs directory and some scripts in model directory. For example, the script gpt2-eus-euscrawl.slurm trains a base gpt model on Euscrawl.

gpt2-eus's People

Contributors

juletx avatar

Stargazers

 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.